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
qpliu/esolang
gbagbo/hs/TestValue.hs
gpl-3.0
combinationsTest2 :: [[Int]] -> Bool combinationsTest2 a = all (and . zipWith (flip elem) a) (combinations a)
109
combinationsTest2 :: [[Int]] -> Bool combinationsTest2 a = all (and . zipWith (flip elem) a) (combinations a)
109
combinationsTest2 a = all (and . zipWith (flip elem) a) (combinations a)
72
false
true
0
10
16
53
27
26
null
null
z0isch/advent-of-code
src/Day18.hs
bsd-3-clause
gridPrint :: Grid -> Int -> Int -> PixelRGB8 gridPrint g x y = if on then PixelRGB8 128 255 0 else PixelRGB8 0 64 0 where on = g ! x ! y == 1
143
gridPrint :: Grid -> Int -> Int -> PixelRGB8 gridPrint g x y = if on then PixelRGB8 128 255 0 else PixelRGB8 0 64 0 where on = g ! x ! y == 1
143
gridPrint g x y = if on then PixelRGB8 128 255 0 else PixelRGB8 0 64 0 where on = g ! x ! y == 1
98
false
true
6
9
37
86
38
48
null
null
urbanslug/ghc
compiler/nativeGen/Dwarf/Types.hs
bsd-3-clause
pprDwarfInfoOpen _ (DwarfSubprogram _ name label) = sdocWithDynFlags $ \df -> pprAbbrev DwAbbrSubprogram $$ pprString name $$ pprString (renderWithStyle df (ppr label) (mkCodeStyle CStyle)) $$ pprFlag (externallyVisibleCLabel label) $$ pprWord (ppr label) $$ pprWord (ppr $ mkAsmTempEndLabel label) $$ pprByte 1 $$ pprByte dW_OP_call_frame_cfa
359
pprDwarfInfoOpen _ (DwarfSubprogram _ name label) = sdocWithDynFlags $ \df -> pprAbbrev DwAbbrSubprogram $$ pprString name $$ pprString (renderWithStyle df (ppr label) (mkCodeStyle CStyle)) $$ pprFlag (externallyVisibleCLabel label) $$ pprWord (ppr label) $$ pprWord (ppr $ mkAsmTempEndLabel label) $$ pprByte 1 $$ pprByte dW_OP_call_frame_cfa
359
pprDwarfInfoOpen _ (DwarfSubprogram _ name label) = sdocWithDynFlags $ \df -> pprAbbrev DwAbbrSubprogram $$ pprString name $$ pprString (renderWithStyle df (ppr label) (mkCodeStyle CStyle)) $$ pprFlag (externallyVisibleCLabel label) $$ pprWord (ppr label) $$ pprWord (ppr $ mkAsmTempEndLabel label) $$ pprByte 1 $$ pprByte dW_OP_call_frame_cfa
359
false
false
15
8
59
136
59
77
null
null
fmthoma/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
isEmptyTy :: Type -> Bool isEmptyTy ty -- Data types where, given the particular type parameters, no data -- constructor matches, are empty. -- This includes data types with no constructors, e.g. Data.Void.Void. | Just (tc, inst_tys) <- splitTyConApp_maybe ty , Just dcs <- tyConDataCons_maybe tc , all (dataConCannotMatch inst_tys) dcs = True | otherwise = False
399
isEmptyTy :: Type -> Bool isEmptyTy ty -- Data types where, given the particular type parameters, no data -- constructor matches, are empty. -- This includes data types with no constructors, e.g. Data.Void.Void. | Just (tc, inst_tys) <- splitTyConApp_maybe ty , Just dcs <- tyConDataCons_maybe tc , all (dataConCannotMatch inst_tys) dcs = True | otherwise = False
399
isEmptyTy ty -- Data types where, given the particular type parameters, no data -- constructor matches, are empty. -- This includes data types with no constructors, e.g. Data.Void.Void. | Just (tc, inst_tys) <- splitTyConApp_maybe ty , Just dcs <- tyConDataCons_maybe tc , all (dataConCannotMatch inst_tys) dcs = True | otherwise = False
373
false
true
0
10
92
89
41
48
null
null
achirkin/easytensor
easytensor/test/Numeric/MatrixDoubleTest.hs
bsd-3-clause
prop_perspective :: TestElem -> TestElem -> TestElem -> TestElem -> Property prop_perspective a b c d = conjoin [ projectTo 0 0 n =~= vec3 0 0 (-1), projectTo 0 0 f =~= vec3 0 0 1, projectTo 1 1 n =~= vec3 1 1 (-1), projectTo 1 (-1) n =~= vec3 1 (-1) (-1), projectTo (-1) 1 n =~= vec3 (-1) 1 (-1), projectTo (-1) (-1) n =~= vec3 (-1) (-1) (-1), projectTo 1 1 f =~= vec3 1 1 1, projectTo 1 (-1) f =~= vec3 1 (-1) 1, projectTo (-1) 1 f =~= vec3 (-1) 1 1, projectTo (-1) (-1) f =~= vec3 (-1) (-1) 1 ] where n = 1.0 + mod' a 9.0 -- Near plane in range [1, 10) f = 2*n + mod' b 99.0 -- Far plane in range [2*n, 2*n + 100) fovy = (0.1 * pi) + mod' c (0.8 * pi) -- Y-axis field of view in range [0.1*pi, 0.9*pi) aspect = 0.25 + mod' d 4.0 -- Aspect ration in range [1/4, 4/1] hpd = tan (fovy * 0.5) -- height/distance wpd = aspect * hpd -- width/distance m = perspective n f fovy aspect projectTo x' y' z = fromHom $ vec4 (x' * wpd * z) (y' * hpd * z) (-z) 1 %* m
1,070
prop_perspective :: TestElem -> TestElem -> TestElem -> TestElem -> Property prop_perspective a b c d = conjoin [ projectTo 0 0 n =~= vec3 0 0 (-1), projectTo 0 0 f =~= vec3 0 0 1, projectTo 1 1 n =~= vec3 1 1 (-1), projectTo 1 (-1) n =~= vec3 1 (-1) (-1), projectTo (-1) 1 n =~= vec3 (-1) 1 (-1), projectTo (-1) (-1) n =~= vec3 (-1) (-1) (-1), projectTo 1 1 f =~= vec3 1 1 1, projectTo 1 (-1) f =~= vec3 1 (-1) 1, projectTo (-1) 1 f =~= vec3 (-1) 1 1, projectTo (-1) (-1) f =~= vec3 (-1) (-1) 1 ] where n = 1.0 + mod' a 9.0 -- Near plane in range [1, 10) f = 2*n + mod' b 99.0 -- Far plane in range [2*n, 2*n + 100) fovy = (0.1 * pi) + mod' c (0.8 * pi) -- Y-axis field of view in range [0.1*pi, 0.9*pi) aspect = 0.25 + mod' d 4.0 -- Aspect ration in range [1/4, 4/1] hpd = tan (fovy * 0.5) -- height/distance wpd = aspect * hpd -- width/distance m = perspective n f fovy aspect projectTo x' y' z = fromHom $ vec4 (x' * wpd * z) (y' * hpd * z) (-z) 1 %* m
1,070
prop_perspective a b c d = conjoin [ projectTo 0 0 n =~= vec3 0 0 (-1), projectTo 0 0 f =~= vec3 0 0 1, projectTo 1 1 n =~= vec3 1 1 (-1), projectTo 1 (-1) n =~= vec3 1 (-1) (-1), projectTo (-1) 1 n =~= vec3 (-1) 1 (-1), projectTo (-1) (-1) n =~= vec3 (-1) (-1) (-1), projectTo 1 1 f =~= vec3 1 1 1, projectTo 1 (-1) f =~= vec3 1 (-1) 1, projectTo (-1) 1 f =~= vec3 (-1) 1 1, projectTo (-1) (-1) f =~= vec3 (-1) (-1) 1 ] where n = 1.0 + mod' a 9.0 -- Near plane in range [1, 10) f = 2*n + mod' b 99.0 -- Far plane in range [2*n, 2*n + 100) fovy = (0.1 * pi) + mod' c (0.8 * pi) -- Y-axis field of view in range [0.1*pi, 0.9*pi) aspect = 0.25 + mod' d 4.0 -- Aspect ration in range [1/4, 4/1] hpd = tan (fovy * 0.5) -- height/distance wpd = aspect * hpd -- width/distance m = perspective n f fovy aspect projectTo x' y' z = fromHom $ vec4 (x' * wpd * z) (y' * hpd * z) (-z) 1 %* m
993
false
true
7
13
332
536
276
260
null
null
carliros/Simple-San-Simon-Functional-Web-Browser
src/Process/MatchSelector.hs
bsd-3-clause
getNextValidTag l@(NTag _ _ _:_) = (True, l)
45
getNextValidTag l@(NTag _ _ _:_) = (True, l)
45
getNextValidTag l@(NTag _ _ _:_) = (True, l)
45
false
false
0
9
8
32
17
15
null
null
holoed/Junior
lib/transformers-0.4.3.0/Control/Applicative/Lift.hs
apache-2.0
-- | Extractor for computations with accumulating errors. -- -- * @'runErrors' ('pure' x) = 'Right' x@ -- -- * @'runErrors' ('failure' e) = 'Left' e@ -- runErrors :: Errors e a -> Either e a runErrors (Other (Constant e)) = Left e
230
runErrors :: Errors e a -> Either e a runErrors (Other (Constant e)) = Left e
77
runErrors (Other (Constant e)) = Left e
39
true
true
0
9
42
49
26
23
null
null
shlomobauer/BuildIT
src/OutClean.hs
apache-2.0
ocleanrvbl h (BlockList BEmpty b) = ocleanrvb h b
49
ocleanrvbl h (BlockList BEmpty b) = ocleanrvb h b
49
ocleanrvbl h (BlockList BEmpty b) = ocleanrvb h b
49
false
false
0
7
8
24
11
13
null
null
urbanslug/ghc
testsuite/tests/typecheck/should_run/T3731.hs
bsd-3-clause
consConstr :: Constr consConstr = mkConstr listDataType "(:)" [] Infix
72
consConstr :: Constr consConstr = mkConstr listDataType "(:)" [] Infix
72
consConstr = mkConstr listDataType "(:)" [] Infix
51
false
true
0
6
11
29
12
17
null
null
cabrera/ghc-mod
Language/Haskell/GhcMod/Monad.hs
bsd-3-clause
newGhcModEnv :: Options -> FilePath -> IO GhcModEnv newGhcModEnv opt dir = do session <- newIORef (error "empty session") c <- findCradle' dir return GhcModEnv { gmGhcSession = session , gmOptions = opt , gmCradle = c }
271
newGhcModEnv :: Options -> FilePath -> IO GhcModEnv newGhcModEnv opt dir = do session <- newIORef (error "empty session") c <- findCradle' dir return GhcModEnv { gmGhcSession = session , gmOptions = opt , gmCradle = c }
271
newGhcModEnv opt dir = do session <- newIORef (error "empty session") c <- findCradle' dir return GhcModEnv { gmGhcSession = session , gmOptions = opt , gmCradle = c }
219
false
true
0
10
89
79
39
40
null
null
forste/haReFork
tools/base/SA/SCC.hs
bsd-3-clause
mkEmpty :: Bounds -> ST s (Set s) mkEmpty bnds = newSTArray bnds False
76
mkEmpty :: Bounds -> ST s (Set s) mkEmpty bnds = newSTArray bnds False
76
mkEmpty bnds = newSTArray bnds False
37
false
true
0
9
19
40
17
23
null
null
cocreature/leksah
src/IDE/TextEditor/CodeMirror.hs
gpl-2.0
historySize = js0 "historySize"
37
historySize = js0 "historySize"
37
historySize = js0 "historySize"
37
false
false
0
5
9
9
4
5
null
null
monsanto/hie
Hie/Language/Haskell/Exts/ParseMonad.hs
gpl-3.0
fromParseResult (ParseFailed loc str) = error $ "fromParseResult: Parse failed at [" ++ srcFilename loc ++ "] (" ++ show (srcLine loc) ++ ":" ++ show (srcColumn loc) ++ "): " ++ str
197
fromParseResult (ParseFailed loc str) = error $ "fromParseResult: Parse failed at [" ++ srcFilename loc ++ "] (" ++ show (srcLine loc) ++ ":" ++ show (srcColumn loc) ++ "): " ++ str
197
fromParseResult (ParseFailed loc str) = error $ "fromParseResult: Parse failed at [" ++ srcFilename loc ++ "] (" ++ show (srcLine loc) ++ ":" ++ show (srcColumn loc) ++ "): " ++ str
197
false
false
0
12
48
70
33
37
null
null
acowley/ghc
compiler/basicTypes/Literal.hs
bsd-3-clause
literalType (MachInt _) = intPrimTy
39
literalType (MachInt _) = intPrimTy
39
literalType (MachInt _) = intPrimTy
39
false
false
0
6
8
16
7
9
null
null
AnttiLukats/orp
software/tools/tidl/src/Tidl/Generate/C.hs
apache-2.0
serialize (FInt IKSigned IS8) = "int8_serialize"
48
serialize (FInt IKSigned IS8) = "int8_serialize"
48
serialize (FInt IKSigned IS8) = "int8_serialize"
48
false
false
0
7
5
17
8
9
null
null
jdubrule/bond
compiler/src/Language/Bond/Lexer.hs
mit
semiOrComma = semi <|> comma
28
semiOrComma = semi <|> comma
28
semiOrComma = semi <|> comma
28
false
false
0
5
4
10
5
5
null
null
diku-kmc/repg
src/KMC/SymbolicSST.hs
mit
valuate s (Left v:xs) = maybe [] id (M.lookup v s) ++ valuate s xs
90
valuate s (Left v:xs) = maybe [] id (M.lookup v s) ++ valuate s xs
90
valuate s (Left v:xs) = maybe [] id (M.lookup v s) ++ valuate s xs
90
false
false
0
9
38
49
23
26
null
null
rpglover64/Haskell-Turtle-Library
src/Turtle/Prelude.hs
bsd-3-clause
-- | @+r +w -x@ rwo :: Permissions -> Permissions rwo = readable . writable . ooo
81
rwo :: Permissions -> Permissions rwo = readable . writable . ooo
65
rwo = readable . writable . ooo
31
true
true
0
7
16
31
14
17
null
null
TomMD/ghc
compiler/main/DriverPipeline.hs
bsd-3-clause
getBackendDefs :: DynFlags -> IO [String] getBackendDefs dflags | hscTarget dflags == HscLlvm = do llvmVer <- figureLlvmVersion dflags return $ case llvmVer of Just n -> [ "-D__GLASGOW_HASKELL_LLVM__="++show n ] _ -> []
262
getBackendDefs :: DynFlags -> IO [String] getBackendDefs dflags | hscTarget dflags == HscLlvm = do llvmVer <- figureLlvmVersion dflags return $ case llvmVer of Just n -> [ "-D__GLASGOW_HASKELL_LLVM__="++show n ] _ -> []
262
getBackendDefs dflags | hscTarget dflags == HscLlvm = do llvmVer <- figureLlvmVersion dflags return $ case llvmVer of Just n -> [ "-D__GLASGOW_HASKELL_LLVM__="++show n ] _ -> []
220
false
true
0
14
76
85
39
46
null
null
vladfi1/hs-misc
FactorGraph/Map.hs
mit
f :: a -> [a] f = return
24
f :: a -> [a] f = return
24
f = return
10
false
true
0
8
7
25
11
14
null
null
ocramz/petsc-hs
src/Numerical/PETSc/Internal/InlineC.hs
gpl-3.0
-- PetscErrorCode DMDAVecGetArray(DM da,Vec vec,void *array) -- Logically collective on Vec -- Input Parameters : -- da - the distributed array -- vec - the vector, either a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector() -- Output Parameter : -- array -the array -- Notes : -- Call DMDAVecRestoreArray() once you have finished accessing the vector entries. -- In C, the indexing is "backwards" from what expects: array[k][j][i] NOT array[i][j][k]! -- If vec is a local vector (obtained with DMCreateLocalVector() etc) then the ghost point locations are accessible. If it is a global vector then the ghost points are not accessible. Of course with the local vector you will have had to do the -- appropriate DMGlobalToLocalBegin() and DMGlobalToLocalEnd() to have correct values in the ghost locations. dmdaVecGetArray' :: DM -> Vec -> IO (Ptr PetscScalar_, CInt) dmdaVecGetArray' dm v = withPtr $ \vvp -> [C.exp|int{DMDAVecGetArray($(DM dm), $(Vec v), $(PetscScalar** vvp))}|]
1,086
dmdaVecGetArray' :: DM -> Vec -> IO (Ptr PetscScalar_, CInt) dmdaVecGetArray' dm v = withPtr $ \vvp -> [C.exp|int{DMDAVecGetArray($(DM dm), $(Vec v), $(PetscScalar** vvp))}|]
235
dmdaVecGetArray' dm v = withPtr $ \vvp -> [C.exp|int{DMDAVecGetArray($(DM dm), $(Vec v), $(PetscScalar** vvp))}|]
174
true
true
0
9
221
63
40
23
null
null
iqsf/HFitUI
src/WebUI/Scripts/JavaScript/HJSVars.hs
bsd-3-clause
-- | Новая переменная Bool newVarBool :: JsName -> Bool -> HSL HLangJS HLangJS newVarBool name val = eqlNew (varJS name) val
146
newVarBool :: JsName -> Bool -> HSL HLangJS HLangJS newVarBool name val = eqlNew (varJS name) val
119
newVarBool name val = eqlNew (varJS name) val
45
true
true
0
7
43
41
20
21
null
null
dolio/vector
Data/Vector/Unboxed.hs
bsd-3-clause
singleton = G.singleton
23
singleton = G.singleton
23
singleton = G.singleton
23
false
false
1
6
2
12
4
8
null
null
charleso/intellij-haskforce
tests/gold/parser/Layout00023.hs
apache-2.0
main = do putStrLn bam where bam = "foo"
56
main = do putStrLn bam where bam = "foo"
56
main = do putStrLn bam where bam = "foo"
56
false
false
1
7
24
24
9
15
null
null
fffej/haskellprojects
freebase/Freebase.hs
bsd-2-clause
version :: URI version = fromJust $ parseURI "http://api.freebase.com/api/version"
82
version :: URI version = fromJust $ parseURI "http://api.freebase.com/api/version"
82
version = fromJust $ parseURI "http://api.freebase.com/api/version"
67
false
true
0
6
8
18
9
9
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Layout/LayoutCombinators.hs
bsd-2-clause
(***/****) = combineTwo (Mirror $ Tall 1 0.1 (3/7))
51
(***/****) = combineTwo (Mirror $ Tall 1 0.1 (3/7))
51
(***/****) = combineTwo (Mirror $ Tall 1 0.1 (3/7))
51
false
false
0
10
8
32
17
15
null
null
comius/haskell-mpfr
src/Numeric/Rounded/Interval.hs
lgpl-3.0
-- | Does there exist an @x@ in @X@, @y@ in @Y@ such that @x '/=' y@? (/=?) :: Interval a -> Interval a -> Bool I ax bx /=? I ay by = coerce ax /= by || coerce bx /= ay
168
(/=?) :: Interval a -> Interval a -> Bool I ax bx /=? I ay by = coerce ax /= by || coerce bx /= ay
98
I ax bx /=? I ay by = coerce ax /= by || coerce bx /= ay
56
true
true
0
9
42
66
30
36
null
null
Debaerdm/L3-MIAGE
Programmation Fonctionnel/TP/TP1/sommeDeXaY.hs
mit
concate' [[]] = []
18
concate' [[]] = []
18
concate' [[]] = []
18
false
false
0
7
3
16
8
8
null
null
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs
mpl-2.0
-- | PEM representation of the replica\'s private key. The corresponsing -- public key is encoded in the client\'s certificate. opcClientKey :: Lens' OnPremisesConfiguration (Maybe Text) opcClientKey = lens _opcClientKey (\ s a -> s{_opcClientKey = a})
254
opcClientKey :: Lens' OnPremisesConfiguration (Maybe Text) opcClientKey = lens _opcClientKey (\ s a -> s{_opcClientKey = a})
126
opcClientKey = lens _opcClientKey (\ s a -> s{_opcClientKey = a})
67
true
true
1
9
38
51
26
25
null
null
josephturnerjr/caster
src/Con/Types/Aggregate.hs
bsd-3-clause
variance :: Aggregate -> Double variance agg = M.foldl' f 0.0 agg where m = mean agg f a b = a + (b - m) ** 2
119
variance :: Aggregate -> Double variance agg = M.foldl' f 0.0 agg where m = mean agg f a b = a + (b - m) ** 2
119
variance agg = M.foldl' f 0.0 agg where m = mean agg f a b = a + (b - m) ** 2
87
false
true
1
8
37
63
31
32
null
null
gjasinski/rsa-haskell
dist/build/autogen/Paths_rsa_haskell.hs
mit
getSysconfDir = catchIO (getEnv "rsa_haskell_sysconfdir") (\_ -> return sysconfdir)
83
getSysconfDir = catchIO (getEnv "rsa_haskell_sysconfdir") (\_ -> return sysconfdir)
83
getSysconfDir = catchIO (getEnv "rsa_haskell_sysconfdir") (\_ -> return sysconfdir)
83
false
false
1
8
8
32
14
18
null
null
jozefg/c-dsl
src/Language/C/DSL/Exp.hs
mit
exp `post` MinusMinus = CUnary CPostDecOp exp undefNode
55
exp `post` MinusMinus = CUnary CPostDecOp exp undefNode
55
exp `post` MinusMinus = CUnary CPostDecOp exp undefNode
55
false
false
0
5
7
21
10
11
null
null
da-x/lamdu
Lamdu/Data/Export/JSON/Codec.hs
gpl-3.0
decodeNamedNominal :: Decoder ((Maybe String, T.NominalId), Nominal) decodeNamedNominal json = withObject "nom" (decodeNamed "nom" decodeNominal) json <&> _1 . _2 %~ T.NominalId
185
decodeNamedNominal :: Decoder ((Maybe String, T.NominalId), Nominal) decodeNamedNominal json = withObject "nom" (decodeNamed "nom" decodeNominal) json <&> _1 . _2 %~ T.NominalId
185
decodeNamedNominal json = withObject "nom" (decodeNamed "nom" decodeNominal) json <&> _1 . _2 %~ T.NominalId
116
false
true
2
8
29
65
32
33
null
null
colah/ImplicitCAD
programs/docgen.hs
agpl-3.0
-- | Return true if the argument is of type Branch. isBranch :: DocPart -> Bool isBranch (Branch _) = True
106
isBranch :: DocPart -> Bool isBranch (Branch _) = True
54
isBranch (Branch _) = True
26
true
true
0
9
20
31
14
17
null
null
hvr/vector
Data/Vector.hs
bsd-3-clause
maximum = G.maximum
19
maximum = G.maximum
19
maximum = G.maximum
19
false
false
1
6
2
12
4
8
null
null
KiNaudiz/bachelor
CN/Test2D.hs
gpl-3.0
-- g = 0 u :: Potential2D Double u r@(x,y) = a*(x**2+y**2) + g * magnitude ( cond r )
85
u :: Potential2D Double u r@(x,y) = a*(x**2+y**2) + g * magnitude ( cond r )
76
u r@(x,y) = a*(x**2+y**2) + g * magnitude ( cond r )
52
true
true
1
11
19
65
33
32
null
null
siddhanathan/ghc
testsuite/tests/rename/should_compile/timing001.hs
bsd-3-clause
a470 = a471
11
a470 = a471
11
a470 = a471
11
false
false
1
5
2
10
3
7
null
null
unknownloner/slow-frp
src/FoldVersion.hs
bsd-3-clause
stepSynth :: DeltaTime -> SynthState -> SynthState stepSynth dt (SynthState oscs hz) = SynthState (map (stepOsc hz dt) oscs) hz
129
stepSynth :: DeltaTime -> SynthState -> SynthState stepSynth dt (SynthState oscs hz) = SynthState (map (stepOsc hz dt) oscs) hz
129
stepSynth dt (SynthState oscs hz) = SynthState (map (stepOsc hz dt) oscs) hz
78
false
true
0
9
21
53
26
27
null
null
tismith/tlisp
write-yourself-a-scheme/listings/listing6.1.hs
mit
parseString :: Parser LispVal parseString = do char '"' x <- many (noneOf "\"") char '"' return $ String x
157
parseString :: Parser LispVal parseString = do char '"' x <- many (noneOf "\"") char '"' return $ String x
157
parseString = do char '"' x <- many (noneOf "\"") char '"' return $ String x
127
false
true
0
10
70
52
22
30
null
null
mgsloan/panopti
src/Utils.hs
bsd-3-clause
-- | Conditionally run an action, and yield result. maybeM :: Monad m => Maybe a -> (a -> m b) -> m (Maybe b) maybeM x f = maybe (return Nothing) (liftM Just . f) x
164
maybeM :: Monad m => Maybe a -> (a -> m b) -> m (Maybe b) maybeM x f = maybe (return Nothing) (liftM Just . f) x
112
maybeM x f = maybe (return Nothing) (liftM Just . f) x
54
true
true
0
10
36
77
37
40
null
null
LambdaHack/LambdaHack
engine-src/Game/LambdaHack/Client/UI/Key.hs
bsd-3-clause
keyTranslateWeb "Alt" _ = DeadKey
41
keyTranslateWeb "Alt" _ = DeadKey
41
keyTranslateWeb "Alt" _ = DeadKey
41
false
false
0
5
12
11
5
6
null
null
BartAdv/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
inlinable :: FnOpts -> Bool inlinable = elem Inlinable
54
inlinable :: FnOpts -> Bool inlinable = elem Inlinable
54
inlinable = elem Inlinable
26
false
true
0
5
8
18
9
9
null
null
AndreasVoellmy/openflow
src/Network/Data/OF13/Message.hs
bsd-3-clause
oFPP_CONTROLLER, oFPP_ANY :: PortID oFPP_CONTROLLER = 0xfffffffd
64
oFPP_CONTROLLER, oFPP_ANY :: PortID oFPP_CONTROLLER = 0xfffffffd
64
oFPP_CONTROLLER = 0xfffffffd
28
false
true
0
4
6
13
8
5
null
null
brendanhay/gogol
gogol-cloudidentity/gen/Network/Google/Resource/CloudIdentity/Groups/Memberships/SearchTransitiveMemberships.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). gmstmUploadType :: Lens' GroupsMembershipsSearchTransitiveMemberships (Maybe Text) gmstmUploadType = lens _gmstmUploadType (\ s a -> s{_gmstmUploadType = a})
236
gmstmUploadType :: Lens' GroupsMembershipsSearchTransitiveMemberships (Maybe Text) gmstmUploadType = lens _gmstmUploadType (\ s a -> s{_gmstmUploadType = a})
165
gmstmUploadType = lens _gmstmUploadType (\ s a -> s{_gmstmUploadType = a})
82
true
true
0
9
34
48
25
23
null
null
sol/depends
src/GhcPkg.hs
mit
parsePackage :: String -> Maybe Package parsePackage xs = do (name, version) <- splitVersion xs Package name <$> parseVersion version where splitVersion ys = case (break (== '-') . reverse) ys of (version, '-' : name) -> Just (reverse name, reverse version) _ -> Nothing
292
parsePackage :: String -> Maybe Package parsePackage xs = do (name, version) <- splitVersion xs Package name <$> parseVersion version where splitVersion ys = case (break (== '-') . reverse) ys of (version, '-' : name) -> Just (reverse name, reverse version) _ -> Nothing
292
parsePackage xs = do (name, version) <- splitVersion xs Package name <$> parseVersion version where splitVersion ys = case (break (== '-') . reverse) ys of (version, '-' : name) -> Just (reverse name, reverse version) _ -> Nothing
252
false
true
0
10
66
118
58
60
null
null
nevrenato/Hets_Fork
Static/PrintDevGraph.hs
gpl-2.0
showLEdge :: LEdge DGLinkLab -> String showLEdge (s, t, l) = "edge " ++ showEdgeId (dgl_id l) ++ " " ++ dglName l ++ "(" ++ showNodeId s ++ " --> " ++ show t ++ ")"
168
showLEdge :: LEdge DGLinkLab -> String showLEdge (s, t, l) = "edge " ++ showEdgeId (dgl_id l) ++ " " ++ dglName l ++ "(" ++ showNodeId s ++ " --> " ++ show t ++ ")"
168
showLEdge (s, t, l) = "edge " ++ showEdgeId (dgl_id l) ++ " " ++ dglName l ++ "(" ++ showNodeId s ++ " --> " ++ show t ++ ")"
129
false
true
16
8
40
94
40
54
null
null
shlevy/ghc
compiler/codeGen/StgCmmHeap.hs
bsd-3-clause
mkStaticClosure :: DynFlags -> CLabel -> CostCentreStack -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] mkStaticClosure dflags info_lbl ccs payload padding static_link_field saved_info_field = [CmmLabel info_lbl] ++ staticProfHdr dflags ccs ++ payload ++ padding ++ static_link_field ++ saved_info_field
331
mkStaticClosure :: DynFlags -> CLabel -> CostCentreStack -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] mkStaticClosure dflags info_lbl ccs payload padding static_link_field saved_info_field = [CmmLabel info_lbl] ++ staticProfHdr dflags ccs ++ payload ++ padding ++ static_link_field ++ saved_info_field
331
mkStaticClosure dflags info_lbl ccs payload padding static_link_field saved_info_field = [CmmLabel info_lbl] ++ staticProfHdr dflags ccs ++ payload ++ padding ++ static_link_field ++ saved_info_field
212
false
true
10
14
54
108
52
56
null
null
tdietert/scheduler
src/Scheduler.hs
bsd-3-clause
diffTimeToHHMM :: Clock.NominalDiffTime -> String diffTimeToHHMM t = fst $ splitAt (length todStr - 3) todStr where todStr = show . LocT.timeToTimeOfDay $ realToFrac t
171
diffTimeToHHMM :: Clock.NominalDiffTime -> String diffTimeToHHMM t = fst $ splitAt (length todStr - 3) todStr where todStr = show . LocT.timeToTimeOfDay $ realToFrac t
171
diffTimeToHHMM t = fst $ splitAt (length todStr - 3) todStr where todStr = show . LocT.timeToTimeOfDay $ realToFrac t
121
false
true
0
9
28
63
30
33
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_ASM_NUMBER :: Int wxSTC_ASM_NUMBER = 2
44
wxSTC_ASM_NUMBER :: Int wxSTC_ASM_NUMBER = 2
44
wxSTC_ASM_NUMBER = 2
20
false
true
0
4
5
11
6
5
null
null
ackao/APRICoT
web/conference-management-system/Application.hs
gpl-3.0
makeLogWare :: App -> IO Middleware makeLogWare foundation = mkRequestLogger def { outputFormat = if appDetailedRequestLogging $ appSettings foundation then Detailed True else Apache (if appIpFromHeader $ appSettings foundation then FromFallback else FromSocket) , destination = Logger $ loggerSet $ appLogger foundation }
474
makeLogWare :: App -> IO Middleware makeLogWare foundation = mkRequestLogger def { outputFormat = if appDetailedRequestLogging $ appSettings foundation then Detailed True else Apache (if appIpFromHeader $ appSettings foundation then FromFallback else FromSocket) , destination = Logger $ loggerSet $ appLogger foundation }
474
makeLogWare foundation = mkRequestLogger def { outputFormat = if appDetailedRequestLogging $ appSettings foundation then Detailed True else Apache (if appIpFromHeader $ appSettings foundation then FromFallback else FromSocket) , destination = Logger $ loggerSet $ appLogger foundation }
438
false
true
0
13
194
96
47
49
null
null
MichielDerhaeg/stack
src/Stack/Sig/Sign.hs
bsd-3-clause
-- | Sign a haskell package with the given url of the signature -- service and a path to a tarball. sign #if __GLASGOW_HASKELL__ < 710 :: (Applicative m, MonadUnliftIO m, MonadLogger m, MonadThrow m) #else :: (MonadUnliftIO m, MonadLogger m, MonadThrow m) #endif => String -> Path Abs File -> m Signature sign url filePath = withRunInIO $ \run -> withSystemTempDir "stack" (\tempDir -> do bytes <- liftIO (fmap GZip.decompress (BS.readFile (toFilePath filePath))) maybePath <- extractCabalFile tempDir (Tar.read bytes) case maybePath of Nothing -> throwM SigInvalidSDistTarBall Just cabalPath -> do pkg <- cabalFilePackageId (tempDir </> cabalPath) run (signPackage url pkg filePath)) where extractCabalFile tempDir (Tar.Next entry entries) = case Tar.entryContent entry of (Tar.NormalFile lbs _) -> case FP.splitFileName (Tar.entryPath entry) of (folder,file) | length (FP.splitDirectories folder) == 1 && FP.takeExtension file == ".cabal" -> do cabalFile <- parseRelFile file liftIO (BS.writeFile (toFilePath (tempDir </> cabalFile)) lbs) return (Just cabalFile) (_,_) -> extractCabalFile tempDir entries _ -> extractCabalFile tempDir entries extractCabalFile _ _ = return Nothing -- | Sign a haskell package with the given url to the signature -- service, a package tarball path (package tarball name) and a lazy -- bytestring of bytes that represent the tarball bytestream. The -- function will write the bytes to the path in a temp dir and sign -- the tarball with GPG.
2,084
sign #if __GLASGOW_HASKELL__ < 710 :: (Applicative m, MonadUnliftIO m, MonadLogger m, MonadThrow m) #else :: (MonadUnliftIO m, MonadLogger m, MonadThrow m) #endif => String -> Path Abs File -> m Signature sign url filePath = withRunInIO $ \run -> withSystemTempDir "stack" (\tempDir -> do bytes <- liftIO (fmap GZip.decompress (BS.readFile (toFilePath filePath))) maybePath <- extractCabalFile tempDir (Tar.read bytes) case maybePath of Nothing -> throwM SigInvalidSDistTarBall Just cabalPath -> do pkg <- cabalFilePackageId (tempDir </> cabalPath) run (signPackage url pkg filePath)) where extractCabalFile tempDir (Tar.Next entry entries) = case Tar.entryContent entry of (Tar.NormalFile lbs _) -> case FP.splitFileName (Tar.entryPath entry) of (folder,file) | length (FP.splitDirectories folder) == 1 && FP.takeExtension file == ".cabal" -> do cabalFile <- parseRelFile file liftIO (BS.writeFile (toFilePath (tempDir </> cabalFile)) lbs) return (Just cabalFile) (_,_) -> extractCabalFile tempDir entries _ -> extractCabalFile tempDir entries extractCabalFile _ _ = return Nothing -- | Sign a haskell package with the given url to the signature -- service, a package tarball path (package tarball name) and a lazy -- bytestring of bytes that represent the tarball bytestream. The -- function will write the bytes to the path in a temp dir and sign -- the tarball with GPG.
1,984
sign url filePath = withRunInIO $ \run -> withSystemTempDir "stack" (\tempDir -> do bytes <- liftIO (fmap GZip.decompress (BS.readFile (toFilePath filePath))) maybePath <- extractCabalFile tempDir (Tar.read bytes) case maybePath of Nothing -> throwM SigInvalidSDistTarBall Just cabalPath -> do pkg <- cabalFilePackageId (tempDir </> cabalPath) run (signPackage url pkg filePath)) where extractCabalFile tempDir (Tar.Next entry entries) = case Tar.entryContent entry of (Tar.NormalFile lbs _) -> case FP.splitFileName (Tar.entryPath entry) of (folder,file) | length (FP.splitDirectories folder) == 1 && FP.takeExtension file == ".cabal" -> do cabalFile <- parseRelFile file liftIO (BS.writeFile (toFilePath (tempDir </> cabalFile)) lbs) return (Just cabalFile) (_,_) -> extractCabalFile tempDir entries _ -> extractCabalFile tempDir entries extractCabalFile _ _ = return Nothing -- | Sign a haskell package with the given url to the signature -- service, a package tarball path (package tarball name) and a lazy -- bytestring of bytes that represent the tarball bytestream. The -- function will write the bytes to the path in a temp dir and sign -- the tarball with GPG.
1,767
true
true
1
21
830
407
199
208
null
null
Vlix/wechat
Web/WeChat/XMLParse.hs
mit
-- strContent' is a version of strContent that ignores all-whitespace text nodes -- when they aren't enclosed in CDATA[] strContent' :: Element -> String strContent' e = concat [ cd | c <- onlyText $ elContent e , let cd = cdData c , not (all isSpace cd) || cdVerbatim c == CDataVerbatim ]
381
strContent' :: Element -> String strContent' e = concat [ cd | c <- onlyText $ elContent e , let cd = cdData c , not (all isSpace cd) || cdVerbatim c == CDataVerbatim ]
260
strContent' e = concat [ cd | c <- onlyText $ elContent e , let cd = cdData c , not (all isSpace cd) || cdVerbatim c == CDataVerbatim ]
227
true
true
0
12
145
80
39
41
null
null
nominolo/haddock2
src/Haddock/Utils.hs
bsd-2-clause
markup m (DocString s) = markupString m s
49
markup m (DocString s) = markupString m s
49
markup m (DocString s) = markupString m s
49
false
false
0
6
15
24
10
14
null
null
ambiata/mafia
Setup.hs
bsd-3-clause
timestamp :: Verbosity -> IO String timestamp verbosity = rawSystemStdout verbosity "date" ["+%Y%m%d%H%M%S"] >>= \s -> case splitAt 14 s of (d, n : []) -> if (length d == 14 && filter isDigit d == d) then return d else fail $ "date has failed to produce the correct format [" <> s <> "]." _ -> fail $ "date has failed to produce a date long enough [" <> s <> "]."
417
timestamp :: Verbosity -> IO String timestamp verbosity = rawSystemStdout verbosity "date" ["+%Y%m%d%H%M%S"] >>= \s -> case splitAt 14 s of (d, n : []) -> if (length d == 14 && filter isDigit d == d) then return d else fail $ "date has failed to produce the correct format [" <> s <> "]." _ -> fail $ "date has failed to produce a date long enough [" <> s <> "]."
417
timestamp verbosity = rawSystemStdout verbosity "date" ["+%Y%m%d%H%M%S"] >>= \s -> case splitAt 14 s of (d, n : []) -> if (length d == 14 && filter isDigit d == d) then return d else fail $ "date has failed to produce the correct format [" <> s <> "]." _ -> fail $ "date has failed to produce a date long enough [" <> s <> "]."
381
false
true
0
15
127
131
66
65
null
null
krystalcode/bloodhound
src/Database/Bloodhound/Types.hs
bsd-3-clause
mkDateHistogram :: FieldName -> Interval -> DateHistogramAggregation mkDateHistogram t i = DateHistogramAggregation t i Nothing Nothing Nothing Nothing Nothing Nothing
167
mkDateHistogram :: FieldName -> Interval -> DateHistogramAggregation mkDateHistogram t i = DateHistogramAggregation t i Nothing Nothing Nothing Nothing Nothing Nothing
167
mkDateHistogram t i = DateHistogramAggregation t i Nothing Nothing Nothing Nothing Nothing Nothing
98
false
true
0
6
19
41
20
21
null
null
glguy/advent2016
Day16-functions.hs
isc
part1, part2 :: Int part1 = 272
31
part1, part2 :: Int part1 = 272
31
part1 = 272
11
false
true
2
6
6
24
9
15
null
null
brendanhay/amqp-bark
bark/src/Bark/Types.hs
bsd-3-clause
-- -- Internal -- name :: B.ByteString -> Category -> Severity -> String name prefix cat sev = B.unpack $ normalise [prefix, cat, sev]
135
name :: B.ByteString -> Category -> Severity -> String name prefix cat sev = B.unpack $ normalise [prefix, cat, sev]
116
name prefix cat sev = B.unpack $ normalise [prefix, cat, sev]
61
true
true
0
7
24
53
29
24
null
null
NorfairKing/super-user-spark
src/SuperUserSpark/Check/Internal.hs
mit
deploymentReadyToDeploy _ = False
33
deploymentReadyToDeploy _ = False
33
deploymentReadyToDeploy _ = False
33
false
false
0
5
3
9
4
5
null
null
nomeata/ghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
emitCmmLitSwitch scrut branches deflt = do scrut' <- assignTemp' scrut join_lbl <- newLabelC deflt_lbl <- label_code join_lbl deflt branches_lbls <- label_branches join_lbl branches emit =<< mk_lit_switch scrut' deflt_lbl (sortBy (comparing fst) branches_lbls) emitLabel join_lbl
319
emitCmmLitSwitch scrut branches deflt = do scrut' <- assignTemp' scrut join_lbl <- newLabelC deflt_lbl <- label_code join_lbl deflt branches_lbls <- label_branches join_lbl branches emit =<< mk_lit_switch scrut' deflt_lbl (sortBy (comparing fst) branches_lbls) emitLabel join_lbl
319
emitCmmLitSwitch scrut branches deflt = do scrut' <- assignTemp' scrut join_lbl <- newLabelC deflt_lbl <- label_code join_lbl deflt branches_lbls <- label_branches join_lbl branches emit =<< mk_lit_switch scrut' deflt_lbl (sortBy (comparing fst) branches_lbls) emitLabel join_lbl
319
false
false
0
12
73
88
38
50
null
null
intolerable/GroupProject
src/Emulator/Memory/Regions.hs
bsd-2-clause
canWrite Unused = False
30
canWrite Unused = False
30
canWrite Unused = False
30
false
false
0
5
10
9
4
5
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x0A33' = "\x0A32\x0A3C"
39
decomposeChar '\x0A33' = "\x0A32\x0A3C"
39
decomposeChar '\x0A33' = "\x0A32\x0A3C"
39
false
false
0
5
3
9
4
5
null
null
bitemyapp/roshask
src/executable/FieldImports.hs
bsd-3-clause
typeDependency _ _ RInt16 = intImport
51
typeDependency _ _ RInt16 = intImport
51
typeDependency _ _ RInt16 = intImport
51
false
false
0
5
19
13
6
7
null
null
trenttobler/hs-asteroids
src/Pt2.hs
bsd-3-clause
maxPt2Dist :: (Ord a, Floating a) => [Pt2 a] -> a maxPt2Dist = foldl' maxDist 0 where maxDist d p = max (ptDist p) d ptDist p = sqrt ( p `dotPt2` p )
162
maxPt2Dist :: (Ord a, Floating a) => [Pt2 a] -> a maxPt2Dist = foldl' maxDist 0 where maxDist d p = max (ptDist p) d ptDist p = sqrt ( p `dotPt2` p )
161
maxPt2Dist = foldl' maxDist 0 where maxDist d p = max (ptDist p) d ptDist p = sqrt ( p `dotPt2` p )
111
false
true
1
9
46
93
44
49
null
null
jsavatgy/hatupist
code/result-tables-02.hs
gpl-2.0
onTimeout gui gsRef = do gs <- readIORef gsRef pt <- getPOSIXTime let t = secondsFrom (startTime gs) pt iCur = iNumber t newGs <- renewTables gui gs t iCur writeIORef gsRef newGs return True
209
onTimeout gui gsRef = do gs <- readIORef gsRef pt <- getPOSIXTime let t = secondsFrom (startTime gs) pt iCur = iNumber t newGs <- renewTables gui gs t iCur writeIORef gsRef newGs return True
209
onTimeout gui gsRef = do gs <- readIORef gsRef pt <- getPOSIXTime let t = secondsFrom (startTime gs) pt iCur = iNumber t newGs <- renewTables gui gs t iCur writeIORef gsRef newGs return True
209
false
false
1
13
53
91
37
54
null
null
JacksonGariety/euler.hs
035.hs
bsd-3-clause
rotate :: [a] -> [a] rotate (x:xs) = xs ++ [x]
46
rotate :: [a] -> [a] rotate (x:xs) = xs ++ [x]
46
rotate (x:xs) = xs ++ [x]
25
false
true
0
6
10
42
22
20
null
null
stephenjbarr/hakyll-bootstrap
Main.hs
mit
index :: Rules () index = do match "index.html" $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "posts/*" getResourceBody >>= applyAsTemplate (indexCtx posts) >>= relativizeUrls
232
index :: Rules () index = do match "index.html" $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "posts/*" getResourceBody >>= applyAsTemplate (indexCtx posts) >>= relativizeUrls
232
index = do match "index.html" $ do route idRoute compile $ do posts <- recentFirst =<< loadAll "posts/*" getResourceBody >>= applyAsTemplate (indexCtx posts) >>= relativizeUrls
214
false
true
0
17
66
79
33
46
null
null
ajm188/99-problems
haskell/lists.hs
mit
-- # 16 dropEvery :: [a] -> Int -> [a] dropEvery xs n = [x | (x, i) <- (zip xs $ cycle [1..n]), i /= n]
103
dropEvery :: [a] -> Int -> [a] dropEvery xs n = [x | (x, i) <- (zip xs $ cycle [1..n]), i /= n]
95
dropEvery xs n = [x | (x, i) <- (zip xs $ cycle [1..n]), i /= n]
64
true
true
0
11
26
74
40
34
null
null
supermitch/learn-haskell
real-world-haskell/ch05/PutJson.hs
mit
renderJValue (JNull) = "null"
29
renderJValue (JNull) = "null"
29
renderJValue (JNull) = "null"
29
false
false
0
5
3
13
6
7
null
null
nevrenato/Hets_Fork
HasCASL/Sublogic.hs
gpl-2.0
-- | minimal sublogic with polymorhism need_polymorphism :: Sublogic need_polymorphism = bottom { has_polymorphism = True }
123
need_polymorphism :: Sublogic need_polymorphism = bottom { has_polymorphism = True }
84
need_polymorphism = bottom { has_polymorphism = True }
54
true
true
0
7
16
27
13
14
null
null
AlexanderPankiv/ghc
compiler/hsSyn/HsBinds.hs
bsd-3-clause
emptyValBindsOut = ValBindsOut [] []
41
emptyValBindsOut = ValBindsOut [] []
41
emptyValBindsOut = ValBindsOut [] []
41
false
false
0
6
9
15
7
8
null
null
koterpillar/tianbar
tests/TestPlugin/DBus/Serialization.hs
mit
simpleVariant TypeObjectPath = (toVariant . unwrapOP) <$> (arbitrary :: Gen WrapObjectPath)
92
simpleVariant TypeObjectPath = (toVariant . unwrapOP) <$> (arbitrary :: Gen WrapObjectPath)
92
simpleVariant TypeObjectPath = (toVariant . unwrapOP) <$> (arbitrary :: Gen WrapObjectPath)
92
false
false
1
8
11
33
15
18
null
null
DatePaper616/code
ToNET.hs
apache-2.0
translateTranslatableTerm (TR_OR y1 y2) = combineOr (translateTerm y1) (translateTerm y2)
90
translateTranslatableTerm (TR_OR y1 y2) = combineOr (translateTerm y1) (translateTerm y2)
90
translateTranslatableTerm (TR_OR y1 y2) = combineOr (translateTerm y1) (translateTerm y2)
90
false
false
0
7
10
34
16
18
null
null
frederickOtus/roguenads
src/Parser.hs
gpl-3.0
identType s | isInt s = TInt (read s) | otherwise = Ident s
67
identType s | isInt s = TInt (read s) | otherwise = Ident s
67
identType s | isInt s = TInt (read s) | otherwise = Ident s
67
false
false
1
8
21
37
16
21
null
null
fedora-haskell/fedora-haskell-tools
fhbz.hs
gpl-3.0
-- final empty whiteboard eaten by lines parseLines [bid, bcomp, bst, bsum] = [BugState bid bcomp bst bsum ""]
110
parseLines [bid, bcomp, bst, bsum] = [BugState bid bcomp bst bsum ""]
69
parseLines [bid, bcomp, bst, bsum] = [BugState bid bcomp bst bsum ""]
69
true
false
0
6
18
36
20
16
null
null
mstksg/auto
src/Control/Auto/Collection.hs
mit
e2m :: Either (a, b) b -> (Maybe a, b) e2m (Left (x, y)) = (Just x , y)
71
e2m :: Either (a, b) b -> (Maybe a, b) e2m (Left (x, y)) = (Just x , y)
71
e2m (Left (x, y)) = (Just x , y)
32
false
true
0
8
18
59
32
27
null
null
gnn/Hets
Proofs/NormalForm.hs
gpl-2.0
normalFormLNS :: [LibName] -> LibEnv -> Result LibEnv normalFormLNS lns libEnv = foldM (\ le ln -> do let dg = lookupDGraph ln le newDg <- normalFormDG le dg return $ Map.insert ln (groupHistory dg normalFormRule newDg) le) libEnv lns
246
normalFormLNS :: [LibName] -> LibEnv -> Result LibEnv normalFormLNS lns libEnv = foldM (\ le ln -> do let dg = lookupDGraph ln le newDg <- normalFormDG le dg return $ Map.insert ln (groupHistory dg normalFormRule newDg) le) libEnv lns
246
normalFormLNS lns libEnv = foldM (\ le ln -> do let dg = lookupDGraph ln le newDg <- normalFormDG le dg return $ Map.insert ln (groupHistory dg normalFormRule newDg) le) libEnv lns
192
false
true
0
13
51
101
47
54
null
null
DavidAlphaFox/ghc
libraries/filepath/System/FilePath/Internal.hs
bsd-3-clause
isPathSeparator '\\' = isWindows
32
isPathSeparator '\\' = isWindows
32
isPathSeparator '\\' = isWindows
32
false
false
0
5
3
9
4
5
null
null
sqd/haskell-C89-interpreter
Parse.hs
mit
splitTopLevelOn :: Eq a => a -> a -> a -> [a] -> [[a]] splitTopLevelOn _ _ _ [] = [[]]
86
splitTopLevelOn :: Eq a => a -> a -> a -> [a] -> [[a]] splitTopLevelOn _ _ _ [] = [[]]
86
splitTopLevelOn _ _ _ [] = [[]]
31
false
true
0
11
20
59
31
28
null
null
chrisbarrett/whippet
test/Language/Whippet/Parser/ParseUtils.hs
bsd-3-clause
int :: Integer -> Expr () int = ELit . LitInt
45
int :: Integer -> Expr () int = ELit . LitInt
45
int = ELit . LitInt
19
false
true
0
8
10
30
13
17
null
null
jtdaugherty/mix-assembler
tests/Tests/MIXWord.hs
bsd-3-clause
testStorage :: Test testStorage = let desc = "Word storage operations affect the stored fields" idx = choose (0, 5) in testProperty desc $ forAll mixInt $ \dest -> forAll mixInt $ \src -> forAll idx $ \lft -> forAll (idx `suchThat` (>= lft)) $ \rght -> -- Given source and destination words and a field -- specification, check that storing bytes from source into -- dest only affect the right fields in dest. let resultW = storeInField srcW (lft, rght) destW destW = toWord dest srcW = toWord src destRange = range (max 1 lft, rght) srcRange = range (max 1 lft + (bytesPerWord-rght), bytesPerWord) fieldPairs = zip srcRange destRange chkInField (srcI, destI) = getByte srcI srcW == getByte destI resultW msg = concat [ "Source word: " ++ show srcW ++ "\n" , "Dest word: " ++ show destW ++ "\n" , "Field: " ++ show (lft, rght) ++ "\n" , "Source field range: " ++ show srcRange ++ "\n" , "Dest field range: " ++ show destRange ++ "\n" , "Result: " ++ show resultW ++ "\n" ] in printTestCase msg $ and [ if lft == 0 then chkInField (0, 0) else True , and (chkInField <$> fieldPairs) ]
1,503
testStorage :: Test testStorage = let desc = "Word storage operations affect the stored fields" idx = choose (0, 5) in testProperty desc $ forAll mixInt $ \dest -> forAll mixInt $ \src -> forAll idx $ \lft -> forAll (idx `suchThat` (>= lft)) $ \rght -> -- Given source and destination words and a field -- specification, check that storing bytes from source into -- dest only affect the right fields in dest. let resultW = storeInField srcW (lft, rght) destW destW = toWord dest srcW = toWord src destRange = range (max 1 lft, rght) srcRange = range (max 1 lft + (bytesPerWord-rght), bytesPerWord) fieldPairs = zip srcRange destRange chkInField (srcI, destI) = getByte srcI srcW == getByte destI resultW msg = concat [ "Source word: " ++ show srcW ++ "\n" , "Dest word: " ++ show destW ++ "\n" , "Field: " ++ show (lft, rght) ++ "\n" , "Source field range: " ++ show srcRange ++ "\n" , "Dest field range: " ++ show destRange ++ "\n" , "Result: " ++ show resultW ++ "\n" ] in printTestCase msg $ and [ if lft == 0 then chkInField (0, 0) else True , and (chkInField <$> fieldPairs) ]
1,503
testStorage = let desc = "Word storage operations affect the stored fields" idx = choose (0, 5) in testProperty desc $ forAll mixInt $ \dest -> forAll mixInt $ \src -> forAll idx $ \lft -> forAll (idx `suchThat` (>= lft)) $ \rght -> -- Given source and destination words and a field -- specification, check that storing bytes from source into -- dest only affect the right fields in dest. let resultW = storeInField srcW (lft, rght) destW destW = toWord dest srcW = toWord src destRange = range (max 1 lft, rght) srcRange = range (max 1 lft + (bytesPerWord-rght), bytesPerWord) fieldPairs = zip srcRange destRange chkInField (srcI, destI) = getByte srcI srcW == getByte destI resultW msg = concat [ "Source word: " ++ show srcW ++ "\n" , "Dest word: " ++ show destW ++ "\n" , "Field: " ++ show (lft, rght) ++ "\n" , "Source field range: " ++ show srcRange ++ "\n" , "Dest field range: " ++ show destRange ++ "\n" , "Result: " ++ show resultW ++ "\n" ] in printTestCase msg $ and [ if lft == 0 then chkInField (0, 0) else True , and (chkInField <$> fieldPairs) ]
1,483
false
true
0
24
624
379
198
181
null
null
acowley/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
kind2 = liftedTypeKind `mkArrowKind` kind1
42
kind2 = liftedTypeKind `mkArrowKind` kind1
42
kind2 = liftedTypeKind `mkArrowKind` kind1
42
false
false
1
5
4
15
7
8
null
null
dimara/ganeti
src/Ganeti/OpCodes.hs
bsd-2-clause
opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s)
63
opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s)
63
opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s)
63
false
false
0
7
10
28
13
15
null
null
erlandsona/cal_haskell
test/DaySpec.hs
mit
main :: IO () main = hspec spec
31
main :: IO () main = hspec spec
31
main = hspec spec
17
false
true
0
6
7
19
9
10
null
null
gmarpons/sepa-debits
Sepa/DirectDebitMessageXML.hs
gpl-3.0
mndtRltdInf :: Mandate -> Node -- ++++ mndtRltdInf m = nodeElem "MndtRltdInf" [mndtId m, dtOfSgntr m]
140
mndtRltdInf :: Mandate -> Node mndtRltdInf m = nodeElem "MndtRltdInf" [mndtId m, dtOfSgntr m]
93
mndtRltdInf m = nodeElem "MndtRltdInf" [mndtId m, dtOfSgntr m]
62
true
true
0
7
54
36
18
18
null
null
calebgregory/fp101x
wk2/disjunction.hs
mit
False || False = False
22
False || False = False
22
False || False = False
22
false
false
0
5
4
16
6
10
null
null
NCrashed/hjass
src/library/Language/Jass/Parser/Lexer.hs
mit
rawCode :: Parser Int rawCode = Tok.lexeme lexer raw <?> "rawcode" where raw = do _ <- char '\'' s <- replicateM 4 anyChar _ <- char '\'' return $ unDigits 256 $ map ord s
202
rawCode :: Parser Int rawCode = Tok.lexeme lexer raw <?> "rawcode" where raw = do _ <- char '\'' s <- replicateM 4 anyChar _ <- char '\'' return $ unDigits 256 $ map ord s
202
rawCode = Tok.lexeme lexer raw <?> "rawcode" where raw = do _ <- char '\'' s <- replicateM 4 anyChar _ <- char '\'' return $ unDigits 256 $ map ord s
180
false
true
1
10
66
94
38
56
null
null
phischu/fragnix
builtins/base/System.IO.hs
bsd-3-clause
-- | The computation 'appendFile' @file str@ function appends the string @str@, -- to the file @file@. -- -- Note that 'writeFile' and 'appendFile' write a literal string -- to a file. To write a value of any printable type, as with 'print', -- use the 'show' function to convert the value to a string first. -- -- > main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]]) appendFile :: FilePath -> String -> IO () appendFile f txt = withFile f AppendMode (\ hdl -> hPutStr hdl txt)
496
appendFile :: FilePath -> String -> IO () appendFile f txt = withFile f AppendMode (\ hdl -> hPutStr hdl txt)
114
appendFile f txt = withFile f AppendMode (\ hdl -> hPutStr hdl txt)
67
true
true
0
9
96
61
33
28
null
null
ameingast/slisp
src/SLISP/Data.hs
bsd-3-clause
fromLispBool (List l) = l /= []
31
fromLispBool (List l) = l /= []
31
fromLispBool (List l) = l /= []
31
false
false
0
7
6
21
10
11
null
null
5outh/Bang
src/Bang/Interface/Drum.hs
mit
muteHighConga :: Music PercussionSound muteHighConga = qd MuteHighConga
71
muteHighConga :: Music PercussionSound muteHighConga = qd MuteHighConga
71
muteHighConga = qd MuteHighConga
32
false
true
0
5
7
17
8
9
null
null
bamboo/sneerkell
src/Sneer/Protocol.hs
lgpl-3.0
ackKeyword :: T.Transit ackKeyword = k "ack"
44
ackKeyword :: T.Transit ackKeyword = k "ack"
44
ackKeyword = k "ack"
20
false
true
0
5
6
16
8
8
null
null
limaner2002/EPC-tools
USACScripts/src/Scripts/FCCForm471Types.hs
bsd-3-clause
checkCosts :: MonthlyCost -> OneTimeCost -> Bool checkCosts monthly oneTime = checkMonthlyEligible && checkOneTimeEligible && checkPreDiscountEligible where oneTimeEligible = oneTime ^? otEligible . _EligibleCost oneTimeQuantity = oneTime ^. otQuantity . to (DollarAmt . fromIntegral) monthlyEligible = monthly ^? mthEligible . _EligibleCost monthlyQuantity = monthly ^. mthQuantity . to (DollarAmt . fromIntegral) checkMonthlyEligible = monthlyEligible > Just 0 checkOneTimeEligible = oneTimeEligible > Just 0 checkPreDiscountEligible = ((+) <$> totalOneTimeEligible <*> totalMonthlyEligible) < Just 9999999999.99 totalOneTimeEligible = fmap (* oneTimeQuantity) oneTimeEligible totalMonthlyEligible = fmap (* monthlyQuantity) monthlyEligible
781
checkCosts :: MonthlyCost -> OneTimeCost -> Bool checkCosts monthly oneTime = checkMonthlyEligible && checkOneTimeEligible && checkPreDiscountEligible where oneTimeEligible = oneTime ^? otEligible . _EligibleCost oneTimeQuantity = oneTime ^. otQuantity . to (DollarAmt . fromIntegral) monthlyEligible = monthly ^? mthEligible . _EligibleCost monthlyQuantity = monthly ^. mthQuantity . to (DollarAmt . fromIntegral) checkMonthlyEligible = monthlyEligible > Just 0 checkOneTimeEligible = oneTimeEligible > Just 0 checkPreDiscountEligible = ((+) <$> totalOneTimeEligible <*> totalMonthlyEligible) < Just 9999999999.99 totalOneTimeEligible = fmap (* oneTimeQuantity) oneTimeEligible totalMonthlyEligible = fmap (* monthlyQuantity) monthlyEligible
781
checkCosts monthly oneTime = checkMonthlyEligible && checkOneTimeEligible && checkPreDiscountEligible where oneTimeEligible = oneTime ^? otEligible . _EligibleCost oneTimeQuantity = oneTime ^. otQuantity . to (DollarAmt . fromIntegral) monthlyEligible = monthly ^? mthEligible . _EligibleCost monthlyQuantity = monthly ^. mthQuantity . to (DollarAmt . fromIntegral) checkMonthlyEligible = monthlyEligible > Just 0 checkOneTimeEligible = oneTimeEligible > Just 0 checkPreDiscountEligible = ((+) <$> totalOneTimeEligible <*> totalMonthlyEligible) < Just 9999999999.99 totalOneTimeEligible = fmap (* oneTimeQuantity) oneTimeEligible totalMonthlyEligible = fmap (* monthlyQuantity) monthlyEligible
732
false
true
4
8
123
200
98
102
null
null
athanclark/sets
src/Data/Set/Ordered/Many.hs
mit
-- | /O(?)/ mapMaybe :: (a -> Maybe b) -> OMSet a -> OMSet b mapMaybe f (OMSet xs) = OMSet (Vector.mapMaybe f xs)
113
mapMaybe :: (a -> Maybe b) -> OMSet a -> OMSet b mapMaybe f (OMSet xs) = OMSet (Vector.mapMaybe f xs)
101
mapMaybe f (OMSet xs) = OMSet (Vector.mapMaybe f xs)
52
true
true
0
8
23
60
29
31
null
null
michaelficarra/purescript
src/Language/PureScript/Docs/Types.hs
mit
takeLocals :: [InPackage a] -> [a] takeLocals = mapMaybe takeLocal
66
takeLocals :: [InPackage a] -> [a] takeLocals = mapMaybe takeLocal
66
takeLocals = mapMaybe takeLocal
31
false
true
0
7
9
27
14
13
null
null
BakerSmithA/Turing
src/Syntax/VariableExpr.hs
bsd-3-clause
-- Parses an expression which evaluates to a tape symbol. symExpr :: ParserM SymExpr symExpr = Read <$ lTok "read" <* lWhitespace <*> tapeExpr <|> SymLit <$> between (char '\'') (lTok "\'") tapeSymbol <|> SymVar <$> expVarId SymType <|> parens symExpr
269
symExpr :: ParserM SymExpr symExpr = Read <$ lTok "read" <* lWhitespace <*> tapeExpr <|> SymLit <$> between (char '\'') (lTok "\'") tapeSymbol <|> SymVar <$> expVarId SymType <|> parens symExpr
211
symExpr = Read <$ lTok "read" <* lWhitespace <*> tapeExpr <|> SymLit <$> between (char '\'') (lTok "\'") tapeSymbol <|> SymVar <$> expVarId SymType <|> parens symExpr
184
true
true
0
13
58
75
36
39
null
null
iemxblog/sivi-haskell
src/Sivi/OpenSCAD.hs
gpl-2.0
oV3 :: V3 Double -> String oV3 (V3 x y z) = "[" ++ showDouble x ++ ", " ++ showDouble y ++ ", " ++ showDouble z ++ "]"
118
oV3 :: V3 Double -> String oV3 (V3 x y z) = "[" ++ showDouble x ++ ", " ++ showDouble y ++ ", " ++ showDouble z ++ "]"
118
oV3 (V3 x y z) = "[" ++ showDouble x ++ ", " ++ showDouble y ++ ", " ++ showDouble z ++ "]"
91
false
true
0
11
29
68
31
37
null
null
brendanhay/gogol
gogol-gmail/gen/Network/Google/Gmail/Types/Product.hs
mpl-2.0
-- | When Gmail will stop sending notifications for mailbox updates (epoch -- millis). Call \`watch\` again before this time to renew the watch. wrExpiration :: Lens' WatchResponse (Maybe Int64) wrExpiration = lens _wrExpiration (\ s a -> s{_wrExpiration = a}) . mapping _Coerce
286
wrExpiration :: Lens' WatchResponse (Maybe Int64) wrExpiration = lens _wrExpiration (\ s a -> s{_wrExpiration = a}) . mapping _Coerce
141
wrExpiration = lens _wrExpiration (\ s a -> s{_wrExpiration = a}) . mapping _Coerce
91
true
true
3
8
51
64
29
35
null
null
jameshsmith/HRL
Server/Gen/Dungeon.hs
mit
pick :: (Functor m, Monad m) => [a] -> StateT StdGen m (Maybe a) pick [] = return Nothing
89
pick :: (Functor m, Monad m) => [a] -> StateT StdGen m (Maybe a) pick [] = return Nothing
89
pick [] = return Nothing
24
false
true
0
10
18
59
28
31
null
null
mightymoose/liquidhaskell
benchmarks/vector-0.10.0.1/Data/Vector/Generic/Mutable.hs
bsd-3-clause
growFront v by = BOUNDS_CHECK(checkLength) "growFront" by $ unsafeGrowFront v by
95
growFront v by = BOUNDS_CHECK(checkLength) "growFront" by $ unsafeGrowFront v by
95
growFront v by = BOUNDS_CHECK(checkLength) "growFront" by $ unsafeGrowFront v by
95
false
false
3
6
25
37
14
23
null
null
Mahdi89/eTeak
src/ParseTree.hs
bsd-3-clause
isNoDeclRef :: [Context Decl] -> Ref -> Bool isNoDeclRef cs ref = isNoDecl $ bindingValue $ findBindingByRef cs ref
119
isNoDeclRef :: [Context Decl] -> Ref -> Bool isNoDeclRef cs ref = isNoDecl $ bindingValue $ findBindingByRef cs ref
115
isNoDeclRef cs ref = isNoDecl $ bindingValue $ findBindingByRef cs ref
70
false
true
0
7
22
43
21
22
null
null
connrs/ffsplitgen
test/UtilitiesSpec.hs
apache-2.0
testSingleItem = TestCase ( assertEqual "Test single item" [] (pairs [0]) )
77
testSingleItem = TestCase ( assertEqual "Test single item" [] (pairs [0]) )
77
testSingleItem = TestCase ( assertEqual "Test single item" [] (pairs [0]) )
77
false
false
0
10
13
30
15
15
null
null