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
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1F6A' = "\x03A9\x0313\x0300"
45
decomposeChar '\x1F6A' = "\x03A9\x0313\x0300"
45
decomposeChar '\x1F6A' = "\x03A9\x0313\x0300"
45
false
false
0
4
3
10
4
6
null
null
termite2/tsl
Abstract/BFormula.hs
bsd-3-clause
fAbsVars' FFalse = []
31
fAbsVars' FFalse = []
31
fAbsVars' FFalse = []
31
false
false
0
5
13
12
5
7
null
null
uduki/hsQt
Qtc/Gui/QUndoGroup.hs
bsd-2-clause
activeStack :: QUndoGroup a -> (()) -> IO (QUndoStack ()) activeStack x0 () = withQUndoStackResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QUndoGroup_activeStack cobj_x0
176
activeStack :: QUndoGroup a -> (()) -> IO (QUndoStack ()) activeStack x0 () = withQUndoStackResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QUndoGroup_activeStack cobj_x0
176
activeStack x0 () = withQUndoStackResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QUndoGroup_activeStack cobj_x0
118
false
true
4
11
32
70
32
38
null
null
green-haskell/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
tickishCounts HpcTick{} = True
33
tickishCounts HpcTick{} = True
33
tickishCounts HpcTick{} = True
33
false
false
0
6
6
13
6
7
null
null
kdungs/adventofcode2016
04.hs
mit
sumSectorIds :: [Room] -> Int sumSectorIds = foldl (\acc r -> acc + (sector r)) 0
81
sumSectorIds :: [Room] -> Int sumSectorIds = foldl (\acc r -> acc + (sector r)) 0
81
sumSectorIds = foldl (\acc r -> acc + (sector r)) 0
51
false
true
0
10
15
50
24
26
null
null
scravy/multimap
src/Data/BagMultiMap.hs
mit
foldrWithKey :: (k -> a -> b -> b) -> b -> BagMultiMap k a -> b -- ^ /O(n)./ Fold the keys and values in the map using the given right-associative -- binary operator, taking into account not only the value but also the key. foldrWithKey f e = P.foldr (uncurry f) e . toList
273
foldrWithKey :: (k -> a -> b -> b) -> b -> BagMultiMap k a -> b foldrWithKey f e = P.foldr (uncurry f) e . toList
113
foldrWithKey f e = P.foldr (uncurry f) e . toList
49
true
true
0
9
55
67
34
33
null
null
codemac/yi-editor
src/Yi/Mode/Latex.hs
gpl-2.0
-- | syntax-based latex mode latexMode3 :: Mode (Latex.Tree Latex.TT) latexMode3 = abstract { modeName = "latex", modeHL = ExtHL $ Driver.mkHighlighter (IncrParser.scanner Latex.parse . latexLexer), modeGetStrokes = \t point begin end -> Latex.getStrokes point begin end t }
298
latexMode3 :: Mode (Latex.Tree Latex.TT) latexMode3 = abstract { modeName = "latex", modeHL = ExtHL $ Driver.mkHighlighter (IncrParser.scanner Latex.parse . latexLexer), modeGetStrokes = \t point begin end -> Latex.getStrokes point begin end t }
269
latexMode3 = abstract { modeName = "latex", modeHL = ExtHL $ Driver.mkHighlighter (IncrParser.scanner Latex.parse . latexLexer), modeGetStrokes = \t point begin end -> Latex.getStrokes point begin end t }
228
true
true
2
13
62
100
49
51
null
null
ekmett/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr (MOVZxL II32 src dst) = pprSizeOpOp (sLit "mov") II32 src dst
70
pprInstr (MOVZxL II32 src dst) = pprSizeOpOp (sLit "mov") II32 src dst
70
pprInstr (MOVZxL II32 src dst) = pprSizeOpOp (sLit "mov") II32 src dst
70
false
false
0
7
11
34
16
18
null
null
acowley/ghc
compiler/deSugar/DsUtils.hs
bsd-3-clause
wrapBind :: Var -> Var -> CoreExpr -> CoreExpr wrapBind new old body -- NB: this function must deal with term | new==old = body -- variables, type variables or coercion variables | otherwise = Let (NonRec new (varToCoreExpr old)) body
246
wrapBind :: Var -> Var -> CoreExpr -> CoreExpr wrapBind new old body -- NB: this function must deal with term | new==old = body -- variables, type variables or coercion variables | otherwise = Let (NonRec new (varToCoreExpr old)) body
246
wrapBind new old body -- NB: this function must deal with term | new==old = body -- variables, type variables or coercion variables | otherwise = Let (NonRec new (varToCoreExpr old)) body
199
false
true
1
9
52
68
34
34
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/Disks/Resize.hs
mpl-2.0
-- | Creates a value of 'DisksResize' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'drProject' -- -- * 'drDisk' -- -- * 'drZone' -- -- * 'drPayload' disksResize :: Text -- ^ 'drProject' -> Text -- ^ 'drDisk' -> Text -- ^ 'drZone' -> DisksResizeRequest -- ^ 'drPayload' -> DisksResize disksResize pDrProject_ pDrDisk_ pDrZone_ pDrPayload_ = DisksResize' { _drProject = pDrProject_ , _drDisk = pDrDisk_ , _drZone = pDrZone_ , _drPayload = pDrPayload_ }
582
disksResize :: Text -- ^ 'drProject' -> Text -- ^ 'drDisk' -> Text -- ^ 'drZone' -> DisksResizeRequest -- ^ 'drPayload' -> DisksResize disksResize pDrProject_ pDrDisk_ pDrZone_ pDrPayload_ = DisksResize' { _drProject = pDrProject_ , _drDisk = pDrDisk_ , _drZone = pDrZone_ , _drPayload = pDrPayload_ }
345
disksResize pDrProject_ pDrDisk_ pDrZone_ pDrPayload_ = DisksResize' { _drProject = pDrProject_ , _drDisk = pDrDisk_ , _drZone = pDrZone_ , _drPayload = pDrPayload_ }
190
true
true
0
8
136
77
50
27
null
null
sapek/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
isBlockTag :: Tag String -> Bool isBlockTag t = tagOpen isBlockTagName (const True) t || tagClose isBlockTagName t || tagComment (const True) t where isBlockTagName ('?':_) = True isBlockTagName ('!':_) = True isBlockTagName x = x `elem` blockTags || x `elem` eitherBlockOrInline
423
isBlockTag :: Tag String -> Bool isBlockTag t = tagOpen isBlockTagName (const True) t || tagClose isBlockTagName t || tagComment (const True) t where isBlockTagName ('?':_) = True isBlockTagName ('!':_) = True isBlockTagName x = x `elem` blockTags || x `elem` eitherBlockOrInline
423
isBlockTag t = tagOpen isBlockTagName (const True) t || tagClose isBlockTagName t || tagComment (const True) t where isBlockTagName ('?':_) = True isBlockTagName ('!':_) = True isBlockTagName x = x `elem` blockTags || x `elem` eitherBlockOrInline
390
false
true
0
9
185
114
58
56
null
null
modeswitch/barrelfish
tools/hamlet/Parser.hs
mit
-- parse subexpression for the above exprP = do left <- identifier (do reservedOp "+" right <- identifier return $ AddExpr left right <|> (return $ NameExpr left))
192
exprP = do left <- identifier (do reservedOp "+" right <- identifier return $ AddExpr left right <|> (return $ NameExpr left))
155
exprP = do left <- identifier (do reservedOp "+" right <- identifier return $ AddExpr left right <|> (return $ NameExpr left))
155
true
false
1
13
56
63
27
36
null
null
brendanhay/gogol
gogol-vault/gen/Network/Google/Resource/Vault/Matters/Holds/Update.hs
mpl-2.0
-- | JSONP mhuCallback :: Lens' MattersHoldsUpdate (Maybe Text) mhuCallback = lens _mhuCallback (\ s a -> s{_mhuCallback = a})
128
mhuCallback :: Lens' MattersHoldsUpdate (Maybe Text) mhuCallback = lens _mhuCallback (\ s a -> s{_mhuCallback = a})
117
mhuCallback = lens _mhuCallback (\ s a -> s{_mhuCallback = a})
64
true
true
1
9
21
52
25
27
null
null
Altech/haScm
src/Scheme/Evaluator.hs
gpl-3.0
require _ [v] = throwError $ TypeMismatch "symbol" v
52
require _ [v] = throwError $ TypeMismatch "symbol" v
52
require _ [v] = throwError $ TypeMismatch "symbol" v
52
false
false
1
6
8
25
11
14
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Key name of this placement. This is a read-only, auto-generated field. p1KeyName :: Lens' Placement (Maybe Text) p1KeyName = lens _p1KeyName (\ s a -> s{_p1KeyName = a})
176
p1KeyName :: Lens' Placement (Maybe Text) p1KeyName = lens _p1KeyName (\ s a -> s{_p1KeyName = a})
100
p1KeyName = lens _p1KeyName (\ s a -> s{_p1KeyName = a})
58
true
true
0
9
31
46
25
21
null
null
eryx67/haskell-libtorrent
src/Network/Libtorrent/TorrentHandle/TorrentStatus.hs
bsd-3-clause
getNumUploads :: MonadIO m => TorrentStatus -> m CInt getNumUploads ho = liftIO . withPtr ho $ \hoPtr -> [CU.exp| int { $(torrent_status * hoPtr)->num_uploads } |]
168
getNumUploads :: MonadIO m => TorrentStatus -> m CInt getNumUploads ho = liftIO . withPtr ho $ \hoPtr -> [CU.exp| int { $(torrent_status * hoPtr)->num_uploads } |]
168
getNumUploads ho = liftIO . withPtr ho $ \hoPtr -> [CU.exp| int { $(torrent_status * hoPtr)->num_uploads } |]
113
false
true
0
7
31
50
26
24
null
null
geophf/1HaskellADay
exercises/HAD/Y2017/M03/D16/Solution.hs
mit
sfs :: [Prime] -> Set Integer -> Set Integer sfs (p:rimes) uniq = if fromMaybe 0 (fst <$> Set.maxView uniq) < p * p then uniq else sfs rimes (squareFreed p uniq)
167
sfs :: [Prime] -> Set Integer -> Set Integer sfs (p:rimes) uniq = if fromMaybe 0 (fst <$> Set.maxView uniq) < p * p then uniq else sfs rimes (squareFreed p uniq)
167
sfs (p:rimes) uniq = if fromMaybe 0 (fst <$> Set.maxView uniq) < p * p then uniq else sfs rimes (squareFreed p uniq)
122
false
true
0
12
37
90
44
46
null
null
d0kt0r0/Tidal
src/Sound/Tidal/UI.hs
gpl-3.0
{-| Decide whether to apply one or another function depending on the result of a test function that is passed the current cycle as a number. @ d1 $ ifp ((== 0).(flip mod 2)) (striate 4) (# coarse "24 48") $ sound "hh hc" @ This will apply `striate 4` for every _even_ cycle and aply `# coarse "24 48"` for every _odd_. Detail: As you can see the test function is arbitrary and does not rely on anything tidal specific. In fact it uses only plain haskell functionality, that is: it calculates the modulo of 2 of the current cycle which is either 0 (for even cycles) or 1. It then compares this value against 0 and returns the result, which is either `True` or `False`. This is what the `ifp` signature's first part signifies `(Int -> Bool)`, a function that takes a whole number and returns either `True` or `False`. -} ifp :: (Int -> Bool) -> (Pattern a -> Pattern a) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a ifp test f1 f2 p = splitQueries $ p {query = q} where q a | test (floor $ start $ arc a) = query (f1 p) a | otherwise = query (f2 p) a -- | @wedge t p p'@ combines patterns @p@ and @p'@ by squashing the -- @p@ into the portion of each cycle given by @t@, and @p'@ into the -- remainer of each cycle.
1,245
ifp :: (Int -> Bool) -> (Pattern a -> Pattern a) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a ifp test f1 f2 p = splitQueries $ p {query = q} where q a | test (floor $ start $ arc a) = query (f1 p) a | otherwise = query (f2 p) a -- | @wedge t p p'@ combines patterns @p@ and @p'@ by squashing the -- @p@ into the portion of each cycle given by @t@, and @p'@ into the -- remainer of each cycle.
417
ifp test f1 f2 p = splitQueries $ p {query = q} where q a | test (floor $ start $ arc a) = query (f1 p) a | otherwise = query (f2 p) a -- | @wedge t p p'@ combines patterns @p@ and @p'@ by squashing the -- @p@ into the portion of each cycle given by @t@, and @p'@ into the -- remainer of each cycle.
314
true
true
0
11
268
155
76
79
null
null
urbanslug/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
emptyHsQTvs :: LHsTyVarBndrs name -- Use only when you know there are no kind binders emptyHsQTvs = HsQTvs { hsq_kvs = [], hsq_tvs = [] }
140
emptyHsQTvs :: LHsTyVarBndrs name emptyHsQTvs = HsQTvs { hsq_kvs = [], hsq_tvs = [] }
86
emptyHsQTvs = HsQTvs { hsq_kvs = [], hsq_tvs = [] }
52
true
true
1
8
28
37
19
18
null
null
siddhanathan/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
isCTyEqCan (CFunEqCan {}) = False
33
isCTyEqCan (CFunEqCan {}) = False
33
isCTyEqCan (CFunEqCan {}) = False
33
false
false
0
7
4
16
8
8
null
null
monsanto/hie
Hie/Language/Haskell/Exts/ParseSyntax.hs
gpl-3.0
list_tycon l = TyCon l (list_tycon_name l)
55
list_tycon l = TyCon l (list_tycon_name l)
55
list_tycon l = TyCon l (list_tycon_name l)
55
false
false
0
7
19
20
9
11
null
null
Drezil/subhask
src/SubHask/SubType.hs
bsd-3-clause
stripForall (ConT t) = ConT t
29
stripForall (ConT t) = ConT t
29
stripForall (ConT t) = ConT t
29
false
false
0
7
5
18
8
10
null
null
RAFIRAF/HASKELL
baby.hs
mit
maksimumif :: (Ord a) => [a] -> a maksimumif [] = error "Pusta lista"
70
maksimumif :: (Ord a) => [a] -> a maksimumif [] = error "Pusta lista"
70
maksimumif [] = error "Pusta lista"
36
false
true
0
9
14
41
19
22
null
null
alanz/aws-dynamodb-play
src/Main.hs
unlicense
-- --------------------------------------------------------------------- {- Working through http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStartedDynamoDB.html Use case 1: Product Catalog Suppose you want to store product information in DynamoDB. Each product you store has its own set of properties, and accordingly, you need to store different information about each of these products. DynamoDB is a NoSQL database: Except for a required common primary key, individual items in a table can have any number of attributes. This enables you to save all the product data in the same table. So you will create a ProductCatalog table that uses Id as the primary key and stores information for products such as books and bicycles in the table. Id is a numeric attribute and hash type primary key. After creating the table, in the next step you will write code to retrieve items from this table. Note that while you can retrieve an item, you cannot query the table. To query the table, the primary key must be of the hash and range type. Table Name : ProductCatalog Primary Key : (Id, ... ) Type : Hash Hash Attribute Name : Id Hash Attribute Type : Number Range Attribute Name and Type : N/A Provisioned Throughput: Read capacity units: 10 Write capacity units: 5 -} createProductCatalogTableAndWait :: IO () createProductCatalogTableAndWait = do let req0 = createTable "ProductCatalog" [AttributeDefinition "Id" AttrNumber] (HashOnly "Id") (ProvisionedThroughput 10 5) resp0 <- runCommand req0 print resp0 print "Waiting for table to be created" threadDelay (30 * 1000000) let req1 = DescribeTable "ProductCatalog" resp1 <- runCommand req1 print resp1 -- ---------------------------------------------------------------------
1,879
createProductCatalogTableAndWait :: IO () createProductCatalogTableAndWait = do let req0 = createTable "ProductCatalog" [AttributeDefinition "Id" AttrNumber] (HashOnly "Id") (ProvisionedThroughput 10 5) resp0 <- runCommand req0 print resp0 print "Waiting for table to be created" threadDelay (30 * 1000000) let req1 = DescribeTable "ProductCatalog" resp1 <- runCommand req1 print resp1 -- ---------------------------------------------------------------------
501
createProductCatalogTableAndWait = do let req0 = createTable "ProductCatalog" [AttributeDefinition "Id" AttrNumber] (HashOnly "Id") (ProvisionedThroughput 10 5) resp0 <- runCommand req0 print resp0 print "Waiting for table to be created" threadDelay (30 * 1000000) let req1 = DescribeTable "ProductCatalog" resp1 <- runCommand req1 print resp1 -- ---------------------------------------------------------------------
459
true
true
0
12
387
122
55
67
null
null
NotBrianZach/postgrest
src/PostgREST/DbStructure.hs
mit
pkFromRow :: [Table] -> (Schema, Text, Text) -> Maybe PrimaryKey pkFromRow tabs (s, t, n) = PrimaryKey <$> table <*> pure n where table = find (\tbl -> tableSchema tbl == s && tableName tbl == t) tabs
202
pkFromRow :: [Table] -> (Schema, Text, Text) -> Maybe PrimaryKey pkFromRow tabs (s, t, n) = PrimaryKey <$> table <*> pure n where table = find (\tbl -> tableSchema tbl == s && tableName tbl == t) tabs
202
pkFromRow tabs (s, t, n) = PrimaryKey <$> table <*> pure n where table = find (\tbl -> tableSchema tbl == s && tableName tbl == t) tabs
137
false
true
0
11
39
102
52
50
null
null
hferreiro/ghc-events-replay
Replay.hs
bsd-3-clause
die s = do hPutStrLn stderr s; exitWith (ExitFailure 1) #endif
62
die s = do hPutStrLn stderr s; exitWith (ExitFailure 1) #endif
62
die s = do hPutStrLn stderr s; exitWith (ExitFailure 1) #endif
62
false
false
1
10
10
35
14
21
null
null
DavidAlphaFox/ghc
libraries/transformers/Control/Applicative/Lift.hs
bsd-3-clause
unLift (Other e) = e
20
unLift (Other e) = e
20
unLift (Other e) = e
20
false
false
0
7
4
15
7
8
null
null
fiigii/k-cfa
Parser.hs
mit
term :: Parser Ast term = parens expr <|> var <|> literal <|> funcExpr <|> ifExpr <|> letExpr <|> block <|> list <|> headExpr <|> tailExpr <|> isNil
157
term :: Parser Ast term = parens expr <|> var <|> literal <|> funcExpr <|> ifExpr <|> letExpr <|> block <|> list <|> headExpr <|> tailExpr <|> isNil
157
term = parens expr <|> var <|> literal <|> funcExpr <|> ifExpr <|> letExpr <|> block <|> list <|> headExpr <|> tailExpr <|> isNil
138
false
true
4
10
36
64
30
34
null
null
pparkkin/eta
compiler/ETA/Prelude/TysWiredIn.hs
bsd-3-clause
coercibleDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "MkCoercible") coercibleDataConKey coercibleDataCon
123
coercibleDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "MkCoercible") coercibleDataConKey coercibleDataCon
123
coercibleDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "MkCoercible") coercibleDataConKey coercibleDataCon
123
false
false
0
7
8
23
11
12
null
null
erochest/cabal-new
CabalNew/Opts.hs
apache-2.0
opts :: ParserInfo CabalNew opts = info (helper <*> opts') ( fullDesc <> progDesc "Create a new Haskell project\ \ with cabal, git, sandbox-init,\ \ and everything else." <> header ("cabal-new - " ++ showVersion version ++ " - a utility to initialize\ \ a new Haskell project.") )
432
opts :: ParserInfo CabalNew opts = info (helper <*> opts') ( fullDesc <> progDesc "Create a new Haskell project\ \ with cabal, git, sandbox-init,\ \ and everything else." <> header ("cabal-new - " ++ showVersion version ++ " - a utility to initialize\ \ a new Haskell project.") )
432
opts = info (helper <*> opts') ( fullDesc <> progDesc "Create a new Haskell project\ \ with cabal, git, sandbox-init,\ \ and everything else." <> header ("cabal-new - " ++ showVersion version ++ " - a utility to initialize\ \ a new Haskell project.") )
404
false
true
0
12
200
57
28
29
null
null
BartAdv/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
-- |Return True if the argument 'Name' should be interpreted as the name of a -- typeclass. tcname (UN xs) | T.null xs = False | otherwise = T.head xs == '@'
172
tcname (UN xs) | T.null xs = False | otherwise = T.head xs == '@'
80
tcname (UN xs) | T.null xs = False | otherwise = T.head xs == '@'
80
true
false
1
9
46
46
21
25
null
null
kojiromike/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
defined (PDSL n _) = [n]
55
defined (PDSL n _) = [n]
55
defined (PDSL n _) = [n]
55
false
false
0
6
36
21
10
11
null
null
haroldcarr/learn-haskell-coq-ml-etc
foundations/book/2002-TAPL-2005-ATAPL/tapl/src/Ch25_System_F.hs
unlicense
typeSubstTop :: Ty -> Ty -> Ty typeSubstTop tyS tyT = typeShift (-1) (typeSubst (typeShift 1 tyS) 0 tyT)
104
typeSubstTop :: Ty -> Ty -> Ty typeSubstTop tyS tyT = typeShift (-1) (typeSubst (typeShift 1 tyS) 0 tyT)
104
typeSubstTop tyS tyT = typeShift (-1) (typeSubst (typeShift 1 tyS) 0 tyT)
73
false
true
0
9
18
52
26
26
null
null
mathhun/stack
src/Stack/Types/Config.hs
bsd-3-clause
configMonoidExtraIncludeDirsName :: Text configMonoidExtraIncludeDirsName = "extra-include-dirs"
96
configMonoidExtraIncludeDirsName :: Text configMonoidExtraIncludeDirsName = "extra-include-dirs"
96
configMonoidExtraIncludeDirsName = "extra-include-dirs"
55
false
true
0
4
5
11
6
5
null
null
jthornber/language-c-ejt
src/Language/C/Analysis/AstAnalysis.hs
bsd-3-clause
tStmt c (CFor i g inc s _) = do enterBlockScope either (maybe (return ()) checkExpr) (analyseDecl True) i maybe (return ()) (checkGuard c) g maybe (return ()) checkExpr inc tStmt (LoopCtx : c) s leaveBlockScope return voidType where checkExpr e = tExpr c RValue e >> return ()
316
tStmt c (CFor i g inc s _) = do enterBlockScope either (maybe (return ()) checkExpr) (analyseDecl True) i maybe (return ()) (checkGuard c) g maybe (return ()) checkExpr inc tStmt (LoopCtx : c) s leaveBlockScope return voidType where checkExpr e = tExpr c RValue e >> return ()
316
tStmt c (CFor i g inc s _) = do enterBlockScope either (maybe (return ()) checkExpr) (analyseDecl True) i maybe (return ()) (checkGuard c) g maybe (return ()) checkExpr inc tStmt (LoopCtx : c) s leaveBlockScope return voidType where checkExpr e = tExpr c RValue e >> return ()
316
false
false
0
12
88
152
69
83
null
null
jsavatgy/xroads-game
code/io-vecs.hs
gpl-2.0
r2 = plateW - r1
16
r2 = plateW - r1
16
r2 = plateW - r1
16
false
false
0
5
4
10
5
5
null
null
flowbox-public/accelerate-cuda
Data/Array/Accelerate/CUDA/Array/Prim.hs
bsd-3-clause
showBytes :: Int -> String showBytes x = D.showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"
104
showBytes :: Int -> String showBytes x = D.showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"
104
showBytes x = D.showFFloatSIBase (Just 0) 1024 (fromIntegral x :: Double) "B"
77
false
true
0
7
16
49
23
26
null
null
afiore/jenkins-tty.hs
src/Options.hs
mit
buildParamParser :: String -> ReadM BuildParams buildParamParser = return . BuildParams . mapMaybe parseParam . BS.words . BS.pack
130
buildParamParser :: String -> ReadM BuildParams buildParamParser = return . BuildParams . mapMaybe parseParam . BS.words . BS.pack
130
buildParamParser = return . BuildParams . mapMaybe parseParam . BS.words . BS.pack
82
false
true
0
8
17
41
20
21
null
null
brendanhay/gogol
gogol-cloudprivatecatalogproducer/gen/Network/Google/Resource/CloudPrivateCatalogProducer/Catalogs/Associations/Get.hs
mpl-2.0
-- | The resource name of the \`Association\` to retrieve. cagName :: Lens' CatalogsAssociationsGet Text cagName = lens _cagName (\ s a -> s{_cagName = a})
155
cagName :: Lens' CatalogsAssociationsGet Text cagName = lens _cagName (\ s a -> s{_cagName = a})
96
cagName = lens _cagName (\ s a -> s{_cagName = a})
50
true
true
0
9
25
40
22
18
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Attrs/Attrs.hs
bsd-3-clause
httpEquiv ∷ AttrHasHttpEquiv a ⇒ Text → a → a httpEquiv t = attrSetHttpEquiv (HttpEquiv t)
90
httpEquiv ∷ AttrHasHttpEquiv a ⇒ Text → a → a httpEquiv t = attrSetHttpEquiv (HttpEquiv t)
90
httpEquiv t = attrSetHttpEquiv (HttpEquiv t)
44
false
true
0
9
15
43
19
24
null
null
spinda/liquidhaskell
tests/gsoc15/unknown/pos/monad6.hs
bsd-3-clause
:: Monad m => m Int -> m Int gpp z = do x <- z return $ liquidAssert (x >= 0) (x + 1)
96
:: Monad m => m Int -> m Int gpp z = do x <- z return $ liquidAssert (x >= 0) (x + 1)
96
:: Monad m => m Int -> m Int gpp z = do x <- z return $ liquidAssert (x >= 0) (x + 1)
96
false
false
0
11
35
66
30
36
null
null
diegospd/pol
src/StartApp.hs
gpl-3.0
handleEv _conf st (VtyEvent (EvKey (KChar 'c') [MCtrl] )) = continue' st $ expandAll st
87
handleEv _conf st (VtyEvent (EvKey (KChar 'c') [MCtrl] )) = continue' st $ expandAll st
87
handleEv _conf st (VtyEvent (EvKey (KChar 'c') [MCtrl] )) = continue' st $ expandAll st
87
false
false
0
10
14
49
22
27
null
null
kellino/TypeSystems
typedArith/Main.hs
mit
main :: IO () main = do (file:_) <- getArgs contents' <- readFile file let program = parseProgram "<from file>" contents' case program of Left err -> print err Right ast -> mapM_ (T.putStrLn . hoistError . typeAndEval) ast
257
main :: IO () main = do (file:_) <- getArgs contents' <- readFile file let program = parseProgram "<from file>" contents' case program of Left err -> print err Right ast -> mapM_ (T.putStrLn . hoistError . typeAndEval) ast
257
main = do (file:_) <- getArgs contents' <- readFile file let program = parseProgram "<from file>" contents' case program of Left err -> print err Right ast -> mapM_ (T.putStrLn . hoistError . typeAndEval) ast
243
false
true
0
15
73
106
47
59
null
null
DaMSL/K3
src/Language/K3/Utils/TemplateHaskell/Utils.hs
apache-2.0
getConstructors :: Info -> Q [Con] getConstructors info = case info of TyConI dec -> case dec of NewtypeD _ _ _ con _ -> return [con] DataD _ _ _ cons _ -> return cons TySynD _ _ typ -> getConstructors =<< reify (getNameOfType typ) _ -> error $ "getConstructors: " ++ show info ++ " is not a data decl or alias to one" _ -> error $ "getConstructors: " ++ show info ++ " is not a type constructor" -- |Obtains the name of a given type.
481
getConstructors :: Info -> Q [Con] getConstructors info = case info of TyConI dec -> case dec of NewtypeD _ _ _ con _ -> return [con] DataD _ _ _ cons _ -> return cons TySynD _ _ typ -> getConstructors =<< reify (getNameOfType typ) _ -> error $ "getConstructors: " ++ show info ++ " is not a data decl or alias to one" _ -> error $ "getConstructors: " ++ show info ++ " is not a type constructor" -- |Obtains the name of a given type.
481
getConstructors info = case info of TyConI dec -> case dec of NewtypeD _ _ _ con _ -> return [con] DataD _ _ _ cons _ -> return cons TySynD _ _ typ -> getConstructors =<< reify (getNameOfType typ) _ -> error $ "getConstructors: " ++ show info ++ " is not a data decl or alias to one" _ -> error $ "getConstructors: " ++ show info ++ " is not a type constructor" -- |Obtains the name of a given type.
446
false
true
2
11
136
155
73
82
null
null
tismith/tlisp
write-yourself-a-scheme/listings/listing6.3.hs
mit
eqv :: [LispVal] -> ThrowsError LispVal eqv [(Bool arg1), (Bool arg2)] = return $ Bool $ arg1 == arg2
101
eqv :: [LispVal] -> ThrowsError LispVal eqv [(Bool arg1), (Bool arg2)] = return $ Bool $ arg1 == arg2
101
eqv [(Bool arg1), (Bool arg2)] = return $ Bool $ arg1 == arg2
61
false
true
0
7
18
58
29
29
null
null
tokiwoousaka/takahashi
src/Control/Monad/Takahashi/Slide.hs
mit
runTakahashi :: Taka a -> Html runTakahashi t = snd $ execRWS (buildTakahashi t) () defaultSlideOption
102
runTakahashi :: Taka a -> Html runTakahashi t = snd $ execRWS (buildTakahashi t) () defaultSlideOption
102
runTakahashi t = snd $ execRWS (buildTakahashi t) () defaultSlideOption
71
false
true
0
8
15
40
19
21
null
null
brendanhay/gogol
gogol-tpu/gen/Network/Google/Resource/TPU/Projects/Locations/Nodes/List.hs
mpl-2.0
-- | OAuth access token. plnlAccessToken :: Lens' ProjectsLocationsNodesList (Maybe Text) plnlAccessToken = lens _plnlAccessToken (\ s a -> s{_plnlAccessToken = a})
172
plnlAccessToken :: Lens' ProjectsLocationsNodesList (Maybe Text) plnlAccessToken = lens _plnlAccessToken (\ s a -> s{_plnlAccessToken = a})
147
plnlAccessToken = lens _plnlAccessToken (\ s a -> s{_plnlAccessToken = a})
82
true
true
0
9
29
48
25
23
null
null
MaxDaten/netwire
Control/Wire/Session.hs
bsd-3-clause
counterSession :: (Monad m) => Time -- ^ Time delta for every instant. -> Session m counterSession dt = let s = Session (return (dt, s)) in s
158
counterSession :: (Monad m) => Time -- ^ Time delta for every instant. -> Session m counterSession dt = let s = Session (return (dt, s)) in s
158
counterSession dt = let s = Session (return (dt, s)) in s
61
false
true
0
12
44
62
30
32
null
null
ryantrinkle/ghcjs
src/Gen2/Printer.hs
mit
braceNest' :: Doc -> Doc braceNest' x = nest 2 (char '{' $+$ x) $$ char '}'
75
braceNest' :: Doc -> Doc braceNest' x = nest 2 (char '{' $+$ x) $$ char '}'
75
braceNest' x = nest 2 (char '{' $+$ x) $$ char '}'
50
false
true
0
8
16
46
20
26
null
null
yiannist/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
hvMigrationFailed :: String hvMigrationFailed = "failed"
56
hvMigrationFailed :: String hvMigrationFailed = "failed"
56
hvMigrationFailed = "failed"
28
false
true
0
4
5
11
6
5
null
null
a143753/AOJ
0041.hs
apache-2.0
chk' _ [] _ = Nothing
21
chk' _ [] _ = Nothing
21
chk' _ [] _ = Nothing
21
false
false
0
6
5
15
7
8
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxDS_MANAGE_SCROLLBARS :: Int wxDS_MANAGE_SCROLLBARS = 16
57
wxDS_MANAGE_SCROLLBARS :: Int wxDS_MANAGE_SCROLLBARS = 16
57
wxDS_MANAGE_SCROLLBARS = 16
27
false
true
0
6
5
18
7
11
null
null
konn/latex-crossref
src/Text/LaTeX/CrossRef.hs
bsd-3-clause
mapArgM f (SymArg arg) = SymArg <$> f arg
41
mapArgM f (SymArg arg) = SymArg <$> f arg
41
mapArgM f (SymArg arg) = SymArg <$> f arg
41
false
false
0
7
8
24
11
13
null
null
OS2World/DEV-UTIL-HUGS
libraries/Graphics/UI/GLUT/Fonts.hs
bsd-3-clause
marhshalStrokeFont :: StrokeFont -> IO GLUTstrokeFont marhshalStrokeFont f = case f of Roman -> hOpenGL_marshalStrokeFont 0 MonoRoman -> hOpenGL_marshalStrokeFont 1 --------------------------------------------------------------------------------
256
marhshalStrokeFont :: StrokeFont -> IO GLUTstrokeFont marhshalStrokeFont f = case f of Roman -> hOpenGL_marshalStrokeFont 0 MonoRoman -> hOpenGL_marshalStrokeFont 1 --------------------------------------------------------------------------------
256
marhshalStrokeFont f = case f of Roman -> hOpenGL_marshalStrokeFont 0 MonoRoman -> hOpenGL_marshalStrokeFont 1 --------------------------------------------------------------------------------
202
false
true
2
6
31
45
21
24
null
null
CulpaBS/wbBach
src/Futhark/Analysis/HORepresentation/SOACNest.hs
bsd-3-clause
params :: Annotations lore => Combinator lore -> [Ident] params = fst . combinatorFirstLoop
101
params :: Annotations lore => Combinator lore -> [Ident] params = fst . combinatorFirstLoop
101
params = fst . combinatorFirstLoop
34
false
true
0
7
23
32
16
16
null
null
spockwangs/scheme.in.haskell
list10.hs
unlicense
-- | Parse input as an Lisp expression. readOrThrow :: Parser a -> String -> ThrowsError a readOrThrow parser input = case parse parser "lisp" input of Left err -> throwError $ Parser err Right val -> return val
270
readOrThrow :: Parser a -> String -> ThrowsError a readOrThrow parser input = case parse parser "lisp" input of Left err -> throwError $ Parser err Right val -> return val
229
readOrThrow parser input = case parse parser "lisp" input of Left err -> throwError $ Parser err Right val -> return val
178
true
true
0
9
97
74
33
41
null
null
phischu/fragnix
tests/packages/scotty/Data.Vault.Strict.hs
bsd-3-clause
-- | Insert a value for a given key. Overwrites any previous value. insert :: Key a -> a -> Vault -> Vault insert = ST.insert
125
insert :: Key a -> a -> Vault -> Vault insert = ST.insert
57
insert = ST.insert
18
true
true
0
7
25
29
15
14
null
null
avieth/diplomacy
Diplomacy/OrderResolution.hs
bsd-3-clause
-- | Resolution for the Retreat phase. retreatResolution :: M.Map Zone (Aligned Unit, SomeOrderObject Retreat) -> Resolution Retreat retreatResolution zonedOrders = M.mapWithKey (resolveRetreat zonedWithdraws) zonedOrders where -- At each Zone we have a list of the zones from which a withdraw attempt -- is made. zonedWithdraws :: M.Map Zone [Aligned Subject] zonedWithdraws = M.foldWithKey folder M.empty zonedOrders where folder :: Zone -> (Aligned Unit, SomeOrderObject Retreat) -> M.Map Zone [Aligned Subject] -> M.Map Zone [Aligned Subject] folder zone (aunit, SomeOrderObject object) b = case object of WithdrawObject withdrawingTo -> M.alter alteration (Zone withdrawingTo) b where subject = align (alignedThing aunit, zoneProvinceTarget zone) (alignedGreatPower aunit) alteration x = case x of Nothing -> Just [subject] Just ys -> Just (subject : ys) _ -> b resolveRetreat :: M.Map Zone [Aligned Subject] -> Zone -> (Aligned Unit, SomeOrderObject Retreat) -> (Aligned Unit, SomeResolved OrderObject Retreat) resolveRetreat zonedWithdraws zone (aunit, SomeOrderObject object) = case object of SurrenderObject -> (aunit, SomeResolved (object, Nothing)) WithdrawObject _ -> (aunit, SomeResolved (object, resolution)) where resolution :: Maybe (FailureReason Retreat Withdraw) resolution = case fmap (filter (/= thisSubject)) (M.lookup (Zone (withdrawTarget object)) zonedWithdraws) of Just [] -> Nothing Just (x : xs) -> Just (WithdrawCollision (AtLeast (VCons x VNil) xs)) _ -> Nothing where thisSubject = align (alignedThing aunit, zoneProvinceTarget zone) (alignedGreatPower aunit) -- | Resolution for the Adjust phase.
1,987
retreatResolution :: M.Map Zone (Aligned Unit, SomeOrderObject Retreat) -> Resolution Retreat retreatResolution zonedOrders = M.mapWithKey (resolveRetreat zonedWithdraws) zonedOrders where -- At each Zone we have a list of the zones from which a withdraw attempt -- is made. zonedWithdraws :: M.Map Zone [Aligned Subject] zonedWithdraws = M.foldWithKey folder M.empty zonedOrders where folder :: Zone -> (Aligned Unit, SomeOrderObject Retreat) -> M.Map Zone [Aligned Subject] -> M.Map Zone [Aligned Subject] folder zone (aunit, SomeOrderObject object) b = case object of WithdrawObject withdrawingTo -> M.alter alteration (Zone withdrawingTo) b where subject = align (alignedThing aunit, zoneProvinceTarget zone) (alignedGreatPower aunit) alteration x = case x of Nothing -> Just [subject] Just ys -> Just (subject : ys) _ -> b resolveRetreat :: M.Map Zone [Aligned Subject] -> Zone -> (Aligned Unit, SomeOrderObject Retreat) -> (Aligned Unit, SomeResolved OrderObject Retreat) resolveRetreat zonedWithdraws zone (aunit, SomeOrderObject object) = case object of SurrenderObject -> (aunit, SomeResolved (object, Nothing)) WithdrawObject _ -> (aunit, SomeResolved (object, resolution)) where resolution :: Maybe (FailureReason Retreat Withdraw) resolution = case fmap (filter (/= thisSubject)) (M.lookup (Zone (withdrawTarget object)) zonedWithdraws) of Just [] -> Nothing Just (x : xs) -> Just (WithdrawCollision (AtLeast (VCons x VNil) xs)) _ -> Nothing where thisSubject = align (alignedThing aunit, zoneProvinceTarget zone) (alignedGreatPower aunit) -- | Resolution for the Adjust phase.
1,948
retreatResolution zonedOrders = M.mapWithKey (resolveRetreat zonedWithdraws) zonedOrders where -- At each Zone we have a list of the zones from which a withdraw attempt -- is made. zonedWithdraws :: M.Map Zone [Aligned Subject] zonedWithdraws = M.foldWithKey folder M.empty zonedOrders where folder :: Zone -> (Aligned Unit, SomeOrderObject Retreat) -> M.Map Zone [Aligned Subject] -> M.Map Zone [Aligned Subject] folder zone (aunit, SomeOrderObject object) b = case object of WithdrawObject withdrawingTo -> M.alter alteration (Zone withdrawingTo) b where subject = align (alignedThing aunit, zoneProvinceTarget zone) (alignedGreatPower aunit) alteration x = case x of Nothing -> Just [subject] Just ys -> Just (subject : ys) _ -> b resolveRetreat :: M.Map Zone [Aligned Subject] -> Zone -> (Aligned Unit, SomeOrderObject Retreat) -> (Aligned Unit, SomeResolved OrderObject Retreat) resolveRetreat zonedWithdraws zone (aunit, SomeOrderObject object) = case object of SurrenderObject -> (aunit, SomeResolved (object, Nothing)) WithdrawObject _ -> (aunit, SomeResolved (object, resolution)) where resolution :: Maybe (FailureReason Retreat Withdraw) resolution = case fmap (filter (/= thisSubject)) (M.lookup (Zone (withdrawTarget object)) zonedWithdraws) of Just [] -> Nothing Just (x : xs) -> Just (WithdrawCollision (AtLeast (VCons x VNil) xs)) _ -> Nothing where thisSubject = align (alignedThing aunit, zoneProvinceTarget zone) (alignedGreatPower aunit) -- | Resolution for the Adjust phase.
1,846
true
true
0
19
580
561
281
280
null
null
dgvncsz0f/nws
src/Jerimum/PostgreSQL/Parser.hs
bsd-3-clause
decodeTimeline :: L.ByteString -> Maybe Timeline decodeTimeline codedTimeline = case L8.readInt codedTimeline of Just (timeline, "") -> Just timeline _ -> Nothing
190
decodeTimeline :: L.ByteString -> Maybe Timeline decodeTimeline codedTimeline = case L8.readInt codedTimeline of Just (timeline, "") -> Just timeline _ -> Nothing
190
decodeTimeline codedTimeline = case L8.readInt codedTimeline of Just (timeline, "") -> Just timeline _ -> Nothing
141
false
true
0
9
49
56
27
29
null
null
ony/Yampa-core
tests/AFRPTestsLaws.hs
bsd-3-clause
laws_tr = and laws_trs
22
laws_tr = and laws_trs
22
laws_tr = and laws_trs
22
false
false
0
5
3
9
4
5
null
null
ksaveljev/hake-2
src/QCommon/CNodeT.hs
bsd-3-clause
newCNodeT :: CNodeT newCNodeT = CNodeT Nothing (0, 0)
53
newCNodeT :: CNodeT newCNodeT = CNodeT Nothing (0, 0)
53
newCNodeT = CNodeT Nothing (0, 0)
33
false
true
0
6
8
22
12
10
null
null
eccstartup/numberToText
src/Text/New/NumberToText.hs
bsd-3-clause
toTriples n | mod n 3 == 0 = n | otherwise = n + 3 - (mod n 3)
66
toTriples n | mod n 3 == 0 = n | otherwise = n + 3 - (mod n 3)
66
toTriples n | mod n 3 == 0 = n | otherwise = n + 3 - (mod n 3)
66
false
false
1
9
23
48
22
26
null
null
cvb/hs-orgmode
Text/OrgMode/Elements/List.hs
bsd-3-clause
listEl :: Stream Text Identity b => Parsec Text s ListEl listEl = (try $ ListEl <$> list) <|> (try $ ListEl <$> paragraph)
129
listEl :: Stream Text Identity b => Parsec Text s ListEl listEl = (try $ ListEl <$> list) <|> (try $ ListEl <$> paragraph)
129
listEl = (try $ ListEl <$> list) <|> (try $ ListEl <$> paragraph)
72
false
true
3
8
30
64
31
33
null
null
Xion/spiteful
src/Main.hs
gpl-2.0
run :: Options -> IO () run opts = do opts'@Options{..} <- fixCredentials opts setupLogging optVerbosity let features = fromMaybe defaultFeatures optFeatures if null features then do logAt Info "No features selected, exiting." exitWith ExitSuccess else logAt Info $ "Features: " <> csv features tid <- myThreadId installHandler sigINT $ \_ -> do Text.putStrLn "" >> printStatistics features throwTo tid ExitSuccess logAt Info $ "spiteful-bot v" <> botVersion logAt Debug $ "Command line options: " <> tshow opts' TLS.setGlobalManager =<< TLS.newTlsManager whenJust optDebugPort $ \port -> startDebugServer port features let workerFuncs = resolveFeatures features mapConcurrently_ ($ opts) workerFuncs
751
run :: Options -> IO () run opts = do opts'@Options{..} <- fixCredentials opts setupLogging optVerbosity let features = fromMaybe defaultFeatures optFeatures if null features then do logAt Info "No features selected, exiting." exitWith ExitSuccess else logAt Info $ "Features: " <> csv features tid <- myThreadId installHandler sigINT $ \_ -> do Text.putStrLn "" >> printStatistics features throwTo tid ExitSuccess logAt Info $ "spiteful-bot v" <> botVersion logAt Debug $ "Command line options: " <> tshow opts' TLS.setGlobalManager =<< TLS.newTlsManager whenJust optDebugPort $ \port -> startDebugServer port features let workerFuncs = resolveFeatures features mapConcurrently_ ($ opts) workerFuncs
751
run opts = do opts'@Options{..} <- fixCredentials opts setupLogging optVerbosity let features = fromMaybe defaultFeatures optFeatures if null features then do logAt Info "No features selected, exiting." exitWith ExitSuccess else logAt Info $ "Features: " <> csv features tid <- myThreadId installHandler sigINT $ \_ -> do Text.putStrLn "" >> printStatistics features throwTo tid ExitSuccess logAt Info $ "spiteful-bot v" <> botVersion logAt Debug $ "Command line options: " <> tshow opts' TLS.setGlobalManager =<< TLS.newTlsManager whenJust optDebugPort $ \port -> startDebugServer port features let workerFuncs = resolveFeatures features mapConcurrently_ ($ opts) workerFuncs
727
false
true
0
14
148
240
104
136
null
null
FranklinChen/hugs98-plus-Sep2006
packages/HaXml/src/Text/XML/HaXml/Parse.hs
bsd-3-clause
publicid :: XParser PublicID publicid = do word "PUBLIC" p <- pubidliteral return (PUBLICID p)
106
publicid :: XParser PublicID publicid = do word "PUBLIC" p <- pubidliteral return (PUBLICID p)
106
publicid = do word "PUBLIC" p <- pubidliteral return (PUBLICID p)
77
false
true
0
9
26
39
17
22
null
null
JoseD92/EasyGL
src/EasyGL/Obj/ObjData.hs
bsd-3-clause
faceTriangesV :: VM.MVector s FaceNode -> Face -> Int -> ST s Int faceTriangesV arr f i = aux i $ viewl rest where (pivot :< rest) = viewl f aux index (x :< sx) = case viewl sx of S.EmptyL -> return index (y :< _) -> do VM.write arr index pivot VM.write arr (index+1) x VM.write arr (index+2) y aux (index + 3) (viewl sx)
385
faceTriangesV :: VM.MVector s FaceNode -> Face -> Int -> ST s Int faceTriangesV arr f i = aux i $ viewl rest where (pivot :< rest) = viewl f aux index (x :< sx) = case viewl sx of S.EmptyL -> return index (y :< _) -> do VM.write arr index pivot VM.write arr (index+1) x VM.write arr (index+2) y aux (index + 3) (viewl sx)
384
faceTriangesV arr f i = aux i $ viewl rest where (pivot :< rest) = viewl f aux index (x :< sx) = case viewl sx of S.EmptyL -> return index (y :< _) -> do VM.write arr index pivot VM.write arr (index+1) x VM.write arr (index+2) y aux (index + 3) (viewl sx)
318
false
true
1
14
130
190
90
100
null
null
themoritz/cabal
Cabal/Distribution/Compiler.hs
bsd-3-clause
abiTagString (AbiTag tag) = tag
31
abiTagString (AbiTag tag) = tag
31
abiTagString (AbiTag tag) = tag
31
false
false
0
6
4
16
7
9
null
null
erikd/yesod
yesod-test/Yesod/Test/CssQuery.hs
mit
parseTag :: Parser Selector parseTag = ByTagName <$> pIdent
59
parseTag :: Parser Selector parseTag = ByTagName <$> pIdent
59
parseTag = ByTagName <$> pIdent
31
false
true
0
5
8
18
9
9
null
null
paulkeene/FP101x
chapter05/Exercises.hs
bsd-3-clause
myMerge xs [] = xs
18
myMerge xs [] = xs
18
myMerge xs [] = xs
18
false
false
0
6
4
13
6
7
null
null
fmapfmapfmap/amazonka
amazonka-cloudformation/gen/Network/AWS/CloudFormation/Types/Product.hs
mpl-2.0
-- | Current status of the resource. srResourceStatus :: Lens' StackResource ResourceStatus srResourceStatus = lens _srResourceStatus (\ s a -> s{_srResourceStatus = a})
169
srResourceStatus :: Lens' StackResource ResourceStatus srResourceStatus = lens _srResourceStatus (\ s a -> s{_srResourceStatus = a})
132
srResourceStatus = lens _srResourceStatus (\ s a -> s{_srResourceStatus = a})
77
true
true
0
9
22
40
22
18
null
null
twittner/wai-routing
src/Network/Wai/Routing/Route.hs
mpl-2.0
connect = addRoute (renderStdMethod CONNECT)
44
connect = addRoute (renderStdMethod CONNECT)
44
connect = addRoute (renderStdMethod CONNECT)
44
false
false
1
7
4
19
7
12
null
null
rubik/stack
src/Stack/Package.hs
bsd-3-clause
-- | Read the raw, unresolved package information. readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m ([PWarning],GenericPackageDescription) readPackageUnresolved cabalfp = liftIO (BS.readFile (FL.toFilePath cabalfp)) >>= readPackageUnresolvedBS (Just cabalfp)
330
readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m ([PWarning],GenericPackageDescription) readPackageUnresolved cabalfp = liftIO (BS.readFile (FL.toFilePath cabalfp)) >>= readPackageUnresolvedBS (Just cabalfp)
279
readPackageUnresolved cabalfp = liftIO (BS.readFile (FL.toFilePath cabalfp)) >>= readPackageUnresolvedBS (Just cabalfp)
123
true
true
2
10
79
85
43
42
null
null
kaoskorobase/mescaline
lib/mescaline-patterns/src/Mescaline/Pattern/Base.hs
gpl-3.0
wrap :: (Ord a, Num a) => a -> a -> a -> a wrap l r x = if x > r then wrap l r (x - (r - l)) else if x < l then wrap l r (x + (r - l)) else x
203
wrap :: (Ord a, Num a) => a -> a -> a -> a wrap l r x = if x > r then wrap l r (x - (r - l)) else if x < l then wrap l r (x + (r - l)) else x
203
wrap l r x = if x > r then wrap l r (x - (r - l)) else if x < l then wrap l r (x + (r - l)) else x
160
false
true
0
11
109
117
60
57
null
null
HIPERFIT/futhark
src/Language/Futhark/TypeChecker/Terms.hs
isc
returnType (Scalar (Prim t)) _ _ = Scalar $ Prim t
52
returnType (Scalar (Prim t)) _ _ = Scalar $ Prim t
52
returnType (Scalar (Prim t)) _ _ = Scalar $ Prim t
52
false
false
3
8
12
35
15
20
null
null
deepakjois/hs-logo
src/Logo.hs
bsd-3-clause
logoOpts :: String -> LogoOpts logoOpts prog = LogoOpts { output = "logo.svg" &= typFile &= help "Output image file (default=logo.svg)" , src = def &= typFile &= args } &= summary "hs-logo Logo Interpreter v0.1" &= program prog
276
logoOpts :: String -> LogoOpts logoOpts prog = LogoOpts { output = "logo.svg" &= typFile &= help "Output image file (default=logo.svg)" , src = def &= typFile &= args } &= summary "hs-logo Logo Interpreter v0.1" &= program prog
276
logoOpts prog = LogoOpts { output = "logo.svg" &= typFile &= help "Output image file (default=logo.svg)" , src = def &= typFile &= args } &= summary "hs-logo Logo Interpreter v0.1" &= program prog
245
false
true
4
8
87
78
37
41
null
null
tonyday567/tower
test/test.hs
bsd-3-clause
testsInt :: TestTree testsInt = testGroup "Int" [ testGroup "Additive" $ testLawOf ([]::[Int]) <$> additiveLaws , testGroup "Additive Group" $ testLawOf ([]::[Int]) <$> additiveGroupLaws , testGroup "Multiplicative" $ testLawOf ([]::[Int]) <$> multiplicativeLaws , testGroup "Distribution" $ testLawOf ([]::[Int]) <$> distributionLaws , testGroup "Integral" $ testLawOf ([]::[Int]) <$> integralLaws , testGroup "Signed" $ testLawOf ([]::[Int]) <$> signedLaws ]
524
testsInt :: TestTree testsInt = testGroup "Int" [ testGroup "Additive" $ testLawOf ([]::[Int]) <$> additiveLaws , testGroup "Additive Group" $ testLawOf ([]::[Int]) <$> additiveGroupLaws , testGroup "Multiplicative" $ testLawOf ([]::[Int]) <$> multiplicativeLaws , testGroup "Distribution" $ testLawOf ([]::[Int]) <$> distributionLaws , testGroup "Integral" $ testLawOf ([]::[Int]) <$> integralLaws , testGroup "Signed" $ testLawOf ([]::[Int]) <$> signedLaws ]
524
testsInt = testGroup "Int" [ testGroup "Additive" $ testLawOf ([]::[Int]) <$> additiveLaws , testGroup "Additive Group" $ testLawOf ([]::[Int]) <$> additiveGroupLaws , testGroup "Multiplicative" $ testLawOf ([]::[Int]) <$> multiplicativeLaws , testGroup "Distribution" $ testLawOf ([]::[Int]) <$> distributionLaws , testGroup "Integral" $ testLawOf ([]::[Int]) <$> integralLaws , testGroup "Signed" $ testLawOf ([]::[Int]) <$> signedLaws ]
503
false
true
0
10
120
185
98
87
null
null
olorin/amazonka
amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/Types/Product.hs
mpl-2.0
-- | Creates a value of 'IdentityPool' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ipSupportedLoginProviders' -- -- * 'ipDeveloperProviderName' -- -- * 'ipOpenIdConnectProviderARNs' -- -- * 'ipIdentityPoolId' -- -- * 'ipIdentityPoolName' -- -- * 'ipAllowUnauthenticatedIdentities' identityPool :: Text -- ^ 'ipIdentityPoolId' -> Text -- ^ 'ipIdentityPoolName' -> Bool -- ^ 'ipAllowUnauthenticatedIdentities' -> IdentityPool identityPool pIdentityPoolId_ pIdentityPoolName_ pAllowUnauthenticatedIdentities_ = IdentityPool' { _ipSupportedLoginProviders = Nothing , _ipDeveloperProviderName = Nothing , _ipOpenIdConnectProviderARNs = Nothing , _ipIdentityPoolId = pIdentityPoolId_ , _ipIdentityPoolName = pIdentityPoolName_ , _ipAllowUnauthenticatedIdentities = pAllowUnauthenticatedIdentities_ }
931
identityPool :: Text -- ^ 'ipIdentityPoolId' -> Text -- ^ 'ipIdentityPoolName' -> Bool -- ^ 'ipAllowUnauthenticatedIdentities' -> IdentityPool identityPool pIdentityPoolId_ pIdentityPoolName_ pAllowUnauthenticatedIdentities_ = IdentityPool' { _ipSupportedLoginProviders = Nothing , _ipDeveloperProviderName = Nothing , _ipOpenIdConnectProviderARNs = Nothing , _ipIdentityPoolId = pIdentityPoolId_ , _ipIdentityPoolName = pIdentityPoolName_ , _ipAllowUnauthenticatedIdentities = pAllowUnauthenticatedIdentities_ }
560
identityPool pIdentityPoolId_ pIdentityPoolName_ pAllowUnauthenticatedIdentities_ = IdentityPool' { _ipSupportedLoginProviders = Nothing , _ipDeveloperProviderName = Nothing , _ipOpenIdConnectProviderARNs = Nothing , _ipIdentityPoolId = pIdentityPoolId_ , _ipIdentityPoolName = pIdentityPoolName_ , _ipAllowUnauthenticatedIdentities = pAllowUnauthenticatedIdentities_ }
401
true
true
0
9
150
95
60
35
null
null
krapsh/kraps-haskell
test-integration/Spark/Core/GroupsSpec.hs
apache-2.0
spec :: Spec spec = do describe "Integration test - groups on (text, int)" $ do run "empty" $ sumGroup [] [] run "one" $ sumGroup [MyPair "x" 1] [("x", 1)] run "two" $ sumGroup [MyPair "x" 1, MyPair "x" 2, MyPair "y" 1] [("x", 3), ("y", 1)]
272
spec :: Spec spec = do describe "Integration test - groups on (text, int)" $ do run "empty" $ sumGroup [] [] run "one" $ sumGroup [MyPair "x" 1] [("x", 1)] run "two" $ sumGroup [MyPair "x" 1, MyPair "x" 2, MyPair "y" 1] [("x", 3), ("y", 1)]
272
spec = do describe "Integration test - groups on (text, int)" $ do run "empty" $ sumGroup [] [] run "one" $ sumGroup [MyPair "x" 1] [("x", 1)] run "two" $ sumGroup [MyPair "x" 1, MyPair "x" 2, MyPair "y" 1] [("x", 3), ("y", 1)]
259
false
true
0
14
79
136
65
71
null
null
ezyang/ghc
testsuite/tests/typecheck/should_compile/T11379.hs
bsd-3-clause
transform' :: (Transformer t a) => t -> EL l a -> EL l a transform' t (EL l det) = undefined
92
transform' :: (Transformer t a) => t -> EL l a -> EL l a transform' t (EL l det) = undefined
92
transform' t (EL l det) = undefined
35
false
true
0
8
21
53
26
27
null
null
typelead/epm
epm/Distribution/Client/Setup.hs
bsd-3-clause
readRepos :: String -> Maybe [RemoteRepo] readRepos = readPToMaybe parseRepos
77
readRepos :: String -> Maybe [RemoteRepo] readRepos = readPToMaybe parseRepos
77
readRepos = readPToMaybe parseRepos
35
false
true
0
7
9
24
12
12
null
null
iambernie/dotfiles
.xmonad/xmonad.hs
mit
xmobarTop = bin_xmobar ++ " " ++ rc_xmobarTop
45
xmobarTop = bin_xmobar ++ " " ++ rc_xmobarTop
45
xmobarTop = bin_xmobar ++ " " ++ rc_xmobarTop
45
false
false
0
6
7
14
7
7
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ECSTaskDefinitionContainerDefinition.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-containerdefinitions.html#cfn-ecs-taskdefinition-containerdefinition-memoryreservation ecstdcdMemoryReservation :: Lens' ECSTaskDefinitionContainerDefinition (Maybe (Val Integer)) ecstdcdMemoryReservation = lens _eCSTaskDefinitionContainerDefinitionMemoryReservation (\s a -> s { _eCSTaskDefinitionContainerDefinitionMemoryReservation = a })
442
ecstdcdMemoryReservation :: Lens' ECSTaskDefinitionContainerDefinition (Maybe (Val Integer)) ecstdcdMemoryReservation = lens _eCSTaskDefinitionContainerDefinitionMemoryReservation (\s a -> s { _eCSTaskDefinitionContainerDefinitionMemoryReservation = a })
254
ecstdcdMemoryReservation = lens _eCSTaskDefinitionContainerDefinitionMemoryReservation (\s a -> s { _eCSTaskDefinitionContainerDefinitionMemoryReservation = a })
161
true
true
0
9
22
52
28
24
null
null
patperry/hs-linear-algebra
tests-old/STMatrix.hs
bsd-3-clause
prop_SwapMatrix = swapMatrix `implements2` swapMatrix_S
55
prop_SwapMatrix = swapMatrix `implements2` swapMatrix_S
55
prop_SwapMatrix = swapMatrix `implements2` swapMatrix_S
55
false
false
0
5
4
12
7
5
null
null
itayd/hh
src/hh.hs
bsd-3-clause
options :: [OptDescr OptFlag] options = [ Option "v" ["version"] (NoArg Version) "show version number", Option "h?" ["help"] (NoArg Help) "show help", Option "s" ["save-cfg"] (NoArg SaveConfig) "save configuration on exit", Option "i" ["init"] (NoArg Init) "create default rc file if non exists", Option "f" ["from","from-file"] (OptArg fromFile "FILE") "read history content from FILE" ] where fromFile Nothing = FromFile defHistFileName fromFile (Just fn) = FromFile fn
655
options :: [OptDescr OptFlag] options = [ Option "v" ["version"] (NoArg Version) "show version number", Option "h?" ["help"] (NoArg Help) "show help", Option "s" ["save-cfg"] (NoArg SaveConfig) "save configuration on exit", Option "i" ["init"] (NoArg Init) "create default rc file if non exists", Option "f" ["from","from-file"] (OptArg fromFile "FILE") "read history content from FILE" ] where fromFile Nothing = FromFile defHistFileName fromFile (Just fn) = FromFile fn
655
options = [ Option "v" ["version"] (NoArg Version) "show version number", Option "h?" ["help"] (NoArg Help) "show help", Option "s" ["save-cfg"] (NoArg SaveConfig) "save configuration on exit", Option "i" ["init"] (NoArg Init) "create default rc file if non exists", Option "f" ["from","from-file"] (OptArg fromFile "FILE") "read history content from FILE" ] where fromFile Nothing = FromFile defHistFileName fromFile (Just fn) = FromFile fn
625
false
true
0
8
250
166
82
84
null
null
solidsnack/coproc
System/Posix/CoProc.hs
bsd-3-clause
query :: (Internals.Interpreter int) => Session int -> ByteString -> IO (ByteString, ByteString) query Session{..} q = (withMVar lock . const) (Internals.query interpreter handles q)
210
query :: (Internals.Interpreter int) => Session int -> ByteString -> IO (ByteString, ByteString) query Session{..} q = (withMVar lock . const) (Internals.query interpreter handles q)
210
query Session{..} q = (withMVar lock . const) (Internals.query interpreter handles q)
107
false
true
0
9
52
78
39
39
null
null
kylcarte/threepenny-extra
src/Graphics/UI/Threepenny/Attributes/Lens.hs
bsd-3-clause
jsonStr :: FromJSON a => String -> Maybe a jsonStr = JSON.decode . BS.pack
74
jsonStr :: FromJSON a => String -> Maybe a jsonStr = JSON.decode . BS.pack
74
jsonStr = JSON.decode . BS.pack
31
false
true
0
8
13
39
17
22
null
null
zhensydow/ljcsandbox
edx/fp101x/lab6.hs
gpl-3.0
foldf3 f = flip $ foldr (\a b g -> b (f g a)) id
48
foldf3 f = flip $ foldr (\a b g -> b (f g a)) id
48
foldf3 f = flip $ foldr (\a b g -> b (f g a)) id
48
false
false
0
11
14
41
20
21
null
null
Chouffe/hlisp
src/Evaluator.hs
bsd-3-clause
-- Cond -- TODO: Rewrite in terms of if eval _ (List [Symbol "cond"]) = return $ Nil
84
eval _ (List [Symbol "cond"]) = return $ Nil
44
eval _ (List [Symbol "cond"]) = return $ Nil
44
true
false
0
9
17
29
15
14
null
null
marcinmrotek/repa-linear-algebra
src/Numeric/LinearAlgebra/Repa/Conversion.hs
bsd-3-clause
repa2hmP :: (Storable t, Monad m) => Array D DIM2 t -> m (H.Matrix t) -- ^Convert a delayed Repa Array to a HMatrix Matrix, evaluating it in parallel. repa2hmP = fmap repa2hm . computeP
185
repa2hmP :: (Storable t, Monad m) => Array D DIM2 t -> m (H.Matrix t) repa2hmP = fmap repa2hm . computeP
104
repa2hmP = fmap repa2hm . computeP
34
true
true
0
11
34
61
29
32
null
null
robx/puzzle-draw
tests/Draw/PuzzleTypesSpec.hs
mit
spec :: Spec spec = do describe "colorakari" $ do it "doesn't crash on blanks in the grid" $ do let sz = mkSizeSpec2D (Just 1.0) (Just 1.0) cfg = Draw.Config Draw.Screen Font.fontAnelizaRegular Font.fontBit g = Map.fromList [((C 1 1), Just 'R'), ((C 1 2), Just ' '), ((C 2 2), Nothing)] d = Draw.diagram cfg $ Draw.puzzle colorakari $ g bs = renderBytesSVG SVG sz d LBS.length bs `shouldSatisfy` (\l -> l > 0)
493
spec :: Spec spec = do describe "colorakari" $ do it "doesn't crash on blanks in the grid" $ do let sz = mkSizeSpec2D (Just 1.0) (Just 1.0) cfg = Draw.Config Draw.Screen Font.fontAnelizaRegular Font.fontBit g = Map.fromList [((C 1 1), Just 'R'), ((C 1 2), Just ' '), ((C 2 2), Nothing)] d = Draw.diagram cfg $ Draw.puzzle colorakari $ g bs = renderBytesSVG SVG sz d LBS.length bs `shouldSatisfy` (\l -> l > 0)
493
spec = do describe "colorakari" $ do it "doesn't crash on blanks in the grid" $ do let sz = mkSizeSpec2D (Just 1.0) (Just 1.0) cfg = Draw.Config Draw.Screen Font.fontAnelizaRegular Font.fontBit g = Map.fromList [((C 1 1), Just 'R'), ((C 1 2), Just ' '), ((C 2 2), Nothing)] d = Draw.diagram cfg $ Draw.puzzle colorakari $ g bs = renderBytesSVG SVG sz d LBS.length bs `shouldSatisfy` (\l -> l > 0)
480
false
true
0
20
158
205
104
101
null
null
openbrainsrc/postgresql-simple-sop
src/Database/PostgreSQL/Simple/SOP.hs
mit
-- -- |Generic fromRow gfromRow :: (All FromField xs, Code a ~ '[xs], Generic a) => RowParser a gfromRow = to . SOP . Z <$> hsequence (hcpure fromFieldp field) where fromFieldp = Proxy :: Proxy FromField -- |Generic toRow
229
gfromRow :: (All FromField xs, Code a ~ '[xs], Generic a) => RowParser a gfromRow = to . SOP . Z <$> hsequence (hcpure fromFieldp field) where fromFieldp = Proxy :: Proxy FromField -- |Generic toRow
205
gfromRow = to . SOP . Z <$> hsequence (hcpure fromFieldp field) where fromFieldp = Proxy :: Proxy FromField -- |Generic toRow
128
true
true
0
9
47
90
46
44
null
null
mathologist/hTestMaker
testmaker-cli/src/Main.hs
gpl-3.0
testMaker (MakeStatic texfile) = do frozen <- T.unpack <$> freeze texfile putStrLn frozen -- | Parse options for the testgen command
170
testMaker (MakeStatic texfile) = do frozen <- T.unpack <$> freeze texfile putStrLn frozen -- | Parse options for the testgen command
170
testMaker (MakeStatic texfile) = do frozen <- T.unpack <$> freeze texfile putStrLn frozen -- | Parse options for the testgen command
170
false
false
0
9
58
38
17
21
null
null
rueshyna/gogol
gogol-apps-calendar/gen/Network/Google/AppsCalendar/Types/Product.hs
mpl-2.0
-- | Optional error(s) (if computation for the group failed). fbgErrors :: Lens' FreeBusyGroup [Error'] fbgErrors = lens _fbgErrors (\ s a -> s{_fbgErrors = a}) . _Default . _Coerce
195
fbgErrors :: Lens' FreeBusyGroup [Error'] fbgErrors = lens _fbgErrors (\ s a -> s{_fbgErrors = a}) . _Default . _Coerce
133
fbgErrors = lens _fbgErrors (\ s a -> s{_fbgErrors = a}) . _Default . _Coerce
91
true
true
1
10
43
55
28
27
null
null
stevely/hspirv
src/SpirV/Builder/Raw.hs
bsd-3-clause
-- Id 1: Result type, must be float type -- Id 2: Operand dPdyFine :: Id -> Id -> Builder Id dPdyFine = threeOp OpDPdyFine
122
dPdyFine :: Id -> Id -> Builder Id dPdyFine = threeOp OpDPdyFine
64
dPdyFine = threeOp OpDPdyFine
29
true
true
0
7
24
27
14
13
null
null
Happy0/snowdrift
Handler/Wiki/Comment.hs
agpl-3.0
getUnclaimWikiCommentR :: Text -> Text -> CommentId -> Handler Html getUnclaimWikiCommentR project_handle target comment_id = do (widget, _) <- makeWikiPageCommentActionWidget makeUnclaimCommentWidget project_handle target comment_id def getMaxDepth defaultLayout (wikiDiscussionPage project_handle target widget)
390
getUnclaimWikiCommentR :: Text -> Text -> CommentId -> Handler Html getUnclaimWikiCommentR project_handle target comment_id = do (widget, _) <- makeWikiPageCommentActionWidget makeUnclaimCommentWidget project_handle target comment_id def getMaxDepth defaultLayout (wikiDiscussionPage project_handle target widget)
390
getUnclaimWikiCommentR project_handle target comment_id = do (widget, _) <- makeWikiPageCommentActionWidget makeUnclaimCommentWidget project_handle target comment_id def getMaxDepth defaultLayout (wikiDiscussionPage project_handle target widget)
322
false
true
0
9
107
75
36
39
null
null
nmattia/halytics
examples/Example.hs
bsd-3-clause
servers :: [(ServerID, Server)] servers = zip [1 .. ] [slowServer, fastServer, slowServer] where fastServer = Server fastSum slowServer = Server slowSum
162
servers :: [(ServerID, Server)] servers = zip [1 .. ] [slowServer, fastServer, slowServer] where fastServer = Server fastSum slowServer = Server slowSum
162
servers = zip [1 .. ] [slowServer, fastServer, slowServer] where fastServer = Server fastSum slowServer = Server slowSum
130
false
true
0
8
31
63
33
30
null
null
Bugfry/exercism
exercism/haskell/matrix/src/Matrix.hs
mit
flatten :: Matrix a -> Vector a flatten (Matrix v) = V.concat $ V.toList v
74
flatten :: Matrix a -> Vector a flatten (Matrix v) = V.concat $ V.toList v
74
flatten (Matrix v) = V.concat $ V.toList v
42
false
true
0
7
14
41
19
22
null
null
shlevy/ghc
compiler/cmm/CmmMachOp.hs
bsd-3-clause
mo_wordSGt dflags = MO_S_Gt (wordWidth dflags)
52
mo_wordSGt dflags = MO_S_Gt (wordWidth dflags)
52
mo_wordSGt dflags = MO_S_Gt (wordWidth dflags)
52
false
false
0
7
11
18
8
10
null
null
hephaestus-pl/hephaestus
alexandre/feature-modeling/src/FeatureModel/Logic.hs
mit
-- Syntatic sugars for building expressions. (|=>) :: FeatureExpression -> FeatureExpression -> FeatureExpression e1 |=> e2 = Or (Not e1) e2
140
(|=>) :: FeatureExpression -> FeatureExpression -> FeatureExpression e1 |=> e2 = Or (Not e1) e2
95
e1 |=> e2 = Or (Not e1) e2
26
true
true
0
9
20
40
20
20
null
null
acowley/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
left_RDR, right_RDR :: RdrName left_RDR = nameRdrName leftDataConName
84
left_RDR, right_RDR :: RdrName left_RDR = nameRdrName leftDataConName
84
left_RDR = nameRdrName leftDataConName
53
false
true
0
5
22
16
9
7
null
null