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
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
bsd-3-clause
-- * V1ResourceRule -- | 'v1ResourceRuleApiGroups' Lens v1ResourceRuleApiGroupsL :: Lens_' V1ResourceRule (Maybe [Text]) v1ResourceRuleApiGroupsL f V1ResourceRule{..} = (\v1ResourceRuleApiGroups -> V1ResourceRule { v1ResourceRuleApiGroups, ..} ) <$> f v1ResourceRuleApiGroups
276
v1ResourceRuleApiGroupsL :: Lens_' V1ResourceRule (Maybe [Text]) v1ResourceRuleApiGroupsL f V1ResourceRule{..} = (\v1ResourceRuleApiGroups -> V1ResourceRule { v1ResourceRuleApiGroups, ..} ) <$> f v1ResourceRuleApiGroups
219
v1ResourceRuleApiGroupsL f V1ResourceRule{..} = (\v1ResourceRuleApiGroups -> V1ResourceRule { v1ResourceRuleApiGroups, ..} ) <$> f v1ResourceRuleApiGroups
154
true
true
1
8
27
65
33
32
null
null
gridaphobe/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
isCIrredEvCan _ = False
38
isCIrredEvCan _ = False
38
isCIrredEvCan _ = False
38
false
false
0
5
18
9
4
5
null
null
freizl/hoauth2
hoauth2-example/src/Session.hs
bsd-3-clause
lookupKey :: CacheStore -> IDPLabel -> ExceptT IDPLabel IO IDPData lookupKey store idpKey = ExceptT $ do m1 <- tryReadMVar store return $ maybe (Left ("unknown IDP " <> idpKey)) Right (Map.lookup idpKey =<< m1)
220
lookupKey :: CacheStore -> IDPLabel -> ExceptT IDPLabel IO IDPData lookupKey store idpKey = ExceptT $ do m1 <- tryReadMVar store return $ maybe (Left ("unknown IDP " <> idpKey)) Right (Map.lookup idpKey =<< m1)
220
lookupKey store idpKey = ExceptT $ do m1 <- tryReadMVar store return $ maybe (Left ("unknown IDP " <> idpKey)) Right (Map.lookup idpKey =<< m1)
147
false
true
0
13
44
84
40
44
null
null
sgillespie/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
mkBoxedTupleStr :: Arity -> String mkBoxedTupleStr 0 = "()"
60
mkBoxedTupleStr :: Arity -> String mkBoxedTupleStr 0 = "()"
60
mkBoxedTupleStr 0 = "()"
25
false
true
0
5
9
18
9
9
null
null
ghc-android/ghc
compiler/nativeGen/RegAlloc/Linear/Main.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- Top level of the register allocator -- Allocate registers regAlloc :: (Outputable instr, Instruction instr) => DynFlags -> LiveCmmDecl statics instr -> UniqSM ( NatCmmDecl statics instr , Maybe Int -- number of extra stack slots required, -- beyond maxSpillSlots , Maybe RegAllocStats) regAlloc _ (CmmData sec d) = return ( CmmData sec d , Nothing , Nothing )
601
regAlloc :: (Outputable instr, Instruction instr) => DynFlags -> LiveCmmDecl statics instr -> UniqSM ( NatCmmDecl statics instr , Maybe Int -- number of extra stack slots required, -- beyond maxSpillSlots , Maybe RegAllocStats) regAlloc _ (CmmData sec d) = return ( CmmData sec d , Nothing , Nothing )
457
regAlloc _ (CmmData sec d) = return ( CmmData sec d , Nothing , Nothing )
129
true
true
0
10
219
97
51
46
null
null
brendanhay/gogol
gogol-cloudkms/gen/Network/Google/Resource/CloudKMS/Projects/Locations/KeyRings/CryptoKeys/CryptoKeyVersions/Restore.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). plkrckckvrUploadType :: Lens' ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestore (Maybe Text) plkrckckvrUploadType = lens _plkrckckvrUploadType (\ s a -> s{_plkrckckvrUploadType = a})
271
plkrckckvrUploadType :: Lens' ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersionsRestore (Maybe Text) plkrckckvrUploadType = lens _plkrckckvrUploadType (\ s a -> s{_plkrckckvrUploadType = a})
200
plkrckckvrUploadType = lens _plkrckckvrUploadType (\ s a -> s{_plkrckckvrUploadType = a})
97
true
true
0
8
34
49
25
24
null
null
kim/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types.hs
mpl-2.0
-- | The current configuration information for the streaming distribution. sdStreamingDistributionConfig :: Lens' StreamingDistribution StreamingDistributionConfig sdStreamingDistributionConfig = lens _sdStreamingDistributionConfig (\s a -> s { _sdStreamingDistributionConfig = a })
294
sdStreamingDistributionConfig :: Lens' StreamingDistribution StreamingDistributionConfig sdStreamingDistributionConfig = lens _sdStreamingDistributionConfig (\s a -> s { _sdStreamingDistributionConfig = a })
219
sdStreamingDistributionConfig = lens _sdStreamingDistributionConfig (\s a -> s { _sdStreamingDistributionConfig = a })
130
true
true
0
9
39
40
22
18
null
null
eriksvedang/Carp
src/RenderDocs.hs
mpl-2.0
saveDocsForEnv :: Project -> [String] -> (SymPath, Env) -> IO () saveDocsForEnv ctx moduleNames (pathToEnv, env) = do let SymPath _ moduleName = pathToEnv dir = projectDocsDir ctx fullPath = dir ++ "/" ++ moduleName ++ ".html" string = renderHtml (envToHtml env ctx (show pathToEnv) moduleNames) createDirectoryIfMissing False dir writeFile fullPath string
395
saveDocsForEnv :: Project -> [String] -> (SymPath, Env) -> IO () saveDocsForEnv ctx moduleNames (pathToEnv, env) = do let SymPath _ moduleName = pathToEnv dir = projectDocsDir ctx fullPath = dir ++ "/" ++ moduleName ++ ".html" string = renderHtml (envToHtml env ctx (show pathToEnv) moduleNames) createDirectoryIfMissing False dir writeFile fullPath string
395
saveDocsForEnv ctx moduleNames (pathToEnv, env) = do let SymPath _ moduleName = pathToEnv dir = projectDocsDir ctx fullPath = dir ++ "/" ++ moduleName ++ ".html" string = renderHtml (envToHtml env ctx (show pathToEnv) moduleNames) createDirectoryIfMissing False dir writeFile fullPath string
330
false
true
0
15
90
137
66
71
null
null
Frefreak/Gideon
src/XML/Character.hs
bsd-3-clause
marketOrdersUrl :: Params -> String marketOrdersUrl = composeXMLUrl "char/MarketOrders.xml.aspx"
96
marketOrdersUrl :: Params -> String marketOrdersUrl = composeXMLUrl "char/MarketOrders.xml.aspx"
96
marketOrdersUrl = composeXMLUrl "char/MarketOrders.xml.aspx"
60
false
true
0
5
8
18
9
9
null
null
pascal-knodel/haskell-craft
_/links/E'5'22.hs
mit
onSeparateLines :: [String] -> String onSeparateLines xs = [ c | x <- xs, c <- (x ++ "\n")]
94
onSeparateLines :: [String] -> String onSeparateLines xs = [ c | x <- xs, c <- (x ++ "\n")]
94
onSeparateLines xs = [ c | x <- xs, c <- (x ++ "\n")]
56
false
true
0
10
21
53
26
27
null
null
wavewave/lhc-analysis-collection
analysis/2013-07-26_prospino.hs
gpl-3.0
datalst :: [ (Double,Double) ] datalst = [ (mg,mn) | mg <- [ 200,250..1500 ], mn <- [ 50,100..mg-50] ]
102
datalst :: [ (Double,Double) ] datalst = [ (mg,mn) | mg <- [ 200,250..1500 ], mn <- [ 50,100..mg-50] ]
102
datalst = [ (mg,mn) | mg <- [ 200,250..1500 ], mn <- [ 50,100..mg-50] ]
71
false
true
0
10
19
72
39
33
null
null
kcsongor/generic-lens
generic-optics/src/Data/Generics/Internal/Optics.hs
bsd-3-clause
normaliseLens :: Lens s t a b -> Lens s t a b normaliseLens l = withLens l (\_get _set -> lens _get _set)
105
normaliseLens :: Lens s t a b -> Lens s t a b normaliseLens l = withLens l (\_get _set -> lens _get _set)
105
normaliseLens l = withLens l (\_get _set -> lens _get _set)
59
false
true
0
8
23
62
28
34
null
null
kolmodin/cabal
cabal-install/Distribution/Client/ProjectConfig/Legacy.hs
bsd-3-clause
programLocationsFieldDescrs :: [FieldDescr ConfigFlags] programLocationsFieldDescrs = commandOptionsToFields $ programConfigurationPaths' (++ "-location") defaultProgramDb ParseArgs configProgramPaths (\paths conf -> conf { configProgramPaths = paths })
296
programLocationsFieldDescrs :: [FieldDescr ConfigFlags] programLocationsFieldDescrs = commandOptionsToFields $ programConfigurationPaths' (++ "-location") defaultProgramDb ParseArgs configProgramPaths (\paths conf -> conf { configProgramPaths = paths })
296
programLocationsFieldDescrs = commandOptionsToFields $ programConfigurationPaths' (++ "-location") defaultProgramDb ParseArgs configProgramPaths (\paths conf -> conf { configProgramPaths = paths })
240
false
true
2
9
65
66
31
35
null
null
jeremyong/Yaiba
Yaiba/Map.hs
bsd-3-clause
-- | /O(n)/. Partition the map according to a predicate. The first -- map contains all elements that satisfy the predicate, the second all -- elements that fail the predicate. See also 'split'. -- -- > partition (> "a") (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", singleton 5 "a") -- > partition (< "x") (fromList [(5,"a"), (3,"b")]) == (fromList [(3, "b"), (5, "a")], empty) -- > partition (> "x") (fromList [(5,"a"), (3,"b")]) == (empty, fromList [(3, "b"), (5, "a")]) partition :: Ord k => (a -> Bool) -> Map k a -> (Map k a,Map k a) partition p m = partitionWithKey (\_ x -> p x) m
595
partition :: Ord k => (a -> Bool) -> Map k a -> (Map k a,Map k a) partition p m = partitionWithKey (\_ x -> p x) m
116
partition p m = partitionWithKey (\_ x -> p x) m
50
true
true
0
11
110
89
46
43
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/fromEnum_2.hs
mit
primDivNatS0 x y MyTrue = Succ (primDivNatS (primMinusNatS x y) (Succ y))
73
primDivNatS0 x y MyTrue = Succ (primDivNatS (primMinusNatS x y) (Succ y))
73
primDivNatS0 x y MyTrue = Succ (primDivNatS (primMinusNatS x y) (Succ y))
73
false
false
0
9
11
38
18
20
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
happyReduce_308 = happySpecReduce_3 97# happyReduction_308
58
happyReduce_308 = happySpecReduce_3 97# happyReduction_308
58
happyReduce_308 = happySpecReduce_3 97# happyReduction_308
58
false
false
0
5
4
11
5
6
null
null
GaloisInc/linux-ptrace
System/Linux/Ptrace/Syscall.hs
mit
optionCode :: Option -> DataArg optionCode TraceSysGood = 0x01
62
optionCode :: Option -> DataArg optionCode TraceSysGood = 0x01
62
optionCode TraceSysGood = 0x01
30
false
true
0
7
8
24
10
14
null
null
shayan-najd/MiniLava
Lava/Library/Patterns.hs
bsd-3-clause
bfly n circ = ilv (bfly (n-1) circ) ->- twoN (n-1) circ
55
bfly n circ = ilv (bfly (n-1) circ) ->- twoN (n-1) circ
55
bfly n circ = ilv (bfly (n-1) circ) ->- twoN (n-1) circ
55
false
false
0
10
11
45
22
23
null
null
gbaz/cabal
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs
bsd-3-clause
-- | Cycles through setup dependencies -- -- The first cycle is unsolvable: package A has a setup dependency on B, -- B has a regular dependency on A, and we only have a single version available -- for both. -- -- The second cycle can be broken by picking different versions: package C-2.0 -- has a setup dependency on D, and D has a regular dependency on C-*. However, -- version C-1.0 is already available (perhaps it didn't have this setup dep). -- Thus, we should be able to break this cycle even if we are installing package -- E, which explictly depends on C-2.0. db15 :: ExampleDb db15 = [ -- First example (real cycle, no solution) Right $ exAv "A" 1 [] `withSetupDeps` [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] -- Second example (cycle can be broken by picking versions carefully) , Left $ exInst "C" 1 "C-1-inst" [] , Right $ exAv "C" 2 [] `withSetupDeps` [ExAny "D"] , Right $ exAv "D" 1 [ExAny "C" ] , Right $ exAv "E" 1 [ExFix "C" 2] ]
1,064
db15 :: ExampleDb db15 = [ -- First example (real cycle, no solution) Right $ exAv "A" 1 [] `withSetupDeps` [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] -- Second example (cycle can be broken by picking versions carefully) , Left $ exInst "C" 1 "C-1-inst" [] , Right $ exAv "C" 2 [] `withSetupDeps` [ExAny "D"] , Right $ exAv "D" 1 [ExAny "C" ] , Right $ exAv "E" 1 [ExFix "C" 2] ]
494
db15 = [ -- First example (real cycle, no solution) Right $ exAv "A" 1 [] `withSetupDeps` [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] -- Second example (cycle can be broken by picking versions carefully) , Left $ exInst "C" 1 "C-1-inst" [] , Right $ exAv "C" 2 [] `withSetupDeps` [ExAny "D"] , Right $ exAv "D" 1 [ExAny "C" ] , Right $ exAv "E" 1 [ExFix "C" 2] ]
476
true
true
0
10
296
167
90
77
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\x2FA18' = "\x9EFE"
34
decomposeChar '\x2FA18' = "\x9EFE"
34
decomposeChar '\x2FA18' = "\x9EFE"
34
false
false
1
5
3
13
4
9
null
null
hkupty/aura
src/Aura/Languages.hs
gpl-3.0
-- \32 langFromEnv :: String -> Language langFromEnv = \case "ja" -> Japanese "pl" -> Polish "hr" -> Croatian "sv" -> Swedish "de" -> German "es" -> Spanish "pt" -> Portuguese "fr" -> French "ru" -> Russian "it" -> Italian "sr" -> Serbian "nb" -> Norwegian "id" -> Indonesia _ -> English ---------------------- -- Aura/Core functions ---------------------- -- NEEDS TRANSLATION
438
langFromEnv :: String -> Language langFromEnv = \case "ja" -> Japanese "pl" -> Polish "hr" -> Croatian "sv" -> Swedish "de" -> German "es" -> Spanish "pt" -> Portuguese "fr" -> French "ru" -> Russian "it" -> Italian "sr" -> Serbian "nb" -> Norwegian "id" -> Indonesia _ -> English ---------------------- -- Aura/Core functions ---------------------- -- NEEDS TRANSLATION
430
langFromEnv = \case "ja" -> Japanese "pl" -> Polish "hr" -> Croatian "sv" -> Swedish "de" -> German "es" -> Spanish "pt" -> Portuguese "fr" -> French "ru" -> Russian "it" -> Italian "sr" -> Serbian "nb" -> Norwegian "id" -> Indonesia _ -> English ---------------------- -- Aura/Core functions ---------------------- -- NEEDS TRANSLATION
396
true
true
2
5
120
66
56
10
null
null
jystic/river
src/River/Core/Transform/Copy.hs
bsd-3-clause
removeStaleBindings :: Ord n => [n] -> Map n (Atom n a) -> Map n (Atom n a) removeStaleBindings ns env = let names = Set.fromList ns -- k is bound to one of the names which we are about to bind bound k = Set.member k names -- v references one of the names which we are about to bind references v = case v of Variable _ n -> Set.member n names Immediate _ _ -> False stale (k, v) = bound k || references v in Map.filterWithKey (curry $ not . stale) env
546
removeStaleBindings :: Ord n => [n] -> Map n (Atom n a) -> Map n (Atom n a) removeStaleBindings ns env = let names = Set.fromList ns -- k is bound to one of the names which we are about to bind bound k = Set.member k names -- v references one of the names which we are about to bind references v = case v of Variable _ n -> Set.member n names Immediate _ _ -> False stale (k, v) = bound k || references v in Map.filterWithKey (curry $ not . stale) env
546
removeStaleBindings ns env = let names = Set.fromList ns -- k is bound to one of the names which we are about to bind bound k = Set.member k names -- v references one of the names which we are about to bind references v = case v of Variable _ n -> Set.member n names Immediate _ _ -> False stale (k, v) = bound k || references v in Map.filterWithKey (curry $ not . stale) env
470
false
true
0
13
190
176
85
91
null
null
maciej-bendkowski/LCCLUtils
src/Memo.hs
mit
idx :: Tree a -> Int -> a idx (Tree _ x _) 0 = x
52
idx :: Tree a -> Int -> a idx (Tree _ x _) 0 = x
48
idx (Tree _ x _) 0 = x
22
false
true
0
10
19
43
19
24
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 24794 = 5487
32
getValueFromProduct 24794 = 5487
32
getValueFromProduct 24794 = 5487
32
false
false
0
5
3
9
4
5
null
null
taksuyu/marktime
marktime/Parser.hs
bsd-3-clause
stopOpts :: Parser MarktimeCommand stopOpts = fmap StopCommand $ pure StopOpts <*> int64Argument (metavar "KEY" <> help "Stop a task by it's key.")
155
stopOpts :: Parser MarktimeCommand stopOpts = fmap StopCommand $ pure StopOpts <*> int64Argument (metavar "KEY" <> help "Stop a task by it's key.")
155
stopOpts = fmap StopCommand $ pure StopOpts <*> int64Argument (metavar "KEY" <> help "Stop a task by it's key.")
120
false
true
3
8
30
48
22
26
null
null
timtylin/scholdoc-citeproc
src/Text/CSL/Proc/Disamb.hs
bsd-3-clause
same :: Eq a => [a] -> [Bool] same l = map (`elem` dupl) l where dupl = catMaybes . snd . macc [] $ l macc = mapAccumL $ \a x -> if x `elem` a then (a,Just x) else (x:a,Nothing)
259
same :: Eq a => [a] -> [Bool] same l = map (`elem` dupl) l where dupl = catMaybes . snd . macc [] $ l macc = mapAccumL $ \a x -> if x `elem` a then (a,Just x) else (x:a,Nothing)
259
same l = map (`elem` dupl) l where dupl = catMaybes . snd . macc [] $ l macc = mapAccumL $ \a x -> if x `elem` a then (a,Just x) else (x:a,Nothing)
229
false
true
0
10
123
122
65
57
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/ExtensionPredicates.hs
bsd-3-clause
-- | Is the <https://www.opengl.org/registry/specs/ARB/texture_barrier.txt ARB_texture_barrier> extension supported? -- Note that in the presence of multiple contexts with different capabilities, -- this might be wrong. Use 'glGetARBTextureBarrier' in those cases instead. gl_ARB_texture_barrier :: Bool gl_ARB_texture_barrier = member "GL_ARB_texture_barrier" extensions
371
gl_ARB_texture_barrier :: Bool gl_ARB_texture_barrier = member "GL_ARB_texture_barrier" extensions
98
gl_ARB_texture_barrier = member "GL_ARB_texture_barrier" extensions
67
true
true
0
5
38
19
11
8
null
null
google/codeworld
codeworld-api/src/CodeWorld/Color.hs
apache-2.0
darker :: Double -> Color -> Color darker d = lighter (- d)
59
darker :: Double -> Color -> Color darker d = lighter (- d)
59
darker d = lighter (- d)
24
false
true
0
7
12
30
15
15
null
null
Chobbes/Flochastic
Flochastic/Main.hs
mit
removeEnv :: String -> LaTeX -> LaTeX removeEnv env = texmap isEnv (const TeXEmpty) where isEnv e = case e of (TeXEnv texEnv _ _) -> texEnv == env _ -> False -- | Render LaTeX cards.
226
removeEnv :: String -> LaTeX -> LaTeX removeEnv env = texmap isEnv (const TeXEmpty) where isEnv e = case e of (TeXEnv texEnv _ _) -> texEnv == env _ -> False -- | Render LaTeX cards.
226
removeEnv env = texmap isEnv (const TeXEmpty) where isEnv e = case e of (TeXEnv texEnv _ _) -> texEnv == env _ -> False -- | Render LaTeX cards.
188
false
true
0
9
80
74
37
37
null
null
ingemaradahl/bilder
src/Compiler/Lifter.hs
lgpl-3.0
findSFunDecl (SType _ s) = findSFunDecl s
41
findSFunDecl (SType _ s) = findSFunDecl s
41
findSFunDecl (SType _ s) = findSFunDecl s
41
false
false
0
7
6
20
9
11
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Protocol.hs
bsd-3-clause
parseQueryResult (IfThenElseL8Float _ _ _) (IfThenElseFloatReply r) = Just $ ExprRight $ lit r
94
parseQueryResult (IfThenElseL8Float _ _ _) (IfThenElseFloatReply r) = Just $ ExprRight $ lit r
94
parseQueryResult (IfThenElseL8Float _ _ _) (IfThenElseFloatReply r) = Just $ ExprRight $ lit r
94
false
false
0
7
13
38
18
20
null
null
phaazon/bifunctors
src/Data/Bifunctor/Apply.hs
bsd-2-clause
(<<$>>) :: (a -> b) -> a -> b (<<$>>) = id
42
(<<$>>) :: (a -> b) -> a -> b (<<$>>) = id
42
(<<$>>) = id
12
false
true
0
8
11
37
19
18
null
null
keithodulaigh/Hets
HasCASL/AsUtils.hs
gpl-2.0
-- | get the type variable getTypeVar :: TypeArg -> Id getTypeVar (TypeArg v _ _ _ _ _ _) = v
93
getTypeVar :: TypeArg -> Id getTypeVar (TypeArg v _ _ _ _ _ _) = v
66
getTypeVar (TypeArg v _ _ _ _ _ _) = v
38
true
true
0
9
21
43
20
23
null
null
tjakway/ghcjvm
compiler/utils/IOEnv.hs
bsd-3-clause
tryIOEnvFailure :: IO a -> IO (Either IOEnvFailure a) tryIOEnvFailure = try
75
tryIOEnvFailure :: IO a -> IO (Either IOEnvFailure a) tryIOEnvFailure = try
75
tryIOEnvFailure = try
21
false
true
0
8
11
29
14
15
null
null
TomMD/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
appK :: Kind -> Kind -> Kind appK = AppT
40
appK :: Kind -> Kind -> Kind appK = AppT
40
appK = AppT
11
false
true
0
6
9
19
10
9
null
null
bogwonch/SecPAL
src/Logic/SecPAL/DatalogC.hs
gpl-3.0
toEnt :: SP.D -> E toEnt (SP.Zero) = k0
43
toEnt :: SP.D -> E toEnt (SP.Zero) = k0
43
toEnt (SP.Zero) = k0
24
false
true
0
9
12
31
14
17
null
null
vikraman/ghc
compiler/stranal/DmdAnal.hs
bsd-3-clause
getStrictness :: AnalEnv -> Id -> StrictSig getStrictness env fn | isGlobalId fn = idStrictness fn | Just (sig, _) <- lookupSigEnv env fn = sig | otherwise = nopSig
220
getStrictness :: AnalEnv -> Id -> StrictSig getStrictness env fn | isGlobalId fn = idStrictness fn | Just (sig, _) <- lookupSigEnv env fn = sig | otherwise = nopSig
220
getStrictness env fn | isGlobalId fn = idStrictness fn | Just (sig, _) <- lookupSigEnv env fn = sig | otherwise = nopSig
176
false
true
1
10
85
73
34
39
null
null
hot-leaf-juice/gotta-go-fast
src/GottaGoFast.hs
bsd-3-clause
applyBackspaceWord :: State -> State applyBackspaceWord s = s {input = reverse . drop n . reverse $ input s} where n = toWordBeginning . reverse $ input s toWordBeginning "" = 0 toWordBeginning [c] = 1 toWordBeginning (x:y:ys) | not (isSpace x) && isSpace y = 1 | otherwise = 1 + toWordBeginning (y : ys)
334
applyBackspaceWord :: State -> State applyBackspaceWord s = s {input = reverse . drop n . reverse $ input s} where n = toWordBeginning . reverse $ input s toWordBeginning "" = 0 toWordBeginning [c] = 1 toWordBeginning (x:y:ys) | not (isSpace x) && isSpace y = 1 | otherwise = 1 + toWordBeginning (y : ys)
334
applyBackspaceWord s = s {input = reverse . drop n . reverse $ input s} where n = toWordBeginning . reverse $ input s toWordBeginning "" = 0 toWordBeginning [c] = 1 toWordBeginning (x:y:ys) | not (isSpace x) && isSpace y = 1 | otherwise = 1 + toWordBeginning (y : ys)
297
false
true
5
11
86
144
71
73
null
null
brendanhay/gogol
gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/AuthorizedCertificates/Delete.hs
mpl-2.0
-- | JSONP aacdCallback :: Lens' AppsAuthorizedCertificatesDelete (Maybe Text) aacdCallback = lens _aacdCallback (\ s a -> s{_aacdCallback = a})
146
aacdCallback :: Lens' AppsAuthorizedCertificatesDelete (Maybe Text) aacdCallback = lens _aacdCallback (\ s a -> s{_aacdCallback = a})
135
aacdCallback = lens _aacdCallback (\ s a -> s{_aacdCallback = a})
67
true
true
1
9
21
52
25
27
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/nativeGen/X86/Instr.hs
bsd-3-clause
i386_insert_ffrees :: [GenBasicBlock Instr] -> [GenBasicBlock Instr] i386_insert_ffrees blocks | any (any is_G_instr) [ instrs | BasicBlock _ instrs <- blocks ] = map insertGFREEs blocks | otherwise = blocks where insertGFREEs (BasicBlock id insns) = BasicBlock id (insertBeforeNonlocalTransfers GFREE insns)
346
i386_insert_ffrees :: [GenBasicBlock Instr] -> [GenBasicBlock Instr] i386_insert_ffrees blocks | any (any is_G_instr) [ instrs | BasicBlock _ instrs <- blocks ] = map insertGFREEs blocks | otherwise = blocks where insertGFREEs (BasicBlock id insns) = BasicBlock id (insertBeforeNonlocalTransfers GFREE insns)
345
i386_insert_ffrees blocks | any (any is_G_instr) [ instrs | BasicBlock _ instrs <- blocks ] = map insertGFREEs blocks | otherwise = blocks where insertGFREEs (BasicBlock id insns) = BasicBlock id (insertBeforeNonlocalTransfers GFREE insns)
260
false
true
0
12
78
111
52
59
null
null
nilcons/lens-datetime
Data/Time/Lens.hs
bsd-3-clause
-- | View 'Day' as a triple of (year,month,day) in Gregorian calendar. -- -- See the description at the definition of 'fromGregorian' / 'toGregorian'. gregorianDate :: Iso' Day (Integer,Int,Int) gregorianDate = iso toGregorian (\(y,m,d) -> fromGregorian y m d)
260
gregorianDate :: Iso' Day (Integer,Int,Int) gregorianDate = iso toGregorian (\(y,m,d) -> fromGregorian y m d)
109
gregorianDate = iso toGregorian (\(y,m,d) -> fromGregorian y m d)
65
true
true
1
8
38
62
33
29
null
null
rubik/stack
src/Stack/PackageDump.hs
bsd-3-clause
stripPrefixText :: Text -> Text -> Maybe Text stripPrefixText x y | x `T.isPrefixOf` y = Just $ T.drop (T.length x) y | otherwise = Nothing
147
stripPrefixText :: Text -> Text -> Maybe Text stripPrefixText x y | x `T.isPrefixOf` y = Just $ T.drop (T.length x) y | otherwise = Nothing
147
stripPrefixText x y | x `T.isPrefixOf` y = Just $ T.drop (T.length x) y | otherwise = Nothing
101
false
true
1
10
33
68
33
35
null
null
travitch/gtk-traymanager
src/Graphics/UI/Gtk/Misc/TrayManager.hs
lgpl-2.1
connect_OBJECT_STRING_INT64_INT64__NONE :: (GObjectClass a', GObjectClass obj) => SignalName -> ConnectAfter -> obj -> (a' -> String -> Int64 -> Int64 -> IO ()) -> IO (ConnectId obj) connect_OBJECT_STRING_INT64_INT64__NONE signal after obj user = connectGeneric signal after obj action where action :: Ptr GObject -> Ptr GObject -> CString -> Int64 -> Int64 -> IO () action _ obj1 str2 int3 int4 = failOnGError $ makeNewGObject (GObject, objectUnrefFromMainloop) (return obj1) >>= \obj1' -> peekUTFString str2 >>= \str2' -> user (unsafeCastGObject obj1') str2' int3 int4
821
connect_OBJECT_STRING_INT64_INT64__NONE :: (GObjectClass a', GObjectClass obj) => SignalName -> ConnectAfter -> obj -> (a' -> String -> Int64 -> Int64 -> IO ()) -> IO (ConnectId obj) connect_OBJECT_STRING_INT64_INT64__NONE signal after obj user = connectGeneric signal after obj action where action :: Ptr GObject -> Ptr GObject -> CString -> Int64 -> Int64 -> IO () action _ obj1 str2 int3 int4 = failOnGError $ makeNewGObject (GObject, objectUnrefFromMainloop) (return obj1) >>= \obj1' -> peekUTFString str2 >>= \str2' -> user (unsafeCastGObject obj1') str2' int3 int4
821
connect_OBJECT_STRING_INT64_INT64__NONE signal after obj user = connectGeneric signal after obj action where action :: Ptr GObject -> Ptr GObject -> CString -> Int64 -> Int64 -> IO () action _ obj1 str2 int3 int4 = failOnGError $ makeNewGObject (GObject, objectUnrefFromMainloop) (return obj1) >>= \obj1' -> peekUTFString str2 >>= \str2' -> user (unsafeCastGObject obj1') str2' int3 int4
423
false
true
2
16
333
213
102
111
null
null
shlevy/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
gcoerceto FF32 = empty
22
gcoerceto FF32 = empty
22
gcoerceto FF32 = empty
22
false
false
1
5
3
13
4
9
null
null
rueshyna/gogol
gogol-adexchange-seller/gen/Network/Google/AdExchangeSeller/Types/Product.hs
mpl-2.0
-- | The names of the metrics which the dimension or metric this reporting -- metadata entry describes requires to also be present in order for the -- report to be valid. Omitting these will not cause an error or warning, -- but may result in data which cannot be correctly interpreted. rmeRequiredMetrics :: Lens' ReportingMetadataEntry [Text] rmeRequiredMetrics = lens _rmeRequiredMetrics (\ s a -> s{_rmeRequiredMetrics = a}) . _Default . _Coerce
469
rmeRequiredMetrics :: Lens' ReportingMetadataEntry [Text] rmeRequiredMetrics = lens _rmeRequiredMetrics (\ s a -> s{_rmeRequiredMetrics = a}) . _Default . _Coerce
182
rmeRequiredMetrics = lens _rmeRequiredMetrics (\ s a -> s{_rmeRequiredMetrics = a}) . _Default . _Coerce
124
true
true
0
11
91
56
31
25
null
null
pparkkin/eta
compiler/ETA/TypeCheck/TcGenDeriv.hs
bsd-3-clause
wrapOpBackquotes :: String -> String wrapOpBackquotes s | isSym s = s | otherwise = '`' : s ++ "`"
119
wrapOpBackquotes :: String -> String wrapOpBackquotes s | isSym s = s | otherwise = '`' : s ++ "`"
119
wrapOpBackquotes s | isSym s = s | otherwise = '`' : s ++ "`"
82
false
true
0
8
40
44
20
24
null
null
jmitchell/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v (LSExt (ITFixed from) ITBig) [x] = v ++ "MKBIGSI(vm, (" ++ signedTy from ++ ")" ++ creg x ++ "->info.bits" ++ show (nativeTyWidth from) ++ ")"
153
doOp v (LSExt (ITFixed from) ITBig) [x] = v ++ "MKBIGSI(vm, (" ++ signedTy from ++ ")" ++ creg x ++ "->info.bits" ++ show (nativeTyWidth from) ++ ")"
153
doOp v (LSExt (ITFixed from) ITBig) [x] = v ++ "MKBIGSI(vm, (" ++ signedTy from ++ ")" ++ creg x ++ "->info.bits" ++ show (nativeTyWidth from) ++ ")"
153
false
false
0
11
31
73
35
38
null
null
emptylambda/BLT
src/BLT.hs
gpl-3.0
typecheck = Typecheck { file = "" &= typFile &= argPos 0 } &= help "Parse & Typecheck Boogie program (No split or Prove)"
140
typecheck = Typecheck { file = "" &= typFile &= argPos 0 } &= help "Parse & Typecheck Boogie program (No split or Prove)"
140
typecheck = Typecheck { file = "" &= typFile &= argPos 0 } &= help "Parse & Typecheck Boogie program (No split or Prove)"
140
false
false
0
9
42
32
16
16
null
null
glennrfisher/cis194-haskell
03 Recursion and Polymorphism/Golf.hs
mit
---------------------------------------------- -- 1. Hopscotch ---------------------------------------------- -- Transform a list into a list of lists, where the nth list of the output -- contains every nth element from the input list. -- -- > skips "ABCD" == ["ABCD", "BD", "C", "D"] -- > skips "hello!" == ["hello!", "el!", "l!", "l", "o", "!"] -- > skips [1] == [[1]] -- > skips [True, False] == [[True, False], [False]] -- > skips [] == [] skips :: [a] -> [[a]] skips xs = [each i xs | i <- [1..length xs]]
512
skips :: [a] -> [[a]] skips xs = [each i xs | i <- [1..length xs]]
66
skips xs = [each i xs | i <- [1..length xs]]
44
true
true
0
9
89
62
38
24
null
null
bitemyapp/ghc
compiler/main/DriverPipeline.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- In each phase, we need to know into what filename to generate the -- output. All the logic about which filenames we generate output -- into is embodied in the following function. phaseOutputFilename :: Phase{-next phase-} -> CompPipeline FilePath phaseOutputFilename next_phase = do PipeEnv{stop_phase, src_basename, output_spec} <- getPipeEnv PipeState{maybe_loc, hsc_env} <- getPipeState let dflags = hsc_dflags hsc_env liftIO $ getOutputFilename stop_phase output_spec src_basename dflags next_phase maybe_loc
635
phaseOutputFilename :: Phase{-next phase-} -> CompPipeline FilePath phaseOutputFilename next_phase = do PipeEnv{stop_phase, src_basename, output_spec} <- getPipeEnv PipeState{maybe_loc, hsc_env} <- getPipeState let dflags = hsc_dflags hsc_env liftIO $ getOutputFilename stop_phase output_spec src_basename dflags next_phase maybe_loc
370
phaseOutputFilename next_phase = do PipeEnv{stop_phase, src_basename, output_spec} <- getPipeEnv PipeState{maybe_loc, hsc_env} <- getPipeState let dflags = hsc_dflags hsc_env liftIO $ getOutputFilename stop_phase output_spec src_basename dflags next_phase maybe_loc
302
true
true
0
11
107
97
48
49
null
null
karamellpelle/grid
designer/source/File/Binary/Reader.hs
gpl-3.0
word8sAsWord32 :: Word8 -> Word8 -> Word8 -> Word8 -> Word32 word8sAsWord32 w0 w1 w2 w3 = #ifdef PLATFORM_LE (shiftL (fI w0) 0) .|. (shiftL (fI w1) 8) .|. (shiftL (fI w2) 16) .|. (shiftL (fI w3) 24)
220
word8sAsWord32 :: Word8 -> Word8 -> Word8 -> Word8 -> Word32 word8sAsWord32 w0 w1 w2 w3 = #ifdef PLATFORM_LE (shiftL (fI w0) 0) .|. (shiftL (fI w1) 8) .|. (shiftL (fI w2) 16) .|. (shiftL (fI w3) 24)
220
word8sAsWord32 w0 w1 w2 w3 = #ifdef PLATFORM_LE (shiftL (fI w0) 0) .|. (shiftL (fI w1) 8) .|. (shiftL (fI w2) 16) .|. (shiftL (fI w3) 24)
159
false
true
3
10
59
117
57
60
null
null
lpeterse/koka
src/Core/Parse.hs
apache-2.0
extract params msg = case params of [] -> return typeUnit [(name,tp)] | name == nameNil -> return tp _ -> if all (\(name,_) -> name == nameNil) params then return (TApp (typeTuple (length params)) (map snd params)) else fail msg
281
extract params msg = case params of [] -> return typeUnit [(name,tp)] | name == nameNil -> return tp _ -> if all (\(name,_) -> name == nameNil) params then return (TApp (typeTuple (length params)) (map snd params)) else fail msg
281
extract params msg = case params of [] -> return typeUnit [(name,tp)] | name == nameNil -> return tp _ -> if all (\(name,_) -> name == nameNil) params then return (TApp (typeTuple (length params)) (map snd params)) else fail msg
281
false
false
0
15
93
125
63
62
null
null
clarissalittler/pi-calculus
Tin.hs
mit
interpSeq :: [Stmt] -> Interp () interpSeq = mapM_ interpStmt
61
interpSeq :: [Stmt] -> Interp () interpSeq = mapM_ interpStmt
61
interpSeq = mapM_ interpStmt
28
false
true
0
8
9
32
14
18
null
null
parapluu/encore
src/ir/AST/Desugarer.hs
bsd-3-clause
desugar FunctionCall{emeta, qname = QName{qnlocal = Name "print"} ,args = [arg]} = Print emeta Stdout [StringLiteral emeta "{}", arg]
157
desugar FunctionCall{emeta, qname = QName{qnlocal = Name "print"} ,args = [arg]} = Print emeta Stdout [StringLiteral emeta "{}", arg]
157
desugar FunctionCall{emeta, qname = QName{qnlocal = Name "print"} ,args = [arg]} = Print emeta Stdout [StringLiteral emeta "{}", arg]
157
false
false
1
9
42
67
33
34
null
null
rimmington/cabal
cabal-install/Distribution/Client/Targets.hs
bsd-3-clause
pkgSpecifierConstraints (SpecificSourcePackage pkg) = [LabeledPackageConstraint pc ConstraintSourceUserTarget] where pc = PackageConstraintVersion (packageName pkg) (thisVersion (packageVersion pkg)) -- ------------------------------------------------------------ -- * Parsing and checking user targets -- ------------------------------------------------------------
387
pkgSpecifierConstraints (SpecificSourcePackage pkg) = [LabeledPackageConstraint pc ConstraintSourceUserTarget] where pc = PackageConstraintVersion (packageName pkg) (thisVersion (packageVersion pkg)) -- ------------------------------------------------------------ -- * Parsing and checking user targets -- ------------------------------------------------------------
387
pkgSpecifierConstraints (SpecificSourcePackage pkg) = [LabeledPackageConstraint pc ConstraintSourceUserTarget] where pc = PackageConstraintVersion (packageName pkg) (thisVersion (packageVersion pkg)) -- ------------------------------------------------------------ -- * Parsing and checking user targets -- ------------------------------------------------------------
387
false
false
1
9
47
63
29
34
null
null
sampou-org/pfad
Code/Code09.hs
bsd-3-clause
knows :: Person -> Person -> Bool knows = undefined
51
knows :: Person -> Person -> Bool knows = undefined
51
knows = undefined
17
false
true
0
6
9
19
10
9
null
null
niteria/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
ppr_mono_ty _ (HsAppsTy {}) _ _ = error "ppr_mono_ty HsAppsTy"
76
ppr_mono_ty _ (HsAppsTy {}) _ _ = error "ppr_mono_ty HsAppsTy"
76
ppr_mono_ty _ (HsAppsTy {}) _ _ = error "ppr_mono_ty HsAppsTy"
76
false
false
0
7
23
25
12
13
null
null
kuribas/diagrams-contrib
src/Diagrams/TwoD/Layout/CirclePacking.hs
bsd-3-clause
-- | A safe approximation. Calculates the outer radius of the smallest -- axis-aligned polygon with the given number of edges that contains the -- object. A parameter of 4 up to 8 should be sufficient for most applications. approxRadius :: (Monoid' m, Floating (N b), Real (N b), Ord (N b)) => Int -> RadiusFunction b m approxRadius n = if n < 3 then error "circleRadius: n needs to be at least 3" else \o -> outByIn * maximum [ toFractional (envelopeS (e alpha) o) | i <- [1..n] , let alpha = (fromIntegral i + 0.5) / fromIntegral n @@ turn ] -- incircle radius: a / (2 * tan (tau/n)) -- outcircle radius: a / (2 * sin (tau /n)) -- hence factor is : out/in = tan (tau/n) / sin (tau/n) where outByIn = Prelude.tan (pi / (2 * fromIntegral n)) / sin (pi / (2 * fromIntegral n)) -- -- | An unsafe approximation. This is the radius of the largest circle that -- fits in the rectangular bounding box of the object, so it may be too small. -- It is, however, exact for circles, and there is no function that is safe for -- all diagrams and exact for circles.
1,160
approxRadius :: (Monoid' m, Floating (N b), Real (N b), Ord (N b)) => Int -> RadiusFunction b m approxRadius n = if n < 3 then error "circleRadius: n needs to be at least 3" else \o -> outByIn * maximum [ toFractional (envelopeS (e alpha) o) | i <- [1..n] , let alpha = (fromIntegral i + 0.5) / fromIntegral n @@ turn ] -- incircle radius: a / (2 * tan (tau/n)) -- outcircle radius: a / (2 * sin (tau /n)) -- hence factor is : out/in = tan (tau/n) / sin (tau/n) where outByIn = Prelude.tan (pi / (2 * fromIntegral n)) / sin (pi / (2 * fromIntegral n)) -- -- | An unsafe approximation. This is the radius of the largest circle that -- fits in the rectangular bounding box of the object, so it may be too small. -- It is, however, exact for circles, and there is no function that is safe for -- all diagrams and exact for circles.
936
approxRadius n = if n < 3 then error "circleRadius: n needs to be at least 3" else \o -> outByIn * maximum [ toFractional (envelopeS (e alpha) o) | i <- [1..n] , let alpha = (fromIntegral i + 0.5) / fromIntegral n @@ turn ] -- incircle radius: a / (2 * tan (tau/n)) -- outcircle radius: a / (2 * sin (tau /n)) -- hence factor is : out/in = tan (tau/n) / sin (tau/n) where outByIn = Prelude.tan (pi / (2 * fromIntegral n)) / sin (pi / (2 * fromIntegral n)) -- -- | An unsafe approximation. This is the radius of the largest circle that -- fits in the rectangular bounding box of the object, so it may be too small. -- It is, however, exact for circles, and there is no function that is safe for -- all diagrams and exact for circles.
840
true
true
0
18
315
224
118
106
null
null
spacekitteh/smcghc
compiler/main/DynFlags.hs
bsd-3-clause
rtsIsProfiled :: Bool rtsIsProfiled = unsafeDupablePerformIO rtsIsProfiledIO /= 0
81
rtsIsProfiled :: Bool rtsIsProfiled = unsafeDupablePerformIO rtsIsProfiledIO /= 0
81
rtsIsProfiled = unsafeDupablePerformIO rtsIsProfiledIO /= 0
59
false
true
0
6
8
25
10
15
null
null
trxeste/wrk
haskell/TrabalhoIA/docs/astar_documented.hs
bsd-3-clause
astarSearch :: (Eq a, Hashable a) => a -- startNode: the node to start the search from -> (a -> Bool) -- isGoalNode: a function to test if a node is the goal node -> (a -> [(a, Int)]) -- nextNodeFn: a function which calculates the next nodes for a current node -- along with the costs of moving from the current node to the next nodes -> (a -> Int) -- heuristic: a function which calculates the (approximate) cost of moving -- from a node to the nearest goal node -> Maybe (Int, [a]) -- result: Nothing is no path is found else -- Just (path cost, path as a list of nodes) astarSearch startNode isGoalNode nextNodeFn heuristic = astar (PQ.singleton (heuristic startNode) (startNode, 0)) Set.empty (Map.singleton startNode 0) Map.empty where -- pq: open set, seen: closed set, tracks: tracks of states astar pq seen gscore tracks -- If open set is empty then search has failed. Return Nothing | PQ.null pq = Nothing -- If goal node reached then construct the path from the tracks and node | isGoalNode node = Just (gcost, findPath tracks node) -- If node has already been seen then discard it and continue | Set.member node seen = astar pq' seen gscore tracks -- Else expand the node and continue | otherwise = astar pq'' seen' gscore' tracks' where -- Find the node with min f-cost (node, gcost) = snd . PQ.findMin $ pq -- Delete the node from open set pq' = PQ.deleteMin pq -- Add the node to the closed set seen' = Set.insert node seen -- Find the successors (with their g and h costs) of the node -- which have not been seen yet successors = filter (\(s, g, _) -> not (Set.member s seen') && (not (s `Map.member` gscore) || g < (fromJust . Map.lookup s $ gscore))) $ successorsAndCosts node gcost -- Insert the successors in the open set pq'' = foldl' (\q (s, g, h) -> PQ.insert (g + h) (s, g) q) pq' successors gscore' = foldl' (\m (s, g, _) -> Map.insert s g m) gscore successors -- Insert the tracks of the successors tracks' = foldl' (\m (s, _, _) -> Map.insert s node m) tracks successors -- Finds the successors of a given node and their costs successorsAndCosts node gcost = map (\(s, g) -> (s, gcost + g, heuristic s)) . nextNodeFn $ node -- Constructs the path from the tracks and last node findPath tracks node = if Map.member node tracks then findPath tracks (fromJust . Map.lookup node $ tracks) ++ [node] else [node]
2,774
astarSearch :: (Eq a, Hashable a) => a -- startNode: the node to start the search from -> (a -> Bool) -- isGoalNode: a function to test if a node is the goal node -> (a -> [(a, Int)]) -- nextNodeFn: a function which calculates the next nodes for a current node -- along with the costs of moving from the current node to the next nodes -> (a -> Int) -- heuristic: a function which calculates the (approximate) cost of moving -- from a node to the nearest goal node -> Maybe (Int, [a]) astarSearch startNode isGoalNode nextNodeFn heuristic = astar (PQ.singleton (heuristic startNode) (startNode, 0)) Set.empty (Map.singleton startNode 0) Map.empty where -- pq: open set, seen: closed set, tracks: tracks of states astar pq seen gscore tracks -- If open set is empty then search has failed. Return Nothing | PQ.null pq = Nothing -- If goal node reached then construct the path from the tracks and node | isGoalNode node = Just (gcost, findPath tracks node) -- If node has already been seen then discard it and continue | Set.member node seen = astar pq' seen gscore tracks -- Else expand the node and continue | otherwise = astar pq'' seen' gscore' tracks' where -- Find the node with min f-cost (node, gcost) = snd . PQ.findMin $ pq -- Delete the node from open set pq' = PQ.deleteMin pq -- Add the node to the closed set seen' = Set.insert node seen -- Find the successors (with their g and h costs) of the node -- which have not been seen yet successors = filter (\(s, g, _) -> not (Set.member s seen') && (not (s `Map.member` gscore) || g < (fromJust . Map.lookup s $ gscore))) $ successorsAndCosts node gcost -- Insert the successors in the open set pq'' = foldl' (\q (s, g, h) -> PQ.insert (g + h) (s, g) q) pq' successors gscore' = foldl' (\m (s, g, _) -> Map.insert s g m) gscore successors -- Insert the tracks of the successors tracks' = foldl' (\m (s, _, _) -> Map.insert s node m) tracks successors -- Finds the successors of a given node and their costs successorsAndCosts node gcost = map (\(s, g) -> (s, gcost + g, heuristic s)) . nextNodeFn $ node -- Constructs the path from the tracks and last node findPath tracks node = if Map.member node tracks then findPath tracks (fromJust . Map.lookup node $ tracks) ++ [node] else [node]
2,659
astarSearch startNode isGoalNode nextNodeFn heuristic = astar (PQ.singleton (heuristic startNode) (startNode, 0)) Set.empty (Map.singleton startNode 0) Map.empty where -- pq: open set, seen: closed set, tracks: tracks of states astar pq seen gscore tracks -- If open set is empty then search has failed. Return Nothing | PQ.null pq = Nothing -- If goal node reached then construct the path from the tracks and node | isGoalNode node = Just (gcost, findPath tracks node) -- If node has already been seen then discard it and continue | Set.member node seen = astar pq' seen gscore tracks -- Else expand the node and continue | otherwise = astar pq'' seen' gscore' tracks' where -- Find the node with min f-cost (node, gcost) = snd . PQ.findMin $ pq -- Delete the node from open set pq' = PQ.deleteMin pq -- Add the node to the closed set seen' = Set.insert node seen -- Find the successors (with their g and h costs) of the node -- which have not been seen yet successors = filter (\(s, g, _) -> not (Set.member s seen') && (not (s `Map.member` gscore) || g < (fromJust . Map.lookup s $ gscore))) $ successorsAndCosts node gcost -- Insert the successors in the open set pq'' = foldl' (\q (s, g, h) -> PQ.insert (g + h) (s, g) q) pq' successors gscore' = foldl' (\m (s, g, _) -> Map.insert s g m) gscore successors -- Insert the tracks of the successors tracks' = foldl' (\m (s, _, _) -> Map.insert s node m) tracks successors -- Finds the successors of a given node and their costs successorsAndCosts node gcost = map (\(s, g) -> (s, gcost + g, heuristic s)) . nextNodeFn $ node -- Constructs the path from the tracks and last node findPath tracks node = if Map.member node tracks then findPath tracks (fromJust . Map.lookup node $ tracks) ++ [node] else [node]
2,081
true
true
8
18
875
558
315
243
null
null
JacquesCarette/literate-scientific-software
code/drasil-gool/GOOL/Drasil/State.hs
bsd-2-clause
lensFStoVS :: Lens' (GOOLState, FileState) ((((GOOLState, FileState), ClassState), MethodState), ValueState) lensFStoVS = lens getVSfromFS setVSfromFS
152
lensFStoVS :: Lens' (GOOLState, FileState) ((((GOOLState, FileState), ClassState), MethodState), ValueState) lensFStoVS = lens getVSfromFS setVSfromFS
152
lensFStoVS = lens getVSfromFS setVSfromFS
41
false
true
0
10
16
57
31
26
null
null
ruicc/websocket-min
src/Main.hs
mit
getClientState cid (target@(ClientState cid' _ _) : css) | cid == cid' = target | otherwise = getClientState cid css
126
getClientState cid (target@(ClientState cid' _ _) : css) | cid == cid' = target | otherwise = getClientState cid css
126
getClientState cid (target@(ClientState cid' _ _) : css) | cid == cid' = target | otherwise = getClientState cid css
126
false
false
0
10
29
55
26
29
null
null
nau/lasca-compiler
src/lib/Lasca/Lexer.hs
bsd-3-clause
stringLiteral :: Parser Text stringLiteral = do char '"' l <- manyTill L.charLiteral (char '"') return $ T.pack l
125
stringLiteral :: Parser Text stringLiteral = do char '"' l <- manyTill L.charLiteral (char '"') return $ T.pack l
125
stringLiteral = do char '"' l <- manyTill L.charLiteral (char '"') return $ T.pack l
96
false
true
1
11
30
56
23
33
null
null
spechub/Hets
TPTP/Pretty.hs
gpl-2.0
andD :: Doc andD = text "&"
27
andD :: Doc andD = text "&"
27
andD = text "&"
15
false
true
0
5
6
14
7
7
null
null
jameysharp/lotos
LOTOS/Trace.hs
gpl-2.0
traceBehavior (Synchronization b1 b2) = (synchronizeTrace (const True) `on` traceBehavior) b1 b2
96
traceBehavior (Synchronization b1 b2) = (synchronizeTrace (const True) `on` traceBehavior) b1 b2
96
traceBehavior (Synchronization b1 b2) = (synchronizeTrace (const True) `on` traceBehavior) b1 b2
96
false
false
0
10
11
40
20
20
null
null
darthdeus/scheme
src/Scheme/Parser/Combinators.hs
mit
-- Vytvori parser pro jeden znak, ktery splnuje dany predikat. satisfies :: (Char -> Bool) -> Parser Char satisfies p = do c <- anyChar if p c then return c else failed $ "unexpected char: " ++ [c] -- Parser daneho znaku.
235
satisfies :: (Char -> Bool) -> Parser Char satisfies p = do c <- anyChar if p c then return c else failed $ "unexpected char: " ++ [c] -- Parser daneho znaku.
172
satisfies p = do c <- anyChar if p c then return c else failed $ "unexpected char: " ++ [c] -- Parser daneho znaku.
129
true
true
0
10
56
70
34
36
null
null
llelf/prose
tests/Tests.hs
bsd-3-clause
main = defaultMain tests
24
main = defaultMain tests
24
main = defaultMain tests
24
false
false
1
5
3
12
4
8
null
null
iatorm/grime
Matcher.hs
mit
matches (Fixed e) r = matches e r
33
matches (Fixed e) r = matches e r
33
matches (Fixed e) r = matches e r
33
false
false
0
7
7
22
10
12
null
null
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/API/AuthorizationV1.hs
bsd-3-clause
-- *** getAPIResources -- | @GET \/apis\/authorization.k8s.io\/v1\/@ -- -- get available resources -- -- AuthMethod: 'AuthApiKeyBearerToken' -- getAPIResources :: Accept accept -- ^ request accept ('MimeType') -> KubernetesRequest GetAPIResources MimeNoContent V1APIResourceList accept getAPIResources _ = _mkRequest "GET" ["/apis/authorization.k8s.io/v1/"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
431
getAPIResources :: Accept accept -- ^ request accept ('MimeType') -> KubernetesRequest GetAPIResources MimeNoContent V1APIResourceList accept getAPIResources _ = _mkRequest "GET" ["/apis/authorization.k8s.io/v1/"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
283
getAPIResources _ = _mkRequest "GET" ["/apis/authorization.k8s.io/v1/"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
136
true
true
0
8
58
72
39
33
null
null
andrewMacmurray/haskell-book-solutions
src/ch20/Library.hs
mit
minimum' :: (Foldable t, Ord a) => t a -> Maybe a minimum' = compare'' min
74
minimum' :: (Foldable t, Ord a) => t a -> Maybe a minimum' = compare'' min
74
minimum' = compare'' min
24
false
true
0
7
15
39
19
20
null
null
vTurbine/ghc
compiler/utils/FastString.hs
bsd-3-clause
nilFS :: FastString nilFS = mkFastString ""
43
nilFS :: FastString nilFS = mkFastString ""
43
nilFS = mkFastString ""
23
false
true
0
6
6
20
8
12
null
null
gwright83/Wheeler
src/Math/Symbolic/Wheeler/Canonicalize.hs
bsd-3-clause
constantPart Undefined = Undefined
42
constantPart Undefined = Undefined
42
constantPart Undefined = Undefined
42
false
false
0
5
11
9
4
5
null
null
gridaphobe/ghc
libraries/ghc-boot/GHC/PackageDb.hs
bsd-3-clause
getHeader :: Get (Word32, Word32) getHeader = do magic <- getByteString (BS.length headerMagic) when (magic /= headerMagic) $ fail "not a ghc-pkg db file, wrong file magic number" majorVersion <- get :: Get Word32 -- The major version is for incompatible changes minorVersion <- get :: Get Word32 -- The minor version is for compatible extensions when (majorVersion /= 1) $ fail "unsupported ghc-pkg db format version" -- If we ever support multiple major versions then we'll have to change -- this code -- The header can be extended without incrementing the major version, -- we ignore fields we don't know about (currently all). headerExtraLen <- get :: Get Word32 skip (fromIntegral headerExtraLen) return (majorVersion, minorVersion)
810
getHeader :: Get (Word32, Word32) getHeader = do magic <- getByteString (BS.length headerMagic) when (magic /= headerMagic) $ fail "not a ghc-pkg db file, wrong file magic number" majorVersion <- get :: Get Word32 -- The major version is for incompatible changes minorVersion <- get :: Get Word32 -- The minor version is for compatible extensions when (majorVersion /= 1) $ fail "unsupported ghc-pkg db format version" -- If we ever support multiple major versions then we'll have to change -- this code -- The header can be extended without incrementing the major version, -- we ignore fields we don't know about (currently all). headerExtraLen <- get :: Get Word32 skip (fromIntegral headerExtraLen) return (majorVersion, minorVersion)
810
getHeader = do magic <- getByteString (BS.length headerMagic) when (magic /= headerMagic) $ fail "not a ghc-pkg db file, wrong file magic number" majorVersion <- get :: Get Word32 -- The major version is for incompatible changes minorVersion <- get :: Get Word32 -- The minor version is for compatible extensions when (majorVersion /= 1) $ fail "unsupported ghc-pkg db format version" -- If we ever support multiple major versions then we'll have to change -- this code -- The header can be extended without incrementing the major version, -- we ignore fields we don't know about (currently all). headerExtraLen <- get :: Get Word32 skip (fromIntegral headerExtraLen) return (majorVersion, minorVersion)
776
false
true
0
11
188
147
72
75
null
null
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
rapiGroup :: String rapiGroup = Runtime.daemonGroup (DaemonGroup GanetiRapi)
76
rapiGroup :: String rapiGroup = Runtime.daemonGroup (DaemonGroup GanetiRapi)
76
rapiGroup = Runtime.daemonGroup (DaemonGroup GanetiRapi)
56
false
true
0
7
7
22
11
11
null
null
snowleopard/alga
src/Algebra/Graph/NonEmpty/AdjacencyMap.hs
mit
-- | The number of vertices in a graph. -- Complexity: /O(1)/ time. -- -- @ -- vertexCount ('vertex' x) == 1 -- vertexCount == 'length' . 'vertexList' -- vertexCount x \< vertexCount y ==> x \< y -- @ vertexCount :: AdjacencyMap a -> Int vertexCount = coerce AM.vertexCount
300
vertexCount :: AdjacencyMap a -> Int vertexCount = coerce AM.vertexCount
72
vertexCount = coerce AM.vertexCount
35
true
true
0
6
76
31
19
12
null
null
formrre/yi
yi-core/src/Yi/Buffer/TextUnit.hs
gpl-2.0
-- | unitSepThisLine is true for any kind of whitespace/separator on this line only unitSepThisLine :: TextUnit unitSepThisLine = GenUnit Line atSepBoundary
156
unitSepThisLine :: TextUnit unitSepThisLine = GenUnit Line atSepBoundary
72
unitSepThisLine = GenUnit Line atSepBoundary
44
true
true
0
5
21
17
9
8
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F30.hs
bsd-3-clause
ptr_glVertexAttrib3sNV :: FunPtr (GLuint -> GLshort -> GLshort -> GLshort -> IO ()) ptr_glVertexAttrib3sNV = unsafePerformIO $ getCommand "glVertexAttrib3sNV"
158
ptr_glVertexAttrib3sNV :: FunPtr (GLuint -> GLshort -> GLshort -> GLshort -> IO ()) ptr_glVertexAttrib3sNV = unsafePerformIO $ getCommand "glVertexAttrib3sNV"
158
ptr_glVertexAttrib3sNV = unsafePerformIO $ getCommand "glVertexAttrib3sNV"
74
false
true
0
12
18
45
22
23
null
null
uwap/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reifyApp :: IState -> Name -> [Term] -> ElabD PTactic reifyApp ist t [l, r] | t == reflm "Try" = liftM2 Try (reify ist l) (reify ist r)
135
reifyApp :: IState -> Name -> [Term] -> ElabD PTactic reifyApp ist t [l, r] | t == reflm "Try" = liftM2 Try (reify ist l) (reify ist r)
135
reifyApp ist t [l, r] | t == reflm "Try" = liftM2 Try (reify ist l) (reify ist r)
81
false
true
0
9
28
78
38
40
null
null
tjhunter/karps
haskell/src/Spark/Core/Internal/RowUtils.hs
apache-2.0
-- Returns an error message if something wrong is found _checkCell :: DataType -> Cell -> Maybe Text _checkCell dt c = case (dt, c) of (NullableType _, Empty) -> Nothing (StrictType _, Empty) -> pure $ sformat ("Expected a strict value of type "%sh%" but no value") dt (StrictType sdt, x) -> _checkCell' sdt x (NullableType sdt, x) -> _checkCell' sdt x -- Returns an error message if something wrong is found
421
_checkCell :: DataType -> Cell -> Maybe Text _checkCell dt c = case (dt, c) of (NullableType _, Empty) -> Nothing (StrictType _, Empty) -> pure $ sformat ("Expected a strict value of type "%sh%" but no value") dt (StrictType sdt, x) -> _checkCell' sdt x (NullableType sdt, x) -> _checkCell' sdt x -- Returns an error message if something wrong is found
365
_checkCell dt c = case (dt, c) of (NullableType _, Empty) -> Nothing (StrictType _, Empty) -> pure $ sformat ("Expected a strict value of type "%sh%" but no value") dt (StrictType sdt, x) -> _checkCell' sdt x (NullableType sdt, x) -> _checkCell' sdt x -- Returns an error message if something wrong is found
320
true
true
0
12
85
129
67
62
null
null
massysett/penny
penny/lib/Penny/Copper/Decopperize.hs
bsd-3-clause
dNextPosting :: NextPosting Char a -> (a, Trio.Trio, Seq (PostingFieldDecop a)) dNextPosting (NextPosting _ _ _ p) = dPosting p
131
dNextPosting :: NextPosting Char a -> (a, Trio.Trio, Seq (PostingFieldDecop a)) dNextPosting (NextPosting _ _ _ p) = dPosting p
131
dNextPosting (NextPosting _ _ _ p) = dPosting p
47
false
true
0
11
23
63
30
33
null
null
urbanslug/ghc
libraries/base/Data/Typeable/Internal.hs
bsd-3-clause
showArgs sep (a:as) = showsPrec 10 a . sep . showArgs sep as
60
showArgs sep (a:as) = showsPrec 10 a . sep . showArgs sep as
60
showArgs sep (a:as) = showsPrec 10 a . sep . showArgs sep as
60
false
false
0
7
12
38
17
21
null
null
froden/digipostarkiv
src/Api.hs
apache-2.0
getRequest :: (MonadThrow m, Functor m) => Session -> String -> m Request getRequest session url = addHeader acceptDigipost <$> setSession session <$> parseUrl url
163
getRequest :: (MonadThrow m, Functor m) => Session -> String -> m Request getRequest session url = addHeader acceptDigipost <$> setSession session <$> parseUrl url
163
getRequest session url = addHeader acceptDigipost <$> setSession session <$> parseUrl url
89
false
true
0
8
24
59
28
31
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/min_1.hs
mit
esEsOrdering EQ GT = MyFalse
28
esEsOrdering EQ GT = MyFalse
28
esEsOrdering EQ GT = MyFalse
28
false
false
1
5
4
16
5
11
null
null
Athas/banko
bankotrav/src/Bankotrav/Base.hs
bsd-2-clause
validColumnSignatures :: [ColumnSignature] validColumnSignatures = [ (3, 0, 6) , (2, 2, 5) , (1, 4, 4) , (0, 6, 3) ]
212
validColumnSignatures :: [ColumnSignature] validColumnSignatures = [ (3, 0, 6) , (2, 2, 5) , (1, 4, 4) , (0, 6, 3) ]
212
validColumnSignatures = [ (3, 0, 6) , (2, 2, 5) , (1, 4, 4) , (0, 6, 3) ]
169
false
true
0
6
117
62
40
22
null
null
folivetti/BIGDATA
Bibliotecas/Vector.hs
mit
reshape :: Int -> Vector a -> Matrix a reshape n [] = []
56
reshape :: Int -> Vector a -> Matrix a reshape n [] = []
56
reshape n [] = []
17
false
true
0
9
13
39
17
22
null
null
green-haskell/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
-- Not sure which! dataName = DataName
42
dataName = DataName
22
dataName = DataName
22
true
false
0
4
10
7
4
3
null
null
BlairArchibald/bones
lib/src/Bones/Skeletons/BranchAndBound/HdpH/Sequential.hs
bsd-3-clause
-- Assumes any global space state is already initialised search :: Bool -> BBNode a b s -> BAndBFunctions g a b s -> Par a search pl root@(ssol, sbnd, _) fns = do io $ addToRegistry solutionKey (ssol, sbnd) io $ addToRegistry boundKey sbnd space <- io $ getGlobalSearchSpace expand pl space root fns io $ fst <$> readFromRegistry solutionKey
351
search :: Bool -> BBNode a b s -> BAndBFunctions g a b s -> Par a search pl root@(ssol, sbnd, _) fns = do io $ addToRegistry solutionKey (ssol, sbnd) io $ addToRegistry boundKey sbnd space <- io $ getGlobalSearchSpace expand pl space root fns io $ fst <$> readFromRegistry solutionKey
294
search pl root@(ssol, sbnd, _) fns = do io $ addToRegistry solutionKey (ssol, sbnd) io $ addToRegistry boundKey sbnd space <- io $ getGlobalSearchSpace expand pl space root fns io $ fst <$> readFromRegistry solutionKey
228
true
true
14
6
70
121
63
58
null
null
matterhorn-chat/matterhorn
test/test_messages.hs
bsd-3-clause
moveDownTestMultipleSkipDeleted :: TestTree moveDownTestMultipleSkipDeleted = testProperty "Move down in multiple messages skipping deleteds" $ \(w', x', y', z') -> let [w, x, y, z] = setDateOrderMessages [ postMsg w' , delMsg x' , delMsg y' , postMsg z'] msgs = makeMsgs [w, x, y, z] msgid = getNextPostId (messagePostId w) msgs -- for useful info on failure: idents = postids "wxyz" msgs info = idents <> " against " <> show msgid in counterexample info $ (messagePostId z) == msgid
880
moveDownTestMultipleSkipDeleted :: TestTree moveDownTestMultipleSkipDeleted = testProperty "Move down in multiple messages skipping deleteds" $ \(w', x', y', z') -> let [w, x, y, z] = setDateOrderMessages [ postMsg w' , delMsg x' , delMsg y' , postMsg z'] msgs = makeMsgs [w, x, y, z] msgid = getNextPostId (messagePostId w) msgs -- for useful info on failure: idents = postids "wxyz" msgs info = idents <> " against " <> show msgid in counterexample info $ (messagePostId z) == msgid
880
moveDownTestMultipleSkipDeleted = testProperty "Move down in multiple messages skipping deleteds" $ \(w', x', y', z') -> let [w, x, y, z] = setDateOrderMessages [ postMsg w' , delMsg x' , delMsg y' , postMsg z'] msgs = makeMsgs [w, x, y, z] msgid = getNextPostId (messagePostId w) msgs -- for useful info on failure: idents = postids "wxyz" msgs info = idents <> " against " <> show msgid in counterexample info $ (messagePostId z) == msgid
836
false
true
0
13
475
166
88
78
null
null
jtojnar/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/PrimopWrappers.hs
bsd-3-clause
writeWord16OffAddr# :: Addr# -> Int# -> Word# -> State# s -> State# s writeWord16OffAddr# a1 a2 a3 a4 = (GHC.Prim.writeWord16OffAddr#) a1 a2 a3 a4
146
writeWord16OffAddr# :: Addr# -> Int# -> Word# -> State# s -> State# s writeWord16OffAddr# a1 a2 a3 a4 = (GHC.Prim.writeWord16OffAddr#) a1 a2 a3 a4
146
writeWord16OffAddr# a1 a2 a3 a4 = (GHC.Prim.writeWord16OffAddr#) a1 a2 a3 a4
76
false
true
0
9
23
57
28
29
null
null
kvelicka/frag
src/BSP.hs
gpl-2.0
toFloats :: (Real a) => [a] -> [Float] toFloats a = map realToFrac a
69
toFloats :: (Real a) => [a] -> [Float] toFloats a = map realToFrac a
68
toFloats a = map realToFrac a
29
false
true
0
9
14
44
21
23
null
null
NicolasDP/hs-smtp
tests/Arbitrary.hs
bsd-3-clause
arbitraryPath :: Gen Path arbitraryPath = Path <$> (repeatGen (0, 8) arbitraryDomainPart) <*> arbitraryEmailAddress
123
arbitraryPath :: Gen Path arbitraryPath = Path <$> (repeatGen (0, 8) arbitraryDomainPart) <*> arbitraryEmailAddress
123
arbitraryPath = Path <$> (repeatGen (0, 8) arbitraryDomainPart) <*> arbitraryEmailAddress
97
false
true
5
7
21
41
21
20
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
ostensibly = id
15
ostensibly = id
15
ostensibly = id
15
false
false
0
4
2
6
3
3
null
null
ntenczar/PitcherClusterViz
Player.hs
mit
knComp :: Player -> Player -> Double knComp p1 p2 = sq $ (kn p1) - (kn p2)
74
knComp :: Player -> Player -> Double knComp p1 p2 = sq $ (kn p1) - (kn p2)
74
knComp p1 p2 = sq $ (kn p1) - (kn p2)
37
false
true
0
8
17
50
23
27
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Elements.hs
bsd-3-clause
defBr ∷ Br defBr = Br Nothing Nothing
37
defBr ∷ Br defBr = Br Nothing Nothing
37
defBr = Br Nothing Nothing
26
false
true
0
6
7
23
9
14
null
null
input-output-hk/pos-haskell-prototype
core/test/Test/Pos/Core/Gen.hs
mit
-- slow genMerkleTree :: Bi a => Gen a -> Gen (MerkleTree a) genMerkleTree genA = mkMerkleTree <$> Gen.list (Range.linear 0 10) genA
132
genMerkleTree :: Bi a => Gen a -> Gen (MerkleTree a) genMerkleTree genA = mkMerkleTree <$> Gen.list (Range.linear 0 10) genA
124
genMerkleTree genA = mkMerkleTree <$> Gen.list (Range.linear 0 10) genA
71
true
true
0
9
22
59
28
31
null
null
mvoidex/redis-worker
src/System/Worker/Redis.hs
bsd-3-clause
-- | Push one task by id and push that id to task list pushTask :: ByteString -> ByteString -> M.Map ByteString ByteString -> Redis () pushTask tl tid tdata = hmset tid (M.toList tdata) >> pushTaskId tl tid
206
pushTask :: ByteString -> ByteString -> M.Map ByteString ByteString -> Redis () pushTask tl tid tdata = hmset tid (M.toList tdata) >> pushTaskId tl tid
151
pushTask tl tid tdata = hmset tid (M.toList tdata) >> pushTaskId tl tid
71
true
true
0
9
38
70
32
38
null
null
mcmaniac/ghc
compiler/main/CmdLineParser.hs
bsd-3-clause
getCurLoc :: Monad m => EwM m SrcSpan getCurLoc = EwM (\(L loc _) es ws -> return (es, ws, loc))
96
getCurLoc :: Monad m => EwM m SrcSpan getCurLoc = EwM (\(L loc _) es ws -> return (es, ws, loc))
96
getCurLoc = EwM (\(L loc _) es ws -> return (es, ws, loc))
58
false
true
0
9
20
64
31
33
null
null
charlesrosenbauer/Bzo-Compiler
src/Builtins.hs
gpl-3.0
isBuiltinFunc "#arctangent" = 60010
37
isBuiltinFunc "#arctangent" = 60010
37
isBuiltinFunc "#arctangent" = 60010
37
false
false
0
5
5
9
4
5
null
null
da-x/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprCxt :: Cxt -> Doc pprCxt [] = empty
38
pprCxt :: Cxt -> Doc pprCxt [] = empty
38
pprCxt [] = empty
17
false
true
0
6
8
20
10
10
null
null
GaloisInc/linux-ptrace
System/Linux/Ptrace/Syscall.hs
mit
ptrace_getregs :: CPid -> IO Regs ptrace_getregs pid | sizeOf (0 :: RemotePtr ()) == 4 = X86 `fmap` ptraceGet 12 pid | sizeOf (0 :: RemotePtr ()) == 8 = X86_64 `fmap` ptraceGet 12 pid
202
ptrace_getregs :: CPid -> IO Regs ptrace_getregs pid | sizeOf (0 :: RemotePtr ()) == 4 = X86 `fmap` ptraceGet 12 pid | sizeOf (0 :: RemotePtr ()) == 8 = X86_64 `fmap` ptraceGet 12 pid
202
ptrace_getregs pid | sizeOf (0 :: RemotePtr ()) == 4 = X86 `fmap` ptraceGet 12 pid | sizeOf (0 :: RemotePtr ()) == 8 = X86_64 `fmap` ptraceGet 12 pid
168
false
true
1
12
54
99
47
52
null
null