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
tomas-stuina/fp
src/Game.hs
bsd-3-clause
hasWon :: Char -> [Move] -> Bool hasWon m moves = let board = movesToString moves horizontals = fullRow m board -- Patikrinamos horizontalios eilutes vertical [a1,b1,c1,a2,b2,c2,a3,b3,c3] = fullRow m [a1,a2,a3,b1,b2,b3,c1,c2,c3] -- Vertikalios paverciamos horizontaliomis ir patikrinamos. diagonal [a1,_,b1,_,c2,_,b3,_,a3] = fullRow m [a1,c2,a3,b1,c2,b3] -- Istrizaines paverciamos horizontaliomis ir patikrinamos. in horizontals || diagonal board || vertical board
489
hasWon :: Char -> [Move] -> Bool hasWon m moves = let board = movesToString moves horizontals = fullRow m board -- Patikrinamos horizontalios eilutes vertical [a1,b1,c1,a2,b2,c2,a3,b3,c3] = fullRow m [a1,a2,a3,b1,b2,b3,c1,c2,c3] -- Vertikalios paverciamos horizontaliomis ir patikrinamos. diagonal [a1,_,b1,_,c2,_,b3,_,a3] = fullRow m [a1,c2,a3,b1,c2,b3] -- Istrizaines paverciamos horizontaliomis ir patikrinamos. in horizontals || diagonal board || vertical board
489
hasWon m moves = let board = movesToString moves horizontals = fullRow m board -- Patikrinamos horizontalios eilutes vertical [a1,b1,c1,a2,b2,c2,a3,b3,c3] = fullRow m [a1,a2,a3,b1,b2,b3,c1,c2,c3] -- Vertikalios paverciamos horizontaliomis ir patikrinamos. diagonal [a1,_,b1,_,c2,_,b3,_,a3] = fullRow m [a1,c2,a3,b1,c2,b3] -- Istrizaines paverciamos horizontaliomis ir patikrinamos. in horizontals || diagonal board || vertical board
456
false
true
0
10
80
197
113
84
null
null
uuhan/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
c_irts FFunctionIO l x = error "Return of function from foreign call is not supported"
86
c_irts FFunctionIO l x = error "Return of function from foreign call is not supported"
86
c_irts FFunctionIO l x = error "Return of function from foreign call is not supported"
86
false
false
0
5
14
18
7
11
null
null
frelindb/agsyHOL
Main.hs
mit
a [] = if null (problemfile a) then Nothing else Just a
55
a [] = if null (problemfile a) then Nothing else Just a
55
a [] = if null (problemfile a) then Nothing else Just a
55
false
false
1
8
11
34
15
19
null
null
ulricha/dsh
src/Database/DSH/Translate/NKL2FKL.hs
bsd-3-clause
deepFlatten ctx (N.Let _ x xs e) = P.let_ x <$> deepFlatten ctx xs <*> local (bindEnv x (typeOf xs)) (deepFlatten ctx e)
172
deepFlatten ctx (N.Let _ x xs e) = P.let_ x <$> deepFlatten ctx xs <*> local (bindEnv x (typeOf xs)) (deepFlatten ctx e)
172
deepFlatten ctx (N.Let _ x xs e) = P.let_ x <$> deepFlatten ctx xs <*> local (bindEnv x (typeOf xs)) (deepFlatten ctx e)
172
false
false
0
10
74
72
33
39
null
null
chjp2046/fbthrift
thrift/lib/hs/Thrift/Protocol/PrettyJSON.hs
apache-2.0
buildJSONValue :: Int -> Int -> ThriftVal -> Builder buildJSONValue i l (TStruct fields) = "{" <> indented (l + i) <> buildJSONStruct i (l + i) fields <> indented l <> "}"
175
buildJSONValue :: Int -> Int -> ThriftVal -> Builder buildJSONValue i l (TStruct fields) = "{" <> indented (l + i) <> buildJSONStruct i (l + i) fields <> indented l <> "}"
175
buildJSONValue i l (TStruct fields) = "{" <> indented (l + i) <> buildJSONStruct i (l + i) fields <> indented l <> "}"
122
false
true
0
11
36
79
39
40
null
null
acharal/hopes
src/interpreter/Driver.hs
gpl-2.0
parseFromFile fname parser = do file <- liftIO $ openFile fname ReadMode content <- liftIO $ hGetContents file parsed <- runParser $ fromFile fname $ withInput content $ parser case parsed of Right (ast,s) -> return ast Left msgs -> processMsgs msgs
290
parseFromFile fname parser = do file <- liftIO $ openFile fname ReadMode content <- liftIO $ hGetContents file parsed <- runParser $ fromFile fname $ withInput content $ parser case parsed of Right (ast,s) -> return ast Left msgs -> processMsgs msgs
290
parseFromFile fname parser = do file <- liftIO $ openFile fname ReadMode content <- liftIO $ hGetContents file parsed <- runParser $ fromFile fname $ withInput content $ parser case parsed of Right (ast,s) -> return ast Left msgs -> processMsgs msgs
290
false
false
0
11
82
103
46
57
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs
mpl-2.0
-- | The parsed version of the raw message data schematized according to this -- store\'s schemas and type definitions. mSchematizedData :: Lens' Message (Maybe SchematizedData) mSchematizedData = lens _mSchematizedData (\ s a -> s{_mSchematizedData = a})
263
mSchematizedData :: Lens' Message (Maybe SchematizedData) mSchematizedData = lens _mSchematizedData (\ s a -> s{_mSchematizedData = a})
143
mSchematizedData = lens _mSchematizedData (\ s a -> s{_mSchematizedData = a})
85
true
true
2
9
44
56
26
30
null
null
kim/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs
mpl-2.0
-- | For load-based or time-based instances, the type. iAutoScalingType :: Lens' Instance (Maybe AutoScalingType) iAutoScalingType = lens _iAutoScalingType (\s a -> s { _iAutoScalingType = a })
193
iAutoScalingType :: Lens' Instance (Maybe AutoScalingType) iAutoScalingType = lens _iAutoScalingType (\s a -> s { _iAutoScalingType = a })
138
iAutoScalingType = lens _iAutoScalingType (\s a -> s { _iAutoScalingType = a })
79
true
true
0
9
27
46
25
21
null
null
reinerp/vector-derive
Data/Vector/Unboxed/Derive.hs
bsd-3-clause
enumSimpleReprInstance ty n = do let reprType = if n == 2 then ''Bool else if n <= 256 then ''Word8 else ''Word --when (n > 256) $ reportError ("Enums with more than 256 constructors not yet supported. Type: " ++ show ty) x <- newName "x" return [InstanceD [] (appTy ''SimpleRepr [ty]) (concat [[TySynInstD ''ElemRep [ty] (ConT reprType)], fun 'toRep [x] (app 'toEnum [app 'fromEnum [var x]]), fun 'fromRep [x] (app 'toEnum [app 'fromEnum [var x]])])] -- | Generate the 'SimpleRepr' as 'ElemRep a = StrictBox a'.
584
enumSimpleReprInstance ty n = do let reprType = if n == 2 then ''Bool else if n <= 256 then ''Word8 else ''Word --when (n > 256) $ reportError ("Enums with more than 256 constructors not yet supported. Type: " ++ show ty) x <- newName "x" return [InstanceD [] (appTy ''SimpleRepr [ty]) (concat [[TySynInstD ''ElemRep [ty] (ConT reprType)], fun 'toRep [x] (app 'toEnum [app 'fromEnum [var x]]), fun 'fromRep [x] (app 'toEnum [app 'fromEnum [var x]])])] -- | Generate the 'SimpleRepr' as 'ElemRep a = StrictBox a'.
584
enumSimpleReprInstance ty n = do let reprType = if n == 2 then ''Bool else if n <= 256 then ''Word8 else ''Word --when (n > 256) $ reportError ("Enums with more than 256 constructors not yet supported. Type: " ++ show ty) x <- newName "x" return [InstanceD [] (appTy ''SimpleRepr [ty]) (concat [[TySynInstD ''ElemRep [ty] (ConT reprType)], fun 'toRep [x] (app 'toEnum [app 'fromEnum [var x]]), fun 'fromRep [x] (app 'toEnum [app 'fromEnum [var x]])])] -- | Generate the 'SimpleRepr' as 'ElemRep a = StrictBox a'.
584
false
false
0
19
159
199
105
94
null
null
wxwxwwxxx/ghc
compiler/nativeGen/SPARC/Regs.hs
bsd-3-clause
-- | Produce the second-half-of-a-double register given the first half. {- fPair :: Reg -> Maybe Reg fPair (RealReg n) | n >= 32 && n `mod` 2 == 0 = Just (RealReg (n+1)) fPair (VirtualRegD u) = Just (VirtualRegHi u) fPair reg = trace ("MachInstrs.fPair: can't get high half of supposed double reg " ++ showPpr reg) Nothing -} -- | All the regs that the register allocator can allocate to, -- with the the fixed use regs removed. -- allocatableRegs :: [RealReg] allocatableRegs = let isFree rr = case rr of RealRegSingle r -> freeReg r RealRegPair r1 r2 -> freeReg r1 && freeReg r2 in filter isFree allRealRegs
716
allocatableRegs :: [RealReg] allocatableRegs = let isFree rr = case rr of RealRegSingle r -> freeReg r RealRegPair r1 r2 -> freeReg r1 && freeReg r2 in filter isFree allRealRegs
234
allocatableRegs = let isFree rr = case rr of RealRegSingle r -> freeReg r RealRegPair r1 r2 -> freeReg r1 && freeReg r2 in filter isFree allRealRegs
205
true
true
0
13
217
78
37
41
null
null
brendanhay/gogol
gogol-storage/gen/Network/Google/Resource/Storage/Notifications/Delete.hs
mpl-2.0
-- | The project to be billed for this request if the target bucket is -- requester-pays bucket. ndProvisionalUserProject :: Lens' NotificationsDelete (Maybe Text) ndProvisionalUserProject = lens _ndProvisionalUserProject (\ s a -> s{_ndProvisionalUserProject = a})
273
ndProvisionalUserProject :: Lens' NotificationsDelete (Maybe Text) ndProvisionalUserProject = lens _ndProvisionalUserProject (\ s a -> s{_ndProvisionalUserProject = a})
176
ndProvisionalUserProject = lens _ndProvisionalUserProject (\ s a -> s{_ndProvisionalUserProject = a})
109
true
true
1
9
42
52
26
26
null
null
christiaanb/DepCore
Test2.hs
bsd-2-clause
eval _ Type = return VType
41
eval _ Type = return VType
41
eval _ Type = return VType
41
false
false
0
5
20
14
6
8
null
null
acowley/ghc
compiler/utils/Bag.hs
bsd-3-clause
lengthBag (ListBag xs) = length xs
37
lengthBag (ListBag xs) = length xs
37
lengthBag (ListBag xs) = length xs
37
false
false
0
7
8
18
8
10
null
null
GaloisInc/saw-script
src/SAWScript/Value.hs
bsd-3-clause
scriptTopLevel :: TopLevel a -> ProofScript a scriptTopLevel m = ProofScript (lift (lift m))
92
scriptTopLevel :: TopLevel a -> ProofScript a scriptTopLevel m = ProofScript (lift (lift m))
92
scriptTopLevel m = ProofScript (lift (lift m))
46
false
true
0
9
13
39
18
21
null
null
Mikolaj/miniutter
NLP/Miniutter/English.hs
bsd-3-clause
capitalize :: Text -> Text capitalize t = case T.uncons t of Nothing -> T.empty Just (c, rest) -> T.cons (toUpper c) rest
132
capitalize :: Text -> Text capitalize t = case T.uncons t of Nothing -> T.empty Just (c, rest) -> T.cons (toUpper c) rest
132
capitalize t = case T.uncons t of Nothing -> T.empty Just (c, rest) -> T.cons (toUpper c) rest
105
false
true
0
10
33
68
32
36
null
null
mfejzer/knuth-bendix-completion
Parser.hs
bsd-3-clause
argsParser :: GenParser Char st [Term] argsParser = do args <- sepBy termParser (char ',') return $ args
107
argsParser :: GenParser Char st [Term] argsParser = do args <- sepBy termParser (char ',') return $ args
107
argsParser = do args <- sepBy termParser (char ',') return $ args
68
false
true
0
10
20
46
22
24
null
null
hnakamur/haskell-sandbox
sandbox-json/SandBox/Data/JSON/PrettyPrint.hs
bsd-3-clause
hexEscape :: Char -> Doc hexEscape c | d < 0x10000 = smallHex d | otherwise = astral d where d = ord c
116
hexEscape :: Char -> Doc hexEscape c | d < 0x10000 = smallHex d | otherwise = astral d where d = ord c
116
hexEscape c | d < 0x10000 = smallHex d | otherwise = astral d where d = ord c
91
false
true
1
8
37
65
26
39
null
null
potatosalad/cis194
src/Cis194/Week6/Fibonacci.hs
bsd-3-clause
fib n = fib (n - 1) + fib (n - 2)
33
fib n = fib (n - 1) + fib (n - 2)
33
fib n = fib (n - 1) + fib (n - 2)
33
false
false
3
7
11
38
16
22
null
null
DaMSL/K3
src/Language/K3/Core/Constructor/Type.hs
apache-2.0
declaredVar :: Identifier -> K3 Type declaredVar i = Node (TDeclaredVar i :@: []) []
84
declaredVar :: Identifier -> K3 Type declaredVar i = Node (TDeclaredVar i :@: []) []
84
declaredVar i = Node (TDeclaredVar i :@: []) []
47
false
true
0
8
14
45
20
25
null
null
AlexeyRaga/eta
compiler/ETA/DeSugar/DsForeign.hs
bsd-3-clause
castResult :: ExtendsInfo -> Type -> Type -> DsM (Maybe [CoreExpr]) castResult extendsInfo javaTagType resultType | Just var <- getTyVar_maybe resultType , Just (dictId, tagType, bound) <- lookupVarEnv extendsInfo var = do castId <- getClassCastId bound let rawTypeArgs = map Type [resultType, tagType] typeArgs = whenExtends bound rawTypeArgs return . Just $ rawTypeArgs ++ [ Type javaTagType , mkCoreApps (Var castId) (typeArgs ++ [Var dictId]) ] | otherwise = return Nothing
550
castResult :: ExtendsInfo -> Type -> Type -> DsM (Maybe [CoreExpr]) castResult extendsInfo javaTagType resultType | Just var <- getTyVar_maybe resultType , Just (dictId, tagType, bound) <- lookupVarEnv extendsInfo var = do castId <- getClassCastId bound let rawTypeArgs = map Type [resultType, tagType] typeArgs = whenExtends bound rawTypeArgs return . Just $ rawTypeArgs ++ [ Type javaTagType , mkCoreApps (Var castId) (typeArgs ++ [Var dictId]) ] | otherwise = return Nothing
550
castResult extendsInfo javaTagType resultType | Just var <- getTyVar_maybe resultType , Just (dictId, tagType, bound) <- lookupVarEnv extendsInfo var = do castId <- getClassCastId bound let rawTypeArgs = map Type [resultType, tagType] typeArgs = whenExtends bound rawTypeArgs return . Just $ rawTypeArgs ++ [ Type javaTagType , mkCoreApps (Var castId) (typeArgs ++ [Var dictId]) ] | otherwise = return Nothing
482
false
true
0
15
143
190
90
100
null
null
AnkalagonBlack/th-expander
src/Utils/THExpander.hs
bsd-3-clause
generateCompileString :: EnvType -> String generateCompileString t | t == Stack || t == Cabal = (env t) ++ " exec ghc " ++ " -- " ++ "-dth-dec-file -ddump-splices " | t == Plain = "ghc -dth-dec-file -ddump-splices " where env Stack = "stack" env Cabal = "cabal"
301
generateCompileString :: EnvType -> String generateCompileString t | t == Stack || t == Cabal = (env t) ++ " exec ghc " ++ " -- " ++ "-dth-dec-file -ddump-splices " | t == Plain = "ghc -dth-dec-file -ddump-splices " where env Stack = "stack" env Cabal = "cabal"
301
generateCompileString t | t == Stack || t == Cabal = (env t) ++ " exec ghc " ++ " -- " ++ "-dth-dec-file -ddump-splices " | t == Plain = "ghc -dth-dec-file -ddump-splices " where env Stack = "stack" env Cabal = "cabal"
258
false
true
0
10
88
86
41
45
null
null
sdiehl/ghc
testsuite/tests/simplCore/should_compile/T15517a.hs
bsd-3-clause
pat1 :: PoA Singl (El FamRoseInt) '[I Z, I (S Z)] -> NS (PoA Singl (El FamRoseInt)) '[ '[], '[I Z, I (S Z)]] pat1 d = There (Here d)
137
pat1 :: PoA Singl (El FamRoseInt) '[I Z, I (S Z)] -> NS (PoA Singl (El FamRoseInt)) '[ '[], '[I Z, I (S Z)]] pat1 d = There (Here d)
137
pat1 d = There (Here d)
23
false
true
0
13
34
111
55
56
null
null
dcreager/cabal
Distribution/PackageDescription/Parse.hs
bsd-3-clause
-- --------------------------------------------------------------------------- -- The BuildInfo type binfoFieldDescrs :: [FieldDescr BuildInfo] binfoFieldDescrs = [ boolField "buildable" buildable (\val binfo -> binfo{buildable=val}) , commaListField "build-tools" disp parseBuildTool buildTools (\xs binfo -> binfo{buildTools=xs}) , spaceListField "cpp-options" showToken parseTokenQ' cppOptions (\val binfo -> binfo{cppOptions=val}) , spaceListField "cc-options" showToken parseTokenQ' ccOptions (\val binfo -> binfo{ccOptions=val}) , spaceListField "ld-options" showToken parseTokenQ' ldOptions (\val binfo -> binfo{ldOptions=val}) , commaListField "pkgconfig-depends" disp parsePkgconfigDependency pkgconfigDepends (\xs binfo -> binfo{pkgconfigDepends=xs}) , listField "frameworks" showToken parseTokenQ frameworks (\val binfo -> binfo{frameworks=val}) , listField "c-sources" showFilePath parseFilePathQ cSources (\paths binfo -> binfo{cSources=paths}) , listField "extensions" disp parseExtensionQ extensions (\exts binfo -> binfo{extensions=exts}) , listField "extra-libraries" showToken parseTokenQ extraLibs (\xs binfo -> binfo{extraLibs=xs}) , listField "extra-lib-dirs" showFilePath parseFilePathQ extraLibDirs (\xs binfo -> binfo{extraLibDirs=xs}) , listField "includes" showFilePath parseFilePathQ includes (\paths binfo -> binfo{includes=paths}) , listField "install-includes" showFilePath parseFilePathQ installIncludes (\paths binfo -> binfo{installIncludes=paths}) , listField "include-dirs" showFilePath parseFilePathQ includeDirs (\paths binfo -> binfo{includeDirs=paths}) , listField "hs-source-dirs" showFilePath parseFilePathQ hsSourceDirs (\paths binfo -> binfo{hsSourceDirs=paths}) , listField "other-modules" disp parseModuleNameQ otherModules (\val binfo -> binfo{otherModules=val}) , listField "ghc-prof-options" text parseTokenQ ghcProfOptions (\val binfo -> binfo{ghcProfOptions=val}) , listField "ghc-shared-options" text parseTokenQ ghcProfOptions (\val binfo -> binfo{ghcSharedOptions=val}) , optsField "ghc-options" GHC options (\path binfo -> binfo{options=path}) , optsField "hugs-options" Hugs options (\path binfo -> binfo{options=path}) , optsField "nhc98-options" NHC options (\path binfo -> binfo{options=path}) , optsField "jhc-options" JHC options (\path binfo -> binfo{options=path}) ]
3,172
binfoFieldDescrs :: [FieldDescr BuildInfo] binfoFieldDescrs = [ boolField "buildable" buildable (\val binfo -> binfo{buildable=val}) , commaListField "build-tools" disp parseBuildTool buildTools (\xs binfo -> binfo{buildTools=xs}) , spaceListField "cpp-options" showToken parseTokenQ' cppOptions (\val binfo -> binfo{cppOptions=val}) , spaceListField "cc-options" showToken parseTokenQ' ccOptions (\val binfo -> binfo{ccOptions=val}) , spaceListField "ld-options" showToken parseTokenQ' ldOptions (\val binfo -> binfo{ldOptions=val}) , commaListField "pkgconfig-depends" disp parsePkgconfigDependency pkgconfigDepends (\xs binfo -> binfo{pkgconfigDepends=xs}) , listField "frameworks" showToken parseTokenQ frameworks (\val binfo -> binfo{frameworks=val}) , listField "c-sources" showFilePath parseFilePathQ cSources (\paths binfo -> binfo{cSources=paths}) , listField "extensions" disp parseExtensionQ extensions (\exts binfo -> binfo{extensions=exts}) , listField "extra-libraries" showToken parseTokenQ extraLibs (\xs binfo -> binfo{extraLibs=xs}) , listField "extra-lib-dirs" showFilePath parseFilePathQ extraLibDirs (\xs binfo -> binfo{extraLibDirs=xs}) , listField "includes" showFilePath parseFilePathQ includes (\paths binfo -> binfo{includes=paths}) , listField "install-includes" showFilePath parseFilePathQ installIncludes (\paths binfo -> binfo{installIncludes=paths}) , listField "include-dirs" showFilePath parseFilePathQ includeDirs (\paths binfo -> binfo{includeDirs=paths}) , listField "hs-source-dirs" showFilePath parseFilePathQ hsSourceDirs (\paths binfo -> binfo{hsSourceDirs=paths}) , listField "other-modules" disp parseModuleNameQ otherModules (\val binfo -> binfo{otherModules=val}) , listField "ghc-prof-options" text parseTokenQ ghcProfOptions (\val binfo -> binfo{ghcProfOptions=val}) , listField "ghc-shared-options" text parseTokenQ ghcProfOptions (\val binfo -> binfo{ghcSharedOptions=val}) , optsField "ghc-options" GHC options (\path binfo -> binfo{options=path}) , optsField "hugs-options" Hugs options (\path binfo -> binfo{options=path}) , optsField "nhc98-options" NHC options (\path binfo -> binfo{options=path}) , optsField "jhc-options" JHC options (\path binfo -> binfo{options=path}) ]
3,069
binfoFieldDescrs = [ boolField "buildable" buildable (\val binfo -> binfo{buildable=val}) , commaListField "build-tools" disp parseBuildTool buildTools (\xs binfo -> binfo{buildTools=xs}) , spaceListField "cpp-options" showToken parseTokenQ' cppOptions (\val binfo -> binfo{cppOptions=val}) , spaceListField "cc-options" showToken parseTokenQ' ccOptions (\val binfo -> binfo{ccOptions=val}) , spaceListField "ld-options" showToken parseTokenQ' ldOptions (\val binfo -> binfo{ldOptions=val}) , commaListField "pkgconfig-depends" disp parsePkgconfigDependency pkgconfigDepends (\xs binfo -> binfo{pkgconfigDepends=xs}) , listField "frameworks" showToken parseTokenQ frameworks (\val binfo -> binfo{frameworks=val}) , listField "c-sources" showFilePath parseFilePathQ cSources (\paths binfo -> binfo{cSources=paths}) , listField "extensions" disp parseExtensionQ extensions (\exts binfo -> binfo{extensions=exts}) , listField "extra-libraries" showToken parseTokenQ extraLibs (\xs binfo -> binfo{extraLibs=xs}) , listField "extra-lib-dirs" showFilePath parseFilePathQ extraLibDirs (\xs binfo -> binfo{extraLibDirs=xs}) , listField "includes" showFilePath parseFilePathQ includes (\paths binfo -> binfo{includes=paths}) , listField "install-includes" showFilePath parseFilePathQ installIncludes (\paths binfo -> binfo{installIncludes=paths}) , listField "include-dirs" showFilePath parseFilePathQ includeDirs (\paths binfo -> binfo{includeDirs=paths}) , listField "hs-source-dirs" showFilePath parseFilePathQ hsSourceDirs (\paths binfo -> binfo{hsSourceDirs=paths}) , listField "other-modules" disp parseModuleNameQ otherModules (\val binfo -> binfo{otherModules=val}) , listField "ghc-prof-options" text parseTokenQ ghcProfOptions (\val binfo -> binfo{ghcProfOptions=val}) , listField "ghc-shared-options" text parseTokenQ ghcProfOptions (\val binfo -> binfo{ghcSharedOptions=val}) , optsField "ghc-options" GHC options (\path binfo -> binfo{options=path}) , optsField "hugs-options" Hugs options (\path binfo -> binfo{options=path}) , optsField "nhc98-options" NHC options (\path binfo -> binfo{options=path}) , optsField "jhc-options" JHC options (\path binfo -> binfo{options=path}) ]
3,026
true
true
0
10
1,070
711
401
310
null
null
CulpaBS/wbBach
src/Futhark/Representation/AST/Attributes/Aliases.hs
bsd-3-clause
primOpAliases (ArrayLit es _) = [mconcat $ map subExpAliases es]
64
primOpAliases (ArrayLit es _) = [mconcat $ map subExpAliases es]
64
primOpAliases (ArrayLit es _) = [mconcat $ map subExpAliases es]
64
false
false
0
7
9
29
14
15
null
null
wtanaka/haskell
NinetyNine.hs
gpl-3.0
encodeModified (x : xs) = let encodedxs = encodeModified xs in case head encodedxs of Single z -> if x == z then Multiple 2 x : tail encodedxs else Single x : encodedxs Multiple count z -> if x == z then Multiple (1+count) x : tail encodedxs else Single x : encodedxs -- Problem 12
333
encodeModified (x : xs) = let encodedxs = encodeModified xs in case head encodedxs of Single z -> if x == z then Multiple 2 x : tail encodedxs else Single x : encodedxs Multiple count z -> if x == z then Multiple (1+count) x : tail encodedxs else Single x : encodedxs -- Problem 12
333
encodeModified (x : xs) = let encodedxs = encodeModified xs in case head encodedxs of Single z -> if x == z then Multiple 2 x : tail encodedxs else Single x : encodedxs Multiple count z -> if x == z then Multiple (1+count) x : tail encodedxs else Single x : encodedxs -- Problem 12
333
false
false
0
14
108
127
61
66
null
null
Saulzar/reflex-gloss-scene
src/Reflex/Gloss/Scene.hs
bsd-3-clause
observe :: Reflex t => Behavior t a -> Scene t (Event t a) observe b = tag b <$> getTick
88
observe :: Reflex t => Behavior t a -> Scene t (Event t a) observe b = tag b <$> getTick
88
observe b = tag b <$> getTick
29
false
true
0
10
20
54
24
30
null
null
talanis85/mudblood
src/Mudblood/Screen/Gtk.hs
gpl-3.0
getNamedBuffer :: String -> Screen u G.TextBuffer getNamedBuffer name = do buffers <- gets scrBuffers case M.lookup name buffers of Nothing -> do ctrls <- askControls tagTable <- liftIO $ G.textBufferGetTagTable (ctlMainBuffer ctrls) newbuf <- liftIO $ G.textBufferNew (Just tagTable) modify $ \s -> s { scrBuffers = M.insert name newbuf (scrBuffers s) } return newbuf Just b -> return b
471
getNamedBuffer :: String -> Screen u G.TextBuffer getNamedBuffer name = do buffers <- gets scrBuffers case M.lookup name buffers of Nothing -> do ctrls <- askControls tagTable <- liftIO $ G.textBufferGetTagTable (ctlMainBuffer ctrls) newbuf <- liftIO $ G.textBufferNew (Just tagTable) modify $ \s -> s { scrBuffers = M.insert name newbuf (scrBuffers s) } return newbuf Just b -> return b
471
getNamedBuffer name = do buffers <- gets scrBuffers case M.lookup name buffers of Nothing -> do ctrls <- askControls tagTable <- liftIO $ G.textBufferGetTagTable (ctlMainBuffer ctrls) newbuf <- liftIO $ G.textBufferNew (Just tagTable) modify $ \s -> s { scrBuffers = M.insert name newbuf (scrBuffers s) } return newbuf Just b -> return b
421
false
true
0
18
144
159
73
86
null
null
Saulzar/reflex
test/Reflex/Test/Micro.hs
bsd-3-clause
foldedDyn :: (Reflex t, MonadHold t m) => (a -> a -> a) -> Dynamic t a -> m (Dynamic t a) foldedDyn f d = fmap join $ flip buildDynamic never $ do a <- sample (current d) foldDyn f a (updated d)
196
foldedDyn :: (Reflex t, MonadHold t m) => (a -> a -> a) -> Dynamic t a -> m (Dynamic t a) foldedDyn f d = fmap join $ flip buildDynamic never $ do a <- sample (current d) foldDyn f a (updated d)
196
foldedDyn f d = fmap join $ flip buildDynamic never $ do a <- sample (current d) foldDyn f a (updated d)
106
false
true
0
11
45
116
55
61
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp NewSmallArrayOp = _ILIT(155)
41
tagOf_PrimOp NewSmallArrayOp = _ILIT(155)
41
tagOf_PrimOp NewSmallArrayOp = _ILIT(155)
41
false
false
0
6
3
16
7
9
null
null
jspahrsummers/ScrumBut
Handler/Issue.hs
mit
resolveRequestArguments :: Text -> Text -> Integer -> Handler (UserId, GH.Repository, GH.Issue) resolveRequestArguments ownerLogin name issueNumber = do userId <- requireAuthId user <- runDB $ get userId let token = userToken $ fromJust user client <- GH.newClient token repo <- GH.fetchRepo client ownerLogin name issue <- GH.fetchIssue client repo issueNumber return (userId, repo, issue)
420
resolveRequestArguments :: Text -> Text -> Integer -> Handler (UserId, GH.Repository, GH.Issue) resolveRequestArguments ownerLogin name issueNumber = do userId <- requireAuthId user <- runDB $ get userId let token = userToken $ fromJust user client <- GH.newClient token repo <- GH.fetchRepo client ownerLogin name issue <- GH.fetchIssue client repo issueNumber return (userId, repo, issue)
420
resolveRequestArguments ownerLogin name issueNumber = do userId <- requireAuthId user <- runDB $ get userId let token = userToken $ fromJust user client <- GH.newClient token repo <- GH.fetchRepo client ownerLogin name issue <- GH.fetchIssue client repo issueNumber return (userId, repo, issue)
324
false
true
0
11
83
142
67
75
null
null
timtylin/scholdoc
src/Text/Pandoc/Writers/Haddock.hs
gpl-2.0
writeHaddock :: WriterOptions -> Pandoc -> String writeHaddock opts document = evalState (pandocToHaddock opts{ writerWrapText = writerWrapText opts } document) def
184
writeHaddock :: WriterOptions -> Pandoc -> String writeHaddock opts document = evalState (pandocToHaddock opts{ writerWrapText = writerWrapText opts } document) def
184
writeHaddock opts document = evalState (pandocToHaddock opts{ writerWrapText = writerWrapText opts } document) def
134
false
true
0
10
40
53
25
28
null
null
kim/amazonka
amazonka-iam/gen/Network/AWS/IAM/Types.hs
mpl-2.0
-- | A list of inline policies embedded in the role. These policies are the role's -- access (permissions) policies. rdRolePolicyList :: Lens' RoleDetail [PolicyDetail] rdRolePolicyList = lens _rdRolePolicyList (\s a -> s { _rdRolePolicyList = a }) . _List
256
rdRolePolicyList :: Lens' RoleDetail [PolicyDetail] rdRolePolicyList = lens _rdRolePolicyList (\s a -> s { _rdRolePolicyList = a }) . _List
139
rdRolePolicyList = lens _rdRolePolicyList (\s a -> s { _rdRolePolicyList = a }) . _List
87
true
true
0
10
39
48
27
21
null
null
tphyahoo/gititpt
Network/Gitit/Handlers.hs
gpl-2.0
feedHandler :: Handler feedHandler = do cfg <- getConfig when (not $ useFeed cfg) mzero base' <- getWikiBase feedBase <- if null (baseUrl cfg) -- if baseUrl blank, try to get it from Host header then do mbHost <- getHost case mbHost of Nothing -> error "Could not determine base URL" Just hn -> return $ "http://" ++ hn ++ base' else case baseUrl cfg ++ base' of x@('h':'t':'t':'p':':':'/':'/':_) -> return x y -> return $ "http://" ++ y let fc = FeedConfig{ fcTitle = wikiTitle cfg , fcBaseUrl = feedBase , fcFeedDays = feedDays cfg } path' <- getPath -- e.g. "foo/bar" if they hit /_feed/foo/bar let file = (path' `orIfNull` "_site") <.> "feed" let mbPath = if null path' then Nothing else Just path' fs <- getFileStore -- first, check for a cached version that is recent enough now <- liftIO $ getClockTime let isRecentEnough t = diffClockTimes now t > noTimeDiff{tdMin = fromIntegral $ feedRefreshTime cfg} mbCached <- lookupCache file case mbCached of Just (modtime, contents) | isRecentEnough modtime -> do let emptyResponse = setContentType "application/atom+xml; charset=utf-8" . toResponse $ () ok $ emptyResponse{rsBody = B.fromChunks [contents]} _ -> do resp <- liftM toResponse $ liftIO (filestoreToXmlFeed fc fs mbPath) cacheContents file $ S.concat $ B.toChunks $ rsBody resp ok . setContentType "application/atom+xml; charset=UTF-8" $ resp -- | Inquire of a certain directory whether another file lies within its ambit. -- This is basically asking whether the file is 'above' the directory in the filesystems's -- directory tree. Useful for checking the legality of a filename.
1,954
feedHandler :: Handler feedHandler = do cfg <- getConfig when (not $ useFeed cfg) mzero base' <- getWikiBase feedBase <- if null (baseUrl cfg) -- if baseUrl blank, try to get it from Host header then do mbHost <- getHost case mbHost of Nothing -> error "Could not determine base URL" Just hn -> return $ "http://" ++ hn ++ base' else case baseUrl cfg ++ base' of x@('h':'t':'t':'p':':':'/':'/':_) -> return x y -> return $ "http://" ++ y let fc = FeedConfig{ fcTitle = wikiTitle cfg , fcBaseUrl = feedBase , fcFeedDays = feedDays cfg } path' <- getPath -- e.g. "foo/bar" if they hit /_feed/foo/bar let file = (path' `orIfNull` "_site") <.> "feed" let mbPath = if null path' then Nothing else Just path' fs <- getFileStore -- first, check for a cached version that is recent enough now <- liftIO $ getClockTime let isRecentEnough t = diffClockTimes now t > noTimeDiff{tdMin = fromIntegral $ feedRefreshTime cfg} mbCached <- lookupCache file case mbCached of Just (modtime, contents) | isRecentEnough modtime -> do let emptyResponse = setContentType "application/atom+xml; charset=utf-8" . toResponse $ () ok $ emptyResponse{rsBody = B.fromChunks [contents]} _ -> do resp <- liftM toResponse $ liftIO (filestoreToXmlFeed fc fs mbPath) cacheContents file $ S.concat $ B.toChunks $ rsBody resp ok . setContentType "application/atom+xml; charset=UTF-8" $ resp -- | Inquire of a certain directory whether another file lies within its ambit. -- This is basically asking whether the file is 'above' the directory in the filesystems's -- directory tree. Useful for checking the legality of a filename.
1,954
feedHandler = do cfg <- getConfig when (not $ useFeed cfg) mzero base' <- getWikiBase feedBase <- if null (baseUrl cfg) -- if baseUrl blank, try to get it from Host header then do mbHost <- getHost case mbHost of Nothing -> error "Could not determine base URL" Just hn -> return $ "http://" ++ hn ++ base' else case baseUrl cfg ++ base' of x@('h':'t':'t':'p':':':'/':'/':_) -> return x y -> return $ "http://" ++ y let fc = FeedConfig{ fcTitle = wikiTitle cfg , fcBaseUrl = feedBase , fcFeedDays = feedDays cfg } path' <- getPath -- e.g. "foo/bar" if they hit /_feed/foo/bar let file = (path' `orIfNull` "_site") <.> "feed" let mbPath = if null path' then Nothing else Just path' fs <- getFileStore -- first, check for a cached version that is recent enough now <- liftIO $ getClockTime let isRecentEnough t = diffClockTimes now t > noTimeDiff{tdMin = fromIntegral $ feedRefreshTime cfg} mbCached <- lookupCache file case mbCached of Just (modtime, contents) | isRecentEnough modtime -> do let emptyResponse = setContentType "application/atom+xml; charset=utf-8" . toResponse $ () ok $ emptyResponse{rsBody = B.fromChunks [contents]} _ -> do resp <- liftM toResponse $ liftIO (filestoreToXmlFeed fc fs mbPath) cacheContents file $ S.concat $ B.toChunks $ rsBody resp ok . setContentType "application/atom+xml; charset=UTF-8" $ resp -- | Inquire of a certain directory whether another file lies within its ambit. -- This is basically asking whether the file is 'above' the directory in the filesystems's -- directory tree. Useful for checking the legality of a filename.
1,931
false
true
9
20
620
471
233
238
null
null
portnov/yaledger
YaLedger/Output/Formatted.hs
bsd-3-clause
unwordsText :: [FormattedText] -> FormattedText unwordsText texts = intercalate space texts
91
unwordsText :: [FormattedText] -> FormattedText unwordsText texts = intercalate space texts
91
unwordsText texts = intercalate space texts
43
false
true
0
6
10
26
13
13
null
null
olsner/ghc
testsuite/tests/typecheck/should_fail/tcfail043.hs
bsd-3-clause
tl :: [a] -> [a] tl (a:as) = as
31
tl :: [a] -> [a] tl (a:as) = as
31
tl (a:as) = as
14
false
true
0
9
8
37
18
19
null
null
keithodulaigh/Hets
PGIP/tests/Server.hs
gpl-2.0
plainHandler :: HandlerFunc plainHandler h addr msg = do putStrLn $ "From " ++ show addr ++ ": " ++ msg syslog h USER INFO $ "Message received: " ++ msg
160
plainHandler :: HandlerFunc plainHandler h addr msg = do putStrLn $ "From " ++ show addr ++ ": " ++ msg syslog h USER INFO $ "Message received: " ++ msg
160
plainHandler h addr msg = do putStrLn $ "From " ++ show addr ++ ": " ++ msg syslog h USER INFO $ "Message received: " ++ msg
132
false
true
0
10
38
58
27
31
null
null
deepakjois/blaze-svg
src/Util/GenerateSvgCombinators.hs
bsd-3-clause
makeAttribute :: String -> String makeAttribute name = unlines [ DO_NOT_EDIT , "-- | Combinator for the @" ++ name ++ "@ attribute." , "--" , function ++ " :: AttributeValue -- ^ Attribute value." , spaces function ++ " -> Attribute -- ^ Resulting attribute." , function ++ " = attribute \"" ++ name ++ "\" \" " ++ name ++ "=\\\"\"" , "{-# INLINE " ++ function ++ " #-}" ] where function = sanitize name -- | SVG 1.1 -- Reference: https://developer.mozilla.org/en/SVG --
552
makeAttribute :: String -> String makeAttribute name = unlines [ DO_NOT_EDIT , "-- | Combinator for the @" ++ name ++ "@ attribute." , "--" , function ++ " :: AttributeValue -- ^ Attribute value." , spaces function ++ " -> Attribute -- ^ Resulting attribute." , function ++ " = attribute \"" ++ name ++ "\" \" " ++ name ++ "=\\\"\"" , "{-# INLINE " ++ function ++ " #-}" ] where function = sanitize name -- | SVG 1.1 -- Reference: https://developer.mozilla.org/en/SVG --
552
makeAttribute name = unlines [ DO_NOT_EDIT , "-- | Combinator for the @" ++ name ++ "@ attribute." , "--" , function ++ " :: AttributeValue -- ^ Attribute value." , spaces function ++ " -> Attribute -- ^ Resulting attribute." , function ++ " = attribute \"" ++ name ++ "\" \" " ++ name ++ "=\\\"\"" , "{-# INLINE " ++ function ++ " #-}" ] where function = sanitize name -- | SVG 1.1 -- Reference: https://developer.mozilla.org/en/SVG --
518
false
true
1
10
167
109
56
53
null
null
Icelandjack/lens
src/Control/Lens/Indexed.hs
bsd-3-clause
-- | Generalizes 'Data.Traversable.mapAccumL' to add access to the index. -- -- 'imapAccumLOf' accumulates state from left to right. -- -- @ -- 'Control.Lens.Traversal.mapAccumLOf' ≡ 'imapAccumL' '.' 'const' -- @ imapAccumL :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) imapAccumL f s0 a = swap (Lazy.runState (itraverse (\i c -> Lazy.state (\s -> swap (f i s c))) a) s0)
404
imapAccumL :: TraversableWithIndex i t => (i -> s -> a -> (s, b)) -> s -> t a -> (s, t b) imapAccumL f s0 a = swap (Lazy.runState (itraverse (\i c -> Lazy.state (\s -> swap (f i s c))) a) s0)
191
imapAccumL f s0 a = swap (Lazy.runState (itraverse (\i c -> Lazy.state (\s -> swap (f i s c))) a) s0)
101
true
true
0
17
73
141
74
67
null
null
mietek/gml-explorer
src/Main.hs
mit
dispatch RoadNodes = RoadNodes.root 1
41
dispatch RoadNodes = RoadNodes.root 1
41
dispatch RoadNodes = RoadNodes.root 1
41
false
false
0
6
8
14
6
8
null
null
sebastiaanvisser/tonic
tests/ParserTests.hs
bsd-3-clause
-- Run all tests. main :: IO Counts main = runTestTT $ TestList [ parseTextOnly , parseEmptyElems , parseFakeCloses , parseSingleElems , parseAttrs , parseNested ]
178
main :: IO Counts main = runTestTT $ TestList [ parseTextOnly , parseEmptyElems , parseFakeCloses , parseSingleElems , parseAttrs , parseNested ]
159
main = runTestTT $ TestList [ parseTextOnly , parseEmptyElems , parseFakeCloses , parseSingleElems , parseAttrs , parseNested ]
141
true
true
0
5
40
40
23
17
null
null
cronburg/deckbuild
Examples/GreedySampler.hs
bsd-3-clause
greedyMayPick :: Game -> CardName -> IO (Maybe CardName) greedyMayPick g c' = return $ case c' of CHANCELLOR -> Just COPPER -- any card triggers a discard deck otherwise -> Nothing -- Not necessary with only VILLAGE and CHANCELLOR actions:
246
greedyMayPick :: Game -> CardName -> IO (Maybe CardName) greedyMayPick g c' = return $ case c' of CHANCELLOR -> Just COPPER -- any card triggers a discard deck otherwise -> Nothing -- Not necessary with only VILLAGE and CHANCELLOR actions:
246
greedyMayPick g c' = return $ case c' of CHANCELLOR -> Just COPPER -- any card triggers a discard deck otherwise -> Nothing -- Not necessary with only VILLAGE and CHANCELLOR actions:
189
false
true
0
9
47
58
29
29
null
null
b1g3ar5/CsvDatabase
src/CsvDatabase.hs
gpl-3.0
isdouble::Col a -> Bool isdouble (_, Right _) = True
53
isdouble::Col a -> Bool isdouble (_, Right _) = True
52
isdouble (_, Right _) = True
28
false
true
0
7
10
30
15
15
null
null
sjakobi/brick
src/Brick/BorderMap.hs
bsd-3-clause
-- | Given a rectangle (specified as the coordinates of the top, left, bottom, -- and right sides), initialize an empty 'BorderMap'. emptyCoordinates :: Edges Int -> BorderMap a emptyCoordinates cs = BorderMap { _coordinates = cs, _values = pure IM.empty }
256
emptyCoordinates :: Edges Int -> BorderMap a emptyCoordinates cs = BorderMap { _coordinates = cs, _values = pure IM.empty }
123
emptyCoordinates cs = BorderMap { _coordinates = cs, _values = pure IM.empty }
78
true
true
0
8
41
45
24
21
null
null
spechub/Hets
Static/DGNavigation.hs
gpl-2.0
linkLabel :: LEdge a -> a linkSource (x, _, _) = x
50
linkLabel :: LEdge a -> a linkSource (x, _, _) = x
50
linkSource (x, _, _) = x
24
false
true
0
6
11
30
16
14
null
null
buildsome/buildsome
src/Main.hs
gpl-2.0
specifiedMakefile :: Printer -> FilePath -> IO FilePath specifiedMakefile printer path = do mStat <- getMFileStatus path case mStat of Nothing -> E.throwIO $ SpecifiedInexistentMakefilePath (Printer.render printer) path Just stat | Posix.isDirectory stat -> pure $ path </> standardMakeFilename | otherwise -> pure path
367
specifiedMakefile :: Printer -> FilePath -> IO FilePath specifiedMakefile printer path = do mStat <- getMFileStatus path case mStat of Nothing -> E.throwIO $ SpecifiedInexistentMakefilePath (Printer.render printer) path Just stat | Posix.isDirectory stat -> pure $ path </> standardMakeFilename | otherwise -> pure path
367
specifiedMakefile printer path = do mStat <- getMFileStatus path case mStat of Nothing -> E.throwIO $ SpecifiedInexistentMakefilePath (Printer.render printer) path Just stat | Posix.isDirectory stat -> pure $ path </> standardMakeFilename | otherwise -> pure path
311
false
true
0
15
91
114
50
64
null
null
poxu/pandoc
src/Text/Pandoc/Writers/HTML.hs
gpl-2.0
blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do let tolhs = isEnabled Ext_literate_haskell opts && any (\c -> map toLower c == "haskell") classes && any (\c -> map toLower c == "literate") classes classes' = if tolhs then map (\c -> if map toLower c == "haskell" then "literatehaskell" else c) classes else classes adjCode = if tolhs then unlines . map ("> " ++) . lines $ rawCode else rawCode hlCode = if writerHighlight opts -- check highlighting options then highlight formatHtmlBlock (id',classes',keyvals) adjCode else Nothing case hlCode of Nothing -> return $ addAttrs opts (id',classes,keyvals) $ H.pre $ H.code $ toHtml adjCode Just h -> modify (\st -> st{ stHighlighting = True }) >> return (addAttrs opts (id',[],keyvals) h)
1,072
blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do let tolhs = isEnabled Ext_literate_haskell opts && any (\c -> map toLower c == "haskell") classes && any (\c -> map toLower c == "literate") classes classes' = if tolhs then map (\c -> if map toLower c == "haskell" then "literatehaskell" else c) classes else classes adjCode = if tolhs then unlines . map ("> " ++) . lines $ rawCode else rawCode hlCode = if writerHighlight opts -- check highlighting options then highlight formatHtmlBlock (id',classes',keyvals) adjCode else Nothing case hlCode of Nothing -> return $ addAttrs opts (id',classes,keyvals) $ H.pre $ H.code $ toHtml adjCode Just h -> modify (\st -> st{ stHighlighting = True }) >> return (addAttrs opts (id',[],keyvals) h)
1,072
blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do let tolhs = isEnabled Ext_literate_haskell opts && any (\c -> map toLower c == "haskell") classes && any (\c -> map toLower c == "literate") classes classes' = if tolhs then map (\c -> if map toLower c == "haskell" then "literatehaskell" else c) classes else classes adjCode = if tolhs then unlines . map ("> " ++) . lines $ rawCode else rawCode hlCode = if writerHighlight opts -- check highlighting options then highlight formatHtmlBlock (id',classes',keyvals) adjCode else Nothing case hlCode of Nothing -> return $ addAttrs opts (id',classes,keyvals) $ H.pre $ H.code $ toHtml adjCode Just h -> modify (\st -> st{ stHighlighting = True }) >> return (addAttrs opts (id',[],keyvals) h)
1,072
false
false
0
16
441
308
163
145
null
null
ajnsit/glambda
src/Language/Glambda/Parse.hs
bsd-3-clause
arg_ty :: Parser Ty arg_ty = choice [ between (tok LParen) (tok RParen) ty , tycon ]
100
arg_ty :: Parser Ty arg_ty = choice [ between (tok LParen) (tok RParen) ty , tycon ]
100
arg_ty = choice [ between (tok LParen) (tok RParen) ty , tycon ]
80
false
true
0
9
32
42
21
21
null
null
bitemyapp/ganeti
src/Ganeti/HTools/Program/Hspace.hs
bsd-2-clause
specName SpecTiered = "Tiered"
30
specName SpecTiered = "Tiered"
30
specName SpecTiered = "Tiered"
30
false
false
1
5
3
13
4
9
null
null
VictorCMiraldo/mmm
MMM/OOP/Language/Utils.hs
mit
simplify1 SimpVoidcomp def = completevoids def
46
simplify1 SimpVoidcomp def = completevoids def
46
simplify1 SimpVoidcomp def = completevoids def
46
false
false
0
5
5
14
6
8
null
null
olwrapper/olwrapper
wrapper/OpenLayers/Types.hs
bsd-3-clause
-- | The 'Projectionlike' for Mercator mercatorproj = Projection "EPSG:3857"
76
mercatorproj = Projection "EPSG:3857"
37
mercatorproj = Projection "EPSG:3857"
37
true
false
0
5
9
10
5
5
null
null
jyp/inox
C/Deep.hs
gpl-3.0
cTypeName (Var x) = "v" <> x
28
cTypeName (Var x) = "v" <> x
28
cTypeName (Var x) = "v" <> x
28
false
false
0
7
6
19
9
10
null
null
tobynet/java-poker
src/Game/Poker/AI.hs
mit
-- | Sutefuda = Hand - allYaku -- -- >>> let Just (x) = toHand $ take 5 $ (filter (\x -> (cardNumber x == 10)) $ allCards) ++ allCards -- >>> fromHand x -- [H2_,H10,D10,C10,S10] -- >>> nOfKindDiscards x -- [H2_] nOfKindDiscards :: Hand -> DiscardList nOfKindDiscards hand = fromHand hand \\ allNOfKinds hand where -- | all Yaku -- -- >>> let Just (x) = toHand $ take 5 $ (filter (\x -> (cardNumber x == 10)) $ allCards) ++ allCards -- >>> allNOfKinds x -- [H10,D10,C10,S10] allNOfKinds :: Hand -> [Card] allNOfKinds h = concat . concat $ catMaybes [nOfKindHint 2 h, nOfKindHint 3 h, nOfKindHint 4 h]
660
nOfKindDiscards :: Hand -> DiscardList nOfKindDiscards hand = fromHand hand \\ allNOfKinds hand where -- | all Yaku -- -- >>> let Just (x) = toHand $ take 5 $ (filter (\x -> (cardNumber x == 10)) $ allCards) ++ allCards -- >>> allNOfKinds x -- [H10,D10,C10,S10] allNOfKinds :: Hand -> [Card] allNOfKinds h = concat . concat $ catMaybes [nOfKindHint 2 h, nOfKindHint 3 h, nOfKindHint 4 h]
447
nOfKindDiscards hand = fromHand hand \\ allNOfKinds hand where -- | all Yaku -- -- >>> let Just (x) = toHand $ take 5 $ (filter (\x -> (cardNumber x == 10)) $ allCards) ++ allCards -- >>> allNOfKinds x -- [H10,D10,C10,S10] allNOfKinds :: Hand -> [Card] allNOfKinds h = concat . concat $ catMaybes [nOfKindHint 2 h, nOfKindHint 3 h, nOfKindHint 4 h]
408
true
true
0
10
171
97
54
43
null
null
tolysz/Haxl
tests/BatchTests.hs
bsd-3-clause
batching9 = expectRounds 1 6 batching9_
39
batching9 = expectRounds 1 6 batching9_
39
batching9 = expectRounds 1 6 batching9_
39
false
false
1
5
5
18
6
12
null
null
haskoin/haskoin
src/Haskoin/Script/Standard.hs
unlicense
opWitnessVersion OP_5 = Just 5
31
opWitnessVersion OP_5 = Just 5
31
opWitnessVersion OP_5 = Just 5
31
false
false
0
5
5
12
5
7
null
null
Twinside/pandoc
src/Text/Pandoc/Writers/Docx.hs
gpl-2.0
blockToOpenXML opts (Div _ bs) = blocksToOpenXML opts bs
56
blockToOpenXML opts (Div _ bs) = blocksToOpenXML opts bs
56
blockToOpenXML opts (Div _ bs) = blocksToOpenXML opts bs
56
false
false
0
7
8
24
11
13
null
null
pfq/PFQ
user/pfq-lang/examples/regression.hs
gpl-2.0
comparators = (ip_tos .< 42) .||. (ip_tot_len .< 42) .||. (ip_id .< 42) .||. (ip_frag .< 42) .||. (ip_ttl .< 42) .||. (get_mark .< 42) .||. (get_state .< 42) .||. (tcp_source .< 42) .||. (tcp_dest .< 42) .||. (tcp_hdrlen .< 42) .||. (udp_source .< 42) .||. (udp_dest .< 42) .||. (udp_len .< 42) .||. (icmp_type .< 42) .||. (icmp_code .< 42)
472
comparators = (ip_tos .< 42) .||. (ip_tot_len .< 42) .||. (ip_id .< 42) .||. (ip_frag .< 42) .||. (ip_ttl .< 42) .||. (get_mark .< 42) .||. (get_state .< 42) .||. (tcp_source .< 42) .||. (tcp_dest .< 42) .||. (tcp_hdrlen .< 42) .||. (udp_source .< 42) .||. (udp_dest .< 42) .||. (udp_len .< 42) .||. (icmp_type .< 42) .||. (icmp_code .< 42)
472
comparators = (ip_tos .< 42) .||. (ip_tot_len .< 42) .||. (ip_id .< 42) .||. (ip_frag .< 42) .||. (ip_ttl .< 42) .||. (get_mark .< 42) .||. (get_state .< 42) .||. (tcp_source .< 42) .||. (tcp_dest .< 42) .||. (tcp_hdrlen .< 42) .||. (udp_source .< 42) .||. (udp_dest .< 42) .||. (udp_len .< 42) .||. (icmp_type .< 42) .||. (icmp_code .< 42)
472
false
false
15
7
192
213
119
94
null
null
jystic/cthulhu
src/Types.hs
bsd-3-clause
(+>) :: Regex -> Regex -> Regex (+>) = Append
45
(+>) :: Regex -> Regex -> Regex (+>) = Append
45
(+>) = Append
13
false
true
0
6
9
23
14
9
null
null
leshchevds/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
idiskParams :: FrozenSet String idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
93
idiskParams :: FrozenSet String idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
93
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
61
false
true
0
8
8
27
13
14
null
null
dan-t/layers
src/GameData/Level.hs
bsd-3-clause
freeEntityId :: Level -> Int freeEntityId level = maxId + 1 where maxId | L.null allIds = 0 | otherwise = L.maximum allIds allIds = L.map EI.entityId (allEntities level)
201
freeEntityId :: Level -> Int freeEntityId level = maxId + 1 where maxId | L.null allIds = 0 | otherwise = L.maximum allIds allIds = L.map EI.entityId (allEntities level)
201
freeEntityId level = maxId + 1 where maxId | L.null allIds = 0 | otherwise = L.maximum allIds allIds = L.map EI.entityId (allEntities level)
172
false
true
0
9
60
75
35
40
null
null
jstolarek/dep-typed-wbl-heaps-hs
src/TwoPassMerge/NoProofs.hs
bsd-3-clause
-- As a quick sanity check let's construct some examples. Here's a -- heap constructed by inserting following priorities into an empty -- heap: 3, 0, 1, 2. heap :: Heap heap = insert two (insert one (insert zero (insert three Empty)))
252
heap :: Heap heap = insert two (insert one (insert zero (insert three Empty)))
96
heap = insert two (insert one (insert zero (insert three Empty)))
83
true
true
0
11
59
51
24
27
null
null
ibotty/hooks-dir
src/System/Process/Hooks.hs
bsd-3-clause
readStdOut _ = return T.empty
29
readStdOut _ = return T.empty
29
readStdOut _ = return T.empty
29
false
false
0
5
4
15
6
9
null
null
green-haskell/ghc
compiler/iface/IfaceEnv.hs
bsd-3-clause
lookupOrig :: Module -> OccName -> TcRnIf a b Name lookupOrig mod occ = do { -- First ensure that mod and occ are evaluated -- If not, chaos can ensue: -- we read the name-cache -- then pull on mod (say) -- which does some stuff that modifies the name cache -- This did happen, with tycon_mod in TcIface.tcIfaceAlt (DataAlt..) mod `seq` occ `seq` return () -- ; traceIf (text "lookup_orig" <+> ppr mod <+> ppr occ) ; updNameCache $ \name_cache -> case lookupOrigNameCache (nsNames name_cache) mod occ of { Just name -> (name_cache, name); Nothing -> case takeUniqFromSupply (nsUniqs name_cache) of { (uniq, us) -> let name = mkExternalName uniq mod occ noSrcSpan new_cache = extendNameCache (nsNames name_cache) mod occ name in (name_cache{ nsUniqs = us, nsNames = new_cache }, name) }}}
1,071
lookupOrig :: Module -> OccName -> TcRnIf a b Name lookupOrig mod occ = do { -- First ensure that mod and occ are evaluated -- If not, chaos can ensue: -- we read the name-cache -- then pull on mod (say) -- which does some stuff that modifies the name cache -- This did happen, with tycon_mod in TcIface.tcIfaceAlt (DataAlt..) mod `seq` occ `seq` return () -- ; traceIf (text "lookup_orig" <+> ppr mod <+> ppr occ) ; updNameCache $ \name_cache -> case lookupOrigNameCache (nsNames name_cache) mod occ of { Just name -> (name_cache, name); Nothing -> case takeUniqFromSupply (nsUniqs name_cache) of { (uniq, us) -> let name = mkExternalName uniq mod occ noSrcSpan new_cache = extendNameCache (nsNames name_cache) mod occ name in (name_cache{ nsUniqs = us, nsNames = new_cache }, name) }}}
1,071
lookupOrig mod occ = do { -- First ensure that mod and occ are evaluated -- If not, chaos can ensue: -- we read the name-cache -- then pull on mod (say) -- which does some stuff that modifies the name cache -- This did happen, with tycon_mod in TcIface.tcIfaceAlt (DataAlt..) mod `seq` occ `seq` return () -- ; traceIf (text "lookup_orig" <+> ppr mod <+> ppr occ) ; updNameCache $ \name_cache -> case lookupOrigNameCache (nsNames name_cache) mod occ of { Just name -> (name_cache, name); Nothing -> case takeUniqFromSupply (nsUniqs name_cache) of { (uniq, us) -> let name = mkExternalName uniq mod occ noSrcSpan new_cache = extendNameCache (nsNames name_cache) mod occ name in (name_cache{ nsUniqs = us, nsNames = new_cache }, name) }}}
1,019
false
true
0
21
417
201
111
90
null
null
anton-k/language-css
src/Language/Css/Build/Tags.hs
bsd-3-clause
-- | @iframe@ tag iframe :: Sel' iframe = ident "iframe"
56
iframe :: Sel' iframe = ident "iframe"
38
iframe = ident "iframe"
23
true
true
0
6
10
22
9
13
null
null
mcschroeder/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
-- selects 'q','r' runtimeRep1Ty, runtimeRep2Ty :: Type runtimeRep1Ty = mkTyVarTy runtimeRep1TyVar
99
runtimeRep1Ty, runtimeRep2Ty :: Type runtimeRep1Ty = mkTyVarTy runtimeRep1TyVar
79
runtimeRep1Ty = mkTyVarTy runtimeRep1TyVar
42
true
true
0
5
11
17
10
7
null
null
vincenthz/hs-foundation
basement/Basement/Numerical/Conversion.hs
bsd-3-clause
charToInt :: Char -> Int charToInt (C# x) = I# (ord# x)
55
charToInt :: Char -> Int charToInt (C# x) = I# (ord# x)
55
charToInt (C# x) = I# (ord# x)
30
false
true
0
7
11
33
16
17
null
null
jdreaver/iris
src/Iris/Camera/ArcBall.hs
mit
arcBallScrollEvent :: Event MouseScrollAmount -> Event (ArcBallState -> ArcBallState) arcBallScrollEvent eScroll = doZoom <$> eScroll where doZoom z (cm, cs) = (cm, arcBallMouseZoom cs z)
208
arcBallScrollEvent :: Event MouseScrollAmount -> Event (ArcBallState -> ArcBallState) arcBallScrollEvent eScroll = doZoom <$> eScroll where doZoom z (cm, cs) = (cm, arcBallMouseZoom cs z)
208
arcBallScrollEvent eScroll = doZoom <$> eScroll where doZoom z (cm, cs) = (cm, arcBallMouseZoom cs z)
103
false
true
0
8
45
64
33
31
null
null
sapek/pandoc
src/Text/Pandoc/XML.hs
gpl-2.0
fromEntities (x:xs) = x : fromEntities xs
41
fromEntities (x:xs) = x : fromEntities xs
41
fromEntities (x:xs) = x : fromEntities xs
41
false
false
0
7
6
23
11
12
null
null
trskop/hs-not-found
not-found/src/Control/Monad/Utils.hs
bsd-3-clause
-- | Shorthand for @g x \`liftM\` f x@. (>|>) :: Monad m => (a -> m b) -> (a -> b -> c) -> a -> m c (>|>) f g x = g x `liftM` f x
129
(>|>) :: Monad m => (a -> m b) -> (a -> b -> c) -> a -> m c (>|>) f g x = g x `liftM` f x
89
(>|>) f g x = g x `liftM` f x
29
true
true
0
10
38
78
41
37
null
null
neothemachine/monadiccp
src/Control/CP/FD/Expr.hs
bsd-3-clause
simplify (Mod _ (Const (-1))) = Const 0
39
simplify (Mod _ (Const (-1))) = Const 0
39
simplify (Mod _ (Const (-1))) = Const 0
39
false
false
0
10
7
32
15
17
null
null
Migorec/FSM_lib
examples/simple_example/FSM_a.hs
bsd-3-clause
timeout_b = 1
13
timeout_b = 1
13
timeout_b = 1
13
false
false
0
4
2
6
3
3
null
null
chreekat/yesod
yesod-core/test/YesodCoreTest/CleanPath.hs
bsd-2-clause
getSubsite :: a -> Subsite getSubsite = const Subsite
53
getSubsite :: a -> Subsite getSubsite = const Subsite
53
getSubsite = const Subsite
26
false
true
0
5
8
18
9
9
null
null
lukexi/ghc-7.8-arm64
compiler/main/DriverPhases.hs
bsd-3-clause
startPhase "hscpp" = HsPp HsSrcFile
39
startPhase "hscpp" = HsPp HsSrcFile
39
startPhase "hscpp" = HsPp HsSrcFile
39
false
false
0
5
8
12
5
7
null
null
nuttycom/haskoin
Network/Haskoin/Crypto/NormalizedKeys.hs
unlicense
accPubKeys :: MasterKey -> KeyIndex -> [(AccPubKey,KeyIndex)] accPubKeys m i = mapMaybe f $ cycleIndex i where f j = liftM2 (,) (accPubKey m j) (return j) -- | Cyclic list of all valid external 'AddrPrvKey' derived from a 'AccPrvKey' -- and starting from an offset index.
276
accPubKeys :: MasterKey -> KeyIndex -> [(AccPubKey,KeyIndex)] accPubKeys m i = mapMaybe f $ cycleIndex i where f j = liftM2 (,) (accPubKey m j) (return j) -- | Cyclic list of all valid external 'AddrPrvKey' derived from a 'AccPrvKey' -- and starting from an offset index.
276
accPubKeys m i = mapMaybe f $ cycleIndex i where f j = liftM2 (,) (accPubKey m j) (return j) -- | Cyclic list of all valid external 'AddrPrvKey' derived from a 'AccPrvKey' -- and starting from an offset index.
214
false
true
0
9
51
79
41
38
null
null
adbrowne/s3ls-parallel
scripts/find-incomplete.hs
bsd-3-clause
main = do (started, completed) <- execStateT (runEffect $ for P.stdinLn (lift . processLine)) (mempty, mempty) putStrLn $ show (started Set.\\ completed) return ()
169
main = do (started, completed) <- execStateT (runEffect $ for P.stdinLn (lift . processLine)) (mempty, mempty) putStrLn $ show (started Set.\\ completed) return ()
169
main = do (started, completed) <- execStateT (runEffect $ for P.stdinLn (lift . processLine)) (mempty, mempty) putStrLn $ show (started Set.\\ completed) return ()
169
false
false
0
13
29
78
39
39
null
null
anttisalonen/freekick2
src/Main.hs
gpl-3.0
getTSChildren (Leaf (_, ts)) = Right ts
39
getTSChildren (Leaf (_, ts)) = Right ts
39
getTSChildren (Leaf (_, ts)) = Right ts
39
false
false
0
8
6
24
12
12
null
null
leshchevds/ganeti
src/Ganeti/Network.hs
bsd-2-clause
readAllE :: (MonadError e m, FromString e) => Network -> m BA.BitArray readAllE net = do let toRes = liftM apReservations . orNewPool net res <- toRes $ networkReservations net ext <- toRes $ networkExtReservations net return $ res BA.-|- ext
259
readAllE :: (MonadError e m, FromString e) => Network -> m BA.BitArray readAllE net = do let toRes = liftM apReservations . orNewPool net res <- toRes $ networkReservations net ext <- toRes $ networkExtReservations net return $ res BA.-|- ext
259
readAllE net = do let toRes = liftM apReservations . orNewPool net res <- toRes $ networkReservations net ext <- toRes $ networkExtReservations net return $ res BA.-|- ext
179
false
true
0
11
57
100
46
54
null
null
lpenz/realworldhaskell-exercises
ch05/Prettify.hs
mit
w `fits` ('\n':_) = True
25
w `fits` ('\n':_) = True
25
w `fits` ('\n':_) = True
25
false
false
0
7
5
25
12
13
null
null
hermish/courseography
app/Svg/Parser.hs
gpl-3.0
parsePathHelper :: GraphId -- ^ The Path's corresponding graph identifier. -> Point -> Tag T.Text -> [Path] parsePathHelper key trans pathTag = let d = fromAttrib "d" pathTag styles' = styles pathTag currTrans = parseTransform $ fromAttrib "transform" pathTag realD = map (addTuples (addTuples trans currTrans)) $ parsePathD d fillAttr = styleVal "fill" styles' isRegion = not (T.null fillAttr) && fillAttr /= "none" in if T.null d || null realD || (T.last d == 'z' && not isRegion) then [] else [updatePath fillAttr $ Path key "" realD "" "" isRegion "" ""]
794
parsePathHelper :: GraphId -- ^ The Path's corresponding graph identifier. -> Point -> Tag T.Text -> [Path] parsePathHelper key trans pathTag = let d = fromAttrib "d" pathTag styles' = styles pathTag currTrans = parseTransform $ fromAttrib "transform" pathTag realD = map (addTuples (addTuples trans currTrans)) $ parsePathD d fillAttr = styleVal "fill" styles' isRegion = not (T.null fillAttr) && fillAttr /= "none" in if T.null d || null realD || (T.last d == 'z' && not isRegion) then [] else [updatePath fillAttr $ Path key "" realD "" "" isRegion "" ""]
794
parsePathHelper key trans pathTag = let d = fromAttrib "d" pathTag styles' = styles pathTag currTrans = parseTransform $ fromAttrib "transform" pathTag realD = map (addTuples (addTuples trans currTrans)) $ parsePathD d fillAttr = styleVal "fill" styles' isRegion = not (T.null fillAttr) && fillAttr /= "none" in if T.null d || null realD || (T.last d == 'z' && not isRegion) then [] else [updatePath fillAttr $ Path key "" realD "" "" isRegion "" ""]
638
false
true
0
14
328
218
105
113
null
null
ocramz/petsc-hs
examples/Test2.hs
gpl-3.0
-- PETSC_EXTERN PetscErrorCode VecMax(Vec,PetscInt*,PetscReal *); -- PETSC_EXTERN PetscErrorCode VecMin(Vec,PetscInt*,PetscReal *); -- PETSC_EXTERN PetscErrorCode VecScale(Vec,PetscScalar); -- PETSC_EXTERN PetscErrorCode VecPointwiseMax(Vec,Vec,Vec); -- PETSC_EXTERN PetscErrorCode VecPointwiseMaxAbs(Vec,Vec,Vec); -- PETSC_EXTERN PetscErrorCode VecPointwiseMin(Vec,Vec,Vec); -- PETSC_EXTERN PetscErrorCode VecPointwiseMult(Vec,Vec,Vec); -- PETSC_EXTERN PetscErrorCode VecPointwiseDivide(Vec,Vec,Vec); -- PETSC_EXTERN PetscErrorCode VecMaxPointwiseDivide(Vec,Vec,PetscReal*); -- PETSC_EXTERN PetscErrorCode VecShift(Vec,PetscScalar); -- PETSC_EXTERN PetscErrorCode VecReciprocal(Vec); -- PETSC_EXTERN PetscErrorCode VecPermute(Vec, IS, PetscBool ); -- PETSC_EXTERN PetscErrorCode VecSqrtAbs(Vec); -- PETSC_EXTERN PetscErrorCode VecLog(Vec); vecLog' v = [C.exp|int{VecLog($(Vec v))}|]
883
vecLog' v = [C.exp|int{VecLog($(Vec v))}|]
42
vecLog' v = [C.exp|int{VecLog($(Vec v))}|]
42
true
false
0
5
65
29
23
6
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/InstanceGroups/Delete.hs
mpl-2.0
-- | The name of the instance group to delete. igdInstanceGroup :: Lens' InstanceGroupsDelete Text igdInstanceGroup = lens _igdInstanceGroup (\ s a -> s{_igdInstanceGroup = a})
184
igdInstanceGroup :: Lens' InstanceGroupsDelete Text igdInstanceGroup = lens _igdInstanceGroup (\ s a -> s{_igdInstanceGroup = a})
137
igdInstanceGroup = lens _igdInstanceGroup (\ s a -> s{_igdInstanceGroup = a})
85
true
true
1
9
33
46
22
24
null
null
quintype/ringo
src/Ringo/Extractor/Internal.hs
mit
findFact :: TableName -> [Fact] -> Maybe Fact findFact fName = find ((== fName) . factName)
91
findFact :: TableName -> [Fact] -> Maybe Fact findFact fName = find ((== fName) . factName)
91
findFact fName = find ((== fName) . factName)
45
false
true
0
8
15
46
23
23
null
null
brenov/set
interpreter/Types.hs
mit
cast (Nat _ _) (Int i p) = if i < 0 then Int i p else Nat i p
92
cast (Nat _ _) (Int i p) = if i < 0 then Int i p else Nat i p
92
cast (Nat _ _) (Int i p) = if i < 0 then Int i p else Nat i p
92
false
false
0
7
50
49
24
25
null
null
izgzhen/region
src/Rust/Pretty.hs
mit
pStatement :: Statement -> Doc pStatement (Let mut binding (maybeModifier, expr)) = text "let" <+> mutNotation <> pBinding binding <> text "=" <+> printModifier maybeModifier <+> pExpr expr <> text ";" where mutNotation = case mut of Mut -> text "mut" Imm -> text ""
326
pStatement :: Statement -> Doc pStatement (Let mut binding (maybeModifier, expr)) = text "let" <+> mutNotation <> pBinding binding <> text "=" <+> printModifier maybeModifier <+> pExpr expr <> text ";" where mutNotation = case mut of Mut -> text "mut" Imm -> text ""
326
pStatement (Let mut binding (maybeModifier, expr)) = text "let" <+> mutNotation <> pBinding binding <> text "=" <+> printModifier maybeModifier <+> pExpr expr <> text ";" where mutNotation = case mut of Mut -> text "mut" Imm -> text ""
295
false
true
0
11
104
106
50
56
null
null
kazu-yamamoto/llrbtree
Data/Heap/Binominal.hs
bsd-3-clause
deleteMin' (t:ts) | root t < root t' = Just (t, ts) | otherwise = Just (t', t:ts') where Just (t',ts') = deleteMin' ts ---------------------------------------------------------------- {-| Merging two heaps. Worst-case: O(log N), amortized: O(log N) >>> merge (fromList [5,3]) (fromList [5,7]) == fromList [3,5,5,7] True -}
345
deleteMin' (t:ts) | root t < root t' = Just (t, ts) | otherwise = Just (t', t:ts') where Just (t',ts') = deleteMin' ts ---------------------------------------------------------------- {-| Merging two heaps. Worst-case: O(log N), amortized: O(log N) >>> merge (fromList [5,3]) (fromList [5,7]) == fromList [3,5,5,7] True -}
345
deleteMin' (t:ts) | root t < root t' = Just (t, ts) | otherwise = Just (t', t:ts') where Just (t',ts') = deleteMin' ts ---------------------------------------------------------------- {-| Merging two heaps. Worst-case: O(log N), amortized: O(log N) >>> merge (fromList [5,3]) (fromList [5,7]) == fromList [3,5,5,7] True -}
345
false
false
1
9
68
82
42
40
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/LiaSettings/SetposDataprovider.hs
mpl-2.0
-- | Creates a value of 'LiaSettingsSetposDataprovider' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'lssdXgafv' -- -- * 'lssdMerchantId' -- -- * 'lssdUploadProtocol' -- -- * 'lssdCountry' -- -- * 'lssdAccessToken' -- -- * 'lssdUploadType' -- -- * 'lssdAccountId' -- -- * 'lssdPosExternalAccountId' -- -- * 'lssdPosDataProviderId' -- -- * 'lssdCallback' liaSettingsSetposDataprovider :: Word64 -- ^ 'lssdMerchantId' -> Text -- ^ 'lssdCountry' -> Word64 -- ^ 'lssdAccountId' -> LiaSettingsSetposDataprovider liaSettingsSetposDataprovider pLssdMerchantId_ pLssdCountry_ pLssdAccountId_ = LiaSettingsSetposDataprovider' { _lssdXgafv = Nothing , _lssdMerchantId = _Coerce # pLssdMerchantId_ , _lssdUploadProtocol = Nothing , _lssdCountry = pLssdCountry_ , _lssdAccessToken = Nothing , _lssdUploadType = Nothing , _lssdAccountId = _Coerce # pLssdAccountId_ , _lssdPosExternalAccountId = Nothing , _lssdPosDataProviderId = Nothing , _lssdCallback = Nothing }
1,102
liaSettingsSetposDataprovider :: Word64 -- ^ 'lssdMerchantId' -> Text -- ^ 'lssdCountry' -> Word64 -- ^ 'lssdAccountId' -> LiaSettingsSetposDataprovider liaSettingsSetposDataprovider pLssdMerchantId_ pLssdCountry_ pLssdAccountId_ = LiaSettingsSetposDataprovider' { _lssdXgafv = Nothing , _lssdMerchantId = _Coerce # pLssdMerchantId_ , _lssdUploadProtocol = Nothing , _lssdCountry = pLssdCountry_ , _lssdAccessToken = Nothing , _lssdUploadType = Nothing , _lssdAccountId = _Coerce # pLssdAccountId_ , _lssdPosExternalAccountId = Nothing , _lssdPosDataProviderId = Nothing , _lssdCallback = Nothing }
660
liaSettingsSetposDataprovider pLssdMerchantId_ pLssdCountry_ pLssdAccountId_ = LiaSettingsSetposDataprovider' { _lssdXgafv = Nothing , _lssdMerchantId = _Coerce # pLssdMerchantId_ , _lssdUploadProtocol = Nothing , _lssdCountry = pLssdCountry_ , _lssdAccessToken = Nothing , _lssdUploadType = Nothing , _lssdAccountId = _Coerce # pLssdAccountId_ , _lssdPosExternalAccountId = Nothing , _lssdPosDataProviderId = Nothing , _lssdCallback = Nothing }
491
true
true
0
7
200
126
86
40
null
null
ezyang/ghc
utils/deriveConstants/Main.hs
bsd-3-clause
closureFieldOffset_ :: Where -> Name -> String -> String -> Wanteds closureFieldOffset_ w nameBase theType theField = defOffset w nameBase (CExpr ("offsetof(" ++ theType ++ ", " ++ theField ++ ") - TYPE_SIZE(StgHeader)"))
225
closureFieldOffset_ :: Where -> Name -> String -> String -> Wanteds closureFieldOffset_ w nameBase theType theField = defOffset w nameBase (CExpr ("offsetof(" ++ theType ++ ", " ++ theField ++ ") - TYPE_SIZE(StgHeader)"))
225
closureFieldOffset_ w nameBase theType theField = defOffset w nameBase (CExpr ("offsetof(" ++ theType ++ ", " ++ theField ++ ") - TYPE_SIZE(StgHeader)"))
157
false
true
0
12
36
68
34
34
null
null
mightybyte/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
readPToMaybe :: Parse.ReadP a a -> String -> Maybe a readPToMaybe p str = listToMaybe [ r | (r,s) <- Parse.readP_to_S p str , all isSpace s ]
178
readPToMaybe :: Parse.ReadP a a -> String -> Maybe a readPToMaybe p str = listToMaybe [ r | (r,s) <- Parse.readP_to_S p str , all isSpace s ]
178
readPToMaybe p str = listToMaybe [ r | (r,s) <- Parse.readP_to_S p str , all isSpace s ]
125
false
true
0
10
64
70
34
36
null
null
abakst/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/Coverage.hs
bsd-3-clause
allocTickBox :: BoxLabel -> Bool -> Bool -> SrcSpan -> TM (HsExpr Id) -> TM (LHsExpr Id) allocTickBox boxLabel countEntries topOnly pos m = ifGoodTickSrcSpan pos (do (fvs, e) <- getFreeVars m env <- getEnv tickish <- mkTickish boxLabel countEntries topOnly pos fvs (declPath env) return (L pos (HsTick tickish (L pos e))) ) (do e <- m return (L pos e) )
396
allocTickBox :: BoxLabel -> Bool -> Bool -> SrcSpan -> TM (HsExpr Id) -> TM (LHsExpr Id) allocTickBox boxLabel countEntries topOnly pos m = ifGoodTickSrcSpan pos (do (fvs, e) <- getFreeVars m env <- getEnv tickish <- mkTickish boxLabel countEntries topOnly pos fvs (declPath env) return (L pos (HsTick tickish (L pos e))) ) (do e <- m return (L pos e) )
396
allocTickBox boxLabel countEntries topOnly pos m = ifGoodTickSrcSpan pos (do (fvs, e) <- getFreeVars m env <- getEnv tickish <- mkTickish boxLabel countEntries topOnly pos fvs (declPath env) return (L pos (HsTick tickish (L pos e))) ) (do e <- m return (L pos e) )
294
false
true
0
15
105
173
82
91
null
null
amccausl/Swish
Swish/HaskellUtils/LookupMapTest.hs
lgpl-2.1
testLookupMap34 = testLookupMap "34" lm34 [(4,"ddd34"),(2,"bbb1"),(3,"ccc"),(2,"bbb1"),(1,"aaa22")]
109
testLookupMap34 = testLookupMap "34" lm34 [(4,"ddd34"),(2,"bbb1"),(3,"ccc"),(2,"bbb1"),(1,"aaa22")]
109
testLookupMap34 = testLookupMap "34" lm34 [(4,"ddd34"),(2,"bbb1"),(3,"ccc"),(2,"bbb1"),(1,"aaa22")]
109
false
false
1
7
15
61
36
25
null
null
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/Types.hs
mpl-2.0
-- | The request was rejected because the credential report is still being -- generated. _CredentialReportNotReadyException :: AsError a => Getting (First ServiceError) a ServiceError _CredentialReportNotReadyException = _ServiceError . hasStatus 404 . hasCode "ReportInProgress"
283
_CredentialReportNotReadyException :: AsError a => Getting (First ServiceError) a ServiceError _CredentialReportNotReadyException = _ServiceError . hasStatus 404 . hasCode "ReportInProgress"
194
_CredentialReportNotReadyException = _ServiceError . hasStatus 404 . hasCode "ReportInProgress"
99
true
true
0
8
37
47
23
24
null
null
enolan/cabal
cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs
bsd-3-clause
commentPackageEnvironment :: FilePath -> IO PackageEnvironment commentPackageEnvironment sandboxDir = do commentConf <- commentSavedConfig let baseConf = commonPackageEnvironmentConfig sandboxDir return $ mempty { pkgEnvSavedConfig = commentConf `mappend` baseConf } -- | If this package environment inherits from some other package environment, -- return that package environment; otherwise return mempty.
423
commentPackageEnvironment :: FilePath -> IO PackageEnvironment commentPackageEnvironment sandboxDir = do commentConf <- commentSavedConfig let baseConf = commonPackageEnvironmentConfig sandboxDir return $ mempty { pkgEnvSavedConfig = commentConf `mappend` baseConf } -- | If this package environment inherits from some other package environment, -- return that package environment; otherwise return mempty.
423
commentPackageEnvironment sandboxDir = do commentConf <- commentSavedConfig let baseConf = commonPackageEnvironmentConfig sandboxDir return $ mempty { pkgEnvSavedConfig = commentConf `mappend` baseConf } -- | If this package environment inherits from some other package environment, -- return that package environment; otherwise return mempty.
360
false
true
0
11
64
67
33
34
null
null
yiannist/ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
-- | Function to force a non-negative value, without returning via a -- monad. This is needed for, and should be used /only/ in the case of -- forcing constants. In case the constant is wrong (< 0), this will -- become a runtime error. forceNonNeg :: (Num a, Ord a, Show a) => a -> NonNegative a forceNonNeg i = case mkNonNegative i of Ok n -> n Bad msg -> error msg -- ** Disks -- | Disk index type (embedding constraints on the index value via a -- smart constructor).
508
forceNonNeg :: (Num a, Ord a, Show a) => a -> NonNegative a forceNonNeg i = case mkNonNegative i of Ok n -> n Bad msg -> error msg -- ** Disks -- | Disk index type (embedding constraints on the index value via a -- smart constructor).
272
forceNonNeg i = case mkNonNegative i of Ok n -> n Bad msg -> error msg -- ** Disks -- | Disk index type (embedding constraints on the index value via a -- smart constructor).
212
true
true
0
8
130
77
40
37
null
null
muspellsson/hiccup
BSParse.hs
lgpl-2.1
sepBy p sep = (p `sepBy1` sep) </> emit []
42
sepBy p sep = (p `sepBy1` sep) </> emit []
42
sepBy p sep = (p `sepBy1` sep) </> emit []
42
false
false
0
7
9
29
15
14
null
null
apyrgio/snf-ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
readRecreateDisks :: JSValue -> Text.JSON.Result RecreateDisksInfo readRecreateDisks (JSArray []) = return RecreateDisksAll
123
readRecreateDisks :: JSValue -> Text.JSON.Result RecreateDisksInfo readRecreateDisks (JSArray []) = return RecreateDisksAll
123
readRecreateDisks (JSArray []) = return RecreateDisksAll
56
false
true
0
8
11
35
17
18
null
null
bkoropoff/Idris-dev
src/Idris/IdrisDoc.hs
bsd-3-clause
createOtherDoc :: IState -- ^ Needed to determine the types of names -> Docs -- ^ Namespace item to generate HTML block for -> H.Html -- ^ Resulting HTML createOtherDoc ist (FunDoc fd) = createFunDoc ist fd
253
createOtherDoc :: IState -- ^ Needed to determine the types of names -> Docs -- ^ Namespace item to generate HTML block for -> H.Html createOtherDoc ist (FunDoc fd) = createFunDoc ist fd
233
createOtherDoc ist (FunDoc fd) = createFunDoc ist fd
67
true
true
0
7
83
40
21
19
null
null
EchoTeam/harlson
Perftest.hs
bsd-2-clause
main :: IO () main = do let keysCount = 10000 runJob 1 (updateMetrics keysCount) runJob 1 updateLimits runJob 1 (updateLevels keysCount) vars <- replicateM 300 $ myForkIO $ runJob 1 (updateMetrics 2000) mapM_ takeMVar vars print "Done put" runJob 10 getOverLimit runJob 1 stop
312
main :: IO () main = do let keysCount = 10000 runJob 1 (updateMetrics keysCount) runJob 1 updateLimits runJob 1 (updateLevels keysCount) vars <- replicateM 300 $ myForkIO $ runJob 1 (updateMetrics 2000) mapM_ takeMVar vars print "Done put" runJob 10 getOverLimit runJob 1 stop
312
main = do let keysCount = 10000 runJob 1 (updateMetrics keysCount) runJob 1 updateLimits runJob 1 (updateLevels keysCount) vars <- replicateM 300 $ myForkIO $ runJob 1 (updateMetrics 2000) mapM_ takeMVar vars print "Done put" runJob 10 getOverLimit runJob 1 stop
298
false
true
0
12
80
126
52
74
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs
mpl-2.0
-- | Byte(s) to use as the segment terminator. If this is unset, \'\\r\' is -- used as segment terminator, matching the HL7 version 2 specification. pcSegmentTerminator :: Lens' ParserConfig (Maybe ByteString) pcSegmentTerminator = lens _pcSegmentTerminator (\ s a -> s{_pcSegmentTerminator = a}) . mapping _Bytes
327
pcSegmentTerminator :: Lens' ParserConfig (Maybe ByteString) pcSegmentTerminator = lens _pcSegmentTerminator (\ s a -> s{_pcSegmentTerminator = a}) . mapping _Bytes
178
pcSegmentTerminator = lens _pcSegmentTerminator (\ s a -> s{_pcSegmentTerminator = a}) . mapping _Bytes
117
true
true
3
8
59
64
29
35
null
null
bowtiemod/pakoras
src/Pakoras/Conduit.hs
mit
mergeEventList :: [Event Signal] -> Event Signal {-| Merges a list of events into one event. -} mergeEventList [s] = s
123
mergeEventList :: [Event Signal] -> Event Signal mergeEventList [s] = s
74
mergeEventList [s] = s
25
true
true
0
7
25
31
16
15
null
null
janschulz/pandoc
tests/Tests/Readers/LaTeX.hs
gpl-2.0
rt :: String -> Inlines rt = rawInline "latex"
46
rt :: String -> Inlines rt = rawInline "latex"
46
rt = rawInline "latex"
22
false
true
0
7
8
25
10
15
null
null
mietek/stack
src/Stack/Build.hs
bsd-3-clause
mkBaseConfigOpts :: (MonadIO m, MonadReader env m, HasBuildConfig env, MonadThrow m) => BuildOpts -> m BaseConfigOpts mkBaseConfigOpts bopts = do snapDBPath <- packageDatabaseDeps localDBPath <- packageDatabaseLocal snapInstallRoot <- installationRootDeps localInstallRoot <- installationRootLocal return BaseConfigOpts { bcoSnapDB = snapDBPath , bcoLocalDB = localDBPath , bcoSnapInstallRoot = snapInstallRoot , bcoLocalInstallRoot = localInstallRoot , bcoBuildOpts = bopts } -- | Provide a function for loading package information from the package index
641
mkBaseConfigOpts :: (MonadIO m, MonadReader env m, HasBuildConfig env, MonadThrow m) => BuildOpts -> m BaseConfigOpts mkBaseConfigOpts bopts = do snapDBPath <- packageDatabaseDeps localDBPath <- packageDatabaseLocal snapInstallRoot <- installationRootDeps localInstallRoot <- installationRootLocal return BaseConfigOpts { bcoSnapDB = snapDBPath , bcoLocalDB = localDBPath , bcoSnapInstallRoot = snapInstallRoot , bcoLocalInstallRoot = localInstallRoot , bcoBuildOpts = bopts } -- | Provide a function for loading package information from the package index
641
mkBaseConfigOpts bopts = do snapDBPath <- packageDatabaseDeps localDBPath <- packageDatabaseLocal snapInstallRoot <- installationRootDeps localInstallRoot <- installationRootLocal return BaseConfigOpts { bcoSnapDB = snapDBPath , bcoLocalDB = localDBPath , bcoSnapInstallRoot = snapInstallRoot , bcoLocalInstallRoot = localInstallRoot , bcoBuildOpts = bopts } -- | Provide a function for loading package information from the package index
506
false
true
0
10
153
121
62
59
null
null