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
Gurrt/software-testing
week-5/Exercise5.hs
mit
mple1 :: Tree Integer exmple1 = T 1 [T 2 [], T 3 []]
56
exmple1 :: Tree Integer exmple1 = T 1 [T 2 [], T 3 []]
54
exmple1 = T 1 [T 2 [], T 3 []]
30
false
true
0
7
17
45
20
25
null
null
phile314/tasty-silver
Test/Tasty/Silver/Interactive.hs
mit
exitCodeToBool :: ExitCode -> Bool exitCodeToBool ExitSuccess = True
70
exitCodeToBool :: ExitCode -> Bool exitCodeToBool ExitSuccess = True
70
exitCodeToBool ExitSuccess = True
35
false
true
0
7
10
24
10
14
null
null
23Skidoo/erp
ERP.hs
gpl-3.0
int :: Integer -> AST int i = AInt i
36
int :: Integer -> AST int i = AInt i
36
int i = AInt i
14
false
true
0
7
9
27
11
16
null
null
urv/fixhs
src/Data/FIX/Spec/FIX43.hs
lgpl-2.1
tExpireTime :: FIXTag tExpireTime = FIXTag { tName = "ExpireTime" , tnum = 126 , tparser = toFIXTimestamp , arbitraryValue = FIXTimestamp <$> arbitrary }
166
tExpireTime :: FIXTag tExpireTime = FIXTag { tName = "ExpireTime" , tnum = 126 , tparser = toFIXTimestamp , arbitraryValue = FIXTimestamp <$> arbitrary }
166
tExpireTime = FIXTag { tName = "ExpireTime" , tnum = 126 , tparser = toFIXTimestamp , arbitraryValue = FIXTimestamp <$> arbitrary }
144
false
true
0
8
37
45
26
19
null
null
themoritz/cabal
cabal-install/Distribution/Client/ProjectBuilding/Types.hs
bsd-3-clause
buildStatusToString (BuildStatusUnpack fp) = "BuildStatusUnpack " ++ show fp
79
buildStatusToString (BuildStatusUnpack fp) = "BuildStatusUnpack " ++ show fp
79
buildStatusToString (BuildStatusUnpack fp) = "BuildStatusUnpack " ++ show fp
79
false
false
0
7
11
22
10
12
null
null
RedMoonStudios/cryptd-lib
Cryptd/Lib/Util.hs
gpl-3.0
-- | Format a summary of a program with the specified 'Version'. formatSummary :: Version -> String -> String formatSummary version summary = summary ++ " (version: " ++ showVersion version ++ ")"
200
formatSummary :: Version -> String -> String formatSummary version summary = summary ++ " (version: " ++ showVersion version ++ ")"
135
formatSummary version summary = summary ++ " (version: " ++ showVersion version ++ ")"
90
true
true
0
7
36
40
20
20
null
null
shockkolate/web-routes
Web/Routes/PathInfo.hs
bsd-3-clause
-- should this fail if not all the input was consumed? -- -- in theory we -- require the pathInfo to have the initial '/', but this code will -- still work if it is missing. -- -- If there are multiple //// at the beginning, we only drop the first -- one, because we only added one in toPathInfo. Hence the others -- should be significant. -- -- However, if the pathInfo was prepend with http://example.org/ with -- a trailing slash, then things might not line up. -- | parse a 'String' into 'url' using 'PathInfo'. -- -- returns @Left "parse error"@ on failure -- -- returns @Right url@ on success fromPathInfo :: (PathInfo url) => ByteString -> Either String url fromPathInfo pi = parseSegments fromPathSegments (decodePathInfo $ dropSlash pi) where dropSlash s = if ((B.singleton '/') `B.isPrefixOf` s) then B.tail s else s -- | turn a routing function into a 'Site' value using the 'PathInfo' class
938
fromPathInfo :: (PathInfo url) => ByteString -> Either String url fromPathInfo pi = parseSegments fromPathSegments (decodePathInfo $ dropSlash pi) where dropSlash s = if ((B.singleton '/') `B.isPrefixOf` s) then B.tail s else s -- | turn a routing function into a 'Site' value using the 'PathInfo' class
336
fromPathInfo pi = parseSegments fromPathSegments (decodePathInfo $ dropSlash pi) where dropSlash s = if ((B.singleton '/') `B.isPrefixOf` s) then B.tail s else s -- | turn a routing function into a 'Site' value using the 'PathInfo' class
270
true
true
1
10
194
117
65
52
null
null
ml9951/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
isFFIPrimArgumentTy :: DynFlags -> Type -> Validity -- Checks for valid argument type for a 'foreign import prim' -- Currently they must all be simple unlifted types, or the well-known type -- Any, which can be used to pass the address to a Haskell object on the heap to -- the foreign function. isFFIPrimArgumentTy dflags ty | isAnyTy ty = IsValid | otherwise = checkRepTyCon (legalFIPrimArgTyCon dflags) ty
413
isFFIPrimArgumentTy :: DynFlags -> Type -> Validity isFFIPrimArgumentTy dflags ty | isAnyTy ty = IsValid | otherwise = checkRepTyCon (legalFIPrimArgTyCon dflags) ty
169
isFFIPrimArgumentTy dflags ty | isAnyTy ty = IsValid | otherwise = checkRepTyCon (legalFIPrimArgTyCon dflags) ty
117
true
true
0
8
72
63
30
33
null
null
ingemaradahl/bilder
src/Compiler/Split.hs
lgpl-3.0
addDeps ∷ Dep → [Dep] → State St () addDeps _ = mapM_ add
57
addDeps ∷ Dep → [Dep] → State St () addDeps _ = mapM_ add
57
addDeps _ = mapM_ add
21
false
true
0
9
13
40
18
22
null
null
aelve/json-x
tests/DataFamilies/Encoders.hs
bsd-3-clause
{- A NOTE mkToJson/mkToEncoding/mkParseJson don't care about what constructor they're given (C1, C2, or C3), they're going to make an instance for the whole type. There's no reason why we're giving them different constructors – we could just as well give 'C1 and 'Nullary to all of them. -} -------------------------------------------------------------------------------- -- Nullary encoders/decoders -------------------------------------------------------------------------------- thNullaryToJsonString, gNullaryToJsonString :: Nullary Int -> Json thNullaryToJsonString = $(mkToJson defaultOptions 'C1)
608
thNullaryToJsonString, gNullaryToJsonString :: Nullary Int -> Json thNullaryToJsonString = $(mkToJson defaultOptions 'C1)
121
thNullaryToJsonString = $(mkToJson defaultOptions 'C1)
54
true
true
0
7
70
34
20
14
null
null
siddhanathan/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
iselExpr64 (CmmMachOp (MO_Sub _) [e1,e2]) = do ChildCode64 code1 r1lo <- iselExpr64 e1 ChildCode64 code2 r2lo <- iselExpr64 e2 (rlo,rhi) <- getNewRegPairNat II32 let r1hi = getHiVRegFromLo r1lo r2hi = getHiVRegFromLo r2lo code = code1 `appOL` code2 `appOL` toOL [ MOV II32 (OpReg r1lo) (OpReg rlo), SUB II32 (OpReg r2lo) (OpReg rlo), MOV II32 (OpReg r1hi) (OpReg rhi), SBB II32 (OpReg r2hi) (OpReg rhi) ] return (ChildCode64 code rlo)
575
iselExpr64 (CmmMachOp (MO_Sub _) [e1,e2]) = do ChildCode64 code1 r1lo <- iselExpr64 e1 ChildCode64 code2 r2lo <- iselExpr64 e2 (rlo,rhi) <- getNewRegPairNat II32 let r1hi = getHiVRegFromLo r1lo r2hi = getHiVRegFromLo r2lo code = code1 `appOL` code2 `appOL` toOL [ MOV II32 (OpReg r1lo) (OpReg rlo), SUB II32 (OpReg r2lo) (OpReg rlo), MOV II32 (OpReg r1hi) (OpReg rhi), SBB II32 (OpReg r2hi) (OpReg rhi) ] return (ChildCode64 code rlo)
575
iselExpr64 (CmmMachOp (MO_Sub _) [e1,e2]) = do ChildCode64 code1 r1lo <- iselExpr64 e1 ChildCode64 code2 r2lo <- iselExpr64 e2 (rlo,rhi) <- getNewRegPairNat II32 let r1hi = getHiVRegFromLo r1lo r2hi = getHiVRegFromLo r2lo code = code1 `appOL` code2 `appOL` toOL [ MOV II32 (OpReg r1lo) (OpReg rlo), SUB II32 (OpReg r2lo) (OpReg rlo), MOV II32 (OpReg r1hi) (OpReg rhi), SBB II32 (OpReg r2hi) (OpReg rhi) ] return (ChildCode64 code rlo)
575
false
false
0
15
209
217
106
111
null
null
BitFunctor/bitfunctor-theory
src/Network/BitFunctor/Theory/Extraction.hs
mit
getUsedStatements :: TheoryC a k c c' s t => t -> s -> [s] getUsedStatements th st = let stc = toStatementCode st in let thm = toStatementMap th in case stc of Left _ -> [] Right cl -> let usm = catMaybes $ List.map (\u -> case u of Left _ -> Nothing Right e -> if isTheoriable e then Map.lookup (toKey $ toKey e) thm else Nothing) cl in List.nub usm
815
getUsedStatements :: TheoryC a k c c' s t => t -> s -> [s] getUsedStatements th st = let stc = toStatementCode st in let thm = toStatementMap th in case stc of Left _ -> [] Right cl -> let usm = catMaybes $ List.map (\u -> case u of Left _ -> Nothing Right e -> if isTheoriable e then Map.lookup (toKey $ toKey e) thm else Nothing) cl in List.nub usm
815
getUsedStatements th st = let stc = toStatementCode st in let thm = toStatementMap th in case stc of Left _ -> [] Right cl -> let usm = catMaybes $ List.map (\u -> case u of Left _ -> Nothing Right e -> if isTheoriable e then Map.lookup (toKey $ toKey e) thm else Nothing) cl in List.nub usm
756
false
true
0
27
539
186
87
99
null
null
opensuse-haskell/cabal-rpm
src/Commands/Spec.hs
gpl-3.0
showLicense _ OtherLicense = "Unknown"
38
showLicense _ OtherLicense = "Unknown"
38
showLicense _ OtherLicense = "Unknown"
38
false
false
0
5
4
11
5
6
null
null
vdweegen/UvA-Software_Testing
Lab2/Willem/Exercises.hs
gpl-3.0
strip :: String -> String strip = filter(\x -> x `elem` (['a'..'z'] ++ ['A'..'Z']))
83
strip :: String -> String strip = filter(\x -> x `elem` (['a'..'z'] ++ ['A'..'Z']))
83
strip = filter(\x -> x `elem` (['a'..'z'] ++ ['A'..'Z']))
57
false
true
0
11
13
56
29
27
null
null
aopp-pred/fp-truncate
test/Truncate/Test/Hexadecimal.hs
apache-2.0
prop_makeHex64 :: Hexstring64 -> Bool prop_makeHex64 (Hexstring64 h) = case makeHex64 h of Right (Hex64 x) -> x == h Right _ -> False Left _ -> False ------------------------------------------------------------------------ -- Constructors with invalid inputs
388
prop_makeHex64 :: Hexstring64 -> Bool prop_makeHex64 (Hexstring64 h) = case makeHex64 h of Right (Hex64 x) -> x == h Right _ -> False Left _ -> False ------------------------------------------------------------------------ -- Constructors with invalid inputs
388
prop_makeHex64 (Hexstring64 h) = case makeHex64 h of Right (Hex64 x) -> x == h Right _ -> False Left _ -> False ------------------------------------------------------------------------ -- Constructors with invalid inputs
350
false
true
0
10
163
70
34
36
null
null
Axiomatic-/Task9
Graphics/Task9/FileView/FileImageStore.hs
mit
populateStoreFromDir :: MV.ListStore FileImage -> String -> IO () populateStoreFromDir store dir = do let isPict f = FilePath.takeExtension f `elem` [".jpg", ".jpeg", ".png"] files <- Monad.filterM Dir.doesFileExist =<< (map (dir</>) <$> Dir.getDirectoryContents dir) Monad.mapM_ (populateStoreFromFile store) $ sort $ filter isPict files
355
populateStoreFromDir :: MV.ListStore FileImage -> String -> IO () populateStoreFromDir store dir = do let isPict f = FilePath.takeExtension f `elem` [".jpg", ".jpeg", ".png"] files <- Monad.filterM Dir.doesFileExist =<< (map (dir</>) <$> Dir.getDirectoryContents dir) Monad.mapM_ (populateStoreFromFile store) $ sort $ filter isPict files
355
populateStoreFromDir store dir = do let isPict f = FilePath.takeExtension f `elem` [".jpg", ".jpeg", ".png"] files <- Monad.filterM Dir.doesFileExist =<< (map (dir</>) <$> Dir.getDirectoryContents dir) Monad.mapM_ (populateStoreFromFile store) $ sort $ filter isPict files
289
false
true
0
12
59
130
63
67
null
null
input-output-hk/daedalus
ConfigMutator.hs
apache-2.0
main :: IO () main = do args <- getArgs case args of [ filepath, key, appVer ] -> do tlscfg <- decodeConfigFile (ConfigurationKey key) filepath cfg <- parseYamlConfig filepath (T.pack key) let newcfg :: Configuration newcfg = cfg & ccUpdate_L . ccApplicationVersion_L .~ (read appVer) newmap = Map.singleton key newcfg partialcfg = Data.Aeson.toJSON newcfg yaml = Y.encode newmap -- this mess exists because `Configuration` lacks the `tls` field let tlsvalue = Data.Aeson.toJSON tlscfg deobj (Data.Aeson.Object hm) = hm wrappedtls :: HM.HashMap T.Text Data.Aeson.Value wrappedtls = HM.singleton "tls" tlsvalue both = Data.Aeson.Object (wrappedtls <> (deobj partialcfg)) finalCfg = Data.Aeson.Object (HM.singleton (T.pack key) both) BS.putStr $ Y.encode finalCfg _ -> do putStrLn "usage: config-mutator lib/configuration.yaml mainnet_dryrun_wallet_win64 42" exitWith $ ExitFailure 1
1,029
main :: IO () main = do args <- getArgs case args of [ filepath, key, appVer ] -> do tlscfg <- decodeConfigFile (ConfigurationKey key) filepath cfg <- parseYamlConfig filepath (T.pack key) let newcfg :: Configuration newcfg = cfg & ccUpdate_L . ccApplicationVersion_L .~ (read appVer) newmap = Map.singleton key newcfg partialcfg = Data.Aeson.toJSON newcfg yaml = Y.encode newmap -- this mess exists because `Configuration` lacks the `tls` field let tlsvalue = Data.Aeson.toJSON tlscfg deobj (Data.Aeson.Object hm) = hm wrappedtls :: HM.HashMap T.Text Data.Aeson.Value wrappedtls = HM.singleton "tls" tlsvalue both = Data.Aeson.Object (wrappedtls <> (deobj partialcfg)) finalCfg = Data.Aeson.Object (HM.singleton (T.pack key) both) BS.putStr $ Y.encode finalCfg _ -> do putStrLn "usage: config-mutator lib/configuration.yaml mainnet_dryrun_wallet_win64 42" exitWith $ ExitFailure 1
1,029
main = do args <- getArgs case args of [ filepath, key, appVer ] -> do tlscfg <- decodeConfigFile (ConfigurationKey key) filepath cfg <- parseYamlConfig filepath (T.pack key) let newcfg :: Configuration newcfg = cfg & ccUpdate_L . ccApplicationVersion_L .~ (read appVer) newmap = Map.singleton key newcfg partialcfg = Data.Aeson.toJSON newcfg yaml = Y.encode newmap -- this mess exists because `Configuration` lacks the `tls` field let tlsvalue = Data.Aeson.toJSON tlscfg deobj (Data.Aeson.Object hm) = hm wrappedtls :: HM.HashMap T.Text Data.Aeson.Value wrappedtls = HM.singleton "tls" tlsvalue both = Data.Aeson.Object (wrappedtls <> (deobj partialcfg)) finalCfg = Data.Aeson.Object (HM.singleton (T.pack key) both) BS.putStr $ Y.encode finalCfg _ -> do putStrLn "usage: config-mutator lib/configuration.yaml mainnet_dryrun_wallet_win64 42" exitWith $ ExitFailure 1
1,015
false
true
0
21
267
306
149
157
null
null
fmapfmapfmap/amazonka
amazonka-ecs/gen/Network/AWS/ECS/Types/Product.hs
mpl-2.0
-- | The Amazon Resource Name (ARN) that identifies the service. The ARN -- contains the 'arn:aws:ecs' namespace, followed by the region of the -- service, the AWS account ID of the service owner, the 'service' -- namespace, and then the service name. For example, -- arn:aws:ecs:/region/:/012345678910/:service\//my-service/. csServiceARN :: Lens' ContainerService (Maybe Text) csServiceARN = lens _csServiceARN (\ s a -> s{_csServiceARN = a})
444
csServiceARN :: Lens' ContainerService (Maybe Text) csServiceARN = lens _csServiceARN (\ s a -> s{_csServiceARN = a})
117
csServiceARN = lens _csServiceARN (\ s a -> s{_csServiceARN = a})
65
true
true
0
9
63
50
29
21
null
null
rodrigo-machado/verigraph
src/repl/Util/Lua.hs
gpl-3.0
checkStatus :: Lua.Status -> Lua Bool checkStatus Lua.OK = return True
70
checkStatus :: Lua.Status -> Lua Bool checkStatus Lua.OK = return True
70
checkStatus Lua.OK = return True
32
false
true
0
8
10
32
14
18
null
null
IreneKnapp/Faction
libfaction/Distribution/Simple/Configure.hs
bsd-3-clause
hackageUrl :: String hackageUrl = "http://hackage.haskell.org/package/"
71
hackageUrl :: String hackageUrl = "http://hackage.haskell.org/package/"
71
hackageUrl = "http://hackage.haskell.org/package/"
50
false
true
0
4
5
11
6
5
null
null
fmapfmapfmap/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/StopInstance.hs
mpl-2.0
-- | The instance ID. siInstanceId :: Lens' StopInstance Text siInstanceId = lens _siInstanceId (\ s a -> s{_siInstanceId = a})
127
siInstanceId :: Lens' StopInstance Text siInstanceId = lens _siInstanceId (\ s a -> s{_siInstanceId = a})
105
siInstanceId = lens _siInstanceId (\ s a -> s{_siInstanceId = a})
65
true
true
1
9
20
45
22
23
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
whatBuilds ZergUltraliskCavern = ZergDrone
42
whatBuilds ZergUltraliskCavern = ZergDrone
42
whatBuilds ZergUltraliskCavern = ZergDrone
42
false
false
0
5
3
9
4
5
null
null
lingxiao/GoodGreatIntensity
src/Score.hs
bsd-3-clause
countp :: Parser Text -> ReaderT Config IO Output countp phrase = do con <- ask (n, ts) <- phrase `query` (ngrams con) return (n,ts) -- * `count` occurences of some word `w` -- * in onegram file
206
countp :: Parser Text -> ReaderT Config IO Output countp phrase = do con <- ask (n, ts) <- phrase `query` (ngrams con) return (n,ts) -- * `count` occurences of some word `w` -- * in onegram file
206
countp phrase = do con <- ask (n, ts) <- phrase `query` (ngrams con) return (n,ts) -- * `count` occurences of some word `w` -- * in onegram file
156
false
true
0
10
49
74
38
36
null
null
TomMD/ghc
compiler/basicTypes/Var.hs
bsd-3-clause
ppr_id_scope (LocalId NotExported) = ptext (sLit "lid")
55
ppr_id_scope (LocalId NotExported) = ptext (sLit "lid")
55
ppr_id_scope (LocalId NotExported) = ptext (sLit "lid")
55
false
false
0
7
6
24
11
13
null
null
alexander-at-github/eta
compiler/ETA/Types/FamInstEnv.hs
bsd-3-clause
mkImportedFamInst :: Name -- Name of the family -> [Maybe Name] -- Rough match info -> CoAxiom Unbranched -- Axiom introduced -> FamInst -- Resulting family instance mkImportedFamInst fam mb_tcs axiom = FamInst { fi_fam = fam, fi_tcs = mb_tcs, fi_tvs = tvs, fi_tys = tys, fi_rhs = rhs, fi_axiom = axiom, fi_flavor = flavor } where -- See Note [Lazy axiom match] ~(CoAxiom { co_ax_branches = ~(FirstBranch ~(CoAxBranch { cab_lhs = tys , cab_tvs = tvs , cab_rhs = rhs })) }) = axiom -- Derive the flavor for an imported FamInst rather disgustingly -- Maybe we should store it in the IfaceFamInst? flavor = case splitTyConApp_maybe rhs of Just (tc, _) | Just ax' <- tyConFamilyCoercion_maybe tc , ax' == axiom -> DataFamilyInst tc _ -> SynFamilyInst {- ************************************************************************ * * FamInstEnv * * ************************************************************************ Note [FamInstEnv] ~~~~~~~~~~~~~~~~~ A FamInstEnv maps a family name to the list of known instances for that family. The same FamInstEnv includes both 'data family' and 'type family' instances. Type families are reduced during type inference, but not data families; the user explains when to use a data family instance by using contructors and pattern matching. Neverthless it is still useful to have data families in the FamInstEnv: - For finding overlaps and conflicts - For finding the representation type...see FamInstEnv.topNormaliseType and its call site in Simplify - In standalone deriving instance Eq (T [Int]) we need to find the representation type for T [Int] Note [Varying number of patterns for data family axioms] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For data families, the number of patterns may vary between instances. For example data family T a b data instance T Int a = T1 a | T2 data instance T Bool [a] = T3 a Then we get a data type for each instance, and an axiom: data TInt a = T1 a | T2 data TBoolList a = T3 a axiom ax7 :: T Int ~ TInt -- Eta-reduced axiom ax8 a :: T Bool [a] ~ TBoolList a These two axioms for T, one with one pattern, one with two. The reason for this eta-reduction is decribed in TcInstDcls Note [Eta reduction for data family axioms] -}
2,763
mkImportedFamInst :: Name -- Name of the family -> [Maybe Name] -- Rough match info -> CoAxiom Unbranched -- Axiom introduced -> FamInst mkImportedFamInst fam mb_tcs axiom = FamInst { fi_fam = fam, fi_tcs = mb_tcs, fi_tvs = tvs, fi_tys = tys, fi_rhs = rhs, fi_axiom = axiom, fi_flavor = flavor } where -- See Note [Lazy axiom match] ~(CoAxiom { co_ax_branches = ~(FirstBranch ~(CoAxBranch { cab_lhs = tys , cab_tvs = tvs , cab_rhs = rhs })) }) = axiom -- Derive the flavor for an imported FamInst rather disgustingly -- Maybe we should store it in the IfaceFamInst? flavor = case splitTyConApp_maybe rhs of Just (tc, _) | Just ax' <- tyConFamilyCoercion_maybe tc , ax' == axiom -> DataFamilyInst tc _ -> SynFamilyInst {- ************************************************************************ * * FamInstEnv * * ************************************************************************ Note [FamInstEnv] ~~~~~~~~~~~~~~~~~ A FamInstEnv maps a family name to the list of known instances for that family. The same FamInstEnv includes both 'data family' and 'type family' instances. Type families are reduced during type inference, but not data families; the user explains when to use a data family instance by using contructors and pattern matching. Neverthless it is still useful to have data families in the FamInstEnv: - For finding overlaps and conflicts - For finding the representation type...see FamInstEnv.topNormaliseType and its call site in Simplify - In standalone deriving instance Eq (T [Int]) we need to find the representation type for T [Int] Note [Varying number of patterns for data family axioms] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For data families, the number of patterns may vary between instances. For example data family T a b data instance T Int a = T1 a | T2 data instance T Bool [a] = T3 a Then we get a data type for each instance, and an axiom: data TInt a = T1 a | T2 data TBoolList a = T3 a axiom ax7 :: T Int ~ TInt -- Eta-reduced axiom ax8 a :: T Bool [a] ~ TBoolList a These two axioms for T, one with one pattern, one with two. The reason for this eta-reduction is decribed in TcInstDcls Note [Eta reduction for data family axioms] -}
2,723
mkImportedFamInst fam mb_tcs axiom = FamInst { fi_fam = fam, fi_tcs = mb_tcs, fi_tvs = tvs, fi_tys = tys, fi_rhs = rhs, fi_axiom = axiom, fi_flavor = flavor } where -- See Note [Lazy axiom match] ~(CoAxiom { co_ax_branches = ~(FirstBranch ~(CoAxBranch { cab_lhs = tys , cab_tvs = tvs , cab_rhs = rhs })) }) = axiom -- Derive the flavor for an imported FamInst rather disgustingly -- Maybe we should store it in the IfaceFamInst? flavor = case splitTyConApp_maybe rhs of Just (tc, _) | Just ax' <- tyConFamilyCoercion_maybe tc , ax' == axiom -> DataFamilyInst tc _ -> SynFamilyInst {- ************************************************************************ * * FamInstEnv * * ************************************************************************ Note [FamInstEnv] ~~~~~~~~~~~~~~~~~ A FamInstEnv maps a family name to the list of known instances for that family. The same FamInstEnv includes both 'data family' and 'type family' instances. Type families are reduced during type inference, but not data families; the user explains when to use a data family instance by using contructors and pattern matching. Neverthless it is still useful to have data families in the FamInstEnv: - For finding overlaps and conflicts - For finding the representation type...see FamInstEnv.topNormaliseType and its call site in Simplify - In standalone deriving instance Eq (T [Int]) we need to find the representation type for T [Int] Note [Varying number of patterns for data family axioms] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For data families, the number of patterns may vary between instances. For example data family T a b data instance T Int a = T1 a | T2 data instance T Bool [a] = T3 a Then we get a data type for each instance, and an axiom: data TInt a = T1 a | T2 data TBoolList a = T3 a axiom ax7 :: T Int ~ TInt -- Eta-reduced axiom ax8 a :: T Bool [a] ~ TBoolList a These two axioms for T, one with one pattern, one with two. The reason for this eta-reduction is decribed in TcInstDcls Note [Eta reduction for data family axioms] -}
2,512
true
true
0
17
906
205
113
92
null
null
phylake/AS3-AST
Data/AS3/AST/Grammar/Lexicon.hs
bsd-3-clause
-- $7.8.5 Regular Expressions regex_literal :: As3Parser String regex_literal = undefined
90
regex_literal :: As3Parser String regex_literal = undefined
59
regex_literal = undefined
25
true
true
1
5
11
19
8
11
null
null
bhamrick/wordpairs
Data/Regex.hs
bsd-3-clause
anticharset :: FAlgebra RegexF r => [Char] -> r anticharset = alg . AntiCharSet
79
anticharset :: FAlgebra RegexF r => [Char] -> r anticharset = alg . AntiCharSet
79
anticharset = alg . AntiCharSet
31
false
true
1
8
13
39
17
22
null
null
pocket7878/min-tokenizer
src/NFABuilder.hs
gpl-3.0
buildNFA' (Left (R.NoneOf xs)) st@(acc, s) = buildNFA' (Left (R.OneOf (C.toList (A.print C.\\ C.fromList xs)))) st
119
buildNFA' (Left (R.NoneOf xs)) st@(acc, s) = buildNFA' (Left (R.OneOf (C.toList (A.print C.\\ C.fromList xs)))) st
119
buildNFA' (Left (R.NoneOf xs)) st@(acc, s) = buildNFA' (Left (R.OneOf (C.toList (A.print C.\\ C.fromList xs)))) st
119
false
false
0
15
20
77
39
38
null
null
ssaavedra/liquidhaskell
tests/pos/Merge1.hs
bsd-3-clause
merge1 as [] = as
28
merge1 as [] = as
28
merge1 as [] = as
28
false
false
0
6
15
13
6
7
null
null
phischu/fragnix
tests/packages/scotty/Data.ByteString.Lazy.Char8.hs
bsd-3-clause
-- | /O(1)/ Extract the head and tail of a ByteString, returning Nothing -- if it is empty. uncons :: ByteString -> Maybe (Char, ByteString) uncons bs = case L.uncons bs of Nothing -> Nothing Just (w, bs') -> Just (w2c w, bs')
263
uncons :: ByteString -> Maybe (Char, ByteString) uncons bs = case L.uncons bs of Nothing -> Nothing Just (w, bs') -> Just (w2c w, bs')
171
uncons bs = case L.uncons bs of Nothing -> Nothing Just (w, bs') -> Just (w2c w, bs')
122
true
true
0
10
79
71
37
34
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Source/Output.hs
mit
sourceModule :: ModuleName -> Source -> Module sourceModule pm (Source sid st _ sl sc) = srcModule where srcModule = Module srcModuleName termName srcContents [] srcContents = Text.concat [ prologue, licenseText, contentsText, "\n" ] srcModuleName = addModuleName sid pm prologue = joinText "\n" [ getModulePrefix srcModuleName [sourceTypeModuleName] , termType , termDecl ] ctx = increaseIndent emptyContext termName = idAsTerm sid termType = spacedText [ termName, ":", "Source" ] termDecl = spacedText [ termName, "=", "source", quoted sid, quoted st ] licenseText = onePerLine (const quoted) ctx sl contentsText = contentChunkJoin ctx (chunkByMilestone sc)
698
sourceModule :: ModuleName -> Source -> Module sourceModule pm (Source sid st _ sl sc) = srcModule where srcModule = Module srcModuleName termName srcContents [] srcContents = Text.concat [ prologue, licenseText, contentsText, "\n" ] srcModuleName = addModuleName sid pm prologue = joinText "\n" [ getModulePrefix srcModuleName [sourceTypeModuleName] , termType , termDecl ] ctx = increaseIndent emptyContext termName = idAsTerm sid termType = spacedText [ termName, ":", "Source" ] termDecl = spacedText [ termName, "=", "source", quoted sid, quoted st ] licenseText = onePerLine (const quoted) ctx sl contentsText = contentChunkJoin ctx (chunkByMilestone sc)
698
sourceModule pm (Source sid st _ sl sc) = srcModule where srcModule = Module srcModuleName termName srcContents [] srcContents = Text.concat [ prologue, licenseText, contentsText, "\n" ] srcModuleName = addModuleName sid pm prologue = joinText "\n" [ getModulePrefix srcModuleName [sourceTypeModuleName] , termType , termDecl ] ctx = increaseIndent emptyContext termName = idAsTerm sid termType = spacedText [ termName, ":", "Source" ] termDecl = spacedText [ termName, "=", "source", quoted sid, quoted st ] licenseText = onePerLine (const quoted) ctx sl contentsText = contentChunkJoin ctx (chunkByMilestone sc)
651
false
true
0
8
130
212
112
100
null
null
wouwouwou/2017_module_8
src/haskell/PP-project-2017/Checker.hs
apache-2.0
nameCheck ast id = error $ "Shouldn't be reached in Checker.checker2.nameCheck, with: " ++ id ++ " and: " ++ (show ast)
124
nameCheck ast id = error $ "Shouldn't be reached in Checker.checker2.nameCheck, with: " ++ id ++ " and: " ++ (show ast)
124
nameCheck ast id = error $ "Shouldn't be reached in Checker.checker2.nameCheck, with: " ++ id ++ " and: " ++ (show ast)
124
false
false
3
8
26
39
16
23
null
null
spell-music/temporal-music-notation
src/Temporal/Music/Score.hs
bsd-3-clause
-- | Means 'three notes'. Plays three notes as fast as two. trn :: Score a -> Score a trn = str (2/3)
101
trn :: Score a -> Score a trn = str (2/3)
41
trn = str (2/3)
15
true
true
0
7
22
32
16
16
null
null
input-output-hk/rscoin-haskell
src/RSCoin/Bank/Storage/Mintettes.hs
gpl-3.0
replaceWithCare' [] pending list acc = (list ++ pending, acc ++ [length list .. length list + length pending - 1])
118
replaceWithCare' [] pending list acc = (list ++ pending, acc ++ [length list .. length list + length pending - 1])
118
replaceWithCare' [] pending list acc = (list ++ pending, acc ++ [length list .. length list + length pending - 1])
118
false
false
0
10
24
54
27
27
null
null
andrewpetrovic/pandoc
src/Text/Pandoc/Writers/RST.hs
gpl-2.0
definitionListItemToRST :: ([Inline], [[Block]]) -> State WriterState Doc definitionListItemToRST (label, defs) = do label' <- inlineListToRST label contents <- liftM vcat $ mapM blockListToRST defs tabstop <- get >>= (return . writerTabStop . stOptions) return $ label' $$ nest tabstop (nestle contents <> cr) -- | Convert list of Pandoc block elements to RST.
370
definitionListItemToRST :: ([Inline], [[Block]]) -> State WriterState Doc definitionListItemToRST (label, defs) = do label' <- inlineListToRST label contents <- liftM vcat $ mapM blockListToRST defs tabstop <- get >>= (return . writerTabStop . stOptions) return $ label' $$ nest tabstop (nestle contents <> cr) -- | Convert list of Pandoc block elements to RST.
370
definitionListItemToRST (label, defs) = do label' <- inlineListToRST label contents <- liftM vcat $ mapM blockListToRST defs tabstop <- get >>= (return . writerTabStop . stOptions) return $ label' $$ nest tabstop (nestle contents <> cr) -- | Convert list of Pandoc block elements to RST.
296
false
true
0
11
62
122
61
61
null
null
gabrielPeart/VM.hs
src/VM/Core.hs
mit
runInstruction (Or dst r1 r2) cpu = VM.Core.or dst r1 r2 cpu
61
runInstruction (Or dst r1 r2) cpu = VM.Core.or dst r1 r2 cpu
61
runInstruction (Or dst r1 r2) cpu = VM.Core.or dst r1 r2 cpu
61
false
false
1
7
12
35
16
19
null
null
CarmineM74/haskell_craft3e
Chapter14_2.hs
mit
depthGTBranch :: Int -> (GTree a) -> Int depthGTBranch cur_depth (Leaf _) = cur_depth
85
depthGTBranch :: Int -> (GTree a) -> Int depthGTBranch cur_depth (Leaf _) = cur_depth
85
depthGTBranch cur_depth (Leaf _) = cur_depth
44
false
true
0
10
13
42
19
23
null
null
Le-Chiffre/HsC
Code/Compiler/Lexer.hs
gpl-3.0
colon = reservedOp ":"
22
colon = reservedOp ":"
22
colon = reservedOp ":"
22
false
false
1
5
3
13
4
9
null
null
jsnajder/derivbase-de
src/test.hs
bsd-3-clause
dbPairs = "/home/jan/dismods/derivbase/deriv-families/data/DErivBase-v1.3-pairs1-2.txt"
87
dbPairs = "/home/jan/dismods/derivbase/deriv-families/data/DErivBase-v1.3-pairs1-2.txt"
87
dbPairs = "/home/jan/dismods/derivbase/deriv-families/data/DErivBase-v1.3-pairs1-2.txt"
87
false
false
1
5
2
10
3
7
null
null
dmalikov/cabal2nix
src/Cabal2Nix/PostProcess.hs
bsd-3-clause
fixGtkBuilds :: Derivation -> Derivation fixGtkBuilds deriv@(MkDerivation {..}) = deriv { pkgConfDeps = pkgConfDeps `Set.difference` buildDepends }
147
fixGtkBuilds :: Derivation -> Derivation fixGtkBuilds deriv@(MkDerivation {..}) = deriv { pkgConfDeps = pkgConfDeps `Set.difference` buildDepends }
147
fixGtkBuilds deriv@(MkDerivation {..}) = deriv { pkgConfDeps = pkgConfDeps `Set.difference` buildDepends }
106
false
true
0
9
16
46
26
20
null
null
cuklev/JSBoiler
src/JSBoiler/Eval/Binding.hs
gpl-3.0
checkForAlreadyDeclared :: ScopeBindings -> Declaration -> Maybe Text checkForAlreadyDeclared scope (DeclareBinding name) | M.member name scope = Just name | otherwise = Nothing
195
checkForAlreadyDeclared :: ScopeBindings -> Declaration -> Maybe Text checkForAlreadyDeclared scope (DeclareBinding name) | M.member name scope = Just name | otherwise = Nothing
195
checkForAlreadyDeclared scope (DeclareBinding name) | M.member name scope = Just name | otherwise = Nothing
125
false
true
1
9
40
57
26
31
null
null
IreneKnapp/ozweb
Haskell/Schema.hs
mit
compilePrimitiveType :: PrimitiveType -> Compilation SQL.Type compilePrimitiveType IntegerPrimitiveType = return $ SQL.Type SQL.TypeAffinityNone (SQL.TypeName $ fromJust $ SQL.mkOneOrMore [SQL.UnqualifiedIdentifier "integer"]) SQL.NoTypeSize
305
compilePrimitiveType :: PrimitiveType -> Compilation SQL.Type compilePrimitiveType IntegerPrimitiveType = return $ SQL.Type SQL.TypeAffinityNone (SQL.TypeName $ fromJust $ SQL.mkOneOrMore [SQL.UnqualifiedIdentifier "integer"]) SQL.NoTypeSize
305
compilePrimitiveType IntegerPrimitiveType = return $ SQL.Type SQL.TypeAffinityNone (SQL.TypeName $ fromJust $ SQL.mkOneOrMore [SQL.UnqualifiedIdentifier "integer"]) SQL.NoTypeSize
243
false
true
2
10
84
74
33
41
null
null
sheyll/b9-vm-image-builder
src/lib/B9/Artifact/Readable/Source.hs
mit
getArtifactSourceFiles (FromDirectory _ as) = as >>= getArtifactSourceFiles
75
getArtifactSourceFiles (FromDirectory _ as) = as >>= getArtifactSourceFiles
75
getArtifactSourceFiles (FromDirectory _ as) = as >>= getArtifactSourceFiles
75
false
false
0
7
7
21
10
11
null
null
solidsnack/JSONb
test/SimpleUnits.hs
bsd-3-clause
prop_double_round_trip :: Double -> Property prop_double_round_trip n = collect bin $ case (rt . show) n of Right (JSONb.Number r) -> fromRational r == n _ -> False where bin | n < 1 && n > -1 = Bounds (Open (-1)) (Open 1) | n >= 1 && n < 100 = Bounds (Closed 1) (Open 100) | n > -100 && n <= -1 = Bounds (Open (-100)) (Closed (-1)) | n <= -100 = Bounds Infinite (Closed (-100)) | n >= -100 = Bounds (Closed (100)) Infinite
536
prop_double_round_trip :: Double -> Property prop_double_round_trip n = collect bin $ case (rt . show) n of Right (JSONb.Number r) -> fromRational r == n _ -> False where bin | n < 1 && n > -1 = Bounds (Open (-1)) (Open 1) | n >= 1 && n < 100 = Bounds (Closed 1) (Open 100) | n > -100 && n <= -1 = Bounds (Open (-100)) (Closed (-1)) | n <= -100 = Bounds Infinite (Closed (-100)) | n >= -100 = Bounds (Closed (100)) Infinite
536
prop_double_round_trip n = collect bin $ case (rt . show) n of Right (JSONb.Number r) -> fromRational r == n _ -> False where bin | n < 1 && n > -1 = Bounds (Open (-1)) (Open 1) | n >= 1 && n < 100 = Bounds (Closed 1) (Open 100) | n > -100 && n <= -1 = Bounds (Open (-100)) (Closed (-1)) | n <= -100 = Bounds Infinite (Closed (-100)) | n >= -100 = Bounds (Closed (100)) Infinite
485
false
true
0
12
202
280
135
145
null
null
amccausl/Swish
Swish/HaskellUtils/Network/URI.hs
lgpl-2.1
reserved :: Char -> Bool reserved c = c `elem` "/?#[];:@&=+$,"
63
reserved :: Char -> Bool reserved c = c `elem` "/?#[];:@&=+$,"
62
reserved c = c `elem` "/?#[];:@&=+$,"
37
false
true
0
5
11
24
13
11
null
null
uuhan/Idris-dev
src/IRTS/System.hs
bsd-3-clause
getIdrisCRTSDir = do ddir <- getIdrisDataDir return $ addTrailingPathSeparator (ddir </> "rts")
99
getIdrisCRTSDir = do ddir <- getIdrisDataDir return $ addTrailingPathSeparator (ddir </> "rts")
99
getIdrisCRTSDir = do ddir <- getIdrisDataDir return $ addTrailingPathSeparator (ddir </> "rts")
99
false
false
1
11
15
34
14
20
null
null
Kotolegokot/Underlisp
src/Lib/Math.hs
gpl-3.0
biQuotRem :: IORef Scope -> [SExpr] -> EvalM SExpr biQuotRem _ [exp1, exp2] = do (quot, rem) <- liftM2 quotRem (getInt exp1) (getInt exp2) return $ list [int quot, int rem]
176
biQuotRem :: IORef Scope -> [SExpr] -> EvalM SExpr biQuotRem _ [exp1, exp2] = do (quot, rem) <- liftM2 quotRem (getInt exp1) (getInt exp2) return $ list [int quot, int rem]
176
biQuotRem _ [exp1, exp2] = do (quot, rem) <- liftM2 quotRem (getInt exp1) (getInt exp2) return $ list [int quot, int rem]
125
false
true
0
11
34
98
47
51
null
null
emc2/saltlang
src/salt/Language/Salt/Core/Patterns.hs
bsd-3-clause
patternMatch :: (Default bound, Eq bound, Hashable bound) => Pattern bound -- ^ The pattern being matched. -> Intro bound free -- ^ The term attempting to match the pattern. -> Maybe (HashMap bound (Intro bound free)) -- ^ A list of bindings from the pattern, or Nothing. patternMatch = patternMatchTail HashMap.empty
398
patternMatch :: (Default bound, Eq bound, Hashable bound) => Pattern bound -- ^ The pattern being matched. -> Intro bound free -- ^ The term attempting to match the pattern. -> Maybe (HashMap bound (Intro bound free)) patternMatch = patternMatchTail HashMap.empty
331
patternMatch = patternMatchTail HashMap.empty
45
true
true
0
12
132
75
38
37
null
null
bitemyapp/hakaru
Examples/HMMDeriv.hs
bsd-3-clause
rr1 :: (Mochastic repr, Lambda repr, Integrate repr) => repr Int -> repr Int -> repr Table -> repr Table rr1 a b m = vector a (\i -> vector b (\j -> let v = index m i in let s = summate 0 (fromInt (size v - 1)) (index v) in let cv = pair (categorical v) (lam (\c -> let_ (summate 0 (fromInt (size v - 1)) (index v)) $ \tot -> if_ (less 0 tot) (let vv = (mapWithIndex (\i' p -> p * app c i') v) in summate 0 (fromInt (size vv - 1)) (index vv) / tot) 0)) in app (lam (\c -> s * app (snd_ cv) c)) (lam (\j' -> if_ (equal j j') 1 0)) ) )
678
rr1 :: (Mochastic repr, Lambda repr, Integrate repr) => repr Int -> repr Int -> repr Table -> repr Table rr1 a b m = vector a (\i -> vector b (\j -> let v = index m i in let s = summate 0 (fromInt (size v - 1)) (index v) in let cv = pair (categorical v) (lam (\c -> let_ (summate 0 (fromInt (size v - 1)) (index v)) $ \tot -> if_ (less 0 tot) (let vv = (mapWithIndex (\i' p -> p * app c i') v) in summate 0 (fromInt (size vv - 1)) (index vv) / tot) 0)) in app (lam (\c -> s * app (snd_ cv) c)) (lam (\j' -> if_ (equal j j') 1 0)) ) )
678
rr1 a b m = vector a (\i -> vector b (\j -> let v = index m i in let s = summate 0 (fromInt (size v - 1)) (index v) in let cv = pair (categorical v) (lam (\c -> let_ (summate 0 (fromInt (size v - 1)) (index v)) $ \tot -> if_ (less 0 tot) (let vv = (mapWithIndex (\i' p -> p * app c i') v) in summate 0 (fromInt (size vv - 1)) (index vv) / tot) 0)) in app (lam (\c -> s * app (snd_ cv) c)) (lam (\j' -> if_ (equal j j') 1 0)) ) )
571
false
true
0
37
271
377
186
191
null
null
brendanhay/gogol
gogol-run/gen/Network/Google/Run/Types/Product.hs
mpl-2.0
-- | The canonical id for this location. For example: \`\"us-east1\"\`. lLocationId :: Lens' Location (Maybe Text) lLocationId = lens _lLocationId (\ s a -> s{_lLocationId = a})
179
lLocationId :: Lens' Location (Maybe Text) lLocationId = lens _lLocationId (\ s a -> s{_lLocationId = a})
107
lLocationId = lens _lLocationId (\ s a -> s{_lLocationId = a})
64
true
true
0
9
29
48
25
23
null
null
keera-studios/hsQt
Qtc/Gui/QStyleOptionComplex.hs
bsd-2-clause
setActiveSubControls :: QStyleOptionComplex a -> ((SubControls)) -> IO () setActiveSubControls x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionComplex_setActiveSubControls cobj_x0 (toCLong $ qFlags_toInt x1)
222
setActiveSubControls :: QStyleOptionComplex a -> ((SubControls)) -> IO () setActiveSubControls x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionComplex_setActiveSubControls cobj_x0 (toCLong $ qFlags_toInt x1)
222
setActiveSubControls x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionComplex_setActiveSubControls cobj_x0 (toCLong $ qFlags_toInt x1)
148
false
true
0
10
29
68
34
34
null
null
mathhun/stack
src/main/Main.hs
bsd-3-clause
-- | Visualize dependencies dotCmd :: DotOpts -> GlobalOpts -> IO () dotCmd dotOpts go = withBuildConfigAndLock go (\_ -> dot dotOpts)
134
dotCmd :: DotOpts -> GlobalOpts -> IO () dotCmd dotOpts go = withBuildConfigAndLock go (\_ -> dot dotOpts)
106
dotCmd dotOpts go = withBuildConfigAndLock go (\_ -> dot dotOpts)
65
true
true
0
8
21
46
23
23
null
null
froozen/dead-code-detection
src/Run.hs
bsd-3-clause
isConstructorName :: Name -> Bool isConstructorName name = startsWith isUpper name || startsWith (== ':') name
114
isConstructorName :: Name -> Bool isConstructorName name = startsWith isUpper name || startsWith (== ':') name
114
isConstructorName name = startsWith isUpper name || startsWith (== ':') name
80
false
true
0
7
19
36
18
18
null
null
zepto-lang/zepto
src/Zepto/Prompt.hs
gpl-2.0
runFile :: [String] -> IO () runFile args = do env <- primitiveBindings >>= flip extendEnv[((vnamespace, "zepto:args"), List $ fromSimple . String <$> drop 1 args)] >>= flip extendEnv[((vnamespace, "zepto:name"), fromSimple $ String $ head args)] _ <- stdlib env val <- runIOThrowsLispVal (eval env (nullCont env) (List [fromSimple (Atom "load"), fromSimple $ String $ head args])) case val of (Error err) -> do _ <- putStrLn $ show err return () _ -> return () -- | run the REPL
749
runFile :: [String] -> IO () runFile args = do env <- primitiveBindings >>= flip extendEnv[((vnamespace, "zepto:args"), List $ fromSimple . String <$> drop 1 args)] >>= flip extendEnv[((vnamespace, "zepto:name"), fromSimple $ String $ head args)] _ <- stdlib env val <- runIOThrowsLispVal (eval env (nullCont env) (List [fromSimple (Atom "load"), fromSimple $ String $ head args])) case val of (Error err) -> do _ <- putStrLn $ show err return () _ -> return () -- | run the REPL
749
runFile args = do env <- primitiveBindings >>= flip extendEnv[((vnamespace, "zepto:args"), List $ fromSimple . String <$> drop 1 args)] >>= flip extendEnv[((vnamespace, "zepto:name"), fromSimple $ String $ head args)] _ <- stdlib env val <- runIOThrowsLispVal (eval env (nullCont env) (List [fromSimple (Atom "load"), fromSimple $ String $ head args])) case val of (Error err) -> do _ <- putStrLn $ show err return () _ -> return () -- | run the REPL
720
false
true
0
16
350
230
113
117
null
null
sjakobi/brick
programs/BorderDemo.hs
bsd-3-clause
borderMappings :: [(A.AttrName, V.Attr)] borderMappings = [ (B.borderAttr, V.yellow `on` V.black) , (titleAttr, fg V.cyan) ]
155
borderMappings :: [(A.AttrName, V.Attr)] borderMappings = [ (B.borderAttr, V.yellow `on` V.black) , (titleAttr, fg V.cyan) ]
155
borderMappings = [ (B.borderAttr, V.yellow `on` V.black) , (titleAttr, fg V.cyan) ]
114
false
true
0
8
46
59
35
24
null
null
zjhmale/HMF
src/Ranked/Env.hs
bsd-3-clause
tcBool :: T tcBool = TConst "bool"
34
tcBool :: T tcBool = TConst "bool"
34
tcBool = TConst "bool"
22
false
true
0
6
6
20
8
12
null
null
gridaphobe/ghc
compiler/utils/Outputable.hs
bsd-3-clause
arrowtt = unicodeSyntax (char '⤜') (docToSDoc $ Pretty.text ">>-")
69
arrowtt = unicodeSyntax (char '⤜') (docToSDoc $ Pretty.text ">>-")
69
arrowtt = unicodeSyntax (char '⤜') (docToSDoc $ Pretty.text ">>-")
69
false
false
0
9
11
29
14
15
null
null
runjak/carbon-adf
Carbon/Data/Logic/ParseInstance.hs
gpl-3.0
addStatement :: Statement String -> InstanceParser (Statement String) addStatement s = do updateState $ \i -> i{statements = s:statements i} return s
153
addStatement :: Statement String -> InstanceParser (Statement String) addStatement s = do updateState $ \i -> i{statements = s:statements i} return s
153
addStatement s = do updateState $ \i -> i{statements = s:statements i} return s
83
false
true
0
12
25
63
30
33
null
null
balangs/eTeak
src/BalsaParser.hs
bsd-3-clause
whileCmd :: BalsaParser (Pos, Cmd) whileCmd = do pos <- keyword "loop" c1 <- optional NoCmd command ret <- optional (LoopCmd pos c1) $ do pos <- keyword "while" e <- expr optional (WhileCmd pos c1 e NoCmd) $ do keyword "then" c2 <- command return $ WhileCmd pos c1 e c2 keyword "end" return (pos, ret)
429
whileCmd :: BalsaParser (Pos, Cmd) whileCmd = do pos <- keyword "loop" c1 <- optional NoCmd command ret <- optional (LoopCmd pos c1) $ do pos <- keyword "while" e <- expr optional (WhileCmd pos c1 e NoCmd) $ do keyword "then" c2 <- command return $ WhileCmd pos c1 e c2 keyword "end" return (pos, ret)
425
whileCmd = do pos <- keyword "loop" c1 <- optional NoCmd command ret <- optional (LoopCmd pos c1) $ do pos <- keyword "while" e <- expr optional (WhileCmd pos c1 e NoCmd) $ do keyword "then" c2 <- command return $ WhileCmd pos c1 e c2 keyword "end" return (pos, ret)
390
false
true
0
15
184
152
67
85
null
null
mydaum/cabal
cabal-install/Distribution/Client/ProjectPlanning.hs
bsd-3-clause
------------------------------------------------------------------------------ -- * Elaborated install plan ------------------------------------------------------------------------------ -- "Elaborated" -- worked out with great care and nicety of detail; -- executed with great minuteness: elaborate preparations; -- elaborate care. -- -- So here's the idea: -- -- Rather than a miscellaneous collection of 'ConfigFlags', 'InstallFlags' etc -- all passed in as separate args and which are then further selected, -- transformed etc during the execution of the build. Instead we construct -- an elaborated install plan that includes everything we will need, and then -- during the execution of the plan we do as little transformation of this -- info as possible. -- -- So we're trying to split the work into two phases: construction of the -- elaborated install plan (which as far as possible should be pure) and -- then simple execution of that plan without any smarts, just doing what the -- plan says to do. -- -- So that means we need a representation of this fully elaborated install -- plan. The representation consists of two parts: -- -- * A 'ElaboratedInstallPlan'. This is a 'GenericInstallPlan' with a -- representation of source packages that includes a lot more detail about -- that package's individual configuration -- -- * A 'ElaboratedSharedConfig'. Some package configuration is the same for -- every package in a plan. Rather than duplicate that info every entry in -- the 'GenericInstallPlan' we keep that separately. -- -- The division between the shared and per-package config is /not set in stone -- for all time/. For example if we wanted to generalise the install plan to -- describe a situation where we want to build some packages with GHC and some -- with GHCJS then the platform and compiler would no longer be shared between -- all packages but would have to be per-package (probably with some sanity -- condition on the graph structure). -- -- Refer to ProjectPlanning.Types for details of these important types: -- type ElaboratedInstallPlan = ... -- type ElaboratedPlanPackage = ... -- data ElaboratedSharedConfig = ... -- data ElaboratedConfiguredPackage = ... -- data BuildStyle = -- | Check that an 'ElaboratedConfiguredPackage' actually makes -- sense under some 'ElaboratedSharedConfig'. sanityCheckElaboratedConfiguredPackage :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> a -> a sanityCheckElaboratedConfiguredPackage sharedConfig elab@ElaboratedConfiguredPackage{..} = (case elabPkgOrComp of ElabPackage pkg -> sanityCheckElaboratedPackage elab pkg ElabComponent comp -> sanityCheckElaboratedComponent elab comp) -- either a package is being built inplace, or the -- 'installedPackageId' we assigned is consistent with -- the 'hashedInstalledPackageId' we would compute from -- the elaborated configured package . assert (elabBuildStyle == BuildInplaceOnly || elabComponentId == hashedInstalledPackageId (packageHashInputs sharedConfig elab)) -- the stanzas explicitly disabled should not be available . assert (Set.null (Map.keysSet (Map.filter not elabStanzasRequested) `Set.intersection` elabStanzasAvailable)) -- either a package is built inplace, or we are not attempting to -- build any test suites or benchmarks (we never build these -- for remote packages!) . assert (elabBuildStyle == BuildInplaceOnly || Set.null elabStanzasAvailable)
3,601
sanityCheckElaboratedConfiguredPackage :: ElaboratedSharedConfig -> ElaboratedConfiguredPackage -> a -> a sanityCheckElaboratedConfiguredPackage sharedConfig elab@ElaboratedConfiguredPackage{..} = (case elabPkgOrComp of ElabPackage pkg -> sanityCheckElaboratedPackage elab pkg ElabComponent comp -> sanityCheckElaboratedComponent elab comp) -- either a package is being built inplace, or the -- 'installedPackageId' we assigned is consistent with -- the 'hashedInstalledPackageId' we would compute from -- the elaborated configured package . assert (elabBuildStyle == BuildInplaceOnly || elabComponentId == hashedInstalledPackageId (packageHashInputs sharedConfig elab)) -- the stanzas explicitly disabled should not be available . assert (Set.null (Map.keysSet (Map.filter not elabStanzasRequested) `Set.intersection` elabStanzasAvailable)) -- either a package is built inplace, or we are not attempting to -- build any test suites or benchmarks (we never build these -- for remote packages!) . assert (elabBuildStyle == BuildInplaceOnly || Set.null elabStanzasAvailable)
1,232
sanityCheckElaboratedConfiguredPackage sharedConfig elab@ElaboratedConfiguredPackage{..} = (case elabPkgOrComp of ElabPackage pkg -> sanityCheckElaboratedPackage elab pkg ElabComponent comp -> sanityCheckElaboratedComponent elab comp) -- either a package is being built inplace, or the -- 'installedPackageId' we assigned is consistent with -- the 'hashedInstalledPackageId' we would compute from -- the elaborated configured package . assert (elabBuildStyle == BuildInplaceOnly || elabComponentId == hashedInstalledPackageId (packageHashInputs sharedConfig elab)) -- the stanzas explicitly disabled should not be available . assert (Set.null (Map.keysSet (Map.filter not elabStanzasRequested) `Set.intersection` elabStanzasAvailable)) -- either a package is built inplace, or we are not attempting to -- build any test suites or benchmarks (we never build these -- for remote packages!) . assert (elabBuildStyle == BuildInplaceOnly || Set.null elabStanzasAvailable)
1,110
true
true
3
13
685
227
138
89
null
null
IanConnolly/aws-sdk-fork
AWS/EC2/Instance.hs
bsd-3-clause
riap ResetInstanceAttributeRequestRamdisk = "ramdisk"
61
riap ResetInstanceAttributeRequestRamdisk = "ramdisk"
61
riap ResetInstanceAttributeRequestRamdisk = "ramdisk"
61
false
false
0
4
11
10
4
6
null
null
avieth/Manifest
examples/User.hs
bsd-3-clause
johnsEmail = "john@jarndynce.com"
33
johnsEmail = "john@jarndynce.com"
33
johnsEmail = "john@jarndynce.com"
33
false
false
0
4
2
6
3
3
null
null
dpwright/z80
src/Z80/Operations.hs
mit
otdr = code [0xed, 0xbb]
24
otdr = code [0xed, 0xbb]
24
otdr = code [0xed, 0xbb]
24
false
false
1
5
4
18
8
10
null
null
forste/haReFork
tools/hs2html/MyDoc2litHTML.hs
bsd-3-clause
endtag t = text "</" <> text t <> char '>'
45
endtag t = text "</" <> text t <> char '>'
45
endtag t = text "</" <> text t <> char '>'
45
false
false
1
7
13
29
11
18
null
null
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/ANFTransform.hs
bsd-3-clause
normalize _ e@(Lit _) = return e
34
normalize _ e@(Lit _) = return e
34
normalize _ e@(Lit _) = return e
34
false
false
0
8
8
23
11
12
null
null
dkandalov/katas
haskell/p99/src/p9x/p70/P70.hs
unlicense
readNodes :: String -> ([MTree Char], String) readNodes xs@(')':_) = ([], xs)
77
readNodes :: String -> ([MTree Char], String) readNodes xs@(')':_) = ([], xs)
77
readNodes xs@(')':_) = ([], xs)
31
false
true
0
8
11
48
27
21
null
null
sebassimoes/haskell-bayesian
src/Bayesian/Inference/VariableElimination.hs
bsd-3-clause
vePr1EliminateVariable :: Variable -> [Factor] -> [Factor] vePr1EliminateVariable variable factors = let (factorsToEliminate, remainingFactors) = partition (elem variable.factorVars) factors in if null factorsToEliminate then remainingFactors else (summingOut [variable].foldr1 multiply $ factorsToEliminate) : remainingFactors
350
vePr1EliminateVariable :: Variable -> [Factor] -> [Factor] vePr1EliminateVariable variable factors = let (factorsToEliminate, remainingFactors) = partition (elem variable.factorVars) factors in if null factorsToEliminate then remainingFactors else (summingOut [variable].foldr1 multiply $ factorsToEliminate) : remainingFactors
350
vePr1EliminateVariable variable factors = let (factorsToEliminate, remainingFactors) = partition (elem variable.factorVars) factors in if null factorsToEliminate then remainingFactors else (summingOut [variable].foldr1 multiply $ factorsToEliminate) : remainingFactors
291
false
true
0
13
55
93
48
45
null
null
VinylRecords/Vinyl
tests/Aeson.hs
mit
-- | Try un-nesting a recursive 'Array' of fields. That is, if a -- 'Value' is laid out as @Array [Object [(key1,value1)], Array -- [Object [(key2, value2)], ...]]@ we extract all the key-value -- pairs, @[(key1,value1), (key2, value2), ...]@. unnestFields :: Value -> Value unnestFields v = maybe v Object (allAesonFields v)
325
unnestFields :: Value -> Value unnestFields v = maybe v Object (allAesonFields v)
81
unnestFields v = maybe v Object (allAesonFields v)
50
true
true
0
7
51
35
19
16
null
null
calebmer/postgrest
src/PostgREST/DbStructure.hs
mit
accessibleTables :: [Table] -> H.Tx P.Postgres s [Table] accessibleTables allTabs = do accessible <- H.listEx $ [H.stmt| SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('v','r','m') AND n.nspname NOT IN ('pg_catalog', 'information_schema') AND ( pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'::text) OR has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES'::text) ) ORDER BY table_schema, table_name |] let isAccessible table = isJust $ find (\(s,n) -> tableSchema table == s && tableName table == n) accessible return $ filter isAccessible allTabs
851
accessibleTables :: [Table] -> H.Tx P.Postgres s [Table] accessibleTables allTabs = do accessible <- H.listEx $ [H.stmt| SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('v','r','m') AND n.nspname NOT IN ('pg_catalog', 'information_schema') AND ( pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'::text) OR has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES'::text) ) ORDER BY table_schema, table_name |] let isAccessible table = isJust $ find (\(s,n) -> tableSchema table == s && tableName table == n) accessible return $ filter isAccessible allTabs
851
accessibleTables allTabs = do accessible <- H.listEx $ [H.stmt| SELECT n.nspname AS table_schema, c.relname AS table_name FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('v','r','m') AND n.nspname NOT IN ('pg_catalog', 'information_schema') AND ( pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER'::text) OR has_any_column_privilege(c.oid, 'SELECT, INSERT, UPDATE, REFERENCES'::text) ) ORDER BY table_schema, table_name |] let isAccessible table = isJust $ find (\(s,n) -> tableSchema table == s && tableName table == n) accessible return $ filter isAccessible allTabs
794
false
true
0
18
202
124
61
63
null
null
cirquit/hjc
src/Cmm/X86/Core.hs
mit
scale :: Lens' X86State Scale scale = lens _scale (\x y -> x { _scale = y })
78
scale :: Lens' X86State Scale scale = lens _scale (\x y -> x { _scale = y })
78
scale = lens _scale (\x y -> x { _scale = y })
46
false
true
0
9
19
39
21
18
null
null
TravisWhitaker/rdf
src/Data/RDF/ToRDF.hs
mit
newBlankNode :: RDFGen BlankNode newBlankNode = ReaderT (const ((BlankNode . toText . TL.decimal) <$> get <* modify' (+1)))
150
newBlankNode :: RDFGen BlankNode newBlankNode = ReaderT (const ((BlankNode . toText . TL.decimal) <$> get <* modify' (+1)))
150
newBlankNode = ReaderT (const ((BlankNode . toText . TL.decimal) <$> get <* modify' (+1)))
117
false
true
0
13
44
54
28
26
null
null
ghorn/monadic-modeling-test
Classes.hs
bsd-3-clause
getAllSyms :: (MonadState s (m s), Symbols s a) => m s (M.Map a (M.Map String Expr)) getAllSyms = do b <- get return (b ^. symbols b)
137
getAllSyms :: (MonadState s (m s), Symbols s a) => m s (M.Map a (M.Map String Expr)) getAllSyms = do b <- get return (b ^. symbols b)
137
getAllSyms = do b <- get return (b ^. symbols b)
52
false
true
0
11
31
84
41
43
null
null
mimi1vx/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkTr3b= verifyNot checkTr "tr -d '|/_[:upper:]'"
56
prop_checkTr3b= verifyNot checkTr "tr -d '|/_[:upper:]'"
56
prop_checkTr3b= verifyNot checkTr "tr -d '|/_[:upper:]'"
56
false
false
1
5
5
16
5
11
null
null
EricYT/real-world
src/chapter-13/buildmap.hs
apache-2.0
a1 = [(1, "one"), (2, "two"), (3, "three")]
43
a1 = [(1, "one"), (2, "two"), (3, "three")]
43
a1 = [(1, "one"), (2, "two"), (3, "three")]
43
false
false
1
6
7
36
21
15
null
null
meiersi/blaze-builder
benchmarks/Throughput/BinaryPut.hs
bsd-3-clause
putWord32N4Little = loop 0 where loop s n | s `seq` n `seq` False = undefined loop _ 0 = return () loop s n = do putWord32le (s+0) putWord32le (s+1) putWord32le (s+2) putWord32le (s+3) loop (s+4) (n-4)
269
putWord32N4Little = loop 0 where loop s n | s `seq` n `seq` False = undefined loop _ 0 = return () loop s n = do putWord32le (s+0) putWord32le (s+1) putWord32le (s+2) putWord32le (s+3) loop (s+4) (n-4)
269
putWord32N4Little = loop 0 where loop s n | s `seq` n `seq` False = undefined loop _ 0 = return () loop s n = do putWord32le (s+0) putWord32le (s+1) putWord32le (s+2) putWord32le (s+3) loop (s+4) (n-4)
269
false
false
2
11
105
138
67
71
null
null
charlesrosenbauer/Bzo-Compiler
src/Tokens.hs
gpl-3.0
showTk _ = "NIL"
34
showTk _ = "NIL"
34
showTk _ = "NIL"
34
false
false
0
4
21
10
4
6
null
null
YoshikuniJujo/hsgnutls
Network/GnuTLS/Attributes.hs
lgpl-2.1
get :: o -> ReadWriteAttr o a b -> IO a get o (Attr getter _) = getter o
72
get :: o -> ReadWriteAttr o a b -> IO a get o (Attr getter _) = getter o
72
get o (Attr getter _) = getter o
32
false
true
0
7
18
49
22
27
null
null
frawgie/cis194
HW1.hs
mit
-- Exercise 3 doubleEveryOther :: [Integer] -> [Integer] doubleEveryOther x = foldr doubler [] x where doubler num acc | (length acc + 1) `mod` 2 == 0 = num * 2 : acc | otherwise = num : acc -- Exercise 4
265
doubleEveryOther :: [Integer] -> [Integer] doubleEveryOther x = foldr doubler [] x where doubler num acc | (length acc + 1) `mod` 2 == 0 = num * 2 : acc | otherwise = num : acc -- Exercise 4
250
doubleEveryOther x = foldr doubler [] x where doubler num acc | (length acc + 1) `mod` 2 == 0 = num * 2 : acc | otherwise = num : acc -- Exercise 4
207
true
true
0
14
103
94
48
46
null
null
twittner/zeromq-haskell
src/Data/Restricted.hs
mit
fitByRem :: Int -> ByteString -> Restricted r ByteString fitByRem r s = let len = B.length s x = len `mod` r in if x == 0 then Restricted s else Restricted (B.take (len - x) s)
210
fitByRem :: Int -> ByteString -> Restricted r ByteString fitByRem r s = let len = B.length s x = len `mod` r in if x == 0 then Restricted s else Restricted (B.take (len - x) s)
210
fitByRem r s = let len = B.length s x = len `mod` r in if x == 0 then Restricted s else Restricted (B.take (len - x) s)
153
false
true
0
12
71
91
46
45
null
null
nakamuray/htig
HTIG/Database.hs
bsd-3-clause
garbageCollect :: Connection -> IO () garbageCollect conn = do clearOldTimeline conn clearOldMentions conn clearUnreferencedStatuses conn
149
garbageCollect :: Connection -> IO () garbageCollect conn = do clearOldTimeline conn clearOldMentions conn clearUnreferencedStatuses conn
149
garbageCollect conn = do clearOldTimeline conn clearOldMentions conn clearUnreferencedStatuses conn
111
false
true
0
8
27
46
18
28
null
null
JPMoresmau/leksah
src/IDE/Pane/Info.hs
gpl-2.0
gotoModule' :: IDEAction gotoModule' = do mbInfo <- getInfoCont case mbInfo of Nothing -> return () Just info -> void (triggerEventIDE (SelectIdent info)) -- | Replaces the symbol description and displays the info pane
254
gotoModule' :: IDEAction gotoModule' = do mbInfo <- getInfoCont case mbInfo of Nothing -> return () Just info -> void (triggerEventIDE (SelectIdent info)) -- | Replaces the symbol description and displays the info pane
254
gotoModule' = do mbInfo <- getInfoCont case mbInfo of Nothing -> return () Just info -> void (triggerEventIDE (SelectIdent info)) -- | Replaces the symbol description and displays the info pane
229
false
true
0
14
69
61
29
32
null
null
amoerie/labyrinth
Labyrinth/Game.hs
mit
getCards :: Player -> Cards getCards (Player _ _ _ cards) = cards
65
getCards :: Player -> Cards getCards (Player _ _ _ cards) = cards
65
getCards (Player _ _ _ cards) = cards
37
false
true
0
9
12
36
16
20
null
null
FranklinChen/hugs98-plus-Sep2006
packages/GLUT/examples/RedBook/Image.hs
bsd-3-clause
motion :: State -> MotionCallback motion state (Position x y) = do Size _ height <- get windowSize let screenY = height - y -- resolve overloading, not needed in "real" programs let rasterPos2i = rasterPos :: Vertex2 GLint -> IO () rasterPos2i (Vertex2 x screenY) z <- get (zoomFactor state) pixelZoom $= (z, z) copyPixels (Position 0 0) checkImageSize CopyColor pixelZoom $= (1, 1) flush
418
motion :: State -> MotionCallback motion state (Position x y) = do Size _ height <- get windowSize let screenY = height - y -- resolve overloading, not needed in "real" programs let rasterPos2i = rasterPos :: Vertex2 GLint -> IO () rasterPos2i (Vertex2 x screenY) z <- get (zoomFactor state) pixelZoom $= (z, z) copyPixels (Position 0 0) checkImageSize CopyColor pixelZoom $= (1, 1) flush
418
motion state (Position x y) = do Size _ height <- get windowSize let screenY = height - y -- resolve overloading, not needed in "real" programs let rasterPos2i = rasterPos :: Vertex2 GLint -> IO () rasterPos2i (Vertex2 x screenY) z <- get (zoomFactor state) pixelZoom $= (z, z) copyPixels (Position 0 0) checkImageSize CopyColor pixelZoom $= (1, 1) flush
384
false
true
0
12
95
164
75
89
null
null
MarcosPividori/GSoC-Communicating-with-mobile-devices
push-notify-general/Network/PushNotify/General/Send.hs
mit
-- | 'startPushService' starts the PushService creating a PushManager. startPushService :: PushServiceConfig -> IO PushManager startPushService pConfig = do let cnfg = pushConfig pConfig gcmflag = case gcmConfig cnfg of Just (Http _) -> True _ -> False httpMan <- if gcmflag || isJust (mpnsConfig cnfg) then do m <- newManager defaultManagerSettings return (Just m) else return Nothing apnsMan <- case apnsConfig cnfg of Just cnf -> do m <- startAPNS cnf return (Just m) Nothing -> return Nothing ccsMan <- case gcmConfig cnfg of Just (Ccs cnf) -> do m <- startCCS cnf (\d -> (newMessageCallback pConfig) (GCM d)) return (Just m) _ -> return Nothing return $ PushManager httpMan apnsMan ccsMan pConfig -- | 'closePushService' stops the Push service.
1,340
startPushService :: PushServiceConfig -> IO PushManager startPushService pConfig = do let cnfg = pushConfig pConfig gcmflag = case gcmConfig cnfg of Just (Http _) -> True _ -> False httpMan <- if gcmflag || isJust (mpnsConfig cnfg) then do m <- newManager defaultManagerSettings return (Just m) else return Nothing apnsMan <- case apnsConfig cnfg of Just cnf -> do m <- startAPNS cnf return (Just m) Nothing -> return Nothing ccsMan <- case gcmConfig cnfg of Just (Ccs cnf) -> do m <- startCCS cnf (\d -> (newMessageCallback pConfig) (GCM d)) return (Just m) _ -> return Nothing return $ PushManager httpMan apnsMan ccsMan pConfig -- | 'closePushService' stops the Push service.
1,269
startPushService pConfig = do let cnfg = pushConfig pConfig gcmflag = case gcmConfig cnfg of Just (Http _) -> True _ -> False httpMan <- if gcmflag || isJust (mpnsConfig cnfg) then do m <- newManager defaultManagerSettings return (Just m) else return Nothing apnsMan <- case apnsConfig cnfg of Just cnf -> do m <- startAPNS cnf return (Just m) Nothing -> return Nothing ccsMan <- case gcmConfig cnfg of Just (Ccs cnf) -> do m <- startCCS cnf (\d -> (newMessageCallback pConfig) (GCM d)) return (Just m) _ -> return Nothing return $ PushManager httpMan apnsMan ccsMan pConfig -- | 'closePushService' stops the Push service.
1,213
true
true
0
20
711
281
127
154
null
null
skadinyo/conc
haskell/math.hs
epl-1.0
countFactor 1 = 1
17
countFactor 1 = 1
17
countFactor 1 = 1
17
false
false
0
4
3
10
4
6
null
null
mcschroeder/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
snocCts :: Cts -> Ct -> Cts snocCts = snocBag
45
snocCts :: Cts -> Ct -> Cts snocCts = snocBag
45
snocCts = snocBag
17
false
true
0
6
9
19
10
9
null
null
dinnu93/CIS194
Lecture-02/LogAnalysis.hs
cc0-1.0
insert logMsg Leaf = Node Leaf logMsg Leaf
42
insert logMsg Leaf = Node Leaf logMsg Leaf
42
insert logMsg Leaf = Node Leaf logMsg Leaf
42
false
false
0
5
7
19
8
11
null
null
athanclark/hackage-use
src/Fetch/Cabal.hs
bsd-3-clause
libDependencies :: GenericPackageDescription -> Maybe [Dependency] libDependencies pd = (targetBuildDepends . libBuildInfo . condTreeData) <$> condLibrary pd
157
libDependencies :: GenericPackageDescription -> Maybe [Dependency] libDependencies pd = (targetBuildDepends . libBuildInfo . condTreeData) <$> condLibrary pd
157
libDependencies pd = (targetBuildDepends . libBuildInfo . condTreeData) <$> condLibrary pd
90
false
true
0
8
16
42
21
21
null
null
beala/twitter-markov
src/lib/TwitterMarkov/IO.hs
mit
parseDir :: (Functor m, Applicative m, MonadIO m, MonadError ParseError m) => FilePath -> m [Tweet] parseDir dirPath = do files <- liftIO $ getDirectoryFiles dirPath join <$> traverse parseFile files
203
parseDir :: (Functor m, Applicative m, MonadIO m, MonadError ParseError m) => FilePath -> m [Tweet] parseDir dirPath = do files <- liftIO $ getDirectoryFiles dirPath join <$> traverse parseFile files
203
parseDir dirPath = do files <- liftIO $ getDirectoryFiles dirPath join <$> traverse parseFile files
103
false
true
0
9
34
79
38
41
null
null
CloudI/CloudI
src/api/haskell/src/Foreign/Erlang.hs
mit
termsToBinary (OtpErlangMap value) = let length = Map.size value in if length <= 4294967295 then case Map.foldlWithKey mapPairToBinary (Right Monoid.mempty) value of Left err -> errorType err Right mapValue -> ok $ Builder.toLazyByteString $ Builder.word8 tagMapExt <> Builder.word32BE (fromIntegral length) <> mapValue else errorType $ OutputError "uint32 overflow"
510
termsToBinary (OtpErlangMap value) = let length = Map.size value in if length <= 4294967295 then case Map.foldlWithKey mapPairToBinary (Right Monoid.mempty) value of Left err -> errorType err Right mapValue -> ok $ Builder.toLazyByteString $ Builder.word8 tagMapExt <> Builder.word32BE (fromIntegral length) <> mapValue else errorType $ OutputError "uint32 overflow"
510
termsToBinary (OtpErlangMap value) = let length = Map.size value in if length <= 4294967295 then case Map.foldlWithKey mapPairToBinary (Right Monoid.mempty) value of Left err -> errorType err Right mapValue -> ok $ Builder.toLazyByteString $ Builder.word8 tagMapExt <> Builder.word32BE (fromIntegral length) <> mapValue else errorType $ OutputError "uint32 overflow"
510
false
false
2
15
191
128
59
69
null
null
gamelost/pcgen-rules
src/Pcc.hs
apache-2.0
parseInversion :: PParser PCCTag parseInversion = PCCInvert <$> (char '!' >> parseDataTag)
90
parseInversion :: PParser PCCTag parseInversion = PCCInvert <$> (char '!' >> parseDataTag)
90
parseInversion = PCCInvert <$> (char '!' >> parseDataTag)
57
false
true
0
9
11
34
15
19
null
null
mzero/plush
src/Plush/Run/TestExec.hs
apache-2.0
directoryMustNotExist :: String -> FilePath -> FileSystem -> DirPath -> TestExec () directoryMustNotExist fn fp fs dp = when (fsDirectoryExists fs dp) $ raise alreadyExistsErrorType fn fp
191
directoryMustNotExist :: String -> FilePath -> FileSystem -> DirPath -> TestExec () directoryMustNotExist fn fp fs dp = when (fsDirectoryExists fs dp) $ raise alreadyExistsErrorType fn fp
191
directoryMustNotExist fn fp fs dp = when (fsDirectoryExists fs dp) $ raise alreadyExistsErrorType fn fp
107
false
true
0
10
30
67
31
36
null
null
mmarx/jebediah
src/Jebediah/MIDI/Nord/Electro4.hs
gpl-3.0
mkEnum "Toggle" [enum| Off 0 On 127|] data Electro4 = Electro4
97
mkEnum "Toggle" [enum| Off 0 On 127|] data Electro4 = Electro4
97
mkEnum "Toggle" [enum| Off 0 On 127|] data Electro4 = Electro4
97
false
false
0
5
45
21
11
10
null
null
paulbarbu/ePseudocode
src/EPseudocode/Evaluator.hs
bsd-3-clause
eval :: Env -> Stmt -> ErrorWithIO (Env, Expr) eval env Break = return ((":stopiteration:", Bool True):env, Void)
113
eval :: Env -> Stmt -> ErrorWithIO (Env, Expr) eval env Break = return ((":stopiteration:", Bool True):env, Void)
113
eval env Break = return ((":stopiteration:", Bool True):env, Void)
66
false
true
0
9
17
59
30
29
null
null
ruslantalpa/postgrest
src/PostgREST/DbRequestBuilder.hs
mit
addOrder :: (EmbedPath, [OrderTerm]) -> ReadRequest -> ReadRequest addOrder = addProperty addOrderToNode
104
addOrder :: (EmbedPath, [OrderTerm]) -> ReadRequest -> ReadRequest addOrder = addProperty addOrderToNode
104
addOrder = addProperty addOrderToNode
37
false
true
0
7
11
31
17
14
null
null
binesiyu/ifl
Core/CoreParse.hs
mit
clex (c:cs) | isDigit c = num_token : clex rest_cs where num_token = c : takeWhile isDigit cs rest_cs = dropWhile isDigit cs
165
clex (c:cs) | isDigit c = num_token : clex rest_cs where num_token = c : takeWhile isDigit cs rest_cs = dropWhile isDigit cs
165
clex (c:cs) | isDigit c = num_token : clex rest_cs where num_token = c : takeWhile isDigit cs rest_cs = dropWhile isDigit cs
165
false
false
0
8
63
60
27
33
null
null
takoeight0821/malgo
src/Koriel/Core/Lint.hs
bsd-3-clause
lintExp :: (MonadReader [Id a] m, HasType a, Eq a, Pretty a) => Exp (Id a) -> m () lintExp (Atom x) = lintAtom x
112
lintExp :: (MonadReader [Id a] m, HasType a, Eq a, Pretty a) => Exp (Id a) -> m () lintExp (Atom x) = lintAtom x
112
lintExp (Atom x) = lintAtom x
29
false
true
0
9
24
76
37
39
null
null
Teaspot-Studio/GPipe-Core
src/Graphics/GPipe/Internal/FrameBuffer.hs
mit
-- | Perform a stencil test and depth test (in that order) for each fragment from a 'FragmentStream' and write a color value from each fragment that passes the tests into the context window. drawContextColorDepthStencil :: forall os s c ds. (ContextColorFormat c, DepthRenderable ds, StencilRenderable ds) => (s -> (ContextColorOption c, DepthStencilOption)) -> FragmentStream (FragColor c, FragDepth) -> Shader os (ContextFormat c ds) s () drawContextColor sf fs = Shader $ tellDrawcalls fs $ \ a -> make3 (setColor cf 0 a) io where io s = (Nothing, glDisable GL_DEPTH_TEST >> glDisable GL_STENCIL_TEST >> setGlContextColorOptions cf (sf s)) cf = undefined :: c
725
drawContextColorDepthStencil :: forall os s c ds. (ContextColorFormat c, DepthRenderable ds, StencilRenderable ds) => (s -> (ContextColorOption c, DepthStencilOption)) -> FragmentStream (FragColor c, FragDepth) -> Shader os (ContextFormat c ds) s () drawContextColor sf fs = Shader $ tellDrawcalls fs $ \ a -> make3 (setColor cf 0 a) io where io s = (Nothing, glDisable GL_DEPTH_TEST >> glDisable GL_STENCIL_TEST >> setGlContextColorOptions cf (sf s)) cf = undefined :: c
533
drawContextColor sf fs = Shader $ tellDrawcalls fs $ \ a -> make3 (setColor cf 0 a) io where io s = (Nothing, glDisable GL_DEPTH_TEST >> glDisable GL_STENCIL_TEST >> setGlContextColorOptions cf (sf s)) cf = undefined :: c
283
true
true
0
11
166
181
94
87
null
null
ahmadsalim/p3-tool
p3-tool/FPromela/Pretty.hs
gpl-3.0
prettyModule (MTrace seq) = text "trace" $+$ niceBraces (nest 4 (prettySequence seq)) <> semi $+$ space
105
prettyModule (MTrace seq) = text "trace" $+$ niceBraces (nest 4 (prettySequence seq)) <> semi $+$ space
105
prettyModule (MTrace seq) = text "trace" $+$ niceBraces (nest 4 (prettySequence seq)) <> semi $+$ space
105
false
false
0
12
17
47
22
25
null
null
ezyang/ghc
compiler/prelude/PrimOp.hs
bsd-3-clause
monadic_fun_ty ty = mkFunTy ty ty
34
monadic_fun_ty ty = mkFunTy ty ty
34
monadic_fun_ty ty = mkFunTy ty ty
34
false
false
0
5
6
14
6
8
null
null