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
MaximKN/Haskell1
src/REPL.hs
gpl-3.0
-- | Add variable to tree of variables updateTreeVars :: (Ord a) => a -> b -> Tree (a, b) -> Tree (a, b) updateTreeVars n v Empty = Node (n,v) Empty Empty
155
updateTreeVars :: (Ord a) => a -> b -> Tree (a, b) -> Tree (a, b) updateTreeVars n v Empty = Node (n,v) Empty Empty
116
updateTreeVars n v Empty = Node (n,v) Empty Empty
50
true
true
0
10
33
71
38
33
null
null
badp/ganeti
test/hs/Test/Ganeti/OpCodes.hs
gpl-2.0
case_py_compat_fields :: HUnit.Assertion case_py_compat_fields = do let hs_fields = sort $ map (\op_id -> (op_id, OpCodes.allOpFields op_id)) OpCodes.allOpIDs py_stdout <- runPython "from ganeti import opcodes\n\ \import sys\n\ \from ganeti import serializ...
1,458
case_py_compat_fields :: HUnit.Assertion case_py_compat_fields = do let hs_fields = sort $ map (\op_id -> (op_id, OpCodes.allOpFields op_id)) OpCodes.allOpIDs py_stdout <- runPython "from ganeti import opcodes\n\ \import sys\n\ \from ganeti import serializ...
1,458
case_py_compat_fields = do let hs_fields = sort $ map (\op_id -> (op_id, OpCodes.allOpFields op_id)) OpCodes.allOpIDs py_stdout <- runPython "from ganeti import opcodes\n\ \import sys\n\ \from ganeti import serializer\n\ \fields = [(k, sorte...
1,417
false
true
0
16
454
288
143
145
null
null
nikivazou/hscolour
Language/Haskell/HsColour/MIRC.hs
gpl-2.0
code Green False = "3"
24
code Green False = "3"
24
code Green False = "3"
24
false
false
1
5
6
16
5
11
null
null
rrnewton/hgdata_trash
src/Main.hs
mit
-- | Dispatch a command-line request. dispatch :: HGData -> IO () dispatch (OAuth2Url clientId) = putStrLn $ OA2.formUrl (OA2.OAuth2Client clientId undefined) $ mapMaybe (`lookup` OA2.googleScopes) [ "Google Cloud Storage" , "Contacts" , "Picasa Web" , "Google Books" ]
302
dispatch :: HGData -> IO () dispatch (OAuth2Url clientId) = putStrLn $ OA2.formUrl (OA2.OAuth2Client clientId undefined) $ mapMaybe (`lookup` OA2.googleScopes) [ "Google Cloud Storage" , "Contacts" , "Picasa Web" , "Google Books" ]
263
dispatch (OAuth2Url clientId) = putStrLn $ OA2.formUrl (OA2.OAuth2Client clientId undefined) $ mapMaybe (`lookup` OA2.googleScopes) [ "Google Cloud Storage" , "Contacts" , "Picasa Web" , "Google Books" ]
235
true
true
0
10
71
79
42
37
null
null
shlevy/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
tidyType env (TyConApp tycon tys) = let args = tidyTypes env tys in args `seqList` TyConApp tycon args
138
tidyType env (TyConApp tycon tys) = let args = tidyTypes env tys in args `seqList` TyConApp tycon args
138
tidyType env (TyConApp tycon tys) = let args = tidyTypes env tys in args `seqList` TyConApp tycon args
138
false
false
0
9
53
48
22
26
null
null
rahulmutt/ghcvm
compiler/Eta/Prelude/PrelNames.hs
bsd-3-clause
geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
56
geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
56
geIntegerPrimIdKey = mkPreludeMiscIdUnique 77
56
false
false
0
5
14
9
4
5
null
null
lynnard/cocos2d-hs
src/Graphics/UI/Cocos2d/Std.hs
bsd-3-clause
stdString_GE :: (StdStringValue arg'1, StdStringValue arg'2) => arg'1 -> arg'2 -> HoppyP.IO HoppyP.Bool stdString_GE arg'1 arg'2 = withStdStringPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' -> withStdStringPtr arg'2 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'2' -> HoppyP.fmap (/= 0) (stdString_GE' arg'1' ...
327
stdString_GE :: (StdStringValue arg'1, StdStringValue arg'2) => arg'1 -> arg'2 -> HoppyP.IO HoppyP.Bool stdString_GE arg'1 arg'2 = withStdStringPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' -> withStdStringPtr arg'2 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'2' -> HoppyP.fmap (/= 0) (stdString_GE' arg'1' ...
327
stdString_GE arg'1 arg'2 = withStdStringPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' -> withStdStringPtr arg'2 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'2' -> HoppyP.fmap (/= 0) (stdString_GE' arg'1' arg'2')
223
false
true
4
10
46
119
56
63
null
null
ivanperez-keera/Yampa
yampa/src/FRP/Yampa/InternalCore.hs
bsd-3-clause
sfArr (FDG f) = sfArrG f
28
sfArr (FDG f) = sfArrG f
28
sfArr (FDG f) = sfArrG f
28
false
false
0
7
9
18
8
10
null
null
splondike/depcache
src/DepProcessors/Npm.hs
gpl-3.0
findDefinitions :: [FilePath] -> IO [NpmDefinition] findDefinitions files = return $ map NpmDefinition filtered where filtered = filter ((=="package.json") . getFileName) files
185
findDefinitions :: [FilePath] -> IO [NpmDefinition] findDefinitions files = return $ map NpmDefinition filtered where filtered = filter ((=="package.json") . getFileName) files
185
findDefinitions files = return $ map NpmDefinition filtered where filtered = filter ((=="package.json") . getFileName) files
133
false
true
0
8
30
60
31
29
null
null
brendanhay/gogol
gogol-storage/gen/Network/Google/Resource/Storage/Objects/Rewrite.hs
mpl-2.0
-- | Resource name of the Cloud KMS key, of the form -- projects\/my-project\/locations\/global\/keyRings\/my-kr\/cryptoKeys\/my-key, -- that will be used to encrypt the object. Overrides the object -- metadata\'s kms_key_name value, if any. orDestinationKmsKeyName :: Lens' ObjectsRewrite (Maybe Text) orDestinationKmsK...
409
orDestinationKmsKeyName :: Lens' ObjectsRewrite (Maybe Text) orDestinationKmsKeyName = lens _orDestinationKmsKeyName (\ s a -> s{_orDestinationKmsKeyName = a})
167
orDestinationKmsKeyName = lens _orDestinationKmsKeyName (\ s a -> s{_orDestinationKmsKeyName = a})
106
true
true
0
9
56
51
28
23
null
null
GaloisInc/sk-dev-platform
libs/genLobster/Main.hs
bsd-3-clause
updateList :: (a -> Maybe a) -> [a] -> [a] updateList _ [] = []
63
updateList :: (a -> Maybe a) -> [a] -> [a] updateList _ [] = []
63
updateList _ [] = []
20
false
true
0
8
14
44
23
21
null
null
ozgurakgun/Idris-dev
src/Idris/REPL/Parser.hs
bsd-3-clause
nameArgCmd names command doc = (names, NameArg, doc, fnNameArg command)
73
nameArgCmd names command doc = (names, NameArg, doc, fnNameArg command)
73
nameArgCmd names command doc = (names, NameArg, doc, fnNameArg command)
73
false
false
0
6
11
28
15
13
null
null
mcmaniac/ghc
compiler/llvmGen/LlvmCodeGen/Base.hs
bsd-3-clause
-- | Create an external definition for a 'CLabel' defined in another module. genCmmLabelRef :: LlvmEnv -> CLabel -> LMGlobal genCmmLabelRef env = genStringLabelRef . strCLabel_llvm env
184
genCmmLabelRef :: LlvmEnv -> CLabel -> LMGlobal genCmmLabelRef env = genStringLabelRef . strCLabel_llvm env
107
genCmmLabelRef env = genStringLabelRef . strCLabel_llvm env
59
true
true
0
6
26
30
15
15
null
null
spechub/Hets
OWL2/XMLConversion.hs
gpl-2.0
xmlObjProp :: ObjectPropertyExpression -> Element xmlObjProp ope = case ope of ObjectProp op -> mwNameIRI objectPropertyK op ObjectInverseOf i -> makeElement objectInverseOfK [xmlObjProp i]
197
xmlObjProp :: ObjectPropertyExpression -> Element xmlObjProp ope = case ope of ObjectProp op -> mwNameIRI objectPropertyK op ObjectInverseOf i -> makeElement objectInverseOfK [xmlObjProp i]
197
xmlObjProp ope = case ope of ObjectProp op -> mwNameIRI objectPropertyK op ObjectInverseOf i -> makeElement objectInverseOfK [xmlObjProp i]
147
false
true
0
10
31
56
26
30
null
null
zaxtax/hakaru
haskell/Tests/Disintegrate.hs
bsd-3-clause
---------------------------------------------------------------- naiveBayes :: Model ('HArray ('HArray 'HNat)) ('HArray 'HNat) naiveBayes = plate numLabels (\_ -> dirichlet (array sizeVocab (\_ -> prob_ 1))) >>= \bs -> dirichlet (array numLabels (\_ -> prob_ 1)) >>= \ts -> plate numDocs (\_ -> categoric...
615
naiveBayes :: Model ('HArray ('HArray 'HNat)) ('HArray 'HNat) naiveBayes = plate numLabels (\_ -> dirichlet (array sizeVocab (\_ -> prob_ 1))) >>= \bs -> dirichlet (array numLabels (\_ -> prob_ 1)) >>= \ts -> plate numDocs (\_ -> categorical ts) >>= \zs -> plate numDocs (\i -> plate sizeEachDoc ...
550
naiveBayes = plate numLabels (\_ -> dirichlet (array sizeVocab (\_ -> prob_ 1))) >>= \bs -> dirichlet (array numLabels (\_ -> prob_ 1)) >>= \ts -> plate numDocs (\_ -> categorical ts) >>= \zs -> plate numDocs (\i -> plate sizeEachDoc (\_ -> categorical (bs ! (zs ! i)))) >>...
484
true
true
0
15
178
251
126
125
null
null
garetxe/cabal
cabal-install/Distribution/Client/Sandbox/Timestamp.hs
bsd-3-clause
withTimestampFile :: FilePath -> ([TimestampFileRecord] -> IO [TimestampFileRecord]) -> IO () withTimestampFile sandboxDir process = do let timestampFile = sandboxDir </> timestampFileName timestampRecords <- readTimestampFile timestampFile >>= process writeTimestampFile ...
603
withTimestampFile :: FilePath -> ([TimestampFileRecord] -> IO [TimestampFileRecord]) -> IO () withTimestampFile sandboxDir process = do let timestampFile = sandboxDir </> timestampFileName timestampRecords <- readTimestampFile timestampFile >>= process writeTimestampFile ...
603
withTimestampFile sandboxDir process = do let timestampFile = sandboxDir </> timestampFileName timestampRecords <- readTimestampFile timestampFile >>= process writeTimestampFile timestampFile timestampRecords -- | Given a list of 'AddSourceTimestamp's, a list of paths to add-source deps -- we've added and an ini...
467
false
true
1
10
125
84
42
42
null
null
johnjcamilleri/maltese-functional-morphology
malti/AttrMt.hs
lgpl-3.0
atP :: Attr atP = 3
20
atP :: Attr atP = 3
20
atP = 3
8
false
true
0
4
6
11
6
5
null
null
rahulmutt/ghcvm
compiler/Eta/Core/CoreFVs.hs
bsd-3-clause
idUnfoldingFVs :: Id -> FV idUnfoldingFVs id = stableUnfoldingFVs (realIdUnfolding id) `orElse` emptyFV
103
idUnfoldingFVs :: Id -> FV idUnfoldingFVs id = stableUnfoldingFVs (realIdUnfolding id) `orElse` emptyFV
103
idUnfoldingFVs id = stableUnfoldingFVs (realIdUnfolding id) `orElse` emptyFV
76
false
true
0
8
12
33
17
16
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qTableWidgetItemAddFinalizer1 :: QTableWidgetItem a -> IO () qTableWidgetItemAddFinalizer1 (Object fp) = addForeignPtrFinalizer qtc_QTableWidgetItem_getFinalizer1 fp
167
qTableWidgetItemAddFinalizer1 :: QTableWidgetItem a -> IO () qTableWidgetItemAddFinalizer1 (Object fp) = addForeignPtrFinalizer qtc_QTableWidgetItem_getFinalizer1 fp
167
qTableWidgetItemAddFinalizer1 (Object fp) = addForeignPtrFinalizer qtc_QTableWidgetItem_getFinalizer1 fp
106
false
true
0
7
15
37
17
20
null
null
ezyang/ghc
testsuite/tests/typecheck/should_fail/T12973.hs
bsd-3-clause
foo :: forall (a :: TYPE r). Num a => a foo = 3 + 4
51
foo :: forall (a :: TYPE r). Num a => a foo = 3 + 4
51
foo = 3 + 4
11
false
true
2
9
15
44
20
24
null
null
hsinewu/Nand2tetris
06/Decode.hs
mit
decodeJump "JGE" = "011"
24
decodeJump "JGE" = "011"
24
decodeJump "JGE" = "011"
24
false
false
1
5
3
13
4
9
null
null
elieux/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
ppr_reg_float :: Int -> LitString ppr_reg_float i = case i of 16 -> sLit "%fake0"; 17 -> sLit "%fake1" 18 -> sLit "%fake2"; 19 -> sLit "%fake3" 20 -> sLit "%fake4"; 21 -> sLit "%fake5" 24 -> sLit "%xmm0"; 25 -> sLit "%xmm1" 26 -> sLit "%xmm2"; 27 -> sLit "%xmm3" 28...
653
ppr_reg_float :: Int -> LitString ppr_reg_float i = case i of 16 -> sLit "%fake0"; 17 -> sLit "%fake1" 18 -> sLit "%fake2"; 19 -> sLit "%fake3" 20 -> sLit "%fake4"; 21 -> sLit "%fake5" 24 -> sLit "%xmm0"; 25 -> sLit "%xmm1" 26 -> sLit "%xmm2"; 27 -> sLit "%xmm3" 28...
653
ppr_reg_float i = case i of 16 -> sLit "%fake0"; 17 -> sLit "%fake1" 18 -> sLit "%fake2"; 19 -> sLit "%fake3" 20 -> sLit "%fake4"; 21 -> sLit "%fake5" 24 -> sLit "%xmm0"; 25 -> sLit "%xmm1" 26 -> sLit "%xmm2"; 27 -> sLit "%xmm3" 28 -> sLit "%xmm4"; 29 -> sLit "%x...
619
false
true
0
8
218
240
114
126
null
null
bgw/hs-rpal
src/Parser.hs
gpl-3.0
parseA :: [Token] -> ParserResult parseA tokens = do (aa, ta) <- parseAtNeg tokens parseAPartial aa ta where parseAPartial leftAst partialTokens = case partialTokens of (TokenOperator "+" : ta) -> do (ab, tb) <- parseAtNeg ta parseA...
983
parseA :: [Token] -> ParserResult parseA tokens = do (aa, ta) <- parseAtNeg tokens parseAPartial aa ta where parseAPartial leftAst partialTokens = case partialTokens of (TokenOperator "+" : ta) -> do (ab, tb) <- parseAtNeg ta parseA...
983
parseA tokens = do (aa, ta) <- parseAtNeg tokens parseAPartial aa ta where parseAPartial leftAst partialTokens = case partialTokens of (TokenOperator "+" : ta) -> do (ab, tb) <- parseAtNeg ta parseAPartial (AstPlus leftAst ab) tb ...
949
false
true
3
13
379
258
128
130
null
null
fmthoma/ghc
compiler/specialise/Rules.hs
bsd-3-clause
matchN :: InScopeEnv -> [Var] -- ^ Match template type variables -> [CoreExpr] -- ^ Match template -> [CoreExpr] -- ^ Target; can have more elements than the template -> Maybe (BindWrapper, -- Floated bindings; see Note [Matching lets] ...
3,290
matchN :: InScopeEnv -> [Var] -- ^ Match template type variables -> [CoreExpr] -- ^ Match template -> [CoreExpr] -- ^ Target; can have more elements than the template -> Maybe (BindWrapper, -- Floated bindings; see Note [Matching lets] ...
3,053
matchN (in_scope, id_unf) tmpl_vars tmpl_es target_es = do { subst <- go init_menv emptyRuleSubst tmpl_es target_es ; return (rs_binds subst, map (lookup_tmpl subst) tmpl_vars') } where (init_rn_env, tmpl_vars') = mapAccumL rnBndrL (mkRnEnv2 in_scope) tmpl_vars -- See Note [Te...
2,718
true
true
5
12
1,095
470
237
233
null
null
olorin/amazonka
amazonka-iam/gen/Network/AWS/IAM/Types.hs
mpl-2.0
-- | The request was rejected because the same certificate is associated with -- an IAM user in the account. _DuplicateCertificateException :: AsError a => Getting (First ServiceError) a ServiceError _DuplicateCertificateException = _ServiceError . hasStatus 409 . hasCode "DuplicateCertificate"
299
_DuplicateCertificateException :: AsError a => Getting (First ServiceError) a ServiceError _DuplicateCertificateException = _ServiceError . hasStatus 409 . hasCode "DuplicateCertificate"
190
_DuplicateCertificateException = _ServiceError . hasStatus 409 . hasCode "DuplicateCertificate"
99
true
true
1
8
42
48
23
25
null
null
ad0/robozzle-hs
src/Engine.hs
gpl-3.0
turnLeft DirRight = DirUp
25
turnLeft DirRight = DirUp
25
turnLeft DirRight = DirUp
25
false
false
0
5
3
9
4
5
null
null
GaloisInc/saw-script
src/SAWScript/Builtins.hs
bsd-3-clause
cecPrim :: AIGNetwork -> AIGNetwork -> TopLevel ProofResult cecPrim (SV.AIGNetwork x) (SV.AIGNetwork y) = do y' <- case cast y of Just n -> return n Nothing -> fail "Inconsistent AIG types" io $ verifyAIGCompatible x y' res <- io $ AIG.cec x y' let stats = solverStats "ABC" 0 -- TODO, count ...
758
cecPrim :: AIGNetwork -> AIGNetwork -> TopLevel ProofResult cecPrim (SV.AIGNetwork x) (SV.AIGNetwork y) = do y' <- case cast y of Just n -> return n Nothing -> fail "Inconsistent AIG types" io $ verifyAIGCompatible x y' res <- io $ AIG.cec x y' let stats = solverStats "ABC" 0 -- TODO, count ...
758
cecPrim (SV.AIGNetwork x) (SV.AIGNetwork y) = do y' <- case cast y of Just n -> return n Nothing -> fail "Inconsistent AIG types" io $ verifyAIGCompatible x y' res <- io $ AIG.cec x y' let stats = solverStats "ABC" 0 -- TODO, count the size of the networks... case res of AIG.Valid -> r...
698
false
true
0
20
176
244
111
133
null
null
uriba/dwarf
src/Data/Dwarf.hs
bsd-3-clause
dw_at 0x37 = DW_AT_count
24
dw_at 0x37 = DW_AT_count
24
dw_at 0x37 = DW_AT_count
24
false
false
0
5
3
9
4
5
null
null
antarestrader/sapphire
Builtin/Bool.hs
gpl-3.0
tnot [] = replyM_ VFalse
24
tnot [] = replyM_ VFalse
24
tnot [] = replyM_ VFalse
24
false
false
1
5
4
17
6
11
null
null
johnpmayer/elm-compiler
src/AST/Expression/General.hs
bsd-3-clause
localVar :: String -> Expr' ann def Var.Canonical typ localVar x = Var (Var.Canonical Var.Local x)
100
localVar :: String -> Expr' ann def Var.Canonical typ localVar x = Var (Var.Canonical Var.Local x)
100
localVar x = Var (Var.Canonical Var.Local x)
46
false
true
0
8
17
44
21
23
null
null
AubreyEAnderson/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
isConfusedGlobRegex _ = False
29
isConfusedGlobRegex _ = False
29
isConfusedGlobRegex _ = False
29
false
false
0
4
3
10
4
6
null
null
michaxm/task-distribution
src/Control/Distributed/Task/TaskSpawning/FunctionSerialization.hs
bsd-3-clause
serialize :: Typeable a => a -> IO L.ByteString serialize a = P.trySerialize a >>= return . encode
98
serialize :: Typeable a => a -> IO L.ByteString serialize a = P.trySerialize a >>= return . encode
98
serialize a = P.trySerialize a >>= return . encode
50
false
true
0
9
17
48
21
27
null
null
sordina/Deadpan-DDP
src/Web/DDP/Deadpan/GUID.hs
mit
newGuidInt :: IO Int newGuidInt = hash `fmap` hashTriple
56
newGuidInt :: IO Int newGuidInt = hash `fmap` hashTriple
56
newGuidInt = hash `fmap` hashTriple
35
false
true
0
5
8
20
11
9
null
null
kim/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | 'ResourcePendingMaintenanceActions' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'rpmaPendingMaintenanceActionDetails' @::@ ['PendingMaintenanceAction'] -- -- * 'rpmaResourceIdentifier' @::@ 'Maybe' 'Text' -- resourcePendingMaintenanceActions :: ResourcePendingMaintenanceActio...
503
resourcePendingMaintenanceActions :: ResourcePendingMaintenanceActions resourcePendingMaintenanceActions = ResourcePendingMaintenanceActions { _rpmaResourceIdentifier = Nothing , _rpmaPendingMaintenanceActionDetails = mempty }
251
resourcePendingMaintenanceActions = ResourcePendingMaintenanceActions { _rpmaResourceIdentifier = Nothing , _rpmaPendingMaintenanceActionDetails = mempty }
180
true
true
0
7
66
37
24
13
null
null
olsner/sedition
Sed.hs
mit
runIR :: IR.Insn e x -> SedM () runIR (IR.Label _) = return ()
62
runIR :: IR.Insn e x -> SedM () runIR (IR.Label _) = return ()
62
runIR (IR.Label _) = return ()
30
false
true
0
8
13
43
20
23
null
null
aa755/roshask
src/Ros/ROSCoqUtil.hs
bsd-3-clause
coFoldLeft f (h:tl) inita = do ha <- (f inita h) coFoldLeft f tl ha
75
coFoldLeft f (h:tl) inita = do ha <- (f inita h) coFoldLeft f tl ha
75
coFoldLeft f (h:tl) inita = do ha <- (f inita h) coFoldLeft f tl ha
75
false
false
0
9
22
47
21
26
null
null
traceguide/api-php
vendor/apache/thrift/test/hs/TestClient.hs
mit
runClient :: (Protocol p, Transport t) => p t -> IO () runClient p = do let prot = (p,p) putStrLn "Starting Tests" -- VOID Test Client.testVoid prot -- String Test s <- Client.testString prot "Test" when (s /= "Test") exitFailure -- Byte Test byte <- Client.testByte prot 1 when (byte /= 1) exitFa...
2,966
runClient :: (Protocol p, Transport t) => p t -> IO () runClient p = do let prot = (p,p) putStrLn "Starting Tests" -- VOID Test Client.testVoid prot -- String Test s <- Client.testString prot "Test" when (s /= "Test") exitFailure -- Byte Test byte <- Client.testByte prot 1 when (byte /= 1) exitFa...
2,966
runClient p = do let prot = (p,p) putStrLn "Starting Tests" -- VOID Test Client.testVoid prot -- String Test s <- Client.testString prot "Test" when (s /= "Test") exitFailure -- Byte Test byte <- Client.testByte prot 1 when (byte /= 1) exitFailure -- I32 Test i32 <- Client.testI32 prot (-1) ...
2,911
false
true
0
16
784
1,036
493
543
null
null
kojiromike/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectConstant StrType = Var (reflm "StrType")
47
reflectConstant StrType = Var (reflm "StrType")
47
reflectConstant StrType = Var (reflm "StrType")
47
false
false
0
7
5
18
8
10
null
null
ezyang/ghc
compiler/cmm/Hoopl/Block.hs
bsd-3-clause
replaceLastNode :: Block n x C -> n O C -> Block n x C replaceLastNode (BlockOC b _) n = BlockOC b n
102
replaceLastNode :: Block n x C -> n O C -> Block n x C replaceLastNode (BlockOC b _) n = BlockOC b n
102
replaceLastNode (BlockOC b _) n = BlockOC b n
47
false
true
0
10
25
60
27
33
null
null
maarons/Cortex
Common/ErrorIO.hs
agpl-3.0
----- iListenOn :: (MonadError String m, MonadIO m) => Int -> m Socket iListenOn port = ioReport $ listenOn $ PortNumber $ fromIntegral port
141
iListenOn :: (MonadError String m, MonadIO m) => Int -> m Socket iListenOn port = ioReport $ listenOn $ PortNumber $ fromIntegral port
134
iListenOn port = ioReport $ listenOn $ PortNumber $ fromIntegral port
69
true
true
0
7
24
54
27
27
null
null
Hara-Laboratory/subleq-mips
TestRFix2.hs
gpl-3.0
measureSra n = do xs <- map floor <$> res n ys <- replicateM n $ R.sample randomSize let xys = zip xs ys return $ do (x, y) <- xys let res = T.measureInsns $ executeSubroutineWithStates "sra" [0,x,y] maximumTry return (x, y, res)
277
measureSra n = do xs <- map floor <$> res n ys <- replicateM n $ R.sample randomSize let xys = zip xs ys return $ do (x, y) <- xys let res = T.measureInsns $ executeSubroutineWithStates "sra" [0,x,y] maximumTry return (x, y, res)
277
measureSra n = do xs <- map floor <$> res n ys <- replicateM n $ R.sample randomSize let xys = zip xs ys return $ do (x, y) <- xys let res = T.measureInsns $ executeSubroutineWithStates "sra" [0,x,y] maximumTry return (x, y, res)
277
false
false
1
8
91
113
59
54
null
null
egison/egison
hs-src/Language/Egison/Data/Collection.hs
mit
unsnocCollection coll@(ICollection innersRef) = do inners <- liftIO $ readIORef innersRef case Sq.viewr inners of EmptyR -> matchFail hInners :> IElement ref' -> do hInnersRef <- liftIO $ newIORef hInners lift $ (, ref') <$> newEvaluatedObjectRef (ICollection hInnersRef) hInners :> ISubColle...
479
unsnocCollection coll@(ICollection innersRef) = do inners <- liftIO $ readIORef innersRef case Sq.viewr inners of EmptyR -> matchFail hInners :> IElement ref' -> do hInnersRef <- liftIO $ newIORef hInners lift $ (, ref') <$> newEvaluatedObjectRef (ICollection hInnersRef) hInners :> ISubColle...
479
unsnocCollection coll@(ICollection innersRef) = do inners <- liftIO $ readIORef innersRef case Sq.viewr inners of EmptyR -> matchFail hInners :> IElement ref' -> do hInnersRef <- liftIO $ newIORef hInners lift $ (, ref') <$> newEvaluatedObjectRef (ICollection hInnersRef) hInners :> ISubColle...
479
false
false
1
17
106
164
72
92
null
null
vincenthz/hs-foundation
foundation/Foundation/Conduit/Internal.hs
bsd-3-clause
-- | Send a value downstream. yield :: Monad m => o -> Conduit i o m () yield o = Conduit $ \f -> Yield (f ()) (return ()) o
124
yield :: Monad m => o -> Conduit i o m () yield o = Conduit $ \f -> Yield (f ()) (return ()) o
94
yield o = Conduit $ \f -> Yield (f ()) (return ()) o
52
true
true
0
10
30
69
34
35
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcEvidence.hs
bsd-3-clause
-- input coercion is Nominal -- mkSubCo will do some normalisation. We do not do it for TcCoercions, but -- defer that to desugaring; just to reduce the code duplication a little bit mkTcSubCo :: TcCoercion -> TcCoercion mkTcSubCo co = ASSERT2( tcCoercionRole co == Nominal, ppr co) TcSubCo co
308
mkTcSubCo :: TcCoercion -> TcCoercion mkTcSubCo co = ASSERT2( tcCoercionRole co == Nominal, ppr co) TcSubCo co
125
mkTcSubCo co = ASSERT2( tcCoercionRole co == Nominal, ppr co) TcSubCo co
87
true
true
0
8
64
44
23
21
null
null
shinjiro-itagaki/shinjirecs
shinjirecs-api/src/DB/Persist.hs
gpl-3.0
createPool,connect :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => Config -> m ConnectionPool -- createPool,connect :: (MonadIO m, MonadBaseControl IO m) => Config -> m ConnectionPool createPool config = case adapter config of MySQL -> createMySQLPool (configToMySQLConnectInfo config) pool...
528
createPool,connect :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => Config -> m ConnectionPool createPool config = case adapter config of MySQL -> createMySQLPool (configToMySQLConnectInfo config) pool' PostgreSQL -> createPostgresqlPool (configToPgSQLConnectionString config) pool' ...
438
createPool config = case adapter config of MySQL -> createMySQLPool (configToMySQLConnectInfo config) pool' PostgreSQL -> createPostgresqlPool (configToPgSQLConnectionString config) pool' SQLite3 -> createSqlitePool (Data.Text.pack $ database config) pool' where pool' = po...
336
true
true
3
11
107
136
64
72
null
null
lovasko/tabl
examples/Decimals.hs
bsd-2-clause
main :: IO () main = getArgs >>= (\[n] -> T.putStrLn (table (read n)))
70
main :: IO () main = getArgs >>= (\[n] -> T.putStrLn (table (read n)))
70
main = getArgs >>= (\[n] -> T.putStrLn (table (read n)))
56
false
true
0
12
13
48
25
23
null
null
jfremstad/harchey
harchey.hs
gpl-3.0
main :: IO () main = do args <- getArgs case args of ["-h"] -> printHelp ["--help"] -> printHelp ["-l"] -> printList ["--list"] -> printList _ -> putStr "" user <- getUser arch <- isArch hostname <- getHostName kernel <- getKernel uptimedirty <- ...
2,796
main :: IO () main = do args <- getArgs case args of ["-h"] -> printHelp ["--help"] -> printHelp ["-l"] -> printList ["--list"] -> printList _ -> putStr "" user <- getUser arch <- isArch hostname <- getHostName kernel <- getKernel uptimedirty <- ...
2,796
main = do args <- getArgs case args of ["-h"] -> printHelp ["--help"] -> printHelp ["-l"] -> printList ["--list"] -> printList _ -> putStr "" user <- getUser arch <- isArch hostname <- getHostName kernel <- getKernel uptimedirty <- getUptime pr...
2,782
false
true
0
21
1,106
782
408
374
null
null
benley/yet-another-haskell-scheme
Yahs/LispVal.hs
apache-2.0
showVal (IOFunc _) = "<IO primitive>"
49
showVal (IOFunc _) = "<IO primitive>"
49
showVal (IOFunc _) = "<IO primitive>"
49
false
false
0
7
17
15
7
8
null
null
sdiehl/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
mkWpTyLams :: [TyVar] -> HsWrapper mkWpTyLams ids = mk_co_lam_fn WpTyLam ids
76
mkWpTyLams :: [TyVar] -> HsWrapper mkWpTyLams ids = mk_co_lam_fn WpTyLam ids
76
mkWpTyLams ids = mk_co_lam_fn WpTyLam ids
41
false
true
0
7
10
32
14
18
null
null
erikd/yesod
yesod-form/Yesod/Form/MassInput.hs
mit
fixme :: (xml ~ WidgetT site IO ()) => [Either xml (FormResult a, [FieldView site])] -> (FormResult [a], [xml], [[FieldView site]]) fixme eithers = (res, xmls, map snd rest) where (xmls, rest) = partitionEithers eithers res = sequenceA $ map fst rest
276
fixme :: (xml ~ WidgetT site IO ()) => [Either xml (FormResult a, [FieldView site])] -> (FormResult [a], [xml], [[FieldView site]]) fixme eithers = (res, xmls, map snd rest) where (xmls, rest) = partitionEithers eithers res = sequenceA $ map fst rest
276
fixme eithers = (res, xmls, map snd rest) where (xmls, rest) = partitionEithers eithers res = sequenceA $ map fst rest
132
false
true
0
11
67
134
71
63
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x2F9ED' = "\x28BFA"
35
decomposeChar '\x2F9ED' = "\x28BFA"
35
decomposeChar '\x2F9ED' = "\x28BFA"
35
false
false
0
4
3
10
4
6
null
null
nomeata/haskell-spacegoo
Game/Spacegoo.hs
mit
-- | From any own planet, send all ships to any opposing planet. sendSomewhere :: Strategy sendSomewhere (State {..}) = do me <- playerId <$> find itsme players let he = 3 - me aPlanet <- find (\p -> planetOwner p == me && planetShips p /= (0,0,0)) planets otherPlanet <- find (\p -> planetOwner p == he)...
501
sendSomewhere :: Strategy sendSomewhere (State {..}) = do me <- playerId <$> find itsme players let he = 3 - me aPlanet <- find (\p -> planetOwner p == me && planetShips p /= (0,0,0)) planets otherPlanet <- find (\p -> planetOwner p == he) planets return (planetId aPlanet, planetId otherPlanet, plan...
436
sendSomewhere (State {..}) = do me <- playerId <$> find itsme players let he = 3 - me aPlanet <- find (\p -> planetOwner p == me && planetShips p /= (0,0,0)) planets otherPlanet <- find (\p -> planetOwner p == he) planets return (planetId aPlanet, planetId otherPlanet, planetShips aPlanet) -- | Pic...
410
true
true
0
14
106
153
76
77
null
null
NightRa/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
syntaxNames :: Syntax -> [Name] syntaxNames (Rule syms _ _) = mapMaybe ename syms where ename (Keyword n) = Just n ename _ = Nothing
170
syntaxNames :: Syntax -> [Name] syntaxNames (Rule syms _ _) = mapMaybe ename syms where ename (Keyword n) = Just n ename _ = Nothing
170
syntaxNames (Rule syms _ _) = mapMaybe ename syms where ename (Keyword n) = Just n ename _ = Nothing
138
false
true
0
9
62
63
31
32
null
null
bakineggs/k-framework
tools/OutputFilter/FilterOutput.hs
gpl-2.0
pruneChars :: Configuration -> CellName -> ByteString -> ByteString pruneChars conf cn s | shouldPruneChars conf cn = pruneC conf cn s | otherwise = s
190
pruneChars :: Configuration -> CellName -> ByteString -> ByteString pruneChars conf cn s | shouldPruneChars conf cn = pruneC conf cn s | otherwise = s
188
pruneChars conf cn s | shouldPruneChars conf cn = pruneC conf cn s | otherwise = s
120
false
true
1
9
65
61
27
34
null
null
cyanut/tp-tetris-solver
solver.hs
unlicense
connLine :: (a -> a -> SBool) -> [Maybe a] -> SBool connLine f l = bAnd $ connLine' f l where connLine' f [] = [] connLine' f (p:[]) = [] connLine' f (p:Nothing:ps) = connLine' f ps connLine' f (Nothing:p:ps) = connLine' f (p:ps) connLine' f ((Just p1):(Just p2):ps) = f p1 p2 : connLine' f ((Ju...
330
connLine :: (a -> a -> SBool) -> [Maybe a] -> SBool connLine f l = bAnd $ connLine' f l where connLine' f [] = [] connLine' f (p:[]) = [] connLine' f (p:Nothing:ps) = connLine' f ps connLine' f (Nothing:p:ps) = connLine' f (p:ps) connLine' f ((Just p1):(Just p2):ps) = f p1 p2 : connLine' f ((Ju...
330
connLine f l = bAnd $ connLine' f l where connLine' f [] = [] connLine' f (p:[]) = [] connLine' f (p:Nothing:ps) = connLine' f ps connLine' f (Nothing:p:ps) = connLine' f (p:ps) connLine' f ((Just p1):(Just p2):ps) = f p1 p2 : connLine' f ((Just p2):ps)
278
false
true
0
12
84
206
104
102
null
null
vTurbine/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
closureFunInfo :: ClosureInfo -> Maybe (RepArity, ArgDescr) closureFunInfo (ClosureInfo { closureLFInfo = lf_info }) = lfFunInfo lf_info
136
closureFunInfo :: ClosureInfo -> Maybe (RepArity, ArgDescr) closureFunInfo (ClosureInfo { closureLFInfo = lf_info }) = lfFunInfo lf_info
136
closureFunInfo (ClosureInfo { closureLFInfo = lf_info }) = lfFunInfo lf_info
76
false
true
0
9
16
42
22
20
null
null
bvdelft/paragon
test/Language/Java/Paragon/ASTHelpers.hs
bsd-3-clause
modifyFieldDeclType :: ASTModifier RefType ClassBodyDecl modifyFieldDeclType f (MemberDecl fieldDecl) = let (RefType rt) = fieldDeclType fieldDecl rt' = f rt in MemberDecl fieldDecl { fieldDeclType = RefType rt' }
224
modifyFieldDeclType :: ASTModifier RefType ClassBodyDecl modifyFieldDeclType f (MemberDecl fieldDecl) = let (RefType rt) = fieldDeclType fieldDecl rt' = f rt in MemberDecl fieldDecl { fieldDeclType = RefType rt' }
224
modifyFieldDeclType f (MemberDecl fieldDecl) = let (RefType rt) = fieldDeclType fieldDecl rt' = f rt in MemberDecl fieldDecl { fieldDeclType = RefType rt' }
167
false
true
0
10
39
70
33
37
null
null
derkyjadex/aegg-bomb
src/Server.hs
mit
connectionMain :: GameChan -> WS.Connection -> String -> Chan PlayerMsg -> IO () connectionMain gameChan conn name playerChan = do reader <- forkIO . forever $ do msg <- readChan playerChan WS.sendTextData conn $ encode $ playerMsgJson msg when (msg == Removed) $ WS.sendClose conn $ ...
856
connectionMain :: GameChan -> WS.Connection -> String -> Chan PlayerMsg -> IO () connectionMain gameChan conn name playerChan = do reader <- forkIO . forever $ do msg <- readChan playerChan WS.sendTextData conn $ encode $ playerMsgJson msg when (msg == Removed) $ WS.sendClose conn $ ...
856
connectionMain gameChan conn name playerChan = do reader <- forkIO . forever $ do msg <- readChan playerChan WS.sendTextData conn $ encode $ playerMsgJson msg when (msg == Removed) $ WS.sendClose conn $ T.pack "" handle (\(SomeException _) -> return ()) . forever $ do WS....
775
false
true
0
17
228
326
151
175
null
null
keera-studios/hsQt
Qtc/Enums/Gui/QKeySequence.hs
bsd-2-clause
eDeleteEndOfLine :: StandardKey eDeleteEndOfLine = ieStandardKey $ 60
71
eDeleteEndOfLine :: StandardKey eDeleteEndOfLine = ieStandardKey $ 60
71
eDeleteEndOfLine = ieStandardKey $ 60
39
false
true
0
6
9
18
8
10
null
null
beni55/fay
src/tests/Test/Desugar.hs
bsd-3-clause
unAnn :: Functor f => f a -> f () unAnn = void
46
unAnn :: Functor f => f a -> f () unAnn = void
46
unAnn = void
12
false
true
0
8
12
30
14
16
null
null
startling/partly
partly.hs
bsd-3-clause
main :: IO () main = execParser parser >>= apply where apply :: Command -> IO () apply c = case c of View v -> view v; Make m -> make m;
152
main :: IO () main = execParser parser >>= apply where apply :: Command -> IO () apply c = case c of View v -> view v; Make m -> make m;
152
main = execParser parser >>= apply where apply :: Command -> IO () apply c = case c of View v -> view v; Make m -> make m;
138
false
true
2
8
48
77
37
40
null
null
mikeplus64/plissken
src/Game.hs
gpl-3.0
initialGame :: StdGen -> Stage -> GameS initialGame _stdGen _stage = let _snake = Snake (S.singleton (Ent (vec3 4 4 4) (vec3 1 0 0))) S.empty _score = 0 _gameTicks = 0 _message = Nothing _gameIsPaused = False _stageBounds = 10 _snakeIsAlive = True _difficulty ...
480
initialGame :: StdGen -> Stage -> GameS initialGame _stdGen _stage = let _snake = Snake (S.singleton (Ent (vec3 4 4 4) (vec3 1 0 0))) S.empty _score = 0 _gameTicks = 0 _message = Nothing _gameIsPaused = False _stageBounds = 10 _snakeIsAlive = True _difficulty ...
480
initialGame _stdGen _stage = let _snake = Snake (S.singleton (Ent (vec3 4 4 4) (vec3 1 0 0))) S.empty _score = 0 _gameTicks = 0 _message = Nothing _gameIsPaused = False _stageBounds = 10 _snakeIsAlive = True _difficulty = medium _gameEditMode = False ...
440
false
true
0
15
168
145
78
67
null
null
olsner/ghc
compiler/prelude/THNames.hs
bsd-3-clause
-- data Type = ... forallTIdKey, varTIdKey, conTIdKey, tupleTIdKey, unboxedTupleTIdKey, unboxedSumTIdKey, arrowTIdKey, listTIdKey, appTIdKey, sigTIdKey, equalityTIdKey, litTIdKey, promotedTIdKey, promotedTupleTIdKey, promotedNilTIdKey, promotedConsTIdKey, wildCardTIdKey :: Unique forallTIdKey = mkPre...
340
forallTIdKey, varTIdKey, conTIdKey, tupleTIdKey, unboxedTupleTIdKey, unboxedSumTIdKey, arrowTIdKey, listTIdKey, appTIdKey, sigTIdKey, equalityTIdKey, litTIdKey, promotedTIdKey, promotedTupleTIdKey, promotedNilTIdKey, promotedConsTIdKey, wildCardTIdKey :: Unique forallTIdKey = mkPreludeMiscIdUnique 38...
321
forallTIdKey = mkPreludeMiscIdUnique 380
47
true
true
0
5
46
47
40
7
null
null
wafna/euler
Main.hs
unlicense
p4 :: Integer p4 = head $ reverse $ List.sort $ filter palindrome [x * y | x <- [100..999], y <- [100..999]] where palindrome x = let s = show x in s == reverse s -- | What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? -- Here, I started with the product of [11..20]...
401
p4 :: Integer p4 = head $ reverse $ List.sort $ filter palindrome [x * y | x <- [100..999], y <- [100..999]] where palindrome x = let s = show x in s == reverse s -- | What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? -- Here, I started with the product of [11..20]...
401
p4 = head $ reverse $ List.sort $ filter palindrome [x * y | x <- [100..999], y <- [100..999]] where palindrome x = let s = show x in s == reverse s -- | What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? -- Here, I started with the product of [11..20] and then elim...
387
false
true
0
11
85
96
49
47
null
null
hvr/text
Data/Text.hs
bsd-2-clause
-- | /O(n+m)/ Similar to 'breakOn', but searches from the end of the -- string. -- -- The first element of the returned tuple is the prefix of @haystack@ -- up to and including the last match of @needle@. The second is the -- remainder of @haystack@, following the match. -- -- > breakOnEnd "::" "a::b::c" ==> ("a::b::"...
468
breakOnEnd :: Text -> Text -> (Text, Text) breakOnEnd pat src = (reverse b, reverse a) where (a,b) = breakOn (reverse pat) (reverse src)
141
breakOnEnd pat src = (reverse b, reverse a) where (a,b) = breakOn (reverse pat) (reverse src)
98
true
true
0
7
88
81
46
35
null
null
xmonad/xmonad-contrib
XMonad/Hooks/Focus.hs
bsd-3-clause
-- | Execute 'Query', unless focus is locked. unlessFocusLock :: Monoid a => Query a -> Query a unlessFocusLock m = do FocusLock b <- liftX XS.get when' (not b) m -- Commonly used actions for modifying focus. -- -- $common -- Operations in each pair 'keepFocus' and 'switchFocus', 'keepWorkspace' and -- 'swit...
1,125
unlessFocusLock :: Monoid a => Query a -> Query a unlessFocusLock m = do FocusLock b <- liftX XS.get when' (not b) m -- Commonly used actions for modifying focus. -- -- $common -- Operations in each pair 'keepFocus' and 'switchFocus', 'keepWorkspace' and -- 'switchWorkspace' overwrite each other (the letftmo...
1,079
unlessFocusLock m = do FocusLock b <- liftX XS.get when' (not b) m -- Commonly used actions for modifying focus. -- -- $common -- Operations in each pair 'keepFocus' and 'switchFocus', 'keepWorkspace' and -- 'switchWorkspace' overwrite each other (the letftmost will determine what -- happened): -- -- prop> k...
1,029
true
true
0
9
201
83
49
34
null
null
dahlia/nirum
src/Nirum/Cli.hs
gpl-3.0
tryDie :: AppOptions -> String -> IO () tryDie AppOptions { watching = watching' } errorMessage | watching' = hPutStrLn stderr errorMessage | otherwise = die errorMessage
174
tryDie :: AppOptions -> String -> IO () tryDie AppOptions { watching = watching' } errorMessage | watching' = hPutStrLn stderr errorMessage | otherwise = die errorMessage
174
tryDie AppOptions { watching = watching' } errorMessage | watching' = hPutStrLn stderr errorMessage | otherwise = die errorMessage
134
false
true
1
8
30
59
28
31
null
null
oldmanmike/ghc
compiler/deSugar/DsBinds.hs
bsd-3-clause
dsEvTerm (EvDelayedError ty msg) = return $ dsEvDelayedError ty msg
67
dsEvTerm (EvDelayedError ty msg) = return $ dsEvDelayedError ty msg
67
dsEvTerm (EvDelayedError ty msg) = return $ dsEvDelayedError ty msg
67
false
false
0
6
9
27
12
15
null
null
haskell-distributed/distributed-process
src/Control/Distributed/Process/Internal/CQueue.hs
bsd-3-clause
spanMatchChan (m : ms) | MatchChan stm <- m = (stm:stms, rest) | otherwise = ([], m:ms) where !(stms,rest) = spanMatchChan ms -- | Dequeue an element -- -- The timeout (if any) is applied only to waiting for incoming messages, not -- to checking messages that have already arrived
303
spanMatchChan (m : ms) | MatchChan stm <- m = (stm:stms, rest) | otherwise = ([], m:ms) where !(stms,rest) = spanMatchChan ms -- | Dequeue an element -- -- The timeout (if any) is applied only to waiting for incoming messages, not -- to checking messages that have already arrived
303
spanMatchChan (m : ms) | MatchChan stm <- m = (stm:stms, rest) | otherwise = ([], m:ms) where !(stms,rest) = spanMatchChan ms -- | Dequeue an element -- -- The timeout (if any) is applied only to waiting for incoming messages, not -- to checking messages that have already arrived
303
false
false
0
9
72
82
43
39
null
null
kojiromike/Idris-dev
src/Idris/IdeMode.hs
bsd-3-clause
constTy (Fl _) = "Double"
25
constTy (Fl _) = "Double"
25
constTy (Fl _) = "Double"
25
false
false
0
6
4
16
7
9
null
null
ddssff/lens
src/Control/Lens/Fold.hs
bsd-3-clause
ifoldr64 :: Foldable f => (Int64 -> a -> b -> b) -> b -> f a -> b ifoldr64 f z xs = foldr (\ x g i -> i `seq` f i x (g (i+1))) (const z) xs 0
141
ifoldr64 :: Foldable f => (Int64 -> a -> b -> b) -> b -> f a -> b ifoldr64 f z xs = foldr (\ x g i -> i `seq` f i x (g (i+1))) (const z) xs 0
141
ifoldr64 f z xs = foldr (\ x g i -> i `seq` f i x (g (i+1))) (const z) xs 0
75
false
true
0
13
40
108
55
53
null
null
judah/haskeline
System/Console/Haskeline/Vi.hs
bsd-3-clause
killAndStoreI :: MonadIO m => KillHelper -> Command (ViT m) (ArgMode CommandMode) InsertMode killAndStoreI = storedIAction . killFromArgHelper
142
killAndStoreI :: MonadIO m => KillHelper -> Command (ViT m) (ArgMode CommandMode) InsertMode killAndStoreI = storedIAction . killFromArgHelper
142
killAndStoreI = storedIAction . killFromArgHelper
49
false
true
0
9
17
45
22
23
null
null
alexander-b/coreutilhs
rm.hs
gpl-3.0
bork :: String -> IOError -> IO () bork dir err = printf "rm: cannot stat '%s': %s\n" dir $ unpack . toTitle . pack $ ioeGetErrorString err
148
bork :: String -> IOError -> IO () bork dir err = printf "rm: cannot stat '%s': %s\n" dir $ unpack . toTitle . pack $ ioeGetErrorString err
148
bork dir err = printf "rm: cannot stat '%s': %s\n" dir $ unpack . toTitle . pack $ ioeGetErrorString err
112
false
true
0
9
36
53
25
28
null
null
kevinjcliao/bb
src/Parse.hs
bsd-3-clause
toHours 12 PM = 12
22
toHours 12 PM = 12
22
toHours 12 PM = 12
22
false
false
0
5
8
11
5
6
null
null
winterland1989/stdio
Data/Vector.hs
bsd-3-clause
elemIndicesBytes w (PrimVector (PrimArray (ByteArray ba#)) s l) = go s where !w' = fromIntegral w !end = s + l go !i | i >= end = [] | otherwise = let !s' = fromIntegral i !l' = fromIntegral (end - i) in case fromIntegral (c_memchr ba# s' w' l') of ...
380
elemIndicesBytes w (PrimVector (PrimArray (ByteArray ba#)) s l) = go s where !w' = fromIntegral w !end = s + l go !i | i >= end = [] | otherwise = let !s' = fromIntegral i !l' = fromIntegral (end - i) in case fromIntegral (c_memchr ba# s' w' l') of ...
380
elemIndicesBytes w (PrimVector (PrimArray (ByteArray ba#)) s l) = go s where !w' = fromIntegral w !end = s + l go !i | i >= end = [] | otherwise = let !s' = fromIntegral i !l' = fromIntegral (end - i) in case fromIntegral (c_memchr ba# s' w' l') of ...
380
false
false
4
14
165
176
80
96
null
null
JPMoresmau/rnn
test/rnn-test.hs
bsd-2-clause
checkLSTMList :: IO () checkLSTMList = do (n1::LSTMNetwork) <- evalRandIO $ randomNetwork 2 lstmFullSize (n2::LSTMNetwork) <- evalRandIO $ randomNetwork 2 lstmFullSize let (n1_2,out)=evalStep n1 $ M.fromList [1::Double,2] (n2_2,out1)=evalStep n2 out (n3,out2)=evalStep [n1,n2] $ M.fromList [1...
364
checkLSTMList :: IO () checkLSTMList = do (n1::LSTMNetwork) <- evalRandIO $ randomNetwork 2 lstmFullSize (n2::LSTMNetwork) <- evalRandIO $ randomNetwork 2 lstmFullSize let (n1_2,out)=evalStep n1 $ M.fromList [1::Double,2] (n2_2,out1)=evalStep n2 out (n3,out2)=evalStep [n1,n2] $ M.fromList [1...
364
checkLSTMList = do (n1::LSTMNetwork) <- evalRandIO $ randomNetwork 2 lstmFullSize (n2::LSTMNetwork) <- evalRandIO $ randomNetwork 2 lstmFullSize let (n1_2,out)=evalStep n1 $ M.fromList [1::Double,2] (n2_2,out1)=evalStep n2 out (n3,out2)=evalStep [n1,n2] $ M.fromList [1,2] n3 @=? [n1_2,n2...
341
false
true
0
12
76
172
88
84
null
null
gergoerdi/tecs
src/Language/TECS/Jack/ToDeck/Layout.hs
bsd-3-clause
layoutMethod :: MethodDef Name -> Reader (SymbolTable Name Id) (MethodDef Id) layoutMethod (Constructor ty name formals body) = layoutParams (Constructor ty name) formals body
175
layoutMethod :: MethodDef Name -> Reader (SymbolTable Name Id) (MethodDef Id) layoutMethod (Constructor ty name formals body) = layoutParams (Constructor ty name) formals body
175
layoutMethod (Constructor ty name formals body) = layoutParams (Constructor ty name) formals body
97
false
true
0
8
23
67
32
35
null
null
elliottt/blank-slate
src/Graphics/BlankSlate/Prim/Buffer.hs
bsd-3-clause
bindBuffer :: GLenum -> Buffer -> IO () bindBuffer name = glBindBuffer name . getBuffer
87
bindBuffer :: GLenum -> Buffer -> IO () bindBuffer name = glBindBuffer name . getBuffer
87
bindBuffer name = glBindBuffer name . getBuffer
47
false
true
0
9
14
39
17
22
null
null
naoto-ogawa/h-xproto-mysql
src/DataBase/MySQLX/DateTime.hs
mit
-- | zero padding for LocalTime formatLocalTimePadded :: LocalTime -> String formatLocalTimePadded t | length str == 19 = str ++ ".000000000000" | otherwise = str ++ "000000000000" where str = formatTime defaultTimeLocale "%FT%T%Q" t -- | Timeformat for MysqlTime. -- ex) "12:34:56.123" or "-12:34:56...
325
formatLocalTimePadded :: LocalTime -> String formatLocalTimePadded t | length str == 19 = str ++ ".000000000000" | otherwise = str ++ "000000000000" where str = formatTime defaultTimeLocale "%FT%T%Q" t -- | Timeformat for MysqlTime. -- ex) "12:34:56.123" or "-12:34:56.123"
292
formatLocalTimePadded t | length str == 19 = str ++ ".000000000000" | otherwise = str ++ "000000000000" where str = formatTime defaultTimeLocale "%FT%T%Q" t -- | Timeformat for MysqlTime. -- ex) "12:34:56.123" or "-12:34:56.123"
247
true
true
1
9
64
64
32
32
null
null
Changaco/haskell-plugins
src/System/Plugins/Load.hs
lgpl-2.1
resolveObjs :: IO a -> IO () resolveObjs unloadLoaded = do r <- c_resolveObjs when (not r) $ unloadLoaded >> error "resolvedObjs failed." -- | Unload a module
173
resolveObjs :: IO a -> IO () resolveObjs unloadLoaded = do r <- c_resolveObjs when (not r) $ unloadLoaded >> error "resolvedObjs failed." -- | Unload a module
173
resolveObjs unloadLoaded = do r <- c_resolveObjs when (not r) $ unloadLoaded >> error "resolvedObjs failed." -- | Unload a module
144
false
true
0
12
42
62
27
35
null
null
kmate/HaRe
old/testing/removeDef/ListCompIn2_TokOut.hs
bsd-3-clause
zipthree :: [a] -> [b] -> [c] -> [(a,b,c)] zipthree = \xs ys zs -> case (xs, ys, zs) of ([], _, _) -> [] (_, [], _) -> [] (_, _, []) -> [] (a:as, b:bs, c:cs) -> (a,b,c) : zipthree as bs cs
307
zipthree :: [a] -> [b] -> [c] -> [(a,b,c)] zipthree = \xs ys zs -> case (xs, ys, zs) of ([], _, _) -> [] (_, [], _) -> [] (_, _, []) -> [] (a:as, b:bs, c:cs) -> (a,b,c) : zipthree as bs cs
307
zipthree = \xs ys zs -> case (xs, ys, zs) of ([], _, _) -> [] (_, [], _) -> [] (_, _, []) -> [] (a:as, b:bs, c:cs) -> (a,b,c) : zipthree as bs cs
264
false
true
0
10
163
170
98
72
null
null
siddhanathan/ghc
libraries/base/GHC/Show.hs
bsd-3-clause
-- Code specific for characters -- | Convert a character to a string using only printable characters, -- using Haskell source-language escape conventions. For example: -- -- > showLitChar '\n' s = "\\n" ++ s -- showLitChar :: Char -> ShowS showLitChar c s | c > '\DEL' = showChar '\\' (protectEsc isD...
341
showLitChar :: Char -> ShowS showLitChar c s | c > '\DEL' = showChar '\\' (protectEsc isDec (shows (ord c)) s)
126
showLitChar c s | c > '\DEL' = showChar '\\' (protectEsc isDec (shows (ord c)) s)
82
true
true
0
12
76
64
33
31
null
null
jlouis/combinatorrent
src/Process/ChokeMgr.hs
bsd-2-clause
informDone :: InfoHash -> PieceNum -> ChokeMgrProcess () informDone ih pn = do chn <- gets chain T.mapM inform chn >> return () where inform p | (pInfoHash p) == ih = sendDone p >> return () | otherwise = return () sendDone p = msgPeer (pChannel p) (PieceCompleted pn)
310
informDone :: InfoHash -> PieceNum -> ChokeMgrProcess () informDone ih pn = do chn <- gets chain T.mapM inform chn >> return () where inform p | (pInfoHash p) == ih = sendDone p >> return () | otherwise = return () sendDone p = msgPeer (pChannel p) (PieceCompleted pn)
310
informDone ih pn = do chn <- gets chain T.mapM inform chn >> return () where inform p | (pInfoHash p) == ih = sendDone p >> return () | otherwise = return () sendDone p = msgPeer (pChannel p) (PieceCompleted pn)
253
false
true
0
10
91
136
61
75
null
null
fmapfmapfmap/amazonka
amazonka-sts/test/Test/AWS/Gen/STS.hs
mpl-2.0
testDecodeAuthorizationMessageResponse :: DecodeAuthorizationMessageResponse -> TestTree testDecodeAuthorizationMessageResponse = res "DecodeAuthorizationMessageResponse" "fixture/DecodeAuthorizationMessageResponse.proto" sTS (Proxy :: Proxy DecodeAuthorizationMessage)
285
testDecodeAuthorizationMessageResponse :: DecodeAuthorizationMessageResponse -> TestTree testDecodeAuthorizationMessageResponse = res "DecodeAuthorizationMessageResponse" "fixture/DecodeAuthorizationMessageResponse.proto" sTS (Proxy :: Proxy DecodeAuthorizationMessage)
285
testDecodeAuthorizationMessageResponse = res "DecodeAuthorizationMessageResponse" "fixture/DecodeAuthorizationMessageResponse.proto" sTS (Proxy :: Proxy DecodeAuthorizationMessage)
196
false
true
0
6
30
36
17
19
null
null
DataStewardshipPortal/ds-form-engine
FormElement/AutoComplete.hs
apache-2.0
doAc :: String -> String -> Char -> String doAc txt ac delim = let pre = fst $ cutLastPart txt "" delim in case pre of "" -> ac _ -> pre <> [delim] <> ac
163
doAc :: String -> String -> Char -> String doAc txt ac delim = let pre = fst $ cutLastPart txt "" delim in case pre of "" -> ac _ -> pre <> [delim] <> ac
163
doAc txt ac delim = let pre = fst $ cutLastPart txt "" delim in case pre of "" -> ac _ -> pre <> [delim] <> ac
120
false
true
0
12
46
81
39
42
null
null
cartazio/scoutess
Scoutess/Service/Source/Fetch.hs
bsd-3-clause
fetchVersion :: (MonadIO m) => SourceConfig -> SourceLocation -> m (Either SourceException VersionSpec) fetchVersion sourceConfig Hackage = fetchVersionsHackage sourceConfig
219
fetchVersion :: (MonadIO m) => SourceConfig -> SourceLocation -> m (Either SourceException VersionSpec) fetchVersion sourceConfig Hackage = fetchVersionsHackage sourceConfig
219
fetchVersion sourceConfig Hackage = fetchVersionsHackage sourceConfig
73
false
true
0
10
64
47
23
24
null
null
nevrenato/HyLoRes_Source
src/HyLoRes/ClauseSet/Clauses.hs
gpl-2.0
removeById :: ClauseId -> ClausesClauseSet -> ClausesClauseSet removeById clId ccs = ccs{queuesByComplexity = qbc', clauseDataByAge = cba', clauseDataById = cbi'} where mac = IMap.lookup clId cbi cba = clauseDataByAge ccs cba' = maybe ...
550
removeById :: ClauseId -> ClausesClauseSet -> ClausesClauseSet removeById clId ccs = ccs{queuesByComplexity = qbc', clauseDataByAge = cba', clauseDataById = cbi'} where mac = IMap.lookup clId cbi cba = clauseDataByAge ccs cba' = maybe ...
550
removeById clId ccs = ccs{queuesByComplexity = qbc', clauseDataByAge = cba', clauseDataById = cbi'} where mac = IMap.lookup clId cbi cba = clauseDataByAge ccs cba' = maybe cba (\(a,_) -> Map.delete a cba) mac cbi = clauseDat...
487
false
true
0
12
191
168
90
78
null
null
green-haskell/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
92
divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
92
divIntegerName = varQual gHC_INTEGER_TYPE (fsLit "divInteger") divIntegerIdKey
92
false
false
0
7
20
19
9
10
null
null
cullina/Extractor
src/PrefixCode.hs
bsd-3-clause
safeSplitAt (_:_) [] = Nothing
30
safeSplitAt (_:_) [] = Nothing
30
safeSplitAt (_:_) [] = Nothing
30
false
false
0
7
4
20
10
10
null
null
iu-parfunc/haskell-hpx
src/Foreign/HPX.hs
bsd-3-clause
call :: Binary a => Address -> a -> StaticPtr (a -> HPX (Promise r)) -> HPX (LCO r) call (Address addr) arg sptr = do p_action <- lookupAction sptr liftIO $ do Action action <- peek p_action lco@(LCO result) <- newLCOFuture -- TODO: Exit codes _ <- withEncodedValue arg $ c'_...
366
call :: Binary a => Address -> a -> StaticPtr (a -> HPX (Promise r)) -> HPX (LCO r) call (Address addr) arg sptr = do p_action <- lookupAction sptr liftIO $ do Action action <- peek p_action lco@(LCO result) <- newLCOFuture -- TODO: Exit codes _ <- withEncodedValue arg $ c'_...
366
call (Address addr) arg sptr = do p_action <- lookupAction sptr liftIO $ do Action action <- peek p_action lco@(LCO result) <- newLCOFuture -- TODO: Exit codes _ <- withEncodedValue arg $ c'_hpx_call addr action result 2 pure lco
277
false
true
0
15
110
152
68
84
null
null
jkr/pandoc-citeproc
src/Text/CSL/Util.hs
bsd-3-clause
(&=) :: (ToYaml a, Monoid a, Eq a) => Text -> a -> [(Text, YamlBuilder)] -> [(Text, YamlBuilder)] x &= y = \acc -> if y == mempty then acc else (x Y..= y) : acc
205
(&=) :: (ToYaml a, Monoid a, Eq a) => Text -> a -> [(Text, YamlBuilder)] -> [(Text, YamlBuilder)] x &= y = \acc -> if y == mempty then acc else (x Y..= y) : acc
205
x &= y = \acc -> if y == mempty then acc else (x Y..= y) : acc
102
false
true
0
13
80
105
57
48
null
null
maruks/haskell-book
src/Chapter22_reader.hs
gpl-3.0
ask :: Reader a a ask = Reader id
33
ask :: Reader a a ask = Reader id
33
ask = Reader id
15
false
true
1
5
8
22
9
13
null
null
sonyandy/fd
src/Control/Monad/FD/Internal/Dom.hs
bsd-3-clause
lookupMin (Bounds min _) = Just min
35
lookupMin (Bounds min _) = Just min
35
lookupMin (Bounds min _) = Just min
35
false
false
0
7
6
20
9
11
null
null
d-day/relation
src/Data/Relation/Examples/E02.hs
bsd-3-clause
id2 s = ( v1 == v2, v1 ) where v1 = (dom e <$| s) e v2 = dom (e |> s) -- Exploring <|
105
id2 s = ( v1 == v2, v1 ) where v1 = (dom e <$| s) e v2 = dom (e |> s) -- Exploring <|
105
id2 s = ( v1 == v2, v1 ) where v1 = (dom e <$| s) e v2 = dom (e |> s) -- Exploring <|
105
false
false
0
8
45
56
29
27
null
null
eigengrau/hlint
data/Default.hs
bsd-3-clause
error "Redundant if" = (if a then x else x) ==> x where note = IncreasesLaziness
80
error "Redundant if" = (if a then x else x) ==> x where note = IncreasesLaziness
80
error "Redundant if" = (if a then x else x) ==> x where note = IncreasesLaziness
80
false
false
0
7
15
32
17
15
null
null
BartAdv/Idris-dev
src/Idris/Completion.hs
bsd-3-clause
metavars :: Idris [String] metavars = do i <- get return . map (show . nsroot) $ map fst (filter (\(_, (_,_,t)) -> not t) (idris_metavars i)) \\ primDefs
167
metavars :: Idris [String] metavars = do i <- get return . map (show . nsroot) $ map fst (filter (\(_, (_,_,t)) -> not t) (idris_metavars i)) \\ primDefs
167
metavars = do i <- get return . map (show . nsroot) $ map fst (filter (\(_, (_,_,t)) -> not t) (idris_metavars i)) \\ primDefs
140
false
true
0
15
42
94
49
45
null
null
ktemkin/dotfiles
xmonad/xmonad.hs
bsd-2-clause
localLayouts = --Smart Border Filter --(Interceps border assignments and disables borders on fullscreen items, -- when there's only one item, or when the window in focus is similarly -- unambiguous.) smartBorders --Per Workspace Layout --(Allows the user to specify default layouts o...
1,717
localLayouts = --Smart Border Filter --(Interceps border assignments and disables borders on fullscreen items, -- when there's only one item, or when the window in focus is similarly -- unambiguous.) smartBorders --Per Workspace Layout --(Allows the user to specify default layouts o...
1,717
localLayouts = --Smart Border Filter --(Interceps border assignments and disables borders on fullscreen items, -- when there's only one item, or when the window in focus is similarly -- unambiguous.) smartBorders --Per Workspace Layout --(Allows the user to specify default layouts o...
1,717
false
false
11
11
457
228
117
111
null
null
Kyly/liquidhaskell
src/Language/Haskell/Liquid/ANFTransform.hs
bsd-3-clause
expandDefaultCase _ _ z = return z
37
expandDefaultCase _ _ z = return z
37
expandDefaultCase _ _ z = return z
37
false
false
1
5
9
15
6
9
null
null
egaburov/funstuff
Haskell/parsec/PrettyJSON.hs
apache-2.0
renderJValue JNull = text "null"
40
renderJValue JNull = text "null"
40
renderJValue JNull = text "null"
40
false
false
0
5
12
12
5
7
null
null
jstolarek/slicer
lib/Language/Slicer/Parser.hs
gpl-3.0
strDeref = "!"
22
strDeref = "!"
22
strDeref = "!"
22
false
false
1
5
10
10
3
7
null
null