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
lenary/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
isInjective _ = False
38
isInjective _ = False
38
isInjective _ = False
38
false
false
0
5
20
9
4
5
null
null
higgsd/euler
hs/127.hs
bsd-2-clause
cc = 120000
11
cc = 120000
11
cc = 120000
11
false
false
1
5
2
10
3
7
null
null
Botje/crystal
Crystal/Type.hs
gpl-2.0
concreteTypes :: [Type] concreteTypes = [TInt, TString, TBool, TSymbol, TVoid, TVec, TPair, TList, TNull, TChar, TPort, THash]
126
concreteTypes :: [Type] concreteTypes = [TInt, TString, TBool, TSymbol, TVoid, TVec, TPair, TList, TNull, TChar, TPort, THash]
126
concreteTypes = [TInt, TString, TBool, TSymbol, TVoid, TVec, TPair, TList, TNull, TChar, TPort, THash]
102
false
true
0
5
16
50
32
18
null
null
lukexi/ghc
compiler/cmm/CmmType.hs
bsd-3-clause
vec16b8 = vec 16 b8
19
vec16b8 = vec 16 b8
19
vec16b8 = vec 16 b8
19
false
false
1
5
4
16
5
11
null
null
bitemyapp/bytestring-streaming
Data/ByteString/Streaming.hs
bsd-3-clause
yield :: S.ByteString -> ByteString m () yield bs = chunk bs (Empty ())
71
yield :: S.ByteString -> ByteString m () yield bs = chunk bs (Empty ())
71
yield bs = chunk bs (Empty ())
30
false
true
0
8
13
45
20
25
null
null
naoto-ogawa/h-xproto-mysql
src/DataBase/MySQLX/Model.hs
mit
mkServerMessages :: PSM.ServerMessages mkServerMessages = PB.defaultValue
136
mkServerMessages :: PSM.ServerMessages mkServerMessages = PB.defaultValue
115
mkServerMessages = PB.defaultValue
55
false
true
0
5
68
15
8
7
null
null
airobert/yices_haskell
Math/SMT/Yices/Syntax.hs
bsd-3-clause
showExpY (LitB True) = showString "true"
41
showExpY (LitB True) = showString "true"
41
showExpY (LitB True) = showString "true"
41
false
false
0
7
6
18
8
10
null
null
ndmitchell/qed
src/Proof/Exp/HSE.hs
bsd-3-clause
deflateDecl x = x
17
deflateDecl x = x
17
deflateDecl x = x
17
false
false
1
5
3
13
4
9
null
null
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/Bare/DataType.hs
bsd-3-clause
getPsSig _ _ z = error $ "getPsSig" ++ show z
47
getPsSig _ _ z = error $ "getPsSig" ++ show z
47
getPsSig _ _ z = error $ "getPsSig" ++ show z
47
false
false
3
6
12
23
10
13
null
null
joehillen/aura
src/Aura/State.hs
gpl-3.0
readState :: FilePath -> Aura PkgState readState name = liftIO (read <$> readFileUTF8 (stateCache </> name))
108
readState :: FilePath -> Aura PkgState readState name = liftIO (read <$> readFileUTF8 (stateCache </> name))
108
readState name = liftIO (read <$> readFileUTF8 (stateCache </> name))
69
false
true
0
10
15
46
21
25
null
null
rad1al/hutton_exercises
ch10.hs
gpl-2.0
putBoardHelper :: Int -> Board -> IO () putBoardHelper row [] = return ()
77
putBoardHelper :: Int -> Board -> IO () putBoardHelper row [] = return ()
77
putBoardHelper row [] = return ()
37
false
true
0
9
17
41
18
23
null
null
noughtmare/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs
gpl-2.0
-- LEFT CEILING switch '>' '7' = '\x2309'
41
switch '>' '7' = '\x2309'
25
switch '>' '7' = '\x2309'
25
true
false
0
5
7
12
6
6
null
null
mettekou/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
-- | Handle CmmMachOp expressions -- This is a specialised method that handles Global register manipulations like -- 'Sp - 16', using the getelementptr instruction. genMachOp_fast :: EOption -> MachOp -> GlobalReg -> Int -> [CmmExpr] -> LlvmM ExprData genMachOp_fast opt op r n e = do (gv, grt, s1) <- getCmmRegVal (CmmGlobal r) dflags <- getDynFlags let (ix,rem) = n `divMod` ((llvmWidthInBits dflags . pLower) grt `div` 8) case isPointer grt && rem == 0 of True -> do (ptr, s2) <- doExpr grt $ GetElemPtr True gv [toI32 ix] (var, s3) <- doExpr (llvmWord dflags) $ Cast LM_Ptrtoint ptr (llvmWord dflags) return (var, s1 `snocOL` s2 `snocOL` s3, []) False -> genMachOp_slow opt op e -- | Handle CmmMachOp expressions -- This handles all the cases not handle by the specialised genMachOp_fast.
906
genMachOp_fast :: EOption -> MachOp -> GlobalReg -> Int -> [CmmExpr] -> LlvmM ExprData genMachOp_fast opt op r n e = do (gv, grt, s1) <- getCmmRegVal (CmmGlobal r) dflags <- getDynFlags let (ix,rem) = n `divMod` ((llvmWidthInBits dflags . pLower) grt `div` 8) case isPointer grt && rem == 0 of True -> do (ptr, s2) <- doExpr grt $ GetElemPtr True gv [toI32 ix] (var, s3) <- doExpr (llvmWord dflags) $ Cast LM_Ptrtoint ptr (llvmWord dflags) return (var, s1 `snocOL` s2 `snocOL` s3, []) False -> genMachOp_slow opt op e -- | Handle CmmMachOp expressions -- This handles all the cases not handle by the specialised genMachOp_fast.
741
genMachOp_fast opt op r n e = do (gv, grt, s1) <- getCmmRegVal (CmmGlobal r) dflags <- getDynFlags let (ix,rem) = n `divMod` ((llvmWidthInBits dflags . pLower) grt `div` 8) case isPointer grt && rem == 0 of True -> do (ptr, s2) <- doExpr grt $ GetElemPtr True gv [toI32 ix] (var, s3) <- doExpr (llvmWord dflags) $ Cast LM_Ptrtoint ptr (llvmWord dflags) return (var, s1 `snocOL` s2 `snocOL` s3, []) False -> genMachOp_slow opt op e -- | Handle CmmMachOp expressions -- This handles all the cases not handle by the specialised genMachOp_fast.
639
true
true
0
16
247
267
138
129
null
null
mariefarrell/Hets
CspCASLProver/CspProverConsts.hs
gpl-2.0
-- | Name Process symbol cspProver_NamedProcS :: String cspProver_NamedProcS = "Proc_name"
90
cspProver_NamedProcS :: String cspProver_NamedProcS = "Proc_name"
65
cspProver_NamedProcS = "Proc_name"
34
true
true
0
4
10
12
7
5
null
null
thomie/cabal
cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs
bsd-3-clause
testGlobChangeMatchSubdir :: Int -> Assertion testGlobChangeMatchSubdir mtimeChange = withFileMonitor $ \root monitor -> do touchFile root ("dir" </> "a" </> "good-a") touchFile root ("dir" </> "b" </> "good-b") updateMonitor root monitor [monitorFileGlobStr "dir/*/good-*"] () () threadDelay mtimeChange touchFile root ("dir" </> "b" </> "good-b") (res, files) <- expectMonitorUnchanged root monitor () res @?= () files @?= [monitorFileGlobStr "dir/*/good-*"] touchFileContent root "dir/b/good-b" reason <- expectMonitorChanged root monitor () reason @?= MonitoredFileChanged ("dir" </> "b" </> "good-b") -- check nothing goes squiffy with matching in the top dir
714
testGlobChangeMatchSubdir :: Int -> Assertion testGlobChangeMatchSubdir mtimeChange = withFileMonitor $ \root monitor -> do touchFile root ("dir" </> "a" </> "good-a") touchFile root ("dir" </> "b" </> "good-b") updateMonitor root monitor [monitorFileGlobStr "dir/*/good-*"] () () threadDelay mtimeChange touchFile root ("dir" </> "b" </> "good-b") (res, files) <- expectMonitorUnchanged root monitor () res @?= () files @?= [monitorFileGlobStr "dir/*/good-*"] touchFileContent root "dir/b/good-b" reason <- expectMonitorChanged root monitor () reason @?= MonitoredFileChanged ("dir" </> "b" </> "good-b") -- check nothing goes squiffy with matching in the top dir
714
testGlobChangeMatchSubdir mtimeChange = withFileMonitor $ \root monitor -> do touchFile root ("dir" </> "a" </> "good-a") touchFile root ("dir" </> "b" </> "good-b") updateMonitor root monitor [monitorFileGlobStr "dir/*/good-*"] () () threadDelay mtimeChange touchFile root ("dir" </> "b" </> "good-b") (res, files) <- expectMonitorUnchanged root monitor () res @?= () files @?= [monitorFileGlobStr "dir/*/good-*"] touchFileContent root "dir/b/good-b" reason <- expectMonitorChanged root monitor () reason @?= MonitoredFileChanged ("dir" </> "b" </> "good-b") -- check nothing goes squiffy with matching in the top dir
668
false
true
0
13
135
206
97
109
null
null
thinkpad20/rowling
src/Language/Rowling/Parser.hs
mit
-- | Consumes any spaces (not other whitespace). spaces :: Parser String spaces = many $ char ' '
97
spaces :: Parser String spaces = many $ char ' '
48
spaces = many $ char ' '
24
true
true
2
6
18
29
12
17
null
null
kosmoskatten/traffic-analysis
src/Network/Traffic/Object/Filter.hs
mit
(>*<) ClientApp = mkFilterFunc clientApp
46
(>*<) ClientApp = mkFilterFunc clientApp
46
(>*<) ClientApp = mkFilterFunc clientApp
46
false
false
0
5
10
15
7
8
null
null
bus000/Dikunt
plugins/Remind/Main.hs
bsd-3-clause
message :: RequestParser Message message = P.between quote quote (P.many (P.noneOf "\n\r\"")) where quote = P.char '"'
124
message :: RequestParser Message message = P.between quote quote (P.many (P.noneOf "\n\r\"")) where quote = P.char '"'
124
message = P.between quote quote (P.many (P.noneOf "\n\r\"")) where quote = P.char '"'
91
false
true
0
10
22
52
25
27
null
null
google/ghc-source-gen
src/GHC/SourceGen/Module.hs
bsd-3-clause
-- | Adds the @{-# SOURCE #-}@ pragma to an import. source :: ImportDecl' -> ImportDecl' source d = d { ideclSource = #if MIN_VERSION_ghc(9,0,0) IsBoot #else True #endif }
179
source :: ImportDecl' -> ImportDecl' source d = d { ideclSource = #if MIN_VERSION_ghc(9,0,0) IsBoot #else True #endif }
127
source d = d { ideclSource = #if MIN_VERSION_ghc(9,0,0) IsBoot #else True #endif }
90
true
true
0
7
37
39
20
19
null
null
junjihashimoto/persistent
persistent/Database/Persist/Class/PersistEntity.hs
mit
-- | Predefined @toJSON@. The resulting JSON looks like -- @{\"key\": 1, \"value\": {\"name\": ...}}@. -- -- The typical usage is: -- -- @ -- instance ToJSON User where -- toJSON = keyValueEntityToJSON -- @ keyValueEntityToJSON :: (PersistEntity record, ToJSON record, ToJSON (Key record)) => Entity record -> Value keyValueEntityToJSON (Entity key value) = object [ "key" .= key , "value" .= value ]
441
keyValueEntityToJSON :: (PersistEntity record, ToJSON record, ToJSON (Key record)) => Entity record -> Value keyValueEntityToJSON (Entity key value) = object [ "key" .= key , "value" .= value ]
226
keyValueEntityToJSON (Entity key value) = object [ "key" .= key , "value" .= value ]
96
true
true
0
8
104
82
46
36
null
null
d-day/relation
include/pointfree-style/pointless-haskell-0.0.8/src/Generics/Pointless/Combinators.hs
bsd-3-clause
-- | The product distribution combinator distp :: ((c,d),(a,b)) -> ((c,a),(d,b)) distp = fst_X_fst /\ snd_X_snd
111
distp :: ((c,d),(a,b)) -> ((c,a),(d,b)) distp = fst_X_fst /\ snd_X_snd
70
distp = fst_X_fst /\ snd_X_snd
30
true
true
0
7
15
56
35
21
null
null
chemist/highlighter
src/Text/Highlighter/Lexers/Antlr.hs
bsd-3-clause
comments' :: TokenMatcher comments' = [ tok "//.*$" (Arbitrary "Comment") , tok "/\\*(.|\\n)*?\\*/" (Arbitrary "Comment") ]
135
comments' :: TokenMatcher comments' = [ tok "//.*$" (Arbitrary "Comment") , tok "/\\*(.|\\n)*?\\*/" (Arbitrary "Comment") ]
135
comments' = [ tok "//.*$" (Arbitrary "Comment") , tok "/\\*(.|\\n)*?\\*/" (Arbitrary "Comment") ]
109
false
true
0
8
27
39
20
19
null
null
phaazon/leaf
src/Wrapper.hs
gpl-3.0
-- construct a simple name with intercalated nick prettyName :: (String,String,String) -> String prettyName (f,l,n) = intercalate (" " ++ n ++ " ") [f,l]
153
prettyName :: (String,String,String) -> String prettyName (f,l,n) = intercalate (" " ++ n ++ " ") [f,l]
103
prettyName (f,l,n) = intercalate (" " ++ n ++ " ") [f,l]
56
true
true
0
8
24
59
34
25
null
null
nomeata/incredible
logic/Propositions.hs
mit
termP :: Parser Proposition termP = buildExpressionParser table atomP <?> "proposition"
88
termP :: Parser Proposition termP = buildExpressionParser table atomP <?> "proposition"
88
termP = buildExpressionParser table atomP <?> "proposition"
60
false
true
0
6
11
29
12
17
null
null
ryantm/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
eqPhase LlvmMangle LlvmMangle = True
37
eqPhase LlvmMangle LlvmMangle = True
37
eqPhase LlvmMangle LlvmMangle = True
37
false
false
0
5
5
13
5
8
null
null
tjhunter/karps
haskell/src/Spark/Core/Internal/BrainStructures.hs
apache-2.0
-- TODO: could do more checks here about schema, etc. resourcePath :: Text -> Try ResourcePath resourcePath = pure . ResourcePath
129
resourcePath :: Text -> Try ResourcePath resourcePath = pure . ResourcePath
75
resourcePath = pure . ResourcePath
34
true
true
1
7
20
30
13
17
null
null
krapsh/kraps-haskell
src/Spark/Core/Internal/ComputeDag.hs
apache-2.0
mapVertexData :: (v -> v') -> ComputeDag v e -> ComputeDag v' e mapVertexData f = mapVertices (f . vertexData)
110
mapVertexData :: (v -> v') -> ComputeDag v e -> ComputeDag v' e mapVertexData f = mapVertices (f . vertexData)
110
mapVertexData f = mapVertices (f . vertexData)
46
false
true
0
7
19
49
24
25
null
null
raventid/coursera_learning
haskell/stepik/5.4lexer.hs
mit
asToken :: String -> Maybe Token asToken token | all isDigit token = Just $ Number (read token :: Int) | token == "+" = Just Plus | token == "-" = Just Minus | token == "(" = Just LeftBrace | token == ")" = Just RightBrace | otherwise = Nothing
314
asToken :: String -> Maybe Token asToken token | all isDigit token = Just $ Number (read token :: Int) | token == "+" = Just Plus | token == "-" = Just Minus | token == "(" = Just LeftBrace | token == ")" = Just RightBrace | otherwise = Nothing
314
asToken token | all isDigit token = Just $ Number (read token :: Int) | token == "+" = Just Plus | token == "-" = Just Minus | token == "(" = Just LeftBrace | token == ")" = Just RightBrace | otherwise = Nothing
281
false
true
0
9
121
121
54
67
null
null
frantisekfarka/ghc-dsi
libraries/base/Debug/Trace.hs
bsd-3-clause
{-| Like 'traceM', but uses 'show' on the argument to convert it to a 'String'. > ... = do > x <- ... > traceMShow $ x > y <- ... > traceMShow $ x + y /Since: 4.7.0.0/ -} traceShowM :: (Show a, Monad m) => a -> m () traceShowM = traceM . show
252
traceShowM :: (Show a, Monad m) => a -> m () traceShowM = traceM . show
71
traceShowM = traceM . show
26
true
true
0
8
65
40
21
19
null
null
mettekou/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
tcBindGroups :: TopLevelFlag -> TcSigFun -> TcPragEnv -> [(RecFlag, LHsBinds Name)] -> TcM thing -> TcM ([(RecFlag, LHsBinds TcId)], thing) -- Typecheck a whole lot of value bindings, -- one strongly-connected component at a time -- Here a "strongly connected component" has the strightforward -- meaning of a group of bindings that mention each other, -- ignoring type signatures (that part comes later) tcBindGroups _ _ _ [] thing_inside = do { thing <- thing_inside ; return ([], thing) }
529
tcBindGroups :: TopLevelFlag -> TcSigFun -> TcPragEnv -> [(RecFlag, LHsBinds Name)] -> TcM thing -> TcM ([(RecFlag, LHsBinds TcId)], thing) tcBindGroups _ _ _ [] thing_inside = do { thing <- thing_inside ; return ([], thing) }
263
tcBindGroups _ _ _ [] thing_inside = do { thing <- thing_inside ; return ([], thing) }
97
true
true
0
15
117
114
61
53
null
null
danr/hipspec
examples/old-examples/quickspec/ProductiveUseOfFailure2.hs
gpl-3.0
[] `intersect` ys = []
26
[] `intersect` ys = []
26
[] `intersect` ys = []
26
false
false
0
6
8
22
10
12
null
null
Sokal21/GoblinBurner
src/Mannager.hs
bsd-3-clause
-- Funciones para la creacion de personajes character_creation :: Name -> Env -> [DepAttribute] -> [Skills] -> Maybe Character character_creation name xs depAttr skl = do ws <- skillCalculator xs skl ys <- depAttrCalculator ws depAttr return (PC name ys [])
345
character_creation :: Name -> Env -> [DepAttribute] -> [Skills] -> Maybe Character character_creation name xs depAttr skl = do ws <- skillCalculator xs skl ys <- depAttrCalculator ws depAttr return (PC name ys [])
301
character_creation name xs depAttr skl = do ws <- skillCalculator xs skl ys <- depAttrCalculator ws depAttr return (PC name ys [])
218
true
true
0
10
128
88
42
46
null
null
mhwombat/interactive-wains
src/ALife/Creatur/Wain/Interaction/Universe.hs
bsd-3-clause
cInitialPopulationSize :: Setting Int cInitialPopulationSize = requiredSetting "initialPopSize"
95
cInitialPopulationSize :: Setting Int cInitialPopulationSize = requiredSetting "initialPopSize"
95
cInitialPopulationSize = requiredSetting "initialPopSize"
57
false
true
0
5
7
17
8
9
null
null
ezyang/ghc
compiler/vectorise/Vectorise/Convert.hs
bsd-3-clause
identityConv (ForAllTy {}) = noV $ text "identityConv: quantified type changes under vectorisation"
101
identityConv (ForAllTy {}) = noV $ text "identityConv: quantified type changes under vectorisation"
101
identityConv (ForAllTy {}) = noV $ text "identityConv: quantified type changes under vectorisation"
101
false
false
0
7
14
23
11
12
null
null
prb/perpubplat
src/Blog/Widgets/JsonUtilities.hs
bsd-3-clause
uno :: JSValue -> [(String,JSValue)] uno (JSObject o) = fromJSObject o
70
uno :: JSValue -> [(String,JSValue)] uno (JSObject o) = fromJSObject o
70
uno (JSObject o) = fromJSObject o
33
false
true
0
7
10
36
19
17
null
null
ajnsit/packman
Test/AllTests.hs
bsd-3-clause
nfib n = let n1 = nfib (n-1) n2 = nfib (n-2) in 1 + 2*n1 + n2 - n1
88
nfib n = let n1 = nfib (n-1) n2 = nfib (n-2) in 1 + 2*n1 + n2 - n1
88
nfib n = let n1 = nfib (n-1) n2 = nfib (n-2) in 1 + 2*n1 + n2 - n1
88
false
false
1
11
41
65
30
35
null
null
genos/online_problems
advent_of_code_2021/day17/Main.hs
mit
readTarget :: Text -> Target readTarget = fromRight (error "Bad parse") . parseOnly p where p = (,,,) <$> ("target area: x=" *> decimal) <*> (".." *> decimal) <*> (", y=" *> signed decimal) <*> (".." *> signed decimal)
249
readTarget :: Text -> Target readTarget = fromRight (error "Bad parse") . parseOnly p where p = (,,,) <$> ("target area: x=" *> decimal) <*> (".." *> decimal) <*> (", y=" *> signed decimal) <*> (".." *> signed decimal)
249
readTarget = fromRight (error "Bad parse") . parseOnly p where p = (,,,) <$> ("target area: x=" *> decimal) <*> (".." *> decimal) <*> (", y=" *> signed decimal) <*> (".." *> signed decimal)
220
false
true
12
8
69
114
56
58
null
null
ayu-mushi/scientific-ants
ALife/ScientificAnts/Instruct.hs
mit
ifz :: Instruction ifz world = if cx == 0 then world else incIP world where cx = (world ^. (ants <<< focus)) ^. (register <<< _3)
131
ifz :: Instruction ifz world = if cx == 0 then world else incIP world where cx = (world ^. (ants <<< focus)) ^. (register <<< _3)
131
ifz world = if cx == 0 then world else incIP world where cx = (world ^. (ants <<< focus)) ^. (register <<< _3)
112
false
true
0
9
28
68
34
34
null
null
keithodulaigh/Hets
CSL/Reduce_Interface.hs
gpl-2.0
exportExp (Op s _ exps@[e1, e2] _) | elem (simpleName s) infixOps = concat ["(", exportExp e1, simpleName s, exportExp e2, ")"] | otherwise = concat [simpleName s, "(", exportExps exps, ")"]
206
exportExp (Op s _ exps@[e1, e2] _) | elem (simpleName s) infixOps = concat ["(", exportExp e1, simpleName s, exportExp e2, ")"] | otherwise = concat [simpleName s, "(", exportExps exps, ")"]
206
exportExp (Op s _ exps@[e1, e2] _) | elem (simpleName s) infixOps = concat ["(", exportExp e1, simpleName s, exportExp e2, ")"] | otherwise = concat [simpleName s, "(", exportExps exps, ")"]
206
false
false
1
10
47
102
52
50
null
null
johan--/postgrest
src/PostgREST/PgQuery.hs
mit
paramFilter v = "eq." <> unquoted v
35
paramFilter v = "eq." <> unquoted v
35
paramFilter v = "eq." <> unquoted v
35
false
false
0
6
6
16
7
9
null
null
oldmanmike/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
isTauTy (CoercionTy _) = False
37
isTauTy (CoercionTy _) = False
37
isTauTy (CoercionTy _) = False
37
false
false
0
6
11
16
7
9
null
null
bibaijin/cis194
src/Spring13/Week5/StackVM.hs
bsd-3-clause
-- Execute the given program. Returns either an error message or the -- value on top of the stack after execution. stackVM :: Program -> Either String StackVal stackVM = execute []
180
stackVM :: Program -> Either String StackVal stackVM = execute []
65
stackVM = execute []
20
true
true
0
6
31
27
14
13
null
null
isomorphism/csound-expression
src/Csound/Control/Sf.hs
bsd-3-clause
----------------------------------------- -- | Reads sf2 samples with amplitude in (0, 1) and frequency in Hz. -- The interpolation is linear. sfCps :: Sf -> D -> D -> D -> (Sig, Sig) sfCps = genSfCps sfplay
209
sfCps :: Sf -> D -> D -> D -> (Sig, Sig) sfCps = genSfCps sfplay
64
sfCps = genSfCps sfplay
23
true
true
0
11
37
46
23
23
null
null
richard12511/potential-golf-waffle
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Paths_golf.hs
bsd-3-clause
getDataDir = catchIO (getEnv "golf_datadir") (\_ -> return datadir)
67
getDataDir = catchIO (getEnv "golf_datadir") (\_ -> return datadir)
67
getDataDir = catchIO (getEnv "golf_datadir") (\_ -> return datadir)
67
false
false
1
8
8
31
14
17
null
null
CloudI/CloudI
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString.hs
mit
useAsCString :: ByteString -> (CString -> IO a) -> IO a useAsCString (PS fp o l) action = allocaBytes (l+1) $ \buf -> withForeignPtr fp $ \p -> do memcpy buf (p `plusPtr` o) (fromIntegral l) pokeByteOff buf l (0::Word8) action (castPtr buf) -- | /O(n) construction/ Use a @ByteString@ with a function requiring a @CStringLen@. -- As for @useAsCString@ this function makes a copy of the original @ByteString@. -- It must not be stored or used after the subcomputation finishes.
496
useAsCString :: ByteString -> (CString -> IO a) -> IO a useAsCString (PS fp o l) action = allocaBytes (l+1) $ \buf -> withForeignPtr fp $ \p -> do memcpy buf (p `plusPtr` o) (fromIntegral l) pokeByteOff buf l (0::Word8) action (castPtr buf) -- | /O(n) construction/ Use a @ByteString@ with a function requiring a @CStringLen@. -- As for @useAsCString@ this function makes a copy of the original @ByteString@. -- It must not be stored or used after the subcomputation finishes.
496
useAsCString (PS fp o l) action = allocaBytes (l+1) $ \buf -> withForeignPtr fp $ \p -> do memcpy buf (p `plusPtr` o) (fromIntegral l) pokeByteOff buf l (0::Word8) action (castPtr buf) -- | /O(n) construction/ Use a @ByteString@ with a function requiring a @CStringLen@. -- As for @useAsCString@ this function makes a copy of the original @ByteString@. -- It must not be stored or used after the subcomputation finishes.
440
false
true
4
11
100
141
69
72
null
null
xpika/mohws
src/Network/MoHWS/Logger/Error.hs
bsd-3-clause
start :: FilePath -> LogLevel.T -> IO Handle start file level = do l <- Logger.start (return . format) file let h = Handle { logger = l, minLevel = level } log h LogLevel.Warn $ "Starting error logger with log level " ++ show level ++ "..." return h where format m = formatTimeSensibly (toUTCTime (time m)) ++ " " ++ string m
455
start :: FilePath -> LogLevel.T -> IO Handle start file level = do l <- Logger.start (return . format) file let h = Handle { logger = l, minLevel = level } log h LogLevel.Warn $ "Starting error logger with log level " ++ show level ++ "..." return h where format m = formatTimeSensibly (toUTCTime (time m)) ++ " " ++ string m
455
start file level = do l <- Logger.start (return . format) file let h = Handle { logger = l, minLevel = level } log h LogLevel.Warn $ "Starting error logger with log level " ++ show level ++ "..." return h where format m = formatTimeSensibly (toUTCTime (time m)) ++ " " ++ string m
410
false
true
0
11
193
140
67
73
null
null
cutsea110/BISocie
Handler/Issue.hs
bsd-3-clause
getScheduleR :: Year -> Month -> Handler Html getScheduleR year month = do u <- requireAuth today <- liftIO $ fmap utctDay getCurrentTime let days = map (map (ywd2cell today)) $ groupBy ((==) `on` snd3) $ [toWeekDate d | d <- [fromWeekDate fy fm 1 .. fromWeekDate ly lm 7]] defaultLayout $ do setTitle $ preEscapedText $ showText year +++ "年" +++ showText month +++ "月のスケジュール" $(widgetFile "schedule") where ywd2cell c (y,w,d) = let d' = fromWeekDate y w d in (d', classOf d' d c) fday = fromGregorian year month 1 lday = fromGregorian year month $ gregorianMonthLength year month (fy, fm, _) = toWeekDate fday (ly, lm, _) = toWeekDate lday classOf :: Day -> Int -> Day -> String classOf day d today = intercalate " " $ ["schedule-day-cell", toWeekName d] ++ (if today == day then ["today"] else []) ++ (if currentMonth day then ["currentMonth"] else ["otherMonth"]) taskUri :: Day -> Route App taskUri d = let (y', m', d') = toGregorian d in TaskR y' m' d' showDay :: Day -> String showDay = show . thd3 . toGregorian currentMonth :: Day -> Bool currentMonth d = let (y', m', _) = toGregorian d in year == y' && month == m' monthmove n cm = let (y', m', _) = toGregorian $ addGregorianMonthsClip n cm in ScheduleR y' m' prevMonth = monthmove (-1) nextMonth = monthmove 1 prevYear = monthmove (-12) nextYear = monthmove 12 toWeekName :: Int -> String toWeekName = show . toWeekDay toWeekDay :: Int -> WeekDay toWeekDay n = toEnum (n-1)
1,670
getScheduleR :: Year -> Month -> Handler Html getScheduleR year month = do u <- requireAuth today <- liftIO $ fmap utctDay getCurrentTime let days = map (map (ywd2cell today)) $ groupBy ((==) `on` snd3) $ [toWeekDate d | d <- [fromWeekDate fy fm 1 .. fromWeekDate ly lm 7]] defaultLayout $ do setTitle $ preEscapedText $ showText year +++ "年" +++ showText month +++ "月のスケジュール" $(widgetFile "schedule") where ywd2cell c (y,w,d) = let d' = fromWeekDate y w d in (d', classOf d' d c) fday = fromGregorian year month 1 lday = fromGregorian year month $ gregorianMonthLength year month (fy, fm, _) = toWeekDate fday (ly, lm, _) = toWeekDate lday classOf :: Day -> Int -> Day -> String classOf day d today = intercalate " " $ ["schedule-day-cell", toWeekName d] ++ (if today == day then ["today"] else []) ++ (if currentMonth day then ["currentMonth"] else ["otherMonth"]) taskUri :: Day -> Route App taskUri d = let (y', m', d') = toGregorian d in TaskR y' m' d' showDay :: Day -> String showDay = show . thd3 . toGregorian currentMonth :: Day -> Bool currentMonth d = let (y', m', _) = toGregorian d in year == y' && month == m' monthmove n cm = let (y', m', _) = toGregorian $ addGregorianMonthsClip n cm in ScheduleR y' m' prevMonth = monthmove (-1) nextMonth = monthmove 1 prevYear = monthmove (-12) nextYear = monthmove 12 toWeekName :: Int -> String toWeekName = show . toWeekDay toWeekDay :: Int -> WeekDay toWeekDay n = toEnum (n-1)
1,670
getScheduleR year month = do u <- requireAuth today <- liftIO $ fmap utctDay getCurrentTime let days = map (map (ywd2cell today)) $ groupBy ((==) `on` snd3) $ [toWeekDate d | d <- [fromWeekDate fy fm 1 .. fromWeekDate ly lm 7]] defaultLayout $ do setTitle $ preEscapedText $ showText year +++ "年" +++ showText month +++ "月のスケジュール" $(widgetFile "schedule") where ywd2cell c (y,w,d) = let d' = fromWeekDate y w d in (d', classOf d' d c) fday = fromGregorian year month 1 lday = fromGregorian year month $ gregorianMonthLength year month (fy, fm, _) = toWeekDate fday (ly, lm, _) = toWeekDate lday classOf :: Day -> Int -> Day -> String classOf day d today = intercalate " " $ ["schedule-day-cell", toWeekName d] ++ (if today == day then ["today"] else []) ++ (if currentMonth day then ["currentMonth"] else ["otherMonth"]) taskUri :: Day -> Route App taskUri d = let (y', m', d') = toGregorian d in TaskR y' m' d' showDay :: Day -> String showDay = show . thd3 . toGregorian currentMonth :: Day -> Bool currentMonth d = let (y', m', _) = toGregorian d in year == y' && month == m' monthmove n cm = let (y', m', _) = toGregorian $ addGregorianMonthsClip n cm in ScheduleR y' m' prevMonth = monthmove (-1) nextMonth = monthmove 1 prevYear = monthmove (-12) nextYear = monthmove 12 toWeekName :: Int -> String toWeekName = show . toWeekDay toWeekDay :: Int -> WeekDay toWeekDay n = toEnum (n-1)
1,624
false
true
46
16
495
635
331
304
null
null
foreverbell/project-euler-solutions
src/80.hs
bsd-3-clause
main = print $ sum [ go x | x <- nonSquare ] where nonSquare = [1 .. 100] \\ [ i*i | i <- [1 .. 10] ]
105
main = print $ sum [ go x | x <- nonSquare ] where nonSquare = [1 .. 100] \\ [ i*i | i <- [1 .. 10] ]
105
main = print $ sum [ go x | x <- nonSquare ] where nonSquare = [1 .. 100] \\ [ i*i | i <- [1 .. 10] ]
105
false
false
0
9
32
64
35
29
null
null
pigworker/WhatRTypes4
Bits.hs
cc0-1.0
abstract _ _ _ = Nothing
24
abstract _ _ _ = Nothing
24
abstract _ _ _ = Nothing
24
false
false
0
5
5
13
6
7
null
null
mrakgr/futhark
src/Futhark/CodeGen/Backends/SimpleRepresentation.hs
bsd-3-clause
sameRepresentation' :: Type -> Type -> Bool sameRepresentation' (Scalar t1) (Scalar t2) = t1 == t2
100
sameRepresentation' :: Type -> Type -> Bool sameRepresentation' (Scalar t1) (Scalar t2) = t1 == t2
100
sameRepresentation' (Scalar t1) (Scalar t2) = t1 == t2
56
false
true
1
10
17
49
22
27
null
null
mettekou/ghc
compiler/prelude/THNames.hs
bsd-3-clause
typeAnnotationName = libFun (fsLit "typeAnnotation") typeAnnotationIdKey
76
typeAnnotationName = libFun (fsLit "typeAnnotation") typeAnnotationIdKey
76
typeAnnotationName = libFun (fsLit "typeAnnotation") typeAnnotationIdKey
76
false
false
0
7
9
17
8
9
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/range_3.hs
mit
not MyFalse = MyTrue
20
not MyFalse = MyTrue
20
not MyFalse = MyTrue
20
false
false
1
5
3
13
4
9
null
null
BlackBrane/ansigraph
src/System/Console/Ansigraph/Internal/Core.hs
mit
-- | The SGR command corresponding to a particular 'ConsoleLayer' and 'AnsiColor'. interpAnsiColor :: ConsoleLayer -> AnsiColor -> SGR interpAnsiColor l (AnsiColor i c) = SetColor l i c
185
interpAnsiColor :: ConsoleLayer -> AnsiColor -> SGR interpAnsiColor l (AnsiColor i c) = SetColor l i c
102
interpAnsiColor l (AnsiColor i c) = SetColor l i c
50
true
true
0
7
28
40
20
20
null
null
amccausl/Swish
Swish/HaskellRDF/RDFGraphTest.hs
lgpl-2.1
testGraphTranslate03c = testFormulaLookup "GraphTranslate03c" ft3 st2 (Just gt2)
80
testGraphTranslate03c = testFormulaLookup "GraphTranslate03c" ft3 st2 (Just gt2)
80
testGraphTranslate03c = testFormulaLookup "GraphTranslate03c" ft3 st2 (Just gt2)
80
false
false
0
7
7
21
10
11
null
null
gcampax/ghc
compiler/types/TyCon.hs
bsd-3-clause
primElemRepSizeB :: PrimElemRep -> Int primElemRepSizeB Int8ElemRep = 1
73
primElemRepSizeB :: PrimElemRep -> Int primElemRepSizeB Int8ElemRep = 1
73
primElemRepSizeB Int8ElemRep = 1
34
false
true
0
5
10
18
9
9
null
null
wiggly/workshop
src/Data/Workshop/ListMap.hs
bsd-3-clause
-- retrieve a value from the map get :: ListMap a -> MapKey -> Maybe a get (ListMap pairs) k = undefined
104
get :: ListMap a -> MapKey -> Maybe a get (ListMap pairs) k = undefined
71
get (ListMap pairs) k = undefined
33
true
true
0
7
21
37
18
19
null
null
futufeld/eclogues
eclogues-impl/gen-hs/AuroraSchedulerManager.hs
bsd-3-clause
decode_KillTasks_result :: (T.Protocol p, T.Transport t) => p t -> LBS.ByteString -> KillTasks_result decode_KillTasks_result iprot bs = to_KillTasks_result $ T.deserializeVal iprot (T.T_STRUCT typemap_KillTasks_result) bs
222
decode_KillTasks_result :: (T.Protocol p, T.Transport t) => p t -> LBS.ByteString -> KillTasks_result decode_KillTasks_result iprot bs = to_KillTasks_result $ T.deserializeVal iprot (T.T_STRUCT typemap_KillTasks_result) bs
222
decode_KillTasks_result iprot bs = to_KillTasks_result $ T.deserializeVal iprot (T.T_STRUCT typemap_KillTasks_result) bs
120
false
true
0
9
23
73
35
38
null
null
beni55/haste-compiler
libraries/ghc-7.10/base/Data/Maybe.hs
bsd-3-clause
mapMaybe f (x:xs) = let rs = mapMaybe f xs in case f x of Nothing -> rs Just r -> r:rs
94
mapMaybe f (x:xs) = let rs = mapMaybe f xs in case f x of Nothing -> rs Just r -> r:rs
94
mapMaybe f (x:xs) = let rs = mapMaybe f xs in case f x of Nothing -> rs Just r -> r:rs
94
false
false
0
10
29
62
28
34
null
null
vTurbine/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
tc_group top_lvl sig_fn prag_fn (Recursive, binds) closed thing_inside = -- To maximise polymorphism, we do a new -- strongly-connected-component analysis, this time omitting -- any references to variables with type signatures. -- (This used to be optional, but isn't now.) -- See Note [Polymorphic recursion] in HsBinds. do { traceTc "tc_group rec" (pprLHsBinds binds) ; when hasPatSyn $ recursivePatSynErr binds ; (binds1, thing) <- go sccs ; return ([(Recursive, binds1)], thing) } -- Rec them all together where hasPatSyn = anyBag (isPatSyn . unLoc) binds isPatSyn PatSynBind{} = True isPatSyn _ = False sccs :: [SCC (LHsBind Name)] sccs = stronglyConnCompFromEdgedVerticesUniq (mkEdges sig_fn binds) go :: [SCC (LHsBind Name)] -> TcM (LHsBinds TcId, thing) go (scc:sccs) = do { (binds1, ids1) <- tc_scc scc ; (binds2, thing) <- tcExtendLetEnv top_lvl closed ids1 (go sccs) ; return (binds1 `unionBags` binds2, thing) } go [] = do { thing <- thing_inside; return (emptyBag, thing) } tc_scc (AcyclicSCC bind) = tc_sub_group NonRecursive [bind] tc_scc (CyclicSCC binds) = tc_sub_group Recursive binds tc_sub_group rec_tc binds = tcPolyBinds top_lvl sig_fn prag_fn Recursive rec_tc closed binds
1,455
tc_group top_lvl sig_fn prag_fn (Recursive, binds) closed thing_inside = -- To maximise polymorphism, we do a new -- strongly-connected-component analysis, this time omitting -- any references to variables with type signatures. -- (This used to be optional, but isn't now.) -- See Note [Polymorphic recursion] in HsBinds. do { traceTc "tc_group rec" (pprLHsBinds binds) ; when hasPatSyn $ recursivePatSynErr binds ; (binds1, thing) <- go sccs ; return ([(Recursive, binds1)], thing) } -- Rec them all together where hasPatSyn = anyBag (isPatSyn . unLoc) binds isPatSyn PatSynBind{} = True isPatSyn _ = False sccs :: [SCC (LHsBind Name)] sccs = stronglyConnCompFromEdgedVerticesUniq (mkEdges sig_fn binds) go :: [SCC (LHsBind Name)] -> TcM (LHsBinds TcId, thing) go (scc:sccs) = do { (binds1, ids1) <- tc_scc scc ; (binds2, thing) <- tcExtendLetEnv top_lvl closed ids1 (go sccs) ; return (binds1 `unionBags` binds2, thing) } go [] = do { thing <- thing_inside; return (emptyBag, thing) } tc_scc (AcyclicSCC bind) = tc_sub_group NonRecursive [bind] tc_scc (CyclicSCC binds) = tc_sub_group Recursive binds tc_sub_group rec_tc binds = tcPolyBinds top_lvl sig_fn prag_fn Recursive rec_tc closed binds
1,455
tc_group top_lvl sig_fn prag_fn (Recursive, binds) closed thing_inside = -- To maximise polymorphism, we do a new -- strongly-connected-component analysis, this time omitting -- any references to variables with type signatures. -- (This used to be optional, but isn't now.) -- See Note [Polymorphic recursion] in HsBinds. do { traceTc "tc_group rec" (pprLHsBinds binds) ; when hasPatSyn $ recursivePatSynErr binds ; (binds1, thing) <- go sccs ; return ([(Recursive, binds1)], thing) } -- Rec them all together where hasPatSyn = anyBag (isPatSyn . unLoc) binds isPatSyn PatSynBind{} = True isPatSyn _ = False sccs :: [SCC (LHsBind Name)] sccs = stronglyConnCompFromEdgedVerticesUniq (mkEdges sig_fn binds) go :: [SCC (LHsBind Name)] -> TcM (LHsBinds TcId, thing) go (scc:sccs) = do { (binds1, ids1) <- tc_scc scc ; (binds2, thing) <- tcExtendLetEnv top_lvl closed ids1 (go sccs) ; return (binds1 `unionBags` binds2, thing) } go [] = do { thing <- thing_inside; return (emptyBag, thing) } tc_scc (AcyclicSCC bind) = tc_sub_group NonRecursive [bind] tc_scc (CyclicSCC binds) = tc_sub_group Recursive binds tc_sub_group rec_tc binds = tcPolyBinds top_lvl sig_fn prag_fn Recursive rec_tc closed binds
1,455
false
false
4
10
438
416
204
212
null
null
DavidAlphaFox/darcs
harness/Darcs/Test/Patch/Examples/Set2Unwitnessed.hs
gpl-2.0
w_mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p W.:\/: p)] w_mergeExamples = map (unseal2 (mergePairFromCommutePair seal2)) w_commuteExamples
193
w_mergeExamples :: (FromPrim p, Merge p, Invert p, PrimPatchBase p, PrimOf p ~ Prim) => [Sealed2 (p W.:\/: p)] w_mergeExamples = map (unseal2 (mergePairFromCommutePair seal2)) w_commuteExamples
193
w_mergeExamples = map (unseal2 (mergePairFromCommutePair seal2)) w_commuteExamples
82
false
true
0
9
25
81
41
40
null
null
spechub/Hets
Maude/Language.hs
gpl-2.0
maudeParser :: CharParser () [RawResult] maudeParser = toplevel
63
maudeParser :: CharParser () [RawResult] maudeParser = toplevel
63
maudeParser = toplevel
22
false
true
0
6
7
21
11
10
null
null
lamdu/lamdu
src/Revision/Deltum/Transaction.hs
gpl-3.0
lookupBS :: Monad m => UUID -> T m (Maybe Value) lookupBS uuid = do base <- getBase changes <- liftChangesMap State.get case Map.lookup uuid changes <|> Map.lookup uuid base of Nothing -> do store <- getStore liftInner $ storeLookup store uuid Just res -> pure res
316
lookupBS :: Monad m => UUID -> T m (Maybe Value) lookupBS uuid = do base <- getBase changes <- liftChangesMap State.get case Map.lookup uuid changes <|> Map.lookup uuid base of Nothing -> do store <- getStore liftInner $ storeLookup store uuid Just res -> pure res
316
lookupBS uuid = do base <- getBase changes <- liftChangesMap State.get case Map.lookup uuid changes <|> Map.lookup uuid base of Nothing -> do store <- getStore liftInner $ storeLookup store uuid Just res -> pure res
267
false
true
0
14
98
122
53
69
null
null
pjones/cassava-streams
src/System/IO/Streams/Csv/Decode.hs
bsd-3-clause
bomb :: String -> IO a bomb = throwIO . StreamDecodingError
59
bomb :: String -> IO a bomb = throwIO . StreamDecodingError
59
bomb = throwIO . StreamDecodingError
36
false
true
0
6
10
22
11
11
null
null
kim/amazonka
amazonka-sdb/gen/Network/AWS/SDB/BatchDeleteAttributes.hs
mpl-2.0
-- | 'BatchDeleteAttributesResponse' constructor. batchDeleteAttributesResponse :: BatchDeleteAttributesResponse batchDeleteAttributesResponse = BatchDeleteAttributesResponse
174
batchDeleteAttributesResponse :: BatchDeleteAttributesResponse batchDeleteAttributesResponse = BatchDeleteAttributesResponse
124
batchDeleteAttributesResponse = BatchDeleteAttributesResponse
61
true
true
0
4
9
12
7
5
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Projects/List.hs
mpl-2.0
-- | Select only projects with these IDs. plIds :: Lens' ProjectsList [Int64] plIds = lens _plIds (\ s a -> s{_plIds = a}) . _Default . _Coerce
151
plIds :: Lens' ProjectsList [Int64] plIds = lens _plIds (\ s a -> s{_plIds = a}) . _Default . _Coerce
109
plIds = lens _plIds (\ s a -> s{_plIds = a}) . _Default . _Coerce
73
true
true
0
11
35
53
28
25
null
null
ctford/Idris-Elba-dev
src/Idris/Core/Elaborate.hs
bsd-3-clause
no_errors :: Elab' aux () -> Maybe Err -> Elab' aux () no_errors tac err = do ps <- get_probs s <- get case err of Nothing -> tac Just e -> -- update the error, if there is one. case runStateT tac s of Error _ -> lift $ Error e OK (a, s') -> do put s' return a ps' <- get_probs if (length ps' > length ps) then case reverse ps' of ((x,y,env,err) : _) -> let env' = map (\(x, b) -> (x, binderTy b)) env in lift $ tfail $ CantUnify False x y err env' 0 else return $! () -- Try a tactic, if it fails, try another
823
no_errors :: Elab' aux () -> Maybe Err -> Elab' aux () no_errors tac err = do ps <- get_probs s <- get case err of Nothing -> tac Just e -> -- update the error, if there is one. case runStateT tac s of Error _ -> lift $ Error e OK (a, s') -> do put s' return a ps' <- get_probs if (length ps' > length ps) then case reverse ps' of ((x,y,env,err) : _) -> let env' = map (\(x, b) -> (x, binderTy b)) env in lift $ tfail $ CantUnify False x y err env' 0 else return $! () -- Try a tactic, if it fails, try another
823
no_errors tac err = do ps <- get_probs s <- get case err of Nothing -> tac Just e -> -- update the error, if there is one. case runStateT tac s of Error _ -> lift $ Error e OK (a, s') -> do put s' return a ps' <- get_probs if (length ps' > length ps) then case reverse ps' of ((x,y,env,err) : _) -> let env' = map (\(x, b) -> (x, binderTy b)) env in lift $ tfail $ CantUnify False x y err env' 0 else return $! () -- Try a tactic, if it fails, try another
768
false
true
0
19
427
265
128
137
null
null
yliu120/K3
src/Language/K3/Analysis/Provenance/Inference.hs
apache-2.0
pipopcaseM :: () -> PInfM PMatVar pipopcaseM _ = get >>= liftEitherM . pipopcase >>= \(mv,env) -> put env >> return mv
118
pipopcaseM :: () -> PInfM PMatVar pipopcaseM _ = get >>= liftEitherM . pipopcase >>= \(mv,env) -> put env >> return mv
118
pipopcaseM _ = get >>= liftEitherM . pipopcase >>= \(mv,env) -> put env >> return mv
84
false
true
0
8
21
56
28
28
null
null
anthonyde/GLX
src/Graphics/X11/GLX.hs
bsd-3-clause
-- | Encode an integral attribute encodeIntAttr :: Integral a => GLXAttributeToken -> a -> [GLXAttribute] -> [GLXAttribute] encodeIntAttr token val attrs = token : fromIntegral val : attrs
190
encodeIntAttr :: Integral a => GLXAttributeToken -> a -> [GLXAttribute] -> [GLXAttribute] encodeIntAttr token val attrs = token : fromIntegral val : attrs
156
encodeIntAttr token val attrs = token : fromIntegral val : attrs
64
true
true
0
11
30
61
29
32
null
null
fros1y/umbral
src/Color.hs
bsd-3-clause
byName "white smoke" = fromTuple (245,245,245)
46
byName "white smoke" = fromTuple (245,245,245)
46
byName "white smoke" = fromTuple (245,245,245)
46
false
false
1
6
5
24
11
13
null
null
andorp/hs-bluesnap
src/Bluesnap/API/Request.hs
gpl-3.0
elementTax_included :: XMLParser Xsd.Boolean elementTax_included = parseSchemaType "tax-included"
97
elementTax_included :: XMLParser Xsd.Boolean elementTax_included = parseSchemaType "tax-included"
97
elementTax_included = parseSchemaType "tax-included"
52
false
true
0
6
7
19
9
10
null
null
mainland/dph
dph-lifted-vseg/Data/Array/Parallel/Prim.hs
bsd-3-clause
combine2PA_Int# :: Int# -> PArray_Int# -> PArray_Int# -> PArray_Int# -> PArray_Int# -> PArray_Int# combine2PA_Int# _ sel _ xs ys = combine2'PA_Int# sel xs ys
181
combine2PA_Int# :: Int# -> PArray_Int# -> PArray_Int# -> PArray_Int# -> PArray_Int# -> PArray_Int# combine2PA_Int# _ sel _ xs ys = combine2'PA_Int# sel xs ys
181
combine2PA_Int# _ sel _ xs ys = combine2'PA_Int# sel xs ys
58
false
true
0
9
47
49
24
25
null
null
jystic/pointfree
Plugin/Pl/Parser.hs
mit
nameString (HSE.Symbol s) = (Inf, s)
36
nameString (HSE.Symbol s) = (Inf, s)
36
nameString (HSE.Symbol s) = (Inf, s)
36
false
false
0
8
5
23
12
11
null
null
SEEK-Org/evaporate
src/Zip.hs
mit
getPathInArchive :: FilePath -> FilePath -> FilePath getPathInArchive rootPath (takeDirectory -> pathDirectory) = let pathDirectory' = if pathDirectory == "." then "" else pathDirectory in if rootPath /= "" then fromMaybe "" $ stripPrefix (addTrailingPathSeparator rootPath) pathDirectory' else pathDirectory'
321
getPathInArchive :: FilePath -> FilePath -> FilePath getPathInArchive rootPath (takeDirectory -> pathDirectory) = let pathDirectory' = if pathDirectory == "." then "" else pathDirectory in if rootPath /= "" then fromMaybe "" $ stripPrefix (addTrailingPathSeparator rootPath) pathDirectory' else pathDirectory'
321
getPathInArchive rootPath (takeDirectory -> pathDirectory) = let pathDirectory' = if pathDirectory == "." then "" else pathDirectory in if rootPath /= "" then fromMaybe "" $ stripPrefix (addTrailingPathSeparator rootPath) pathDirectory' else pathDirectory'
268
false
true
0
11
50
84
43
41
null
null
beni55/text
Data/Text/Internal/Fusion/Size.hs
bsd-2-clause
exactSize :: Int -> Size exactSize n = #if defined(ASSERTS) assert (n >= 0) #endif Between n n
102
exactSize :: Int -> Size exactSize n = #if defined(ASSERTS) assert (n >= 0) #endif Between n n
102
exactSize n = #if defined(ASSERTS) assert (n >= 0) #endif Between n n
77
false
true
0
7
25
36
19
17
null
null
lordi/flowskell
src/Flowskell/TextureUtils.hs
gpl-2.0
image2Texture (ImageRGB8 (Image width height dat)) = let size = (TextureSize2D (fromIntegral width) (fromIntegral height)) in unsafeWith dat $ \ptr -> texImage2D Nothing NoProxy 0 RGB8 size 0 (PixelData RGB UnsignedByte ptr)
240
image2Texture (ImageRGB8 (Image width height dat)) = let size = (TextureSize2D (fromIntegral width) (fromIntegral height)) in unsafeWith dat $ \ptr -> texImage2D Nothing NoProxy 0 RGB8 size 0 (PixelData RGB UnsignedByte ptr)
240
image2Texture (ImageRGB8 (Image width height dat)) = let size = (TextureSize2D (fromIntegral width) (fromIntegral height)) in unsafeWith dat $ \ptr -> texImage2D Nothing NoProxy 0 RGB8 size 0 (PixelData RGB UnsignedByte ptr)
240
false
false
0
12
47
93
45
48
null
null
mhcurylo/scheme-haskell-tutorial
src/Parser.hs
bsd-3-clause
readExpr :: String -> ThrowsError LispVal readExpr = readOrThrow parseExpr
74
readExpr :: String -> ThrowsError LispVal readExpr = readOrThrow parseExpr
74
readExpr = readOrThrow parseExpr
32
false
true
0
6
9
21
10
11
null
null
MnO2/hindley-milner
src/HM/Parser.hs
bsd-3-clause
readTau :: Parser Tau readTau = choice [try tfun, atomTau]
58
readTau :: Parser Tau readTau = choice [try tfun, atomTau]
58
readTau = choice [try tfun, atomTau]
36
false
true
0
7
9
26
13
13
null
null
parsonsmatt/routerhs
Router.hs
mit
showUserPost :: Num a => a -> a -> Route a showUserPost u n = In Users u $ Do (Show n) Posts
92
showUserPost :: Num a => a -> a -> Route a showUserPost u n = In Users u $ Do (Show n) Posts
92
showUserPost u n = In Users u $ Do (Show n) Posts
49
false
true
0
8
22
54
25
29
null
null
spechub/Hets
Common/AnnoParser.hs
gpl-2.0
newlineOrEof :: GenParser Char st () newlineOrEof = lookAhead $ charOrEof '\n'
78
newlineOrEof :: GenParser Char st () newlineOrEof = lookAhead $ charOrEof '\n'
78
newlineOrEof = lookAhead $ charOrEof '\n'
41
false
true
1
6
11
30
13
17
null
null
fmapfmapfmap/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types/Product.hs
mpl-2.0
-- | The value you provided for the Marker request parameter. sdlMarker :: Lens' StreamingDistributionList Text sdlMarker = lens _sdlMarker (\ s a -> s{_sdlMarker = a})
168
sdlMarker :: Lens' StreamingDistributionList Text sdlMarker = lens _sdlMarker (\ s a -> s{_sdlMarker = a})
106
sdlMarker = lens _sdlMarker (\ s a -> s{_sdlMarker = a})
56
true
true
0
9
26
40
22
18
null
null
andre-artus/handbook-of-practical-logic-and-automated-reasoning-haskell
src/ATP/EqElim.hs
gpl-3.0
indNvSubterm (Atom (R "=" st)) = List.findFirst findNestNonvar st
66
findNvSubterm (Atom (R "=" st)) = List.findFirst findNestNonvar st
66
findNvSubterm (Atom (R "=" st)) = List.findFirst findNestNonvar st
66
false
false
0
8
9
31
14
17
null
null
akru/haste-compiler
libraries/haste-lib/src/Haste/Graphics/Canvas.hs
bsd-3-clause
render :: MonadIO m => Canvas -> Picture a -> m a render (Canvas ctx el) (Picture p) = liftIO $ do jsResetCanvas el p ctx -- | Draw a picture onto a canvas without first clearing it.
188
render :: MonadIO m => Canvas -> Picture a -> m a render (Canvas ctx el) (Picture p) = liftIO $ do jsResetCanvas el p ctx -- | Draw a picture onto a canvas without first clearing it.
188
render (Canvas ctx el) (Picture p) = liftIO $ do jsResetCanvas el p ctx -- | Draw a picture onto a canvas without first clearing it.
138
false
true
0
8
43
68
31
37
null
null
Javran/haptics
src/Trace/Haptics/Combine.hs
bsd-3-clause
combine_main :: Flags -> [String] -> IO () combine_main flags [first_file, second_file] = do let f = theCombineFun (combineFn flags) Just tix1 <- readTix first_file Just tix2 <- readTix second_file let tix = mergeTix (mergeModule flags) f (filterTix flags tix1) (filterTix flags tix2) case outputFile flags of "-" -> putStrLn (show tix) out -> writeTix out tix
429
combine_main :: Flags -> [String] -> IO () combine_main flags [first_file, second_file] = do let f = theCombineFun (combineFn flags) Just tix1 <- readTix first_file Just tix2 <- readTix second_file let tix = mergeTix (mergeModule flags) f (filterTix flags tix1) (filterTix flags tix2) case outputFile flags of "-" -> putStrLn (show tix) out -> writeTix out tix
429
combine_main flags [first_file, second_file] = do let f = theCombineFun (combineFn flags) Just tix1 <- readTix first_file Just tix2 <- readTix second_file let tix = mergeTix (mergeModule flags) f (filterTix flags tix1) (filterTix flags tix2) case outputFile flags of "-" -> putStrLn (show tix) out -> writeTix out tix
386
false
true
0
12
125
158
73
85
null
null
gik0geck0/ac_dc_compiler
parser.hs
unlicense
parse :: Tokens -> Maybe Program parse tks = let prog = program tks validProg = validateProgram prog in if isJust prog then validProg else Nothing
166
parse :: Tokens -> Maybe Program parse tks = let prog = program tks validProg = validateProgram prog in if isJust prog then validProg else Nothing
166
parse tks = let prog = program tks validProg = validateProgram prog in if isJust prog then validProg else Nothing
133
false
true
0
9
45
54
26
28
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/ModifyInstanceAttribute.hs
mpl-2.0
-- | If the value is 'true', you can't terminate the instance using the Amazon EC2 -- console, CLI, or API; otherwise, you can. mia1DisableApiTermination :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) mia1DisableApiTermination = lens _mia1DisableApiTermination (\s a -> s { _mia1DisableApiTermination = a })
335
mia1DisableApiTermination :: Lens' ModifyInstanceAttribute (Maybe AttributeBooleanValue) mia1DisableApiTermination = lens _mia1DisableApiTermination (\s a -> s { _mia1DisableApiTermination = a })
207
mia1DisableApiTermination = lens _mia1DisableApiTermination (\s a -> s { _mia1DisableApiTermination = a })
118
true
true
0
9
54
47
26
21
null
null
jchl/jtrace
src/Operators.hs
mit
rotatex = stackfn_dt (Trans.rotatex_t . degToRad) "rotatex"
59
rotatex = stackfn_dt (Trans.rotatex_t . degToRad) "rotatex"
59
rotatex = stackfn_dt (Trans.rotatex_t . degToRad) "rotatex"
59
false
false
0
8
6
20
10
10
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
action_2 (178#) = happyShift action_59
38
action_2 (178#) = happyShift action_59
38
action_2 (178#) = happyShift action_59
38
false
false
0
6
4
15
7
8
null
null
shnarazk/satter
Satter/Player.hs
gpl-3.0
updateGeometrics g (Just _) p@(Player pg@(Geometrics pos dir v) (_idNumber -> i) (DribblingTo d TargetOffsideLine)) = do let d = dribbleSpeed let tc = getTeamContext g p targetX = fhmargin + fwidth / 5 * if fst pos < fhmargin + fwidth / 2 then 1 else 4 targetY = fvmargin + fheight / 5 * if p ^. property . team == Team1 then 1 else 4 aggresive = _directorIntention tc == AggressiveAttack (zone1, zone2) = if aggresive then (10, 20) else (25, 50) verycloseEnemy <- enemyIsNear g p zone1 closeEnemy <- enemyIsNear g p zone2 let (dir', v') = case () of _ | verycloseEnemy && aggresive -> (randomizeDirection g dir 5 i, 0.9 * v) _ | verycloseEnemy -> (randomizeDirection g dir 5 i, 0.8 * v) _ | closeEnemy && aggresive -> (dir, v) _ | closeEnemy -> (randomizeDirection g dir 5 i, v) _ | aggresive -> ((directionTo pos (targetX, targetY)), v) _ -> (randomizeDirection g (directionTo pos (targetX, targetY)) 5 i, v) let pg' = newGeometrics pos dir' v' return $ Left (pg', Ball pg' (Just i))
1,067
updateGeometrics g (Just _) p@(Player pg@(Geometrics pos dir v) (_idNumber -> i) (DribblingTo d TargetOffsideLine)) = do let d = dribbleSpeed let tc = getTeamContext g p targetX = fhmargin + fwidth / 5 * if fst pos < fhmargin + fwidth / 2 then 1 else 4 targetY = fvmargin + fheight / 5 * if p ^. property . team == Team1 then 1 else 4 aggresive = _directorIntention tc == AggressiveAttack (zone1, zone2) = if aggresive then (10, 20) else (25, 50) verycloseEnemy <- enemyIsNear g p zone1 closeEnemy <- enemyIsNear g p zone2 let (dir', v') = case () of _ | verycloseEnemy && aggresive -> (randomizeDirection g dir 5 i, 0.9 * v) _ | verycloseEnemy -> (randomizeDirection g dir 5 i, 0.8 * v) _ | closeEnemy && aggresive -> (dir, v) _ | closeEnemy -> (randomizeDirection g dir 5 i, v) _ | aggresive -> ((directionTo pos (targetX, targetY)), v) _ -> (randomizeDirection g (directionTo pos (targetX, targetY)) 5 i, v) let pg' = newGeometrics pos dir' v' return $ Left (pg', Ball pg' (Just i))
1,067
updateGeometrics g (Just _) p@(Player pg@(Geometrics pos dir v) (_idNumber -> i) (DribblingTo d TargetOffsideLine)) = do let d = dribbleSpeed let tc = getTeamContext g p targetX = fhmargin + fwidth / 5 * if fst pos < fhmargin + fwidth / 2 then 1 else 4 targetY = fvmargin + fheight / 5 * if p ^. property . team == Team1 then 1 else 4 aggresive = _directorIntention tc == AggressiveAttack (zone1, zone2) = if aggresive then (10, 20) else (25, 50) verycloseEnemy <- enemyIsNear g p zone1 closeEnemy <- enemyIsNear g p zone2 let (dir', v') = case () of _ | verycloseEnemy && aggresive -> (randomizeDirection g dir 5 i, 0.9 * v) _ | verycloseEnemy -> (randomizeDirection g dir 5 i, 0.8 * v) _ | closeEnemy && aggresive -> (dir, v) _ | closeEnemy -> (randomizeDirection g dir 5 i, v) _ | aggresive -> ((directionTo pos (targetX, targetY)), v) _ -> (randomizeDirection g (directionTo pos (targetX, targetY)) 5 i, v) let pg' = newGeometrics pos dir' v' return $ Left (pg', Ball pg' (Just i))
1,067
false
false
0
17
264
479
243
236
null
null
friedbrice/Haskell
fibs/fibs.hs
gpl-2.0
fact4 :: [Integer] fact4 = [1] ++ [(fromIntegral n) * (fact4 !! ((fromIntegral n) - 1)) | n <- [1..]]
101
fact4 :: [Integer] fact4 = [1] ++ [(fromIntegral n) * (fact4 !! ((fromIntegral n) - 1)) | n <- [1..]]
101
fact4 = [1] ++ [(fromIntegral n) * (fact4 !! ((fromIntegral n) - 1)) | n <- [1..]]
82
false
true
2
13
19
73
37
36
null
null
pparkkin/eta
compiler/ETA/Utils/UniqFM.hs
bsd-3-clause
isNullUFM :: UniqFM elt -> Bool isNullUFM (UFM m) = M.null m
60
isNullUFM :: UniqFM elt -> Bool isNullUFM (UFM m) = M.null m
60
isNullUFM (UFM m) = M.null m
28
false
true
0
9
11
37
16
21
null
null
leksah/leksah-server
src/IDE/Utils/FileUtils.hs
gpl-2.0
allHaskellSourceFiles :: FilePath -> IO [FilePath] allHaskellSourceFiles = allFilesWithExtensions [".hs",".lhs"] True []
120
allHaskellSourceFiles :: FilePath -> IO [FilePath] allHaskellSourceFiles = allFilesWithExtensions [".hs",".lhs"] True []
120
allHaskellSourceFiles = allFilesWithExtensions [".hs",".lhs"] True []
69
false
true
0
7
11
36
19
17
null
null
jeannekamikaze/mapgen
MapGen/KdTree.hs
bsd-2-clause
-- Random monad with implicit normal distribution. mean = 0.5
62
mean = 0.5
10
mean = 0.5
10
true
false
0
4
10
7
4
3
null
null
tphyahoo/haskoin
haskoin-core/Network/Haskoin/Util.hs
unlicense
-- | Strict evaluation of the new state modify' :: MonadState s m => (s -> s) -> m () modify' f = get >>= \x -> put $! f x
122
modify' :: MonadState s m => (s -> s) -> m () modify' f = get >>= \x -> put $! f x
82
modify' f = get >>= \x -> put $! f x
36
true
true
0
8
30
56
28
28
null
null
brendanhay/gogol
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Settings/ForwardingAddresses/Get.hs
mpl-2.0
-- | Creates a value of 'UsersSettingsForwardingAddressesGet' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'usfagXgafv' -- -- * 'usfagForwardingEmail' -- -- * 'usfagUploadProtocol' -- -- * 'usfagAccessToken' -- -- * 'usfagUploadType' -- -- * 'usfagUserId' -- -- * 'usfagCallback' usersSettingsForwardingAddressesGet :: Text -- ^ 'usfagForwardingEmail' -> UsersSettingsForwardingAddressesGet usersSettingsForwardingAddressesGet pUsfagForwardingEmail_ = UsersSettingsForwardingAddressesGet' { _usfagXgafv = Nothing , _usfagForwardingEmail = pUsfagForwardingEmail_ , _usfagUploadProtocol = Nothing , _usfagAccessToken = Nothing , _usfagUploadType = Nothing , _usfagUserId = "me" , _usfagCallback = Nothing }
834
usersSettingsForwardingAddressesGet :: Text -- ^ 'usfagForwardingEmail' -> UsersSettingsForwardingAddressesGet usersSettingsForwardingAddressesGet pUsfagForwardingEmail_ = UsersSettingsForwardingAddressesGet' { _usfagXgafv = Nothing , _usfagForwardingEmail = pUsfagForwardingEmail_ , _usfagUploadProtocol = Nothing , _usfagAccessToken = Nothing , _usfagUploadType = Nothing , _usfagUserId = "me" , _usfagCallback = Nothing }
466
usersSettingsForwardingAddressesGet pUsfagForwardingEmail_ = UsersSettingsForwardingAddressesGet' { _usfagXgafv = Nothing , _usfagForwardingEmail = pUsfagForwardingEmail_ , _usfagUploadProtocol = Nothing , _usfagAccessToken = Nothing , _usfagUploadType = Nothing , _usfagUserId = "me" , _usfagCallback = Nothing }
347
true
true
0
6
140
80
56
24
null
null
rvion/ride
jetpack/src/Network/URI/AsUri.hs
bsd-3-clause
get_uri_uriAuthority o = I.uriAuthority o
41
get_uri_uriAuthority o = I.uriAuthority o
41
get_uri_uriAuthority o = I.uriAuthority o
41
false
false
0
6
4
14
6
8
null
null
davmre/matrizer
src/Matrizer/Optimization.hs
gpl-2.0
goUp :: MZipper -> ThrowsError MZipper goUp (t, SingleCrumb op : bs) = Right (Branch1 op t, bs)
95
goUp :: MZipper -> ThrowsError MZipper goUp (t, SingleCrumb op : bs) = Right (Branch1 op t, bs)
95
goUp (t, SingleCrumb op : bs) = Right (Branch1 op t, bs)
56
false
true
0
7
17
52
25
27
null
null
OS2World/DEV-UTIL-HUGS
oldlib/CollectionDefaults.hs
bsd-3-clause
toOrdSeqUsingFoldr :: (OrdColl c a,S.Sequence seq) => c a -> seq a toOrdSeqUsingFoldr = foldr S.cons S.empty
108
toOrdSeqUsingFoldr :: (OrdColl c a,S.Sequence seq) => c a -> seq a toOrdSeqUsingFoldr = foldr S.cons S.empty
108
toOrdSeqUsingFoldr = foldr S.cons S.empty
41
false
true
0
7
16
49
24
25
null
null
kawamuray/ganeti
test/hs/Test/Ganeti/Network.hs
gpl-2.0
-- | Check that the counts of free and reserved ips add up. checkCounts :: AddressPool -> Bool checkCounts a = let res = reservations a in V.length res == getFreeCount a + getReservedCount a
195
checkCounts :: AddressPool -> Bool checkCounts a = let res = reservations a in V.length res == getFreeCount a + getReservedCount a
135
checkCounts a = let res = reservations a in V.length res == getFreeCount a + getReservedCount a
100
true
true
0
10
39
52
24
28
null
null
ezrakilty/narc
Database/Narc/SQL.hs
bsd-2-clause
serializeAtom (Field rec fld) = rec ++ "." ++ fld
49
serializeAtom (Field rec fld) = rec ++ "." ++ fld
49
serializeAtom (Field rec fld) = rec ++ "." ++ fld
49
false
false
0
7
9
25
12
13
null
null
green-haskell/ghc
compiler/main/ErrUtils.hs
bsd-3-clause
makeIntoWarning :: ErrMsg -> ErrMsg makeIntoWarning err = err { errMsgSeverity = SevWarning }
93
makeIntoWarning :: ErrMsg -> ErrMsg makeIntoWarning err = err { errMsgSeverity = SevWarning }
93
makeIntoWarning err = err { errMsgSeverity = SevWarning }
57
false
true
0
6
13
26
14
12
null
null