Search is not available for this dataset
repo_name string | path string | license string | full_code string | full_size int64 | uncommented_code string | uncommented_size int64 | function_only_code string | function_only_size int64 | is_commented bool | is_signatured bool | n_ast_errors int64 | ast_max_depth int64 | n_whitespaces int64 | n_ast_nodes int64 | n_ast_terminals int64 | n_ast_nonterminals int64 | loc int64 | cycloplexity int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SimSaladin/hcalc | src/Hcalc/Examples.hs | bsd-3-clause | t1 :: Sheet
t1 = sheet
[ column ":: kurssi"
[ "Työväline"
, "TVT-ajokortti"
, "JTKT"
, "Ohj. Pe."
, "Ohj. jatk." --
, "Ohj. harj."
, "Ohj. menet."
, "Tiet. toim."
, "TiPe"
, "JYM"
, "Ana1"
, "Lin1"
, "Lask. Malli... | 835 | t1 :: Sheet
t1 = sheet
[ column ":: kurssi"
[ "Työväline"
, "TVT-ajokortti"
, "JTKT"
, "Ohj. Pe."
, "Ohj. jatk." --
, "Ohj. harj."
, "Ohj. menet."
, "Tiet. toim."
, "TiPe"
, "JYM"
, "Ana1"
, "Lin1"
, "Lask. Malli... | 835 | t1 = sheet
[ column ":: kurssi"
[ "Työväline"
, "TVT-ajokortti"
, "JTKT"
, "Ohj. Pe."
, "Ohj. jatk." --
, "Ohj. harj."
, "Ohj. menet."
, "Tiet. toim."
, "TiPe"
, "JYM"
, "Ana1"
, "Lin1"
, "Lask. Mallit"
,... | 823 | false | true | 0 | 12 | 354 | 287 | 155 | 132 | null | null |
flyingleafe/parser-gen | src/GrammarLexer.hs | bsd-3-clause | regexLiteral :: Parser GrammarLexeme
regexLiteral = RegexLiteral <$> surround (char '/') (escapedString1 "/") | 109 | regexLiteral :: Parser GrammarLexeme
regexLiteral = RegexLiteral <$> surround (char '/') (escapedString1 "/") | 109 | regexLiteral = RegexLiteral <$> surround (char '/') (escapedString1 "/") | 72 | false | true | 0 | 8 | 12 | 35 | 17 | 18 | null | null |
kawu/nerf-proto | src/NLP/Nerf2/LogReal.hs | bsd-2-clause | logToLogReal :: Double -> LogReal
logToLogReal = LogReal | 56 | logToLogReal :: Double -> LogReal
logToLogReal = LogReal | 56 | logToLogReal = LogReal | 22 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
coccinelle/herodotos | hBugs/src/Utils.hs | gpl-2.0 | foldr2 _ _ [x] = x | 27 | foldr2 _ _ [x] = x | 27 | foldr2 _ _ [x] = x | 27 | false | false | 0 | 6 | 14 | 16 | 8 | 8 | null | null |
sgillespie/ghc | testsuite/tests/patsyn/should_compile/T10997.hs | bsd-3-clause | foo :: Exp a -> String
foo Tru = "True" | 39 | foo :: Exp a -> String
foo Tru = "True" | 39 | foo Tru = "True" | 16 | false | true | 0 | 6 | 9 | 25 | 11 | 14 | null | null |
lnunno/advent-of-code-2015 | day12/src/Main.hs | mit | sumNumbers (Object o) = 0 | 25 | sumNumbers (Object o) = 0 | 25 | sumNumbers (Object o) = 0 | 25 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
flbulgarelli/hs-inspector | src/Language/Haskell/Inspector.hs | mit | -- private
has f g = any f . g | 31 | has f g = any f . g | 19 | has f g = any f . g | 19 | true | false | 0 | 6 | 10 | 20 | 9 | 11 | null | null |
vincenthz/language-c | test/src/RenderTests.hs | bsd-3-clause | numTests :: TestSummary -> Int
numTests s = numOk s + numFailed s | 65 | numTests :: TestSummary -> Int
numTests s = numOk s + numFailed s | 65 | numTests s = numOk s + numFailed s | 34 | false | true | 0 | 7 | 12 | 33 | 14 | 19 | null | null |
zepto-lang/zepto-js | src/Zepto/Types.hs | gpl-2.0 | typeString (HashMap _) = "hashmap" | 34 | typeString (HashMap _) = "hashmap" | 34 | typeString (HashMap _) = "hashmap" | 34 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | andWC :: WantedConstraints -> WantedConstraints -> WantedConstraints
andWC (WC { wc_simple = f1, wc_impl = i1 })
(WC { wc_simple = f2, wc_impl = i2 })
= WC { wc_simple = f1 `unionBags` f2
, wc_impl = i1 `unionBags` i2 } | 236 | andWC :: WantedConstraints -> WantedConstraints -> WantedConstraints
andWC (WC { wc_simple = f1, wc_impl = i1 })
(WC { wc_simple = f2, wc_impl = i2 })
= WC { wc_simple = f1 `unionBags` f2
, wc_impl = i1 `unionBags` i2 } | 236 | andWC (WC { wc_simple = f1, wc_impl = i1 })
(WC { wc_simple = f2, wc_impl = i2 })
= WC { wc_simple = f1 `unionBags` f2
, wc_impl = i1 `unionBags` i2 } | 167 | false | true | 6 | 8 | 57 | 101 | 53 | 48 | null | null |
jeremyjh/free-agent | core/src/Control/Monad/Logger/Quote.hs | bsd-3-clause | -- | Quoter for logging interpolated strings at LevelDebug
qdebug :: QuasiQuoter
qdebug = qlog True LevelDebug | 110 | qdebug :: QuasiQuoter
qdebug = qlog True LevelDebug | 51 | qdebug = qlog True LevelDebug | 29 | true | true | 0 | 6 | 16 | 23 | 10 | 13 | null | null |
sdiehl/ghc | compiler/GHC/Hs/Expr.hs | bsd-3-clause | matchContextErrString PatBindRhs = text "pattern binding" | 73 | matchContextErrString PatBindRhs = text "pattern binding" | 73 | matchContextErrString PatBindRhs = text "pattern binding" | 73 | false | false | 0 | 5 | 21 | 12 | 5 | 7 | null | null |
blamario/grampa | grammatical-parsers/src/Text/Grampa/Class.hs | bsd-2-clause | completeParser :: MonoidNull s => Compose (ParseResults s) (Compose [] ((,) s)) r -> Compose (ParseResults s) [] r
completeParser (Compose (Left failure)) = Compose (Left failure) | 179 | completeParser :: MonoidNull s => Compose (ParseResults s) (Compose [] ((,) s)) r -> Compose (ParseResults s) [] r
completeParser (Compose (Left failure)) = Compose (Left failure) | 179 | completeParser (Compose (Left failure)) = Compose (Left failure) | 64 | false | true | 0 | 12 | 26 | 93 | 45 | 48 | null | null |
toonn/wyah | src/CalcEval.hs | bsd-2-clause | nf :: Expr -> Expr
nf x = fromMaybe x (nf <$> eval' x) | 54 | nf :: Expr -> Expr
nf x = fromMaybe x (nf <$> eval' x) | 54 | nf x = fromMaybe x (nf <$> eval' x) | 35 | false | true | 0 | 8 | 13 | 40 | 17 | 23 | null | null |
tavisrudd/ghcjs-base | JavaScript/Array/ST.hs | mit | drop :: Int -> STJSArray s -> ST s (STJSArray s)
drop n x = ST (I.js_slice1 n x) | 80 | drop :: Int -> STJSArray s -> ST s (STJSArray s)
drop n x = ST (I.js_slice1 n x) | 80 | drop n x = ST (I.js_slice1 n x) | 31 | false | true | 0 | 10 | 18 | 56 | 25 | 31 | null | null |
cryptica/slapnet | src/Parser/LOLAFormula.hs | gpl-3.0 | prefix :: String -> (a -> a) -> Operator String () Identity a
prefix name fun = Prefix ( reservedOp name *> return fun ) | 120 | prefix :: String -> (a -> a) -> Operator String () Identity a
prefix name fun = Prefix ( reservedOp name *> return fun ) | 120 | prefix name fun = Prefix ( reservedOp name *> return fun ) | 58 | false | true | 0 | 9 | 24 | 62 | 29 | 33 | null | null |
ozgurakgun/Idris-dev | Setup.hs | bsd-3-clause | (<//>) = (Px.</>) | 17 | (<//>) = (Px.</>) | 17 | (<//>) = (Px.</>) | 17 | false | false | 0 | 5 | 2 | 12 | 8 | 4 | null | null |
WJWH/Nivix | nivix.hs | unlicense | main = scotty 80 $ do
get "/dashboard" $ showDashboard --serve een static file met de homepage
get "/history" $ getHistory
post "/postmeasurement" $ receiveEvent --een nieuwe event
notFound show404 -- deze matcht alles, net als "otherwise" in een guard
--serve homepage/dashboard | 304 | main = scotty 80 $ do
get "/dashboard" $ showDashboard --serve een static file met de homepage
get "/history" $ getHistory
post "/postmeasurement" $ receiveEvent --een nieuwe event
notFound show404 -- deze matcht alles, net als "otherwise" in een guard
--serve homepage/dashboard | 304 | main = scotty 80 $ do
get "/dashboard" $ showDashboard --serve een static file met de homepage
get "/history" $ getHistory
post "/postmeasurement" $ receiveEvent --een nieuwe event
notFound show404 -- deze matcht alles, net als "otherwise" in een guard
--serve homepage/dashboard | 304 | false | false | 1 | 10 | 66 | 57 | 24 | 33 | null | null |
HIPERFIT/futhark | src/Futhark/Optimise/Simplify/Rules/BasicOp.hs | isc | ruleBasicOp vtable pat aux (Rearrange perm v1)
| Just (BasicOp (Replicate dims (Var v2)), v1_cs) <- ST.lookupExp v1 vtable,
num_dims <- shapeRank dims,
(rep_perm, rest_perm) <- splitAt num_dims perm,
not $ null rest_perm,
rep_perm == [0 .. length rep_perm -1] =
Simplify $
certifying v1_cs $
... | 561 | ruleBasicOp vtable pat aux (Rearrange perm v1)
| Just (BasicOp (Replicate dims (Var v2)), v1_cs) <- ST.lookupExp v1 vtable,
num_dims <- shapeRank dims,
(rep_perm, rest_perm) <- splitAt num_dims perm,
not $ null rest_perm,
rep_perm == [0 .. length rep_perm -1] =
Simplify $
certifying v1_cs $
... | 561 | ruleBasicOp vtable pat aux (Rearrange perm v1)
| Just (BasicOp (Replicate dims (Var v2)), v1_cs) <- ST.lookupExp v1 vtable,
num_dims <- shapeRank dims,
(rep_perm, rest_perm) <- splitAt num_dims perm,
not $ null rest_perm,
rep_perm == [0 .. length rep_perm -1] =
Simplify $
certifying v1_cs $
... | 561 | false | false | 0 | 15 | 158 | 203 | 96 | 107 | null | null |
snapframework/snap-templates | src/Snap/Starter.hs | bsd-3-clause | ------------------------------------------------------------------------------
usage :: String
usage = unlines
[ "Snap 1.0.0.0 Project Kickstarter"
, ""
, "Usage:"
, ""
, " snap <action>"
, ""
, " <action> can be one of:"
, " init - create a new project directory structure in th... | 473 | usage :: String
usage = unlines
[ "Snap 1.0.0.0 Project Kickstarter"
, ""
, "Usage:"
, ""
, " snap <action>"
, ""
, " <action> can be one of:"
, " init - create a new project directory structure in the " ++
"current directory"
, ""
, " Note: you can use --help a... | 394 | usage = unlines
[ "Snap 1.0.0.0 Project Kickstarter"
, ""
, "Usage:"
, ""
, " snap <action>"
, ""
, " <action> can be one of:"
, " init - create a new project directory structure in the " ++
"current directory"
, ""
, " Note: you can use --help after any of the ... | 378 | true | true | 0 | 7 | 138 | 59 | 33 | 26 | null | null |
shlevy/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | isVecExpr (CmmMachOp (MO_VF_Add {}) _) = True | 49 | isVecExpr (CmmMachOp (MO_VF_Add {}) _) = True | 49 | isVecExpr (CmmMachOp (MO_VF_Add {}) _) = True | 49 | false | false | 0 | 9 | 10 | 24 | 12 | 12 | null | null |
nedervold/origami | src/Data/Origami/Internal/Build.hs | bsd-3-clause | buildFolds :: [Name] -- ^ names of the root datatypes
-> [Name] -- ^ names of the /n/-ary functor classes to be used
-> [Name] -- ^ names of datatypes declared to be atomic
-> Q [Dec]
buildFolds rts functs atoms = do
ff <- buildFoldFamily rts functs atoms
return $ mkFol... | 357 | buildFolds :: [Name] -- ^ names of the root datatypes
-> [Name] -- ^ names of the /n/-ary functor classes to be used
-> [Name] -- ^ names of datatypes declared to be atomic
-> Q [Dec]
buildFolds rts functs atoms = do
ff <- buildFoldFamily rts functs atoms
return $ mkFol... | 357 | buildFolds rts functs atoms = do
ff <- buildFoldFamily rts functs atoms
return $ mkFoldDecs ff
-- | Builds a 'FoldFamily'. | 131 | false | true | 0 | 9 | 108 | 73 | 38 | 35 | null | null |
iand675/digital-ocean | src/DigitalOcean.hs | mit | renameDroplet :: DropletId -> String -> DigitalOcean (Response Event)
renameDroplet dropletId name = do
credentials <- creds
get [uri| /droplets/{dropletId}/rename{?name, credentials*} |]
---- /droplets/{dropletId}/destroy | 227 | renameDroplet :: DropletId -> String -> DigitalOcean (Response Event)
renameDroplet dropletId name = do
credentials <- creds
get [uri| /droplets/{dropletId}/rename{?name, credentials*} |]
---- /droplets/{dropletId}/destroy | 227 | renameDroplet dropletId name = do
credentials <- creds
get [uri| /droplets/{dropletId}/rename{?name, credentials*} |]
---- /droplets/{dropletId}/destroy | 157 | false | true | 0 | 9 | 28 | 51 | 26 | 25 | null | null |
atodorov/bdcs | src/BDCS/Depclose.hs | lgpl-2.1 | -- | Given a path to a mddb, a list of architectures, and a list of RPMS, return a formula describing the dependencies
-- See depcloseGroupIds for further details
depcloseNEVRAs :: (MonadError String m, MonadIO m) => [T.Text] -> [T.Text] -> SqlPersistT m DepFormula
depcloseNEVRAs arches nevras = do
-- Convert each ... | 591 | depcloseNEVRAs :: (MonadError String m, MonadIO m) => [T.Text] -> [T.Text] -> SqlPersistT m DepFormula
depcloseNEVRAs arches nevras = do
-- Convert each NEVRA into a group ID.
groupIds <- mapM getGroupId nevras
depcloseGroupIds arches groupIds
-- | Given a path to a mddb, a list of architectures, and a lis... | 428 | depcloseNEVRAs arches nevras = do
-- Convert each NEVRA into a group ID.
groupIds <- mapM getGroupId nevras
depcloseGroupIds arches groupIds
-- | Given a path to a mddb, a list of architectures, and a list of package names, return a formula describing the dependencies
-- See depcloseGroupIds for further de... | 325 | true | true | 0 | 9 | 107 | 81 | 42 | 39 | null | null |
olsner/ghc | compiler/iface/IfaceEnv.hs | bsd-3-clause | extendIfaceTyVarEnv :: [TyVar] -> IfL a -> IfL a
extendIfaceTyVarEnv tyvars thing_inside
= do { env <- getLclEnv
; let { tv_env' = extendFsEnvList (if_tv_env env) pairs
; pairs = [(occNameFS (getOccName tv), tv) | tv <- tyvars] }
; setLclEnv (env { if_tv_env = tv_env' }) thing_inside ... | 321 | extendIfaceTyVarEnv :: [TyVar] -> IfL a -> IfL a
extendIfaceTyVarEnv tyvars thing_inside
= do { env <- getLclEnv
; let { tv_env' = extendFsEnvList (if_tv_env env) pairs
; pairs = [(occNameFS (getOccName tv), tv) | tv <- tyvars] }
; setLclEnv (env { if_tv_env = tv_env' }) thing_inside ... | 321 | extendIfaceTyVarEnv tyvars thing_inside
= do { env <- getLclEnv
; let { tv_env' = extendFsEnvList (if_tv_env env) pairs
; pairs = [(occNameFS (getOccName tv), tv) | tv <- tyvars] }
; setLclEnv (env { if_tv_env = tv_env' }) thing_inside } | 272 | false | true | 0 | 14 | 83 | 117 | 62 | 55 | null | null |
nuttycom/haskoin | prodnet/Network/Haskoin/Constants.hs | unlicense | -- | Default port
defaultPort :: Int
defaultPort = 8333 | 55 | defaultPort :: Int
defaultPort = 8333 | 37 | defaultPort = 8333 | 18 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
akru/haste-compiler | libraries/haste-lib/src/Haste/Random.hs | bsd-3-clause | nxt :: Seed -> IO Seed
nxt = ffi "(function(s){return window['md51'](s.join(','));})" | 85 | nxt :: Seed -> IO Seed
nxt = ffi "(function(s){return window['md51'](s.join(','));})" | 85 | nxt = ffi "(function(s){return window['md51'](s.join(','));})" | 62 | false | true | 0 | 6 | 10 | 21 | 10 | 11 | null | null |
paulkeene/FP101x | chapter06/Exercises.hs | bsd-3-clause | -- Exercise 12 --
myMapC :: (a -> b) -> [a] -> [b]
myMapC f = unfold null (f . head) tail | 91 | myMapC :: (a -> b) -> [a] -> [b]
myMapC f = unfold null (f . head) tail | 72 | myMapC f = unfold null (f . head) tail | 39 | true | true | 0 | 7 | 23 | 50 | 27 | 23 | null | null |
pseudonom/persistent | persistent/Database/Persist.hs | mit | (==.), (!=.), (<.), (<=.), (>.), (>=.) ::
forall v typ. PersistField typ => EntityField v typ -> typ -> Filter v
-- | Check for equality.
--
-- === __Example usage__
--
-- @
-- selectSPJ :: MonadIO m => ReaderT SqlBackend m [Entity User]
-- selectSPJ = selectList [UserName ==. \"SPJ\" ] []
-- @
--
-- The above quer... | 539 | (==.), (!=.), (<.), (<=.), (>.), (>=.) ::
forall v typ. PersistField typ => EntityField v typ -> typ -> Filter v
f ==. a = Filter f (Left a) Eq | 147 | f ==. a = Filter f (Left a) Eq | 31 | true | true | 0 | 9 | 114 | 100 | 67 | 33 | null | null |
uduki/hsQt | Qtc/Enums/Gui/QPaintEngine.hs | bsd-2-clause | eQuickDraw :: QPaintEngineType
eQuickDraw
= ieQPaintEngineType $ 2 | 68 | eQuickDraw :: QPaintEngineType
eQuickDraw
= ieQPaintEngineType $ 2 | 68 | eQuickDraw
= ieQPaintEngineType $ 2 | 37 | false | true | 0 | 6 | 9 | 22 | 9 | 13 | null | null |
shlevy/ghc | libraries/ghc-compact/GHC/Compact/Serialized.hs | bsd-3-clause | mkBlockList :: Compact# -> IO [(Ptr a, Word)]
mkBlockList buffer = compactGetFirstBlock buffer >>= go
where
go :: (Ptr a, Word) -> IO [(Ptr a, Word)]
go (Ptr block, _) | addrIsNull block = return []
go item@(Ptr block, _) = do
next <- compactGetNextBlock buffer block
rest <- go next
retu... | 1,068 | mkBlockList :: Compact# -> IO [(Ptr a, Word)]
mkBlockList buffer = compactGetFirstBlock buffer >>= go
where
go :: (Ptr a, Word) -> IO [(Ptr a, Word)]
go (Ptr block, _) | addrIsNull block = return []
go item@(Ptr block, _) = do
next <- compactGetNextBlock buffer block
rest <- go next
retu... | 1,068 | mkBlockList buffer = compactGetFirstBlock buffer >>= go
where
go :: (Ptr a, Word) -> IO [(Ptr a, Word)]
go (Ptr block, _) | addrIsNull block = return []
go item@(Ptr block, _) = do
next <- compactGetNextBlock buffer block
rest <- go next
return $ item : rest
-- We MUST mark withSerializ... | 1,022 | false | true | 0 | 9 | 215 | 174 | 92 | 82 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/TextUnit.hs | gpl-2.0 | -- | As 'moveB', unless the point is at a unit boundary
-- So for example here moveToEol = maybeMoveB Line Forward;
-- in that it will move to the end of current line and nowhere if we
-- are already at the end of the current line. Similarly for moveToSol.
maybeMoveB :: TextUnit -> Direction -> BufferM ()
maybeMoveB ... | 407 | maybeMoveB :: TextUnit -> Direction -> BufferM ()
maybeMoveB u d = genMaybeMoveB u (d, case d of Forward -> OutsideBound; Backward -> InsideBound) d | 148 | maybeMoveB u d = genMaybeMoveB u (d, case d of Forward -> OutsideBound; Backward -> InsideBound) d | 98 | true | true | 0 | 9 | 77 | 63 | 34 | 29 | null | null |
johan1a/haskell-go | src/Eval.hs | gpl-2.0 | bindDecls [] type_ _ state = error "mismatch1 TODO error?" | 58 | bindDecls [] type_ _ state = error "mismatch1 TODO error?" | 58 | bindDecls [] type_ _ state = error "mismatch1 TODO error?" | 58 | false | false | 0 | 5 | 9 | 22 | 9 | 13 | null | null |
olsner/ghc | compiler/basicTypes/NameSet.hs | bsd-3-clause | extendNameSet = addOneToUniqSet | 33 | extendNameSet = addOneToUniqSet | 33 | extendNameSet = addOneToUniqSet | 33 | false | false | 0 | 4 | 4 | 6 | 3 | 3 | null | null |
tjakway/ghcjvm | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlVarPat :: id -> LPat id
nlVarPat n = noLoc (VarPat (noLoc n)) | 63 | nlVarPat :: id -> LPat id
nlVarPat n = noLoc (VarPat (noLoc n)) | 63 | nlVarPat n = noLoc (VarPat (noLoc n)) | 37 | false | true | 0 | 9 | 12 | 36 | 17 | 19 | null | null |
oldmanmike/ghc | libraries/base/System/Posix/Internals.hs | bsd-3-clause | fdStat :: FD -> IO (IODeviceType, CDev, CIno)
fdStat fd =
allocaBytes sizeof_stat $ \ p_stat -> do
throwErrnoIfMinus1Retry_ "fdType" $
c_fstat fd p_stat
ty <- statGetType p_stat
dev <- st_dev p_stat
ino <- st_ino p_stat
return (ty,dev,ino) | 269 | fdStat :: FD -> IO (IODeviceType, CDev, CIno)
fdStat fd =
allocaBytes sizeof_stat $ \ p_stat -> do
throwErrnoIfMinus1Retry_ "fdType" $
c_fstat fd p_stat
ty <- statGetType p_stat
dev <- st_dev p_stat
ino <- st_ino p_stat
return (ty,dev,ino) | 269 | fdStat fd =
allocaBytes sizeof_stat $ \ p_stat -> do
throwErrnoIfMinus1Retry_ "fdType" $
c_fstat fd p_stat
ty <- statGetType p_stat
dev <- st_dev p_stat
ino <- st_ino p_stat
return (ty,dev,ino) | 223 | false | true | 0 | 10 | 67 | 102 | 48 | 54 | null | null |
supermitch/learn-haskell | haskell.org/qsort.hs | mit | quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>=p) xs
-- List comprehension form | 172 | quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>=p) xs
-- List comprehension form | 172 | quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
where
lesser = filter (< p) xs
greater = filter (>=p) xs
-- List comprehension form | 172 | false | false | 1 | 8 | 46 | 71 | 38 | 33 | null | null |
lapets/ascetic | Text/Ascetic/HTML.hs | mit | conc :: [HTML] -> HTML
conc hs = A.L hs | 39 | conc :: [HTML] -> HTML
conc hs = A.L hs | 39 | conc hs = A.L hs | 16 | false | true | 0 | 7 | 9 | 32 | 14 | 18 | null | null |
jystic/diffarray | tst/TestMain.hs | bsd-3-clause | prop_elems = elems `eq` elems | 29 | prop_elems = elems `eq` elems | 29 | prop_elems = elems `eq` elems | 29 | false | false | 1 | 5 | 4 | 18 | 8 | 10 | null | null |
slpopejoy/fadno-xml | src/Fadno/MusicXml/MusicXml30.hs | bsd-2-clause | parseChxBend :: P.XParse ChxBend
parseChxBend =
BendPreBend
<$> (P.xchild (P.name "pre-bend") (parseEmpty))
<|> BendRelease
<$> (P.xchild (P.name "release") (parseEmpty)) | 199 | parseChxBend :: P.XParse ChxBend
parseChxBend =
BendPreBend
<$> (P.xchild (P.name "pre-bend") (parseEmpty))
<|> BendRelease
<$> (P.xchild (P.name "release") (parseEmpty)) | 199 | parseChxBend =
BendPreBend
<$> (P.xchild (P.name "pre-bend") (parseEmpty))
<|> BendRelease
<$> (P.xchild (P.name "release") (parseEmpty)) | 166 | false | true | 0 | 12 | 47 | 70 | 36 | 34 | null | null |
fmapfmapfmap/amazonka | amazonka-config/gen/Network/AWS/Config/Types/Product.hs | mpl-2.0 | -- | The type of AWS resource.
ciResourceType :: Lens' ConfigurationItem (Maybe ResourceType)
ciResourceType = lens _ciResourceType (\ s a -> s{_ciResourceType = a}) | 165 | ciResourceType :: Lens' ConfigurationItem (Maybe ResourceType)
ciResourceType = lens _ciResourceType (\ s a -> s{_ciResourceType = a}) | 134 | ciResourceType = lens _ciResourceType (\ s a -> s{_ciResourceType = a}) | 71 | true | true | 1 | 9 | 23 | 50 | 25 | 25 | null | null |
geophf/1HaskellADay | exercises/HAD/Control/List.hs | mit | -- takeout is very 'State-y'
-- permute
permute :: Eq a => [a] -> [[a]]
permute [] = [[]] | 91 | permute :: Eq a => [a] -> [[a]]
permute [] = [[]] | 49 | permute [] = [[]] | 17 | true | true | 0 | 10 | 20 | 49 | 25 | 24 | null | null |
snapframework/snap-core | test/Snap/Util/GZip/Tests.hs | bsd-3-clause | ------------------------------------------------------------------------------
mkNoHeaders :: IO Request
mkNoHeaders = Test.buildRequest $ return () | 148 | mkNoHeaders :: IO Request
mkNoHeaders = Test.buildRequest $ return () | 69 | mkNoHeaders = Test.buildRequest $ return () | 43 | true | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
ryzhyk/cocoon | cocoon/NetKAT/NetKAT.hs | apache-2.0 | ppHeaderVal op (NKIP4Dst ip msk) = pp "ip4Dst" <+> pp op <+> ppIP ip msk | 75 | ppHeaderVal op (NKIP4Dst ip msk) = pp "ip4Dst" <+> pp op <+> ppIP ip msk | 75 | ppHeaderVal op (NKIP4Dst ip msk) = pp "ip4Dst" <+> pp op <+> ppIP ip msk | 75 | false | false | 0 | 7 | 17 | 38 | 17 | 21 | null | null |
ExNexu/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | inferOpts = [] | 14 | inferOpts = [] | 14 | inferOpts = [] | 14 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
lywaterman/parconc-examples | strat3.hs | bsd-3-clause | evalPair :: Strategy a -> Strategy b -> Strategy (a,b)
evalPair sa sb (a,b) = do
a' <- sa a
b' <- sb b
return (a',b')
-- >>
-- <<parPair | 143 | evalPair :: Strategy a -> Strategy b -> Strategy (a,b)
evalPair sa sb (a,b) = do
a' <- sa a
b' <- sb b
return (a',b')
-- >>
-- <<parPair | 143 | evalPair sa sb (a,b) = do
a' <- sa a
b' <- sb b
return (a',b')
-- >>
-- <<parPair | 88 | false | true | 0 | 8 | 36 | 81 | 40 | 41 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Distribution/Client/IndexUtils.hs | bsd-3-clause | -- | It is not necessary to call this, as the cache will be updated when the
-- index is read normally. However you can do the work earlier if you like.
--
updateRepoIndexCache :: Verbosity -> Repo -> IO ()
updateRepoIndexCache verbosity repo =
whenCacheOutOfDate indexFile cacheFile $ do
updatePackageIndexCac... | 472 | updateRepoIndexCache :: Verbosity -> Repo -> IO ()
updateRepoIndexCache verbosity repo =
whenCacheOutOfDate indexFile cacheFile $ do
updatePackageIndexCacheFile verbosity indexFile cacheFile
where
indexFile = repoLocalDir repo </> "00-index.tar"
cacheFile = repoLocalDir repo </> "00-index.cache" | 316 | updateRepoIndexCache verbosity repo =
whenCacheOutOfDate indexFile cacheFile $ do
updatePackageIndexCacheFile verbosity indexFile cacheFile
where
indexFile = repoLocalDir repo </> "00-index.tar"
cacheFile = repoLocalDir repo </> "00-index.cache" | 265 | true | true | 0 | 8 | 86 | 78 | 38 | 40 | null | null |
wat-aro/scheme | app/Main.hs | bsd-3-clause | readProc :: [LispVal] -> IOThrowsError LispVal
readProc [] = readProc [Port stdin] | 82 | readProc :: [LispVal] -> IOThrowsError LispVal
readProc [] = readProc [Port stdin] | 82 | readProc [] = readProc [Port stdin] | 35 | false | true | 0 | 7 | 11 | 35 | 17 | 18 | null | null |
mrehayden1/harmony | Spotify/Appkey.hs | bsd-3-clause | applicationKey :: ApplicationKey
applicationKey = g_appkey | 59 | applicationKey :: ApplicationKey
applicationKey = g_appkey | 58 | applicationKey = g_appkey | 25 | false | true | 0 | 4 | 6 | 11 | 6 | 5 | null | null |
yihuang/cabal-install | Distribution/Client/Targets.hs | bsd-3-clause | reportPackageTargetProblems :: Verbosity
-> [PackageTargetProblem] -> IO ()
reportPackageTargetProblems verbosity problems = do
case [ pkg | PackageNameUnknown pkg originalTarget <- problems
, not (isUserTagetWorld originalTarget) ] of
[] -> return ()
pkgs ... | 1,658 | reportPackageTargetProblems :: Verbosity
-> [PackageTargetProblem] -> IO ()
reportPackageTargetProblems verbosity problems = do
case [ pkg | PackageNameUnknown pkg originalTarget <- problems
, not (isUserTagetWorld originalTarget) ] of
[] -> return ()
pkgs ... | 1,658 | reportPackageTargetProblems verbosity problems = do
case [ pkg | PackageNameUnknown pkg originalTarget <- problems
, not (isUserTagetWorld originalTarget) ] of
[] -> return ()
pkgs -> die $ unlines
[ "There is no package named '" ++ display name ++ "'. "
... | 1,554 | false | true | 0 | 17 | 580 | 327 | 161 | 166 | null | null |
swift-nav/plover | src/Language/Plover/Simplify.hs | mit | poly0 :: Polynomial expr num
poly0 = M.empty | 44 | poly0 :: Polynomial expr num
poly0 = M.empty | 44 | poly0 = M.empty | 15 | false | true | 1 | 6 | 7 | 22 | 9 | 13 | null | null |
brendanhay/gogol | gogol-alertcenter/gen/Network/Google/AlertCenter/Types/Product.hs | mpl-2.0 | -- | Email address of the user.
uEmailAddress :: Lens' User (Maybe Text)
uEmailAddress
= lens _uEmailAddress
(\ s a -> s{_uEmailAddress = a}) | 149 | uEmailAddress :: Lens' User (Maybe Text)
uEmailAddress
= lens _uEmailAddress
(\ s a -> s{_uEmailAddress = a}) | 117 | uEmailAddress
= lens _uEmailAddress
(\ s a -> s{_uEmailAddress = a}) | 76 | true | true | 0 | 9 | 31 | 48 | 25 | 23 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/TysPrim.hs | bsd-3-clause | -- See Note [SuperKind (BOX)]
anyKindTyCon = mkKindTyCon anyKindTyConName superKind | 102 | anyKindTyCon = mkKindTyCon anyKindTyConName superKind | 71 | anyKindTyCon = mkKindTyCon anyKindTyConName superKind | 71 | true | false | 0 | 5 | 28 | 12 | 6 | 6 | null | null |
gust/feature-creature | marketing-site/app/Routing.hs | mit | findAuthToken :: ByteString -> Maybe Text
findAuthToken c = Map.lookup "auth-token" $ parseCookies c | 100 | findAuthToken :: ByteString -> Maybe Text
findAuthToken c = Map.lookup "auth-token" $ parseCookies c | 100 | findAuthToken c = Map.lookup "auth-token" $ parseCookies c | 58 | false | true | 0 | 7 | 13 | 33 | 15 | 18 | null | null |
nominolo/union-find | src/Control/Monad/Trans/UnionFind.hs | bsd-3-clause | -- | Join the equivalence classes of the points. The resulting
-- equivalence class will get the descriptor of the second argument.
union :: Monad m => Point p -> Point p -> UnionFindT p m ()
union p1 p2 = UnionFindT . State.modify $ \x -> UF.union x p1 p2 | 257 | union :: Monad m => Point p -> Point p -> UnionFindT p m ()
union p1 p2 = UnionFindT . State.modify $ \x -> UF.union x p1 p2 | 124 | union p1 p2 = UnionFindT . State.modify $ \x -> UF.union x p1 p2 | 64 | true | true | 0 | 9 | 51 | 72 | 35 | 37 | null | null |
mightymoose/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString/Unsafe.hs | bsd-3-clause | assertS :: String -> Bool -> a -> a
assertS _ True = id | 56 | assertS :: String -> Bool -> a -> a
assertS _ True = id | 56 | assertS _ True = id | 20 | false | true | 0 | 7 | 14 | 28 | 14 | 14 | null | null |
kawu/factorized-tag-parser | src/NLP/Partage/AStar/Auto.hs | bsd-2-clause | -- TODO: the code below is a copy of the code in 'Early.Auto'!
-- | Create the `withBody` component based on the automaton.
mkWithBody
:: A.WeiGramAuto n t
-> M.Map DID (S.Set ID)
mkWithBody dag = M.fromListWith S.union
[ (x, S.singleton i)
| (i, A.Body x, _j) <- A.allEdges (A.fromWei dag) ] | 310 | mkWithBody
:: A.WeiGramAuto n t
-> M.Map DID (S.Set ID)
mkWithBody dag = M.fromListWith S.union
[ (x, S.singleton i)
| (i, A.Body x, _j) <- A.allEdges (A.fromWei dag) ] | 184 | mkWithBody dag = M.fromListWith S.union
[ (x, S.singleton i)
| (i, A.Body x, _j) <- A.allEdges (A.fromWei dag) ] | 120 | true | true | 0 | 12 | 69 | 106 | 52 | 54 | null | null |
joshuaclayton/unused | app/App.hs | mit | ignoredPathsFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
ignoredPathsFilter tms = asks $ ignoringPaths . oIgnoredPaths <*> pure tms | 142 | ignoredPathsFilter :: AppConfig m => TermMatchSet -> m TermMatchSet
ignoredPathsFilter tms = asks $ ignoringPaths . oIgnoredPaths <*> pure tms | 142 | ignoredPathsFilter tms = asks $ ignoringPaths . oIgnoredPaths <*> pure tms | 74 | false | true | 2 | 8 | 19 | 48 | 21 | 27 | null | null |
jvictor0/JoSQL | Server/Parser.hs | mit | isTokenable '_' = True | 22 | isTokenable '_' = True | 22 | isTokenable '_' = True | 22 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
QuickChick/Luck | luck/src/Outer/AST.hs | mit | times e1 (Binop (Lit (LitInt n)) OpTimes e2)
= Binop (litIntE n) OpTimes (Binop e1 OpTimes e2) | 96 | times e1 (Binop (Lit (LitInt n)) OpTimes e2)
= Binop (litIntE n) OpTimes (Binop e1 OpTimes e2) | 96 | times e1 (Binop (Lit (LitInt n)) OpTimes e2)
= Binop (litIntE n) OpTimes (Binop e1 OpTimes e2) | 96 | false | false | 0 | 11 | 18 | 56 | 27 | 29 | null | null |
thurn/cantor | src/ReaderTest.hs | unlicense | showDropDelimiters :: String -> String
showDropDelimiters = tail . init . show | 78 | showDropDelimiters :: String -> String
showDropDelimiters = tail . init . show | 78 | showDropDelimiters = tail . init . show | 39 | false | true | 0 | 6 | 11 | 23 | 12 | 11 | null | null |
szehk/Haskell-Carbonara-Library | src/Data/Carbonara/Char.hs | bsd-3-clause | isNotNumber :: Char -> Bool
isNotNumber = not . isNotNumber | 59 | isNotNumber :: Char -> Bool
isNotNumber = not . isNotNumber | 59 | isNotNumber = not . isNotNumber | 31 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
patrikja/GRACeFUL | CLDSL/InfluenceCalculus.hs | bsd-3-clause | _ .+ Q = Q | 10 | _ .+ Q = Q | 10 | _ .+ Q = Q | 10 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
tpsinnem/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | createOtherDoc :: IState -- ^ Needed to determine the types of names
-> Docs -- ^ Namespace item to generate HTML block for
-> H.Html -- ^ Resulting HTML
createOtherDoc ist (FunDoc fd) = createFunDoc ist fd | 253 | createOtherDoc :: IState -- ^ Needed to determine the types of names
-> Docs -- ^ Namespace item to generate HTML block for
-> H.Html
createOtherDoc ist (FunDoc fd) = createFunDoc ist fd | 233 | createOtherDoc ist (FunDoc fd) = createFunDoc ist fd | 67 | true | true | 0 | 7 | 83 | 40 | 21 | 19 | null | null |
lancelet/approxier | src/lib/Shapes/Torus.hs | apache-2.0 | -- | Computes quartic coefficients for a torus - ray intersection.
--
-- Returns the quartic coefficients (c4, c3, c2, c1, c0) where:
-- c4*t^4 + c3*t^3 + c2*t^2 + c1*t + c0 = 0
torqp :: Torus -> Ray -> (Float, Float, Float, Float, Float)
torqp tor ray =
let
-- inputs
rr = torusMajorRadius tor
... | 893 | torqp :: Torus -> Ray -> (Float, Float, Float, Float, Float)
torqp tor ray =
let
-- inputs
rr = torusMajorRadius tor
r = torusMinorRadius tor
p = rayPoint ray
v = rayVector ray
pv = toVector3 p
(px, py, _) = cartesian3Tuple p
(vx, vy, _) ... | 709 | torqp tor ray =
let
-- inputs
rr = torusMajorRadius tor
r = torusMinorRadius tor
p = rayPoint ray
v = rayVector ray
pv = toVector3 p
(px, py, _) = cartesian3Tuple p
(vx, vy, _) = cartesian3Tuple v
-- intermediate values
r2 = r*r
... | 648 | true | true | 0 | 15 | 330 | 370 | 201 | 169 | null | null |
lueck/standoff-tools | src/StandOff/TextRange.hs | gpl-3.0 | -- | end of x between right split points
endRightForbidden :: (TextRange a1, TextRange a2) => a1 -> a2 -> Bool
endRightForbidden x y = forbidden' end snd x y | 157 | endRightForbidden :: (TextRange a1, TextRange a2) => a1 -> a2 -> Bool
endRightForbidden x y = forbidden' end snd x y | 116 | endRightForbidden x y = forbidden' end snd x y | 46 | true | true | 0 | 7 | 29 | 49 | 25 | 24 | null | null |
pbl64k/HackerRank-Contests | 2014-10-10-FP/Infer/i.fail.hs | bsd-2-clause | disp c m Int = ("int", c, m) | 28 | disp c m Int = ("int", c, m) | 28 | disp c m Int = ("int", c, m) | 28 | false | false | 1 | 5 | 7 | 27 | 12 | 15 | null | null |
crufter/haquery | src/Haquery.hs | bsd-3-clause | parseId :: P.Parser [Selector]
parseId = do
P.char '#'
id <- parseNonquoted
return $ l $ Id id | 106 | parseId :: P.Parser [Selector]
parseId = do
P.char '#'
id <- parseNonquoted
return $ l $ Id id | 106 | parseId = do
P.char '#'
id <- parseNonquoted
return $ l $ Id id | 75 | false | true | 0 | 9 | 29 | 54 | 23 | 31 | null | null |
pbv/codex | src/Codex/Evaluate.hs | mit | cancelPending :: Codex ()
cancelPending
= cancelAll =<< gets _queue | 69 | cancelPending :: Codex ()
cancelPending
= cancelAll =<< gets _queue | 69 | cancelPending
= cancelAll =<< gets _queue | 43 | false | true | 0 | 7 | 11 | 25 | 11 | 14 | null | null |
paulkoerbitz/hsbci | src/Data/HBCI/HbciDef.hs | agpl-3.0 | merr line msg Nothing = err line msg | 37 | merr line msg Nothing = err line msg | 37 | merr line msg Nothing = err line msg | 37 | false | false | 0 | 5 | 8 | 21 | 8 | 13 | null | null |
Michaelt293/Lipid-Haskell | src/Lipid/Parsers/KnownSn/Glycerophospholipid.hs | gpl-3.0 | pgpOmega :: QuasiQuoter
pgpOmega = qQuoter pgpOmegaP | 52 | pgpOmega :: QuasiQuoter
pgpOmega = qQuoter pgpOmegaP | 52 | pgpOmega = qQuoter pgpOmegaP | 28 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
dillonhuff/PlayingCards | src/PlayingCards/TexasHoldEm.hs | bsd-3-clause | playerAndBetGen :: TexasHoldEm -> Gen (Player, Int)
playerAndBetGen game = do
player <- activePlayerGen game
bet <- validBetGen game
return $ (player, bet) | 161 | playerAndBetGen :: TexasHoldEm -> Gen (Player, Int)
playerAndBetGen game = do
player <- activePlayerGen game
bet <- validBetGen game
return $ (player, bet) | 161 | playerAndBetGen game = do
player <- activePlayerGen game
bet <- validBetGen game
return $ (player, bet) | 109 | false | true | 0 | 9 | 28 | 65 | 30 | 35 | null | null |
ngeiswei/opencog | opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs | agpl-3.0 | ifNotFlag :: Flag -> SynIso a a
ifNotFlag flag = Iso f f where
f a = do
flags <- gets sFlags
if flag `M.member` flags
then lift $ Left $ "Flag: " ++ flag ++ " is set."
else pure a
--Left if Flag else Right | 248 | ifNotFlag :: Flag -> SynIso a a
ifNotFlag flag = Iso f f where
f a = do
flags <- gets sFlags
if flag `M.member` flags
then lift $ Left $ "Flag: " ++ flag ++ " is set."
else pure a
--Left if Flag else Right | 248 | ifNotFlag flag = Iso f f where
f a = do
flags <- gets sFlags
if flag `M.member` flags
then lift $ Left $ "Flag: " ++ flag ++ " is set."
else pure a
--Left if Flag else Right | 216 | false | true | 0 | 13 | 89 | 87 | 43 | 44 | null | null |
rueshyna/gogol | gogol-youtube-analytics/gen/Network/Google/YouTubeAnalytics/Types/Product.hs | mpl-2.0 | gSnippet :: Lens' Group (Maybe GroupSnippet)
gSnippet = lens _gSnippet (\ s a -> s{_gSnippet = a}) | 98 | gSnippet :: Lens' Group (Maybe GroupSnippet)
gSnippet = lens _gSnippet (\ s a -> s{_gSnippet = a}) | 98 | gSnippet = lens _gSnippet (\ s a -> s{_gSnippet = a}) | 53 | false | true | 0 | 9 | 16 | 45 | 24 | 21 | null | null |
DavidAlphaFox/yesod | yesod-core/Yesod/Core/Handler.hs | mit | setCookie :: MonadHandler m => SetCookie -> m ()
setCookie = addHeaderInternal . AddCookie | 90 | setCookie :: MonadHandler m => SetCookie -> m ()
setCookie = addHeaderInternal . AddCookie | 90 | setCookie = addHeaderInternal . AddCookie | 41 | false | true | 0 | 8 | 13 | 31 | 15 | 16 | null | null |
olsner/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | -- | Substitute within a 'ThetaType'
-- The substitution has to satisfy the invariants described in
-- Note [The substitution invariant].
substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType
substTheta = substTys | 224 | substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType
substTheta = substTys | 86 | substTheta = substTys | 21 | true | true | 0 | 7 | 32 | 27 | 15 | 12 | null | null |
sol/hpack | src/Hpack/Render/Hints.hs | mit | sniffAlignment :: [String] -> Maybe Alignment
sniffAlignment input = case nub . catMaybes . map indentation . catMaybes . map splitField $ input of
[n] -> Just (Alignment n)
_ -> Nothing
where
indentation :: (String, String) -> Maybe Int
indentation (name, value) = case span isSpace value of
(_, ""... | 385 | sniffAlignment :: [String] -> Maybe Alignment
sniffAlignment input = case nub . catMaybes . map indentation . catMaybes . map splitField $ input of
[n] -> Just (Alignment n)
_ -> Nothing
where
indentation :: (String, String) -> Maybe Int
indentation (name, value) = case span isSpace value of
(_, ""... | 385 | sniffAlignment input = case nub . catMaybes . map indentation . catMaybes . map splitField $ input of
[n] -> Just (Alignment n)
_ -> Nothing
where
indentation :: (String, String) -> Maybe Int
indentation (name, value) = case span isSpace value of
(_, "") -> Nothing
(xs, _) -> (Just . succ . l... | 339 | false | true | 1 | 13 | 91 | 151 | 82 | 69 | null | null |
csrhodes/pandoc | src/Text/Pandoc/Writers/DokuWiki.hs | gpl-2.0 | -- | Convert bullet list item (list of blocks) to DokuWiki.
listItemToDokuWiki :: WriterOptions -> [Block] -> DokuWiki String
listItemToDokuWiki opts items = do
contents <- blockListToDokuWiki opts items
useTags <- stUseTags <$> ask
if useTags
then return $ "<HTML><li></HTML>" ++ contents ++ "<HTML></li></HT... | 659 | listItemToDokuWiki :: WriterOptions -> [Block] -> DokuWiki String
listItemToDokuWiki opts items = do
contents <- blockListToDokuWiki opts items
useTags <- stUseTags <$> ask
if useTags
then return $ "<HTML><li></HTML>" ++ contents ++ "<HTML></li></HTML>"
else do
indent <- stIndent <$> ask
b... | 599 | listItemToDokuWiki opts items = do
contents <- blockListToDokuWiki opts items
useTags <- stUseTags <$> ask
if useTags
then return $ "<HTML><li></HTML>" ++ contents ++ "<HTML></li></HTML>"
else do
indent <- stIndent <$> ask
backSlash <- stBackSlashLB <$> ask
let indent' = if backSlas... | 533 | true | true | 0 | 15 | 140 | 141 | 70 | 71 | null | null |
shockkolate/containers | Data/Map/Base.hs | bsd-3-clause | deleteAt :: Int -> Map k a -> Map k a
deleteAt i t = i `seq`
case t of
Tip -> error "Map.deleteAt: index out of range"
Bin _ kx x l r -> case compare i sizeL of
LT -> balanceR kx x (deleteAt i l) r
GT -> balanceL kx x l (deleteAt (i-sizeL-1) r)
EQ -> glue l r
where
sizeL = size... | 706 | deleteAt :: Int -> Map k a -> Map k a
deleteAt i t = i `seq`
case t of
Tip -> error "Map.deleteAt: index out of range"
Bin _ kx x l r -> case compare i sizeL of
LT -> balanceR kx x (deleteAt i l) r
GT -> balanceL kx x l (deleteAt (i-sizeL-1) r)
EQ -> glue l r
where
sizeL = size... | 706 | deleteAt i t = i `seq`
case t of
Tip -> error "Map.deleteAt: index out of range"
Bin _ kx x l r -> case compare i sizeL of
LT -> balanceR kx x (deleteAt i l) r
GT -> balanceL kx x l (deleteAt (i-sizeL-1) r)
EQ -> glue l r
where
sizeL = size l
{--------------------------------... | 668 | false | true | 0 | 17 | 181 | 162 | 81 | 81 | null | null |
jstolarek/ghc | compiler/cmm/PprC.hs | bsd-3-clause | pprStringInCStyle :: [Word8] -> SDoc
pprStringInCStyle s = doubleQuotes (text (concatMap charToC s)) | 100 | pprStringInCStyle :: [Word8] -> SDoc
pprStringInCStyle s = doubleQuotes (text (concatMap charToC s)) | 100 | pprStringInCStyle s = doubleQuotes (text (concatMap charToC s)) | 63 | false | true | 0 | 9 | 12 | 43 | 20 | 23 | null | null |
cirquit/quizlearner | quizlearner/Handler/Xml.hs | mit | displayXML :: Exam -> Widget
displayXML exam = let eTitle = examTitle exam
percent = examPassPercentage exam
spaces = [whamlet| |]
in
[whamlet|
<div class=xml>
... | 1,239 | displayXML :: Exam -> Widget
displayXML exam = let eTitle = examTitle exam
percent = examPassPercentage exam
spaces = [whamlet| |]
in
[whamlet|
<div class=xml>
... | 1,239 | displayXML exam = let eTitle = examTitle exam
percent = examPassPercentage exam
spaces = [whamlet| |]
in
[whamlet|
<div class=xml>
<<span class=xmlRed>!DO... | 1,210 | false | true | 0 | 9 | 476 | 59 | 31 | 28 | null | null |
jystic/language-scala | src/Language/Scala/Tokens.hs | bsd-3-clause | normalisedScientific m e | m `mod` 10 == 0 = normalisedScientific (m `div` 10) (e + 1) | 86 | normalisedScientific m e | m `mod` 10 == 0 = normalisedScientific (m `div` 10) (e + 1) | 86 | normalisedScientific m e | m `mod` 10 == 0 = normalisedScientific (m `div` 10) (e + 1) | 86 | false | false | 0 | 9 | 16 | 48 | 25 | 23 | null | null |
CindyLinz/Haskell.js | trans/src/Desugar/LambdaCase.hs | mit | deLambdaCasePat (PLit l sign literal) = PLit (id l) (deLambdaCaseSign sign) (deLambdaCaseLiteral literal) | 105 | deLambdaCasePat (PLit l sign literal) = PLit (id l) (deLambdaCaseSign sign) (deLambdaCaseLiteral literal) | 105 | deLambdaCasePat (PLit l sign literal) = PLit (id l) (deLambdaCaseSign sign) (deLambdaCaseLiteral literal) | 105 | false | false | 0 | 7 | 12 | 44 | 21 | 23 | null | null |
josefs/MiniDSL | Feldspar/Reify.hs | bsd-3-clause | replace :: Expr -> IntMap [Expr] -> (Expr,IntMap [Expr])
replace e m | uninteresting e = (e,m) | 94 | replace :: Expr -> IntMap [Expr] -> (Expr,IntMap [Expr])
replace e m | uninteresting e = (e,m) | 94 | replace e m | uninteresting e = (e,m) | 37 | false | true | 0 | 9 | 16 | 57 | 29 | 28 | null | null |
Erdwolf/autotool-bonn | src/Program/List/Value.hs | gpl-2.0 | angles t = hsep [ text "<", t, text ">" ] | 41 | angles t = hsep [ text "<", t, text ">" ] | 41 | angles t = hsep [ text "<", t, text ">" ] | 41 | false | false | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
candidtim/euler | src/Problem15.hs | bsd-3-clause | -- |Number of lattice paths in a grid of give size. Size is the number of cells on each side of the grid.
latticePaths :: Int -> Int
latticePaths gridSize =
let grid = increaseGrid starterGrid (gridSize-1)
in head.last $ grid | 230 | latticePaths :: Int -> Int
latticePaths gridSize =
let grid = increaseGrid starterGrid (gridSize-1)
in head.last $ grid | 124 | latticePaths gridSize =
let grid = increaseGrid starterGrid (gridSize-1)
in head.last $ grid | 97 | true | true | 3 | 11 | 45 | 59 | 26 | 33 | null | null |
dgvncsz0f/boats | src/main/haskell/Battleship/Battleship.hs | gpl-2.0 | size (Destroyer _ _) = 155 | 32 | size (Destroyer _ _) = 155 | 32 | size (Destroyer _ _) = 155 | 32 | false | false | 0 | 6 | 11 | 18 | 8 | 10 | null | null |
queirozfcom/haskell-99-problems | problem6.hs | mit | -- find whether a list is a palindrome
-- my solution
isPalindrome :: (Eq x) => [x] -> Bool
isPalindrome [a] = True | 117 | isPalindrome :: (Eq x) => [x] -> Bool
isPalindrome [a] = True | 62 | isPalindrome [a] = True | 23 | true | true | 0 | 7 | 24 | 35 | 20 | 15 | null | null |
eamsden/time-flies | src/FRP/TimeFlies.hs | bsd-3-clause | step :: (Monad m) => Double -- ^ The latest time (not a time delta)
-> SFEvalT svIn svOut m ()
step time = SFEvalT $ do evalState <- get
let dt = time - esLastTime evalState
(SFInit sampleF _) = esSF evalState
(deltaOut, occsO... | 663 | step :: (Monad m) => Double -- ^ The latest time (not a time delta)
-> SFEvalT svIn svOut m ()
step time = SFEvalT $ do evalState <- get
let dt = time - esLastTime evalState
(SFInit sampleF _) = esSF evalState
(deltaOut, occsO... | 663 | step time = SFEvalT $ do evalState <- get
let dt = time - esLastTime evalState
(SFInit sampleF _) = esSF evalState
(deltaOut, occsOut, newSF) = sampleF dt (esDelta evalState)
lift $ sequence $ applyHandlerDelta (... | 557 | false | true | 2 | 13 | 248 | 188 | 92 | 96 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'SinkSpec' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sAddtional'
sinkSpec
:: HashMap Text JSONValue -- ^ 'sAddtional'
-> SinkSpec
sinkSpec pSAddtional_ = SinkSpec' {_sAddtional = _Coerce # pSAddti... | 326 | sinkSpec
:: HashMap Text JSONValue -- ^ 'sAddtional'
-> SinkSpec
sinkSpec pSAddtional_ = SinkSpec' {_sAddtional = _Coerce # pSAddtional_} | 145 | sinkSpec pSAddtional_ = SinkSpec' {_sAddtional = _Coerce # pSAddtional_} | 72 | true | true | 0 | 7 | 60 | 41 | 24 | 17 | null | null |
knrafto/bash-config | src/Bash/Config/Parser.hs | bsd-3-clause | forCommand :: Parser ShellCommand
forCommand = word "for" *> (arithFor_ <|> for_)
where
arithFor_ = ArithFor
<$ operator "((" <*> arith
<* optional listTerm
<*> doGroup
for_ = For <$> anyWord <*> wordList <*> doGroup
-- | Parse a @select@ command. | 297 | forCommand :: Parser ShellCommand
forCommand = word "for" *> (arithFor_ <|> for_)
where
arithFor_ = ArithFor
<$ operator "((" <*> arith
<* optional listTerm
<*> doGroup
for_ = For <$> anyWord <*> wordList <*> doGroup
-- | Parse a @select@ command. | 297 | forCommand = word "for" *> (arithFor_ <|> for_)
where
arithFor_ = ArithFor
<$ operator "((" <*> arith
<* optional listTerm
<*> doGroup
for_ = For <$> anyWord <*> wordList <*> doGroup
-- | Parse a @select@ command. | 263 | false | true | 0 | 9 | 90 | 76 | 38 | 38 | null | null |
kim/amazonka | amazonka-route53-domains/gen/Network/AWS/Route53Domains/RetrieveDomainAuthCode.hs | mpl-2.0 | -- | 'RetrieveDomainAuthCode' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'rdacDomainName' @::@ 'Text'
--
retrieveDomainAuthCode :: Text -- ^ 'rdacDomainName'
-> RetrieveDomainAuthCode
retrieveDomainAuthCode p1 = RetrieveDomainAuthCode
{ _rdacDomainName ... | 330 | retrieveDomainAuthCode :: Text -- ^ 'rdacDomainName'
-> RetrieveDomainAuthCode
retrieveDomainAuthCode p1 = RetrieveDomainAuthCode
{ _rdacDomainName = p1
} | 185 | retrieveDomainAuthCode p1 = RetrieveDomainAuthCode
{ _rdacDomainName = p1
} | 83 | true | true | 0 | 7 | 67 | 37 | 22 | 15 | null | null |
gridaphobe/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | atomPrimRep (AnnLit l) = typePrimRep (literalType l) | 65 | atomPrimRep (AnnLit l) = typePrimRep (literalType l) | 65 | atomPrimRep (AnnLit l) = typePrimRep (literalType l) | 65 | false | false | 0 | 7 | 19 | 24 | 11 | 13 | null | null |
ekarayel/HTF | Test/Framework/Preprocessor.hs | lgpl-2.1 | analyzeTests =
[(unlines ["module FOO where"
,"import Test.Framework"
,"import {-@ HTF_TESTS @-} qualified Foo as Bar"
,"import {-@ HTF_TESTS @-} qualified Foo.X as Egg"
,"import {-@ HTF_TESTS @-} Foo.Y as Spam"
,"import {-@ HTF_TESTS @-} Foo.Z"
... | 3,323 | analyzeTests =
[(unlines ["module FOO where"
,"import Test.Framework"
,"import {-@ HTF_TESTS @-} qualified Foo as Bar"
,"import {-@ HTF_TESTS @-} qualified Foo.X as Egg"
,"import {-@ HTF_TESTS @-} Foo.Y as Spam"
,"import {-@ HTF_TESTS @-} Foo.Z"
... | 3,323 | analyzeTests =
[(unlines ["module FOO where"
,"import Test.Framework"
,"import {-@ HTF_TESTS @-} qualified Foo as Bar"
,"import {-@ HTF_TESTS @-} qualified Foo.X as Egg"
,"import {-@ HTF_TESTS @-} Foo.Y as Spam"
,"import {-@ HTF_TESTS @-} Foo.Z"
... | 3,323 | false | false | 0 | 12 | 1,554 | 547 | 321 | 226 | null | null |
Lyapunov/haskell-programming-from-first-principles | chapter_2/learn.hs | mit | y = 10 | 6 | y = 10 | 6 | y = 10 | 6 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
parsonsmatt/tiger | src/Language/Tiger/Lexer.hs | bsd-3-clause | lexTiger :: ByteString -> [Token]
lexTiger = alexScanTokens | 59 | lexTiger :: ByteString -> [Token]
lexTiger = alexScanTokens | 59 | lexTiger = alexScanTokens | 25 | false | true | 0 | 8 | 7 | 25 | 11 | 14 | null | null |
urbanslug/ghc | compiler/cmm/CmmExpr.hs | bsd-3-clause | globalRegType dflags (VanillaReg _ VNonGcPtr) = bWord dflags | 60 | globalRegType dflags (VanillaReg _ VNonGcPtr) = bWord dflags | 60 | globalRegType dflags (VanillaReg _ VNonGcPtr) = bWord dflags | 60 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
JoeyEremondi/haskelm | src/Test/module1.hs | bsd-3-clause | minusTest = 3-4 | 15 | minusTest = 3-4 | 15 | minusTest = 3-4 | 15 | false | false | 0 | 5 | 2 | 10 | 5 | 5 | null | null |
4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/Input/ADL1/ParsingLib.hs | gpl-3.0 | pUTCTime :: AmpParser UTCTime
pUTCTime = check (\lx -> case lx of { LexDateTime s -> Just s; _ -> Nothing }) <?> "iso 8601 DateTime" | 133 | pUTCTime :: AmpParser UTCTime
pUTCTime = check (\lx -> case lx of { LexDateTime s -> Just s; _ -> Nothing }) <?> "iso 8601 DateTime" | 133 | pUTCTime = check (\lx -> case lx of { LexDateTime s -> Just s; _ -> Nothing }) <?> "iso 8601 DateTime" | 103 | false | true | 0 | 12 | 26 | 54 | 28 | 26 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | unitbus :: Pattern Int -> Pattern String -> ControlPattern
unitbus _ _ = error $ "Control parameter 'unit' can't be sent to a bus." | 131 | unitbus :: Pattern Int -> Pattern String -> ControlPattern
unitbus _ _ = error $ "Control parameter 'unit' can't be sent to a bus." | 131 | unitbus _ _ = error $ "Control parameter 'unit' can't be sent to a bus." | 72 | false | true | 2 | 8 | 23 | 41 | 17 | 24 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.