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
RoboNickBot/nlp-tools
src/NLP/Tools/Database.hs
bsd-2-clause
fetch = fetchTriGrams
21
fetch = fetchTriGrams
21
fetch = fetchTriGrams
21
false
false
0
4
2
6
3
3
null
null
skatenerd/renderer
src/Lib.hs
bsd-3-clause
makeWorld triangles = World { triangles = triangles, wLookup = fromList points } where points = concat [makePoints t | t <- triangles] makePoints t = [(i,t),(j,t),(k,t)] where Triangle i j k = fmap toV3 t
224
makeWorld triangles = World { triangles = triangles, wLookup = fromList points } where points = concat [makePoints t | t <- triangles] makePoints t = [(i,t),(j,t),(k,t)] where Triangle i j k = fmap toV3 t
224
makeWorld triangles = World { triangles = triangles, wLookup = fromList points } where points = concat [makePoints t | t <- triangles] makePoints t = [(i,t),(j,t),(k,t)] where Triangle i j k = fmap toV3 t
224
false
false
0
8
55
105
57
48
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Orders/List.hs
mpl-2.0
-- | Field by which to sort the list. olSortField :: Lens' OrdersList (Maybe OrdersListSortField) olSortField = lens _olSortField (\ s a -> s{_olSortField = a})
162
olSortField :: Lens' OrdersList (Maybe OrdersListSortField) olSortField = lens _olSortField (\ s a -> s{_olSortField = a})
124
olSortField = lens _olSortField (\ s a -> s{_olSortField = a})
64
true
true
0
9
27
48
25
23
null
null
gibiansky/IHaskell
src/IHaskell/Eval/Parser.hs
mit
-- | Parse a single chunk of code, as indicated by the layout of the code. parseCodeChunk :: GhcMonad m => String -> LineNumber -> m CodeBlock parseCodeChunk code startLine = do flags <- getSessionDynFlags let -- Try each parser in turn. rawResults = map (tryParser code) (parsers flags) -- Conver...
3,074
parseCodeChunk :: GhcMonad m => String -> LineNumber -> m CodeBlock parseCodeChunk code startLine = do flags <- getSessionDynFlags let -- Try each parser in turn. rawResults = map (tryParser code) (parsers flags) -- Convert statements into expressions where we can results = map (statementTo...
2,999
parseCodeChunk code startLine = do flags <- getSessionDynFlags let -- Try each parser in turn. rawResults = map (tryParser code) (parsers flags) -- Convert statements into expressions where we can results = map (statementToExpression flags) rawResults case successes results of -- If n...
2,931
true
true
40
12
825
804
423
381
null
null
OpenXT/network
nws/NetworkForwarding.hs
gpl-2.0
addRoutingTableForInterface :: String -> String -> IO () addRoutingTableForInterface outputIf ifindex = do debug $ printf "Add routing table entry %s (%s)" rtName rtIndex addRoutingTableEntry rtName rtIndex where rtName = "rt-" ++ outputIf rtIndex = show (routingTableIndex ifindex)
311
addRoutingTableForInterface :: String -> String -> IO () addRoutingTableForInterface outputIf ifindex = do debug $ printf "Add routing table entry %s (%s)" rtName rtIndex addRoutingTableEntry rtName rtIndex where rtName = "rt-" ++ outputIf rtIndex = show (routingTableIndex ifindex)
311
addRoutingTableForInterface outputIf ifindex = do debug $ printf "Add routing table entry %s (%s)" rtName rtIndex addRoutingTableEntry rtName rtIndex where rtName = "rt-" ++ outputIf rtIndex = show (routingTableIndex ifindex)
254
false
true
1
8
66
78
36
42
null
null
jwiegley/ghc-release
libraries/Cabal/cabal/Distribution/PackageDescription.hs
gpl-3.0
stdParse :: Text ver => (ver -> String -> res) -> Parse.ReadP r res stdParse f = do cs <- Parse.sepBy1 component (Parse.char '-') _ <- Parse.char '-' ver <- parse let name = intercalate "-" cs return $! f ver (lowercase name) where component = do cs <- Parse.munch1 Char.isAlphaNum if a...
517
stdParse :: Text ver => (ver -> String -> res) -> Parse.ReadP r res stdParse f = do cs <- Parse.sepBy1 component (Parse.char '-') _ <- Parse.char '-' ver <- parse let name = intercalate "-" cs return $! f ver (lowercase name) where component = do cs <- Parse.munch1 Char.isAlphaNum if a...
517
stdParse f = do cs <- Parse.sepBy1 component (Parse.char '-') _ <- Parse.char '-' ver <- parse let name = intercalate "-" cs return $! f ver (lowercase name) where component = do cs <- Parse.munch1 Char.isAlphaNum if all Char.isDigit cs then Parse.pfail else return cs -- each com...
449
false
true
0
11
127
163
76
87
null
null
apyrgio/snf-ganeti
src/Ganeti/HTools/Node.hs
bsd-2-clause
-- * Helper functions -- | Add a tag to a tagmap. addTag :: TagMap -> String -> TagMap addTag t s = Map.insertWith (+) s 1 t
125
addTag :: TagMap -> String -> TagMap addTag t s = Map.insertWith (+) s 1 t
74
addTag t s = Map.insertWith (+) s 1 t
37
true
true
0
8
28
44
22
22
null
null
hvr/async
Control/Concurrent/Async.hs
bsd-3-clause
withAsyncUsing :: (IO () -> IO ThreadId) -> IO a -> (Async a -> IO b) -> IO b -- The bracket version works, but is slow. We can do better by -- hand-coding it: withAsyncUsing doFork = \action inner -> do var <- newEmptyTMVarIO mask $ \restore -> do t <- doFork $ try (restore action) >>= atomical...
676
withAsyncUsing :: (IO () -> IO ThreadId) -> IO a -> (Async a -> IO b) -> IO b withAsyncUsing doFork = \action inner -> do var <- newEmptyTMVarIO mask $ \restore -> do t <- doFork $ try (restore action) >>= atomically . putTMVar var let a = Async t (readTMVar var) r <- restore (inner a) `c...
593
withAsyncUsing doFork = \action inner -> do var <- newEmptyTMVarIO mask $ \restore -> do t <- doFork $ try (restore action) >>= atomically . putTMVar var let a = Async t (readTMVar var) r <- restore (inner a) `catchAll` \e -> do cancel a; throwIO e cancel a return r -- | Wait for an asynchronou...
500
true
true
0
18
166
201
96
105
null
null
petermarks/FDL
src/Graphics/FDL/Lang.hs
bsd-3-clause
lambdaToCL (Var vWit _) (V (Var vrWit _)) = case vWit .=. vrWit of Nothing -> error "Variable should have been eliminated in lambdaToCL" Just TEq -> I -- var must match otherwise it will have been eliminated
221
lambdaToCL (Var vWit _) (V (Var vrWit _)) = case vWit .=. vrWit of Nothing -> error "Variable should have been eliminated in lambdaToCL" Just TEq -> I -- var must match otherwise it will have been eliminated
221
lambdaToCL (Var vWit _) (V (Var vrWit _)) = case vWit .=. vrWit of Nothing -> error "Variable should have been eliminated in lambdaToCL" Just TEq -> I -- var must match otherwise it will have been eliminated
221
false
false
0
8
51
62
29
33
null
null
sdiehl/ghc
compiler/basicTypes/VarEnv.hs
bsd-3-clause
lookupVarEnv = lookupUFM
28
lookupVarEnv = lookupUFM
28
lookupVarEnv = lookupUFM
28
false
false
0
4
6
6
3
3
null
null
adnelson/Idris-dev
src/Idris/Core/WHNF.hs
bsd-3-clause
quote (WBind n ty (sc, env)) = Bind n ty (quoteEnv env sc)
58
quote (WBind n ty (sc, env)) = Bind n ty (quoteEnv env sc)
58
quote (WBind n ty (sc, env)) = Bind n ty (quoteEnv env sc)
58
false
false
0
8
12
40
20
20
null
null
oldmanmike/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
eqIfaceTcArgs _ _ _ = False
27
eqIfaceTcArgs _ _ _ = False
27
eqIfaceTcArgs _ _ _ = False
27
false
false
0
5
5
13
6
7
null
null
johanneshilden/trombone
Trombone/Db/Reflection.hs
bsd-3-clause
queryTable :: QueryExpr -> Maybe Text queryTable ( Select _ _ _ t _ _ _ _ _ _ ) = extractTref t
95
queryTable :: QueryExpr -> Maybe Text queryTable ( Select _ _ _ t _ _ _ _ _ _ ) = extractTref t
95
queryTable ( Select _ _ _ t _ _ _ _ _ _ ) = extractTref t
57
false
true
0
7
22
48
23
25
null
null
jstolarek/ghc
compiler/main/CmdLineParser.hs
bsd-3-clause
getArg :: Monad m => EwM m String getArg = EwM (\(L _ arg) es ws -> return (es, ws, arg))
89
getArg :: Monad m => EwM m String getArg = EwM (\(L _ arg) es ws -> return (es, ws, arg))
89
getArg = EwM (\(L _ arg) es ws -> return (es, ws, arg))
55
false
true
0
9
20
58
30
28
null
null
OS2World/DEV-UTIL-HUGS
libraries/Foreign/Marshal/Pool.hs
bsd-3-clause
pooledMallocBytes :: Pool -> Int -> IO (Ptr a) pooledMallocBytes (Pool pool) size = do ptr <- mallocBytes size ptrs <- readIORef pool writeIORef pool (ptr:ptrs) return (castPtr ptr) -- | Adjust the storage area for an element in the pool to the given size of -- the required type.
293
pooledMallocBytes :: Pool -> Int -> IO (Ptr a) pooledMallocBytes (Pool pool) size = do ptr <- mallocBytes size ptrs <- readIORef pool writeIORef pool (ptr:ptrs) return (castPtr ptr) -- | Adjust the storage area for an element in the pool to the given size of -- the required type.
293
pooledMallocBytes (Pool pool) size = do ptr <- mallocBytes size ptrs <- readIORef pool writeIORef pool (ptr:ptrs) return (castPtr ptr) -- | Adjust the storage area for an element in the pool to the given size of -- the required type.
246
false
true
0
10
62
93
42
51
null
null
fmapfmapfmap/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types/Product.hs
mpl-2.0
-- | Creates a value of 'CustomErrorResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ceResponsePagePath' -- -- * 'ceResponseCode' -- -- * 'ceErrorCachingMinTTL' -- -- * 'ceErrorCode' customErrorResponse :: Int -- ^ 'ceErr...
558
customErrorResponse :: Int -- ^ 'ceErrorCode' -> CustomErrorResponse customErrorResponse pErrorCode_ = CustomErrorResponse' { _ceResponsePagePath = Nothing , _ceResponseCode = Nothing , _ceErrorCachingMinTTL = Nothing , _ceErrorCode = pErrorCode_ }
280
customErrorResponse pErrorCode_ = CustomErrorResponse' { _ceResponsePagePath = Nothing , _ceResponseCode = Nothing , _ceErrorCachingMinTTL = Nothing , _ceErrorCode = pErrorCode_ }
203
true
true
0
7
106
65
40
25
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/HTMLBodyElement.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement.text Mozilla HTMLBodyElement.text documentation> getText :: (MonadDOM m, FromJSString result) => HTMLBodyElement -> m result getText self = liftDOM ((self ^. js "text") >>= fromJSValUnchecked)
272
getText :: (MonadDOM m, FromJSString result) => HTMLBodyElement -> m result getText self = liftDOM ((self ^. js "text") >>= fromJSValUnchecked)
151
getText self = liftDOM ((self ^. js "text") >>= fromJSValUnchecked)
67
true
true
0
10
35
57
29
28
null
null
nirvinm/Solving-Exercises-in-Haskell-Programming-From-First-Principles
Algebraic_DataTypes/Capitalize.hs
gpl-3.0
-- Split a sentence into words, then tuple each word with the capi- -- talized form of each. capitalizeWords :: String -> [(String, String)] capitalizeWords xs = map (\x -> (x, capitalizeWord x)) $ words xs
206
capitalizeWords :: String -> [(String, String)] capitalizeWords xs = map (\x -> (x, capitalizeWord x)) $ words xs
113
capitalizeWords xs = map (\x -> (x, capitalizeWord x)) $ words xs
65
true
true
0
10
35
56
31
25
null
null
neothemachine/monadiccp
src/Control/CP/SearchSpec/Language.hs
bsd-3-clause
neg (GtC x y) = LqC x y
23
neg (GtC x y) = LqC x y
23
neg (GtC x y) = LqC x y
23
false
false
0
6
7
23
10
13
null
null
KaneTW/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
warranty = "\n" ++ "\t THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY \n" ++ "\t EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n" ++ "\t IMPLIED WARRANTIES OF MERCHAN...
1,075
warranty = "\n" ++ "\t THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY \n" ++ "\t EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n" ++ "\t IMPLIED WARRANTIES OF MERCHAN...
1,075
warranty = "\n" ++ "\t THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY \n" ++ "\t EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n" ++ "\t IMPLIED WARRANTIES OF MERCHAN...
1,075
false
false
1
15
360
54
25
29
null
null
danr/hipspec
examples/Challenges/SameFringe.hs
gpl-3.0
(==) :: AB -> AB -> Bool A == A = True
38
(==) :: AB -> AB -> Bool A == A = True
38
A == A = True
13
false
true
0
9
11
32
15
17
null
null
defanor/dotfiles
.xmonad/xmonad.hs
unlicense
-- | Prefixes everything with mod+t instead of a mod key, so that -- mod+1 becomes mod+t 1 (e.g., C-1 -> C-t 1), for instance. myKeys :: (XConfig Layout -> M.Map (KeyMask, KeySym) (X ())) -> XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) myKeys oldKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fro...
392
myKeys :: (XConfig Layout -> M.Map (KeyMask, KeySym) (X ())) -> XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) myKeys oldKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList [((modMask, xK_t), submap (oldKeys conf { modMask = noModMask }))]
265
myKeys oldKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList [((modMask, xK_t), submap (oldKeys conf { modMask = noModMask }))]
138
true
true
0
12
77
135
73
62
null
null
kolmodin/binary-bits
BitsQC.hs
bsd-3-clause
shrinker w = [ w `shiftR` 1 -- try to make everything roughly half size ] ++ [ w' -- flip bits to zero, left->right | m <- [n, n-1..1] , let w' = w `clearBit` m , w /= w' ] ++ [w-1] -- just make it a little smaller where n = bitr...
324
shrinker w = [ w `shiftR` 1 -- try to make everything roughly half size ] ++ [ w' -- flip bits to zero, left->right | m <- [n, n-1..1] , let w' = w `clearBit` m , w /= w' ] ++ [w-1] -- just make it a little smaller where n = bitr...
324
shrinker w = [ w `shiftR` 1 -- try to make everything roughly half size ] ++ [ w' -- flip bits to zero, left->right | m <- [n, n-1..1] , let w' = w `clearBit` m , w /= w' ] ++ [w-1] -- just make it a little smaller where n = bitr...
324
false
false
0
12
146
94
52
42
null
null
evanrinehart/broccoli
Control/Broccoli/Eval.hs
bsd-3-clause
boringGen :: Arbitrary a => Gen (X a) boringGen = do vs <- listOf1 arbitrary let l = length vs return $ (\t -> vs !! (floor t `mod` l)) <$> TimeX
151
boringGen :: Arbitrary a => Gen (X a) boringGen = do vs <- listOf1 arbitrary let l = length vs return $ (\t -> vs !! (floor t `mod` l)) <$> TimeX
151
boringGen = do vs <- listOf1 arbitrary let l = length vs return $ (\t -> vs !! (floor t `mod` l)) <$> TimeX
113
false
true
0
14
37
84
41
43
null
null
AccelerateHS/accelerate-c
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
primToC (PrimIDiv ty) [a,b] | isSignedIntegralType ty = idiv ty (ccast (NumScalarType $ IntegralNumType ty) a) (ccast (NumScalarType $ IntegralNumType ty) b) | otherwise ...
503
primToC (PrimIDiv ty) [a,b] | isSignedIntegralType ty = idiv ty (ccast (NumScalarType $ IntegralNumType ty) a) (ccast (NumScalarType $ IntegralNumType ty) b) | otherwise ...
503
primToC (PrimIDiv ty) [a,b] | isSignedIntegralType ty = idiv ty (ccast (NumScalarType $ IntegralNumType ty) a) (ccast (NumScalarType $ IntegralNumType ty) b) | otherwise ...
503
false
false
0
11
267
127
61
66
null
null
wjt/flitwemmmmm
src/Generator.hs
agpl-3.0
compose :: [a -> a] -> (a -> a) compose = foldl' (.) id
55
compose :: [a -> a] -> (a -> a) compose = foldl' (.) id
55
compose = foldl' (.) id
23
false
true
0
7
13
36
20
16
null
null
jqpeterson/roc-translator
src/Protocol/ROC/PointTypes.hs
bsd-3-clause
fetchPointType (PTID17 _ ) bs = PTID17 $ decodeToEither $ runGetIncremental pointType17Parser `pushChunks` bs
110
fetchPointType (PTID17 _ ) bs = PTID17 $ decodeToEither $ runGetIncremental pointType17Parser `pushChunks` bs
110
fetchPointType (PTID17 _ ) bs = PTID17 $ decodeToEither $ runGetIncremental pointType17Parser `pushChunks` bs
110
false
false
1
7
14
35
17
18
null
null
Zigazou/Sonnex-Generator
src/Generator/PHP.hs
gpl-2.0
-- | Give a weight to a group of `Rule` according to letters frequency groupWeight :: [Rule] -> Int groupWeight (Rule (Trigger _ (Letter a:_) _ _) _:_) = fromMaybe 1000 (elemIndex a frequentLetters)
202
groupWeight :: [Rule] -> Int groupWeight (Rule (Trigger _ (Letter a:_) _ _) _:_) = fromMaybe 1000 (elemIndex a frequentLetters)
131
groupWeight (Rule (Trigger _ (Letter a:_) _ _) _:_) = fromMaybe 1000 (elemIndex a frequentLetters)
102
true
true
0
15
37
76
36
40
null
null
pxqr/algorithm-wm
src/TC.hs
mit
inferKd :: Ty -> TyEnv -> Result (Scheme Kind) inferKd t env = runTI env $ generalizeM t >>= \sc -> do bindKinds sc (kdInf >=> generalizeM)
145
inferKd :: Ty -> TyEnv -> Result (Scheme Kind) inferKd t env = runTI env $ generalizeM t >>= \sc -> do bindKinds sc (kdInf >=> generalizeM)
145
inferKd t env = runTI env $ generalizeM t >>= \sc -> do bindKinds sc (kdInf >=> generalizeM)
98
false
true
0
11
32
67
32
35
null
null
dmjio/aeson
tests/UnitTests.hs
bsd-3-clause
bigRationalDecoding :: Assertion bigRationalDecoding = assertEqual "Decoding an Integer with a large exponent should fail" (Left "Error in $: parsing Ratio failed, found a number with exponent 2000, but it must not be greater than 1024 or less than -1024") ((eitherDecode :: L.ByteString -> Either String Ratio...
334
bigRationalDecoding :: Assertion bigRationalDecoding = assertEqual "Decoding an Integer with a large exponent should fail" (Left "Error in $: parsing Ratio failed, found a number with exponent 2000, but it must not be greater than 1024 or less than -1024") ((eitherDecode :: L.ByteString -> Either String Ratio...
334
bigRationalDecoding = assertEqual "Decoding an Integer with a large exponent should fail" (Left "Error in $: parsing Ratio failed, found a number with exponent 2000, but it must not be greater than 1024 or less than -1024") ((eitherDecode :: L.ByteString -> Either String Rational) "1e2000")
301
false
true
0
9
57
49
24
25
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/GHC/Misc.hs
bsd-3-clause
stripParensSym :: Symbol -> Symbol stripParensSym (symbolText -> t) = symbol $ stripParens t
92
stripParensSym :: Symbol -> Symbol stripParensSym (symbolText -> t) = symbol $ stripParens t
92
stripParensSym (symbolText -> t) = symbol $ stripParens t
57
false
true
0
7
13
32
16
16
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x2F897' = "\x232B8"
35
decomposeChar '\x2F897' = "\x232B8"
35
decomposeChar '\x2F897' = "\x232B8"
35
false
false
0
4
3
10
4
6
null
null
mcmaniac/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
basicBlocksCodeGen env (block:blocks) (lblocks', ltops') = do (env', lb, lt) <- basicBlockCodeGen env block let lblocks = lblocks' ++ lb let ltops = ltops' ++ lt basicBlocksCodeGen env' blocks (lblocks, ltops) -- | Allocations need to be extracted so they can be moved to the entry -- of a fun...
383
basicBlocksCodeGen env (block:blocks) (lblocks', ltops') = do (env', lb, lt) <- basicBlockCodeGen env block let lblocks = lblocks' ++ lb let ltops = ltops' ++ lt basicBlocksCodeGen env' blocks (lblocks, ltops) -- | Allocations need to be extracted so they can be moved to the entry -- of a fun...
383
basicBlocksCodeGen env (block:blocks) (lblocks', ltops') = do (env', lb, lt) <- basicBlockCodeGen env block let lblocks = lblocks' ++ lb let ltops = ltops' ++ lt basicBlocksCodeGen env' blocks (lblocks, ltops) -- | Allocations need to be extracted so they can be moved to the entry -- of a fun...
383
false
false
0
10
87
91
47
44
null
null
jota191/PLang
src/Lexer.hs
gpl-3.0
can ('0':xs) = return (TZero,xs)
33
scan ('0':xs) = return (TZero,xs)
33
scan ('0':xs) = return (TZero,xs)
33
false
false
0
7
5
25
13
12
null
null
cheecheeo/stats
stats.hs
gpl-3.0
first = Stat ("25th percentile: ", quantile 1)
46
first = Stat ("25th percentile: ", quantile 1)
46
first = Stat ("25th percentile: ", quantile 1)
46
false
false
0
7
7
18
9
9
null
null
apyrgio/snf-ganeti
src/Ganeti/HTools/Program/Hbal.hs
bsd-2-clause
arguments :: [ArgCompletion] arguments = []
43
arguments :: [ArgCompletion] arguments = []
43
arguments = []
14
false
true
0
5
5
16
9
7
null
null
alanz/Blobs
lib/DData/Queue.hs
lgpl-2.1
foldL :: (b -> a -> b) -> b -> Queue a -> b foldL f z (Queue xs ys zs) = foldr (flip f) (foldl f z xs) ys
107
foldL :: (b -> a -> b) -> b -> Queue a -> b foldL f z (Queue xs ys zs) = foldr (flip f) (foldl f z xs) ys
107
foldL f z (Queue xs ys zs) = foldr (flip f) (foldl f z xs) ys
63
false
true
0
8
31
77
38
39
null
null
elitak/frag
src/Quaternion.hs
gpl-2.0
slerp :: Quaternion -> Quaternion -> Float -> Quaternion slerp q1@(x0,y0,z0,w0) q2@(x1,y1,z1,w1) t | q1 == q2 = q1 |otherwise = ((scale0*x0)+(scale1*x1), (scale0*y0)+(scale1*y1), (scale0*z0)+(scale1*z1), (scale0*w0)+(scale1*w1)) where scale0 = 1 ...
341
slerp :: Quaternion -> Quaternion -> Float -> Quaternion slerp q1@(x0,y0,z0,w0) q2@(x1,y1,z1,w1) t | q1 == q2 = q1 |otherwise = ((scale0*x0)+(scale1*x1), (scale0*y0)+(scale1*y1), (scale0*z0)+(scale1*z1), (scale0*w0)+(scale1*w1)) where scale0 = 1 -...
340
slerp q1@(x0,y0,z0,w0) q2@(x1,y1,z1,w1) t | q1 == q2 = q1 |otherwise = ((scale0*x0)+(scale1*x1), (scale0*y0)+(scale1*y1), (scale0*z0)+(scale1*z1), (scale0*w0)+(scale1*w1)) where scale0 = 1 - t scale1 = t
283
false
true
2
8
114
180
100
80
null
null
oldmanmike/ghc
compiler/types/CoAxiom.hs
bsd-3-clause
coAxiomNumPats :: CoAxiom br -> Int coAxiomNumPats = length . coAxBranchLHS . (flip coAxiomNthBranch 0)
103
coAxiomNumPats :: CoAxiom br -> Int coAxiomNumPats = length . coAxBranchLHS . (flip coAxiomNthBranch 0)
103
coAxiomNumPats = length . coAxBranchLHS . (flip coAxiomNthBranch 0)
67
false
true
0
7
14
34
17
17
null
null
enolan/cabal
Cabal/Distribution/Simple/LHC.hs
bsd-3-clause
ghcVerbosityOptions :: Verbosity -> [String] ghcVerbosityOptions verbosity | verbosity >= deafening = ["-v"] | verbosity >= normal = [] | otherwise = ["-w", "-v0"]
194
ghcVerbosityOptions :: Verbosity -> [String] ghcVerbosityOptions verbosity | verbosity >= deafening = ["-v"] | verbosity >= normal = [] | otherwise = ["-w", "-v0"]
194
ghcVerbosityOptions verbosity | verbosity >= deafening = ["-v"] | verbosity >= normal = [] | otherwise = ["-w", "-v0"]
149
false
true
0
8
54
64
32
32
null
null
jcsmnt0/MarkovMusic
Piece.hs
mit
-- inverse of Euterpea.chord unchord :: Music a -> [Music a] unchord (a :=: b) = a : unchord b
94
unchord :: Music a -> [Music a] unchord (a :=: b) = a : unchord b
65
unchord (a :=: b) = a : unchord b
33
true
true
0
7
19
42
21
21
null
null
lhuang7/mysql
dist/dist-sandbox-31c119e4/build/autogen/Paths_mysql.hs
bsd-3-clause
libexecdir = "/home/kevin/Programs/mysql/.cabal-sandbox/libexec"
64
libexecdir = "/home/kevin/Programs/mysql/.cabal-sandbox/libexec"
64
libexecdir = "/home/kevin/Programs/mysql/.cabal-sandbox/libexec"
64
false
false
1
5
2
10
3
7
null
null
abooij/sudbury
Graphics/Sudbury/CABI/Protocol.hs
mit
readSignature :: String -> (Maybe Int, [(Bool , ArgTypeBox)]) readSignature str = let versionStr = filter isNumber str remainder = filter (not . isNumber) str version = maybeRead versionStr in (version , go remainder) where maybeRead :: Read a => String -> Maybe a maybeRead = fmap fst . li...
652
readSignature :: String -> (Maybe Int, [(Bool , ArgTypeBox)]) readSignature str = let versionStr = filter isNumber str remainder = filter (not . isNumber) str version = maybeRead versionStr in (version , go remainder) where maybeRead :: Read a => String -> Maybe a maybeRead = fmap fst . li...
652
readSignature str = let versionStr = filter isNumber str remainder = filter (not . isNumber) str version = maybeRead versionStr in (version , go remainder) where maybeRead :: Read a => String -> Maybe a maybeRead = fmap fst . listToMaybe . reads go :: String -> [(Bool , ArgTypeBox)] ...
590
false
true
5
11
167
251
133
118
null
null
duboisf/hexif
src/Data/Exif/Parser.hs
bsd-3-clause
parseExif :: ByteString -> ParserResult TempResult parseExif = runParser $ do logWithPosition "Starting parsing" parseSOI logWithPosition "Parsed start of image" (header, fields) <- parseApp1 return (header, fields)
225
parseExif :: ByteString -> ParserResult TempResult parseExif = runParser $ do logWithPosition "Starting parsing" parseSOI logWithPosition "Parsed start of image" (header, fields) <- parseApp1 return (header, fields)
225
parseExif = runParser $ do logWithPosition "Starting parsing" parseSOI logWithPosition "Parsed start of image" (header, fields) <- parseApp1 return (header, fields)
174
false
true
0
9
36
62
29
33
null
null
bjpop/blip
blipcompiler/src/Blip/Compiler/Utils.hs
bsd-3-clause
mkIdent :: String -> IdentSpan mkIdent str = Ident { ident_string = str, ident_annot = SpanEmpty }
98
mkIdent :: String -> IdentSpan mkIdent str = Ident { ident_string = str, ident_annot = SpanEmpty }
98
mkIdent str = Ident { ident_string = str, ident_annot = SpanEmpty }
67
false
true
0
6
16
32
18
14
null
null
brendanhay/gogol
gogol-containeranalysis/gen/Network/Google/Resource/ContainerAnalysis/Projects/Notes/List.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). pnlUploadType :: Lens' ProjectsNotesList (Maybe Text) pnlUploadType = lens _pnlUploadType (\ s a -> s{_pnlUploadType = a})
201
pnlUploadType :: Lens' ProjectsNotesList (Maybe Text) pnlUploadType = lens _pnlUploadType (\ s a -> s{_pnlUploadType = a})
130
pnlUploadType = lens _pnlUploadType (\ s a -> s{_pnlUploadType = a})
76
true
true
1
9
34
52
25
27
null
null
jutaro/rdf4h
testsuite/tests/Text/RDF/RDF4H/XmlParser_Test.hs
bsd-3-clause
test_parseXmlRDF_NML3 :: Assertion test_parseXmlRDF_NML3 = testParse "<?xml version=\"1.0\" encoding=\"utf-8\"?>\ \<rdf:RDF\ \ xmlns:nml=\"http://schemas.ogf.org/nml/2013/05/base#\"\ \ xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\ \>\ \ <nml:Node rdf:about=\"urn:ogf:network:exa...
1,571
test_parseXmlRDF_NML3 :: Assertion test_parseXmlRDF_NML3 = testParse "<?xml version=\"1.0\" encoding=\"utf-8\"?>\ \<rdf:RDF\ \ xmlns:nml=\"http://schemas.ogf.org/nml/2013/05/base#\"\ \ xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\ \>\ \ <nml:Node rdf:about=\"urn:ogf:network:exa...
1,571
test_parseXmlRDF_NML3 = testParse "<?xml version=\"1.0\" encoding=\"utf-8\"?>\ \<rdf:RDF\ \ xmlns:nml=\"http://schemas.ogf.org/nml/2013/05/base#\"\ \ xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\ \>\ \ <nml:Node rdf:about=\"urn:ogf:network:example.org:2014:foo\">\ \ <nml...
1,536
false
true
0
13
433
178
89
89
null
null
olsner/ghc
compiler/cmm/PprC.hs
bsd-3-clause
-- --------------------------------------------------------------------- -- tend to be implemented by foreign calls pprCallishMachOp_for_C :: CallishMachOp -> SDoc pprCallishMachOp_for_C mop = case mop of MO_F64_Pwr -> text "pow" MO_F64_Sin -> text "sin" MO_F64_Cos -> text "...
2,647
pprCallishMachOp_for_C :: CallishMachOp -> SDoc pprCallishMachOp_for_C mop = case mop of MO_F64_Pwr -> text "pow" MO_F64_Sin -> text "sin" MO_F64_Cos -> text "cos" MO_F64_Tan -> text "tan" MO_F64_Sinh -> text "sinh" MO_F64_Cosh -> text "cos...
2,529
pprCallishMachOp_for_C mop = case mop of MO_F64_Pwr -> text "pow" MO_F64_Sin -> text "sin" MO_F64_Cos -> text "cos" MO_F64_Tan -> text "tan" MO_F64_Sinh -> text "sinh" MO_F64_Cosh -> text "cosh" MO_F64_Tanh -> text "tanh" ...
2,481
true
true
0
11
910
660
312
348
null
null
pradyuman/haskell
fold.hs
mit
-- head' = foldl1 (\acc _ -> acc) last' :: [a] -> a last' = foldl1 (\_ x -> x)
79
last' :: [a] -> a last' = foldl1 (\_ x -> x)
44
last' = foldl1 (\_ x -> x)
26
true
true
0
7
20
32
18
14
null
null
ahammar/Brainfuck.hs
brainfuck.hs
unlicense
oveRight = simple '>' MoveRight
32
moveRight = simple '>' MoveRight
32
moveRight = simple '>' MoveRight
32
false
false
0
5
5
11
5
6
null
null
kim/amazonka
amazonka-autoscaling/gen/Network/AWS/AutoScaling/PutScheduledUpdateGroupAction.hs
mpl-2.0
-- | 'Time' is deprecated. -- -- The time for this action to start. 'Time' is an alias for 'StartTime' and can be -- specified instead of 'StartTime', or vice versa. If both 'Time' and 'StartTime' are -- specified, their values should be identical. Otherwise, 'PutScheduledUpdateGroupAction' will return an error. psugaT...
453
psugaTime :: Lens' PutScheduledUpdateGroupAction (Maybe UTCTime) psugaTime = lens _psugaTime (\s a -> s { _psugaTime = a }) . mapping _Time
139
psugaTime = lens _psugaTime (\s a -> s { _psugaTime = a }) . mapping _Time
74
true
true
0
10
71
57
32
25
null
null
CDSoft/pp
src/Expr.hs
gpl-3.0
op1 op (S s) = Z $ op $ atoi s
30
op1 op (S s) = Z $ op $ atoi s
30
op1 op (S s) = Z $ op $ atoi s
30
false
false
0
7
10
28
13
15
null
null
lfritz/python-type-inference
python-type-inference/src/Language/Python/TypeInference/Analysis/Analysis.hs
bsd-3-clause
expressionType c (AttributeReference (AttributeRef exp name)) = do t <- expressionType c exp case t of UTyTop -> return UTyTop UTy a -> do let f (ClassType t) = do mt <- clsAttr name t return $ fromMaybe bot mt ...
616
expressionType c (AttributeReference (AttributeRef exp name)) = do t <- expressionType c exp case t of UTyTop -> return UTyTop UTy a -> do let f (ClassType t) = do mt <- clsAttr name t return $ fromMaybe bot mt ...
616
expressionType c (AttributeReference (AttributeRef exp name)) = do t <- expressionType c exp case t of UTyTop -> return UTyTop UTy a -> do let f (ClassType t) = do mt <- clsAttr name t return $ fromMaybe bot mt ...
616
false
false
0
18
329
183
81
102
null
null
juhp/stack
src/Stack/Build/Installed.hs
bsd-3-clause
toPackageLocation (Just ExtraGlobal) = Snap
43
toPackageLocation (Just ExtraGlobal) = Snap
43
toPackageLocation (Just ExtraGlobal) = Snap
43
false
false
0
6
4
16
7
9
null
null
narurien/ganeti-ceph
src/Ganeti/Query/Query.hs
gpl-2.0
execGetter _ rt item (FieldRuntime getter) = getter rt item
60
execGetter _ rt item (FieldRuntime getter) = getter rt item
60
execGetter _ rt item (FieldRuntime getter) = getter rt item
60
false
false
0
7
10
26
12
14
null
null
amoerie/labyrinth
Labyrinth/Game.hs
mit
humanTurnSaveAndExit :: Game -> IO() humanTurnSaveAndExit game = do let serialized = Labyrinth.Writer.writeLabyrinth game writeFile "game.txt" serialized return ()
169
humanTurnSaveAndExit :: Game -> IO() humanTurnSaveAndExit game = do let serialized = Labyrinth.Writer.writeLabyrinth game writeFile "game.txt" serialized return ()
169
humanTurnSaveAndExit game = do let serialized = Labyrinth.Writer.writeLabyrinth game writeFile "game.txt" serialized return ()
132
false
true
0
12
24
59
25
34
null
null
denisshevchenko/breadu.info
src/lib/BreadU/Pages/Content/Errors/Messages.hs
mit
foodUnknownNameErrorMessage De = "Bitte wählen Sie das Lebensmittel von der Liste aus oder geben Sie den Wert der Kohlenhydrate in das nächste Eingabefeld."
156
foodUnknownNameErrorMessage De = "Bitte wählen Sie das Lebensmittel von der Liste aus oder geben Sie den Wert der Kohlenhydrate in das nächste Eingabefeld."
156
foodUnknownNameErrorMessage De = "Bitte wählen Sie das Lebensmittel von der Liste aus oder geben Sie den Wert der Kohlenhydrate in das nächste Eingabefeld."
156
false
false
0
5
22
9
4
5
null
null
beni55/vimus
src/Vimus/Command.hs
mit
runShellCommand :: ShellCommand -> Vimus () runShellCommand (ShellCommand cmd) = (expandCurrentPath cmd <$> getCurrentPath) >>= either printError action where action s = liftIO $ do void endwin e <- system s case e of ExitSuccess -> return () ExitFailure n -> putStrLn ("shell r...
359
runShellCommand :: ShellCommand -> Vimus () runShellCommand (ShellCommand cmd) = (expandCurrentPath cmd <$> getCurrentPath) >>= either printError action where action s = liftIO $ do void endwin e <- system s case e of ExitSuccess -> return () ExitFailure n -> putStrLn ("shell r...
359
runShellCommand (ShellCommand cmd) = (expandCurrentPath cmd <$> getCurrentPath) >>= either printError action where action s = liftIO $ do void endwin e <- system s case e of ExitSuccess -> return () ExitFailure n -> putStrLn ("shell returned " ++ show n) void getChar
315
false
true
1
15
97
133
57
76
null
null
mathologist/hTestMaker
testmaker/src/TestMaker/Types.hs
gpl-3.0
-- | Gets the correct answer from a question. If there's no correct answer, it just returns an empty string. getCorrect :: Question -> T.Text getCorrect q@(Question _ _ _ _ _ _) = getCorrect' $ qChoices q where getCorrect' [] = "" getCorrect' (c:cs) = case c of Correct t -> t ...
368
getCorrect :: Question -> T.Text getCorrect q@(Question _ _ _ _ _ _) = getCorrect' $ qChoices q where getCorrect' [] = "" getCorrect' (c:cs) = case c of Correct t -> t _ -> getCorrect' cs
259
getCorrect q@(Question _ _ _ _ _ _) = getCorrect' $ qChoices q where getCorrect' [] = "" getCorrect' (c:cs) = case c of Correct t -> t _ -> getCorrect' cs
226
true
true
1
9
128
97
48
49
null
null
markflorisson/hpack
testrepo/bytestring-0.10.4.1/tests/builder/Data/ByteString/Builder/Tests.hs
bsd-3-clause
testHandlePutBuilderChar8 :: Test testHandlePutBuilderChar8 = testProperty "char8 hPutBuilder" testRecipe where testRecipe :: (String, String, String, Recipe) -> Bool testRecipe args@(before, between, after, recipe) = unsafePerformIO $ do tempDir <- getTemporaryDirectory (tempFile, tempH) ...
1,469
testHandlePutBuilderChar8 :: Test testHandlePutBuilderChar8 = testProperty "char8 hPutBuilder" testRecipe where testRecipe :: (String, String, String, Recipe) -> Bool testRecipe args@(before, between, after, recipe) = unsafePerformIO $ do tempDir <- getTemporaryDirectory (tempFile, tempH) ...
1,469
testHandlePutBuilderChar8 = testProperty "char8 hPutBuilder" testRecipe where testRecipe :: (String, String, String, Recipe) -> Bool testRecipe args@(before, between, after, recipe) = unsafePerformIO $ do tempDir <- getTemporaryDirectory (tempFile, tempH) <- openTempFile tempDir "TestBuild...
1,435
false
true
2
14
469
318
154
164
null
null
brendanhay/semver
src/Data/SemVer/Constraint.hs
mpl-2.0
parser :: Parser Constraint parser = parserD DL.semantic
56
parser :: Parser Constraint parser = parserD DL.semantic
56
parser = parserD DL.semantic
28
false
true
0
6
7
19
9
10
null
null
RaminHAL9001/inf-interval
src/Numeric/Interval/Infinite.hs
gpl-3.0
-- Creates a list from segments, but does not clean it with 'intervalNub' _fromList :: (Ord c, Enum c, InfBound c) => [Interval c] -> Set_ List c _fromList a | Data.List.null a = EmptySet | a==[wholeInterval] = InfiniteSet | otherwise = Set_ $ List a
267
_fromList :: (Ord c, Enum c, InfBound c) => [Interval c] -> Set_ List c _fromList a | Data.List.null a = EmptySet | a==[wholeInterval] = InfiniteSet | otherwise = Set_ $ List a
193
_fromList a | Data.List.null a = EmptySet | a==[wholeInterval] = InfiniteSet | otherwise = Set_ $ List a
121
true
true
2
9
62
93
46
47
null
null
jgm/css-text
Text/CSS/Parse.hs
bsd-2-clause
mediaQueryParser :: Parser NestedBlock mediaQueryParser = do _ <- char '@' sel <- strip <$> takeWhile (\c -> c /= '{' && c /= '}') _ <- char '{' blocks <- nestedBlocksParser skipWS _ <- char '}' return $ NestedBlock ("@" `append` sel) $ blocks
271
mediaQueryParser :: Parser NestedBlock mediaQueryParser = do _ <- char '@' sel <- strip <$> takeWhile (\c -> c /= '{' && c /= '}') _ <- char '{' blocks <- nestedBlocksParser skipWS _ <- char '}' return $ NestedBlock ("@" `append` sel) $ blocks
271
mediaQueryParser = do _ <- char '@' sel <- strip <$> takeWhile (\c -> c /= '{' && c /= '}') _ <- char '{' blocks <- nestedBlocksParser skipWS _ <- char '}' return $ NestedBlock ("@" `append` sel) $ blocks
232
false
true
0
14
72
111
52
59
null
null
phischu/fragnix
tests/packages/scotty/Data.ByteString.Lazy.hs
bsd-3-clause
index cs0 i = index' cs0 i where index' Empty n = moduleError "index" ("index too large: " ++ show n) index' (Chunk c cs) n | n >= fromIntegral (S.length c) = index' cs (n - fromIntegral (S.length c)) | otherwise = S.unsafeIndex c (fromIntegral n) -- | /O(n...
536
index cs0 i = index' cs0 i where index' Empty n = moduleError "index" ("index too large: " ++ show n) index' (Chunk c cs) n | n >= fromIntegral (S.length c) = index' cs (n - fromIntegral (S.length c)) | otherwise = S.unsafeIndex c (fromIntegral n) -- | /O(n...
536
index cs0 i = index' cs0 i where index' Empty n = moduleError "index" ("index too large: " ++ show n) index' (Chunk c cs) n | n >= fromIntegral (S.length c) = index' cs (n - fromIntegral (S.length c)) | otherwise = S.unsafeIndex c (fromIntegral n) -- | /O(n...
536
false
false
3
13
148
129
63
66
null
null
Keruspe/blog
src/Main.hs
bsd-2-clause
-- Custom configuration configuration :: Configuration configuration = defaultConfiguration { tmpDirectory = "/tmp/hakyll" , deployCommand = "git push" }
167
configuration :: Configuration configuration = defaultConfiguration { tmpDirectory = "/tmp/hakyll" , deployCommand = "git push" }
142
configuration = defaultConfiguration { tmpDirectory = "/tmp/hakyll" , deployCommand = "git push" }
111
true
true
0
7
32
36
18
18
null
null
clarissalittler/pi-calculus
PiAST.hs
mit
interpExp (EBool True) = return $ VName "true"
46
interpExp (EBool True) = return $ VName "true"
46
interpExp (EBool True) = return $ VName "true"
46
false
false
0
7
7
22
10
12
null
null
tulcod/megaparsec
tests/Prim.hs
bsd-2-clause
prop_applicative_2 :: Integer -> Integer -> Property prop_applicative_2 n m = (pure n <* pure m) /=\ n
102
prop_applicative_2 :: Integer -> Integer -> Property prop_applicative_2 n m = (pure n <* pure m) /=\ n
102
prop_applicative_2 n m = (pure n <* pure m) /=\ n
49
false
true
0
8
17
47
21
26
null
null
j5b/ps-pc
Signature_test.hs
gpl-3.0
nnfTest3 = nnfTTemplate "toNNF not affecting atom" simple1 simple1
68
nnfTest3 = nnfTTemplate "toNNF not affecting atom" simple1 simple1
68
nnfTest3 = nnfTTemplate "toNNF not affecting atom" simple1 simple1
68
false
false
1
5
10
17
6
11
null
null
brendanhay/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/Orderreports/Listtransactions.hs
mpl-2.0
-- | The ID of the account that manages the order. This cannot be a -- multi-client account. olsMerchantId :: Lens' OrderreportsListtransactions Word64 olsMerchantId = lens _olsMerchantId (\ s a -> s{_olsMerchantId = a}) . _Coerce
244
olsMerchantId :: Lens' OrderreportsListtransactions Word64 olsMerchantId = lens _olsMerchantId (\ s a -> s{_olsMerchantId = a}) . _Coerce
151
olsMerchantId = lens _olsMerchantId (\ s a -> s{_olsMerchantId = a}) . _Coerce
92
true
true
0
10
49
47
25
22
null
null
fmapfmapfmap/amazonka
amazonka-ds/gen/Network/AWS/DirectoryService/CreateDirectory.hs
mpl-2.0
-- | A textual description for the directory. cDescription :: Lens' CreateDirectory (Maybe Text) cDescription = lens _cDescription (\ s a -> s{_cDescription = a})
162
cDescription :: Lens' CreateDirectory (Maybe Text) cDescription = lens _cDescription (\ s a -> s{_cDescription = a})
116
cDescription = lens _cDescription (\ s a -> s{_cDescription = a})
65
true
true
0
9
24
46
25
21
null
null
akamaus/gcodec
src/CNC/Declarative.hs
bsd-3-clause
-- rotates around (0,0) point counter-clockwise on a given angle rotate :: RealT -> Path -> Path rotate a = mapPath (* exp (0 :+ a))
132
rotate :: RealT -> Path -> Path rotate a = mapPath (* exp (0 :+ a))
67
rotate a = mapPath (* exp (0 :+ a))
35
true
true
0
9
25
40
21
19
null
null
greatest-ape/ets
app/Main.hs
bsd-3-clause
handleRequest :: SQLite.Connection -> Request -> IO Response -- Handle help request (request when no key was given) handleRequest dbConnection RequestHelp = return helpResponse
177
handleRequest :: SQLite.Connection -> Request -> IO Response handleRequest dbConnection RequestHelp = return helpResponse
121
handleRequest dbConnection RequestHelp = return helpResponse
60
true
true
0
7
24
33
16
17
null
null
iliastsi/gac
src/main/Outputable.hs
mit
usageString :: String usageString = "Usage: For basic information, try the `--help' option."
92
usageString :: String usageString = "Usage: For basic information, try the `--help' option."
92
usageString = "Usage: For basic information, try the `--help' option."
70
false
true
0
4
12
11
6
5
null
null
diminishedprime/.org
programmey_stuff/write_yourself_a_scheme/ch_03/hello.hs
mit
parseAtom :: Parser LispVal parseAtom = Atom <$> liftM2 (:) (letter <|> symbol) (many (letter <|> digit <|> symbol))
152
parseAtom :: Parser LispVal parseAtom = Atom <$> liftM2 (:) (letter <|> symbol) (many (letter <|> digit <|> symbol))
152
parseAtom = Atom <$> liftM2 (:) (letter <|> symbol) (many (letter <|> digit <|> symbol))
124
false
true
0
11
54
51
27
24
null
null
phischu/fragnix
tests/packages/scotty/Data.HashMap.Base.hs
bsd-3-clause
-- | In-place update version of insertWith unsafeInsertWith :: forall k v. (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v -> HashMap k v unsafeInsertWith f k0 v0 m0 = runST (go h0 k0 v0 0 m0) where h0 = hash k0 go :: Hash -> k -> v -> Shift -> HashMap k v -> ST ...
1,376
unsafeInsertWith :: forall k v. (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> HashMap k v -> HashMap k v unsafeInsertWith f k0 v0 m0 = runST (go h0 k0 v0 0 m0) where h0 = hash k0 go :: Hash -> k -> v -> Shift -> HashMap k v -> ST s (HashMap k v) go !h !k x !_ Empty = r...
1,333
unsafeInsertWith f k0 v0 m0 = runST (go h0 k0 v0 0 m0) where h0 = hash k0 go :: Hash -> k -> v -> Shift -> HashMap k v -> ST s (HashMap k v) go !h !k x !_ Empty = return $! Leaf h (L k x) go h k x s (Leaf hy l@(L ky y)) | hy == h = if ky == k then return $! Leaf h (L k (f x...
1,191
true
true
0
12
555
685
327
358
null
null
brendanhay/gogol
gogol-servicenetworking/gen/Network/Google/Resource/ServiceNetworking/Services/Projects/Global/Networks/UpdateConsumerConfig.hs
mpl-2.0
-- | Creates a value of 'ServicesProjectsGlobalNetworksUpdateConsumerConfig' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'spgnuccParent' -- -- * 'spgnuccXgafv' -- -- * 'spgnuccUploadProtocol' -- -- * 'spgnuccAccessToken' -- -- * 's...
986
servicesProjectsGlobalNetworksUpdateConsumerConfig :: Text -- ^ 'spgnuccParent' -> UpdateConsumerConfigRequest -- ^ 'spgnuccPayload' -> ServicesProjectsGlobalNetworksUpdateConsumerConfig servicesProjectsGlobalNetworksUpdateConsumerConfig pSpgnuccParent_ pSpgnuccPayload_ = ServicesProjectsGlobalNetworksUpd...
597
servicesProjectsGlobalNetworksUpdateConsumerConfig pSpgnuccParent_ pSpgnuccPayload_ = ServicesProjectsGlobalNetworksUpdateConsumerConfig' { _spgnuccParent = pSpgnuccParent_ , _spgnuccXgafv = Nothing , _spgnuccUploadProtocol = Nothing , _spgnuccAccessToken = Nothing , _spgnuccUploadType = Nothing ...
398
true
true
0
6
150
87
60
27
null
null
brendanhay/gogol
gogol-dataflow/gen/Network/Google/Resource/Dataflow/Projects/Locations/Snapshots/Delete.hs
mpl-2.0
-- | The location that contains this snapshot. plsdLocation :: Lens' ProjectsLocationsSnapshotsDelete Text plsdLocation = lens _plsdLocation (\ s a -> s{_plsdLocation = a})
174
plsdLocation :: Lens' ProjectsLocationsSnapshotsDelete Text plsdLocation = lens _plsdLocation (\ s a -> s{_plsdLocation = a})
127
plsdLocation = lens _plsdLocation (\ s a -> s{_plsdLocation = a})
67
true
true
0
9
25
42
22
20
null
null
jthornber/language-c-ejt
src/Language/C/Analysis/AstAnalysis.hs
bsd-3-clause
tDesignator (ArrayType _ _ _ _) (d : ds) = typeError (nodeInfo d) "member designator in array initializer"
108
tDesignator (ArrayType _ _ _ _) (d : ds) = typeError (nodeInfo d) "member designator in array initializer"
108
tDesignator (ArrayType _ _ _ _) (d : ds) = typeError (nodeInfo d) "member designator in array initializer"
108
false
false
0
7
19
45
21
24
null
null
ideas-edu/ideas
src/Ideas/Common/Context.hs
apache-2.0
liftCN _ (C _ (NoNav _)) = fail "noNavigator"
49
liftCN _ (C _ (NoNav _)) = fail "noNavigator"
49
liftCN _ (C _ (NoNav _)) = fail "noNavigator"
49
false
false
0
9
12
28
13
15
null
null
alexbaluta/courseography
dependencies/HaXml-1.25.3/src/Text/XML/HaXml/ByteStringPP.hs
gpl-3.0
containsDoubleQuote :: [EV] -> Bool containsDoubleQuote evs = any csq evs where csq (EVString s) = toWord8 '"' `elem` (pack s) csq _ = False
165
containsDoubleQuote :: [EV] -> Bool containsDoubleQuote evs = any csq evs where csq (EVString s) = toWord8 '"' `elem` (pack s) csq _ = False
165
containsDoubleQuote evs = any csq evs where csq (EVString s) = toWord8 '"' `elem` (pack s) csq _ = False
129
false
true
0
7
49
74
34
40
null
null
snoyberg/ghc
libraries/base/GHC/Real.hs
bsd-3-clause
-------------------------------------------------------------- -- Overloaded numeric functions -------------------------------------------------------------- -- | Converts a possibly-negative 'Real' value to a string. showSigned :: (Real a) => (a -> ShowS) -- ^ a function that can show unsigned values -> Int...
553
showSigned :: (Real a) => (a -> ShowS) -- ^ a function that can show unsigned values -> Int -- ^ the precedence of the enclosing context -> a -- ^ the value to show -> ShowS showSigned showPos p x | x < 0 = showParen (p > 6) (showChar '-' . showPos (-x)) | otherwi...
334
showSigned showPos p x | x < 0 = showParen (p > 6) (showChar '-' . showPos (-x)) | otherwise = showPos x
114
true
true
0
11
132
107
55
52
null
null
ekmett/containers
Data/IntSet/Base.hs
bsd-3-clause
match i p m = (mask i m) == p
31
match i p m = (mask i m) == p
31
match i p m = (mask i m) == p
31
false
false
0
7
11
26
12
14
null
null
diffusionkinetics/open
lucid-extras/site-gen/DevelMain.hs
mit
html :: Html () html = indexPage
32
html :: Html () html = indexPage
32
html = indexPage
16
false
true
0
7
6
22
9
13
null
null
Shakadak/n-puzzle
Parser.hs
mit
seqGrid :: Parser [Int] seqGrid = do skipMany comment size <- lexeme' natural grid <- count size (skipMany comment *> gridLine size) lexeme' (skipMany comment) pure $ concat grid
198
seqGrid :: Parser [Int] seqGrid = do skipMany comment size <- lexeme' natural grid <- count size (skipMany comment *> gridLine size) lexeme' (skipMany comment) pure $ concat grid
198
seqGrid = do skipMany comment size <- lexeme' natural grid <- count size (skipMany comment *> gridLine size) lexeme' (skipMany comment) pure $ concat grid
174
false
true
0
11
48
80
35
45
null
null
bkoropoff/Idris-dev
src/Idris/ParseHelpers.hs
bsd-3-clause
indented :: IdrisParser a -> IdrisParser a indented p = notEndBlock *> p <* keepTerminator
90
indented :: IdrisParser a -> IdrisParser a indented p = notEndBlock *> p <* keepTerminator
90
indented p = notEndBlock *> p <* keepTerminator
47
false
true
0
6
14
32
15
17
null
null
aelve/json-x
tests/DataFamilies/Encoders.hs
bsd-3-clause
gSomeTypeToJson2ElemArray = genericToJson opts2ElemArray
56
gSomeTypeToJson2ElemArray = genericToJson opts2ElemArray
56
gSomeTypeToJson2ElemArray = genericToJson opts2ElemArray
56
false
false
0
5
3
9
4
5
null
null
GaloisInc/halvm-ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprPrefixOcc :: Name -> Doc -- Print operators with parens around them pprPrefixOcc n = parensIf (isSymOcc n) (ppr n)
117
pprPrefixOcc :: Name -> Doc pprPrefixOcc n = parensIf (isSymOcc n) (ppr n)
74
pprPrefixOcc n = parensIf (isSymOcc n) (ppr n)
46
true
true
0
7
19
41
19
22
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | The custom url of the channel. csCustomURL :: Lens' ChannelSnippet (Maybe Text) csCustomURL = lens _csCustomURL (\ s a -> s{_csCustomURL = a})
149
csCustomURL :: Lens' ChannelSnippet (Maybe Text) csCustomURL = lens _csCustomURL (\ s a -> s{_csCustomURL = a})
113
csCustomURL = lens _csCustomURL (\ s a -> s{_csCustomURL = a})
64
true
true
0
9
26
48
25
23
null
null
geophf/1HaskellADay
exercises/HAD/Y2020/M10/D09/Exercise.hs
mit
{-- Task 2: ugh. Embedded non-ASCII characters in ASCII-JSON. WHY! write a cleaner that, given an input supposed-to-be-ASCII-text-file outputs a for-sure-ASCII-text file. --} clean :: FilePath -> FilePath -> IO () clean inputFile outputFile = undefined
255
clean :: FilePath -> FilePath -> IO () clean inputFile outputFile = undefined
77
clean inputFile outputFile = undefined
38
true
true
0
9
38
35
16
19
null
null
simhu/cubical
CTT.hs
mit
unionsMap :: Eq b => (a -> [b]) -> [a] -> [b] unionsMap f = unions . map f
74
unionsMap :: Eq b => (a -> [b]) -> [a] -> [b] unionsMap f = unions . map f
74
unionsMap f = unions . map f
28
false
true
0
9
18
52
27
25
null
null
mbrock/HBEAM
src/Language/Erlang/BEAM/Emulator.hs
gpl-3.0
popRetStack :: Emulation (Maybe (Function, CodePointer)) popRetStack = do p <- asks emuProcess stack <- liftIO $ readIORef (procRetStack p) case stack of (pc:pcs) -> do liftIO $ writeIORef (procRetStack p) pcs return (Just pc) ...
352
popRetStack :: Emulation (Maybe (Function, CodePointer)) popRetStack = do p <- asks emuProcess stack <- liftIO $ readIORef (procRetStack p) case stack of (pc:pcs) -> do liftIO $ writeIORef (procRetStack p) pcs return (Just pc) ...
352
popRetStack = do p <- asks emuProcess stack <- liftIO $ readIORef (procRetStack p) case stack of (pc:pcs) -> do liftIO $ writeIORef (procRetStack p) pcs return (Just pc) _ -> return Nothing
295
false
true
0
15
144
115
54
61
null
null
spockwangs/scheme.in.haskell
list10.hs
unlicense
nullEnv :: IO Env nullEnv = newIORef []
39
nullEnv :: IO Env nullEnv = newIORef []
39
nullEnv = newIORef []
21
false
true
0
6
7
25
10
15
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_POV_DIRECTIVE :: Int wxSTC_POV_DIRECTIVE = 8
50
wxSTC_POV_DIRECTIVE :: Int wxSTC_POV_DIRECTIVE = 8
50
wxSTC_POV_DIRECTIVE = 8
23
false
true
0
4
5
11
6
5
null
null
aretoky/egison2
hs-src/Language/Egison/Numerical.hs
mit
multiOp op aparams = toEgisonVal . foldl1 op <$> mapM fromEgisonVal aparams
75
multiOp op aparams = toEgisonVal . foldl1 op <$> mapM fromEgisonVal aparams
75
multiOp op aparams = toEgisonVal . foldl1 op <$> mapM fromEgisonVal aparams
75
false
false
0
7
11
27
12
15
null
null
Hodapp87/ivory
ivory/src/Ivory/Language/Syntax/Concrete/QQ/BitDataQQ.hs
bsd-3-clause
mkConstrFields :: THDef -> THConstr -> [DecQ] mkConstrFields def c = concat $ mapLayout (mkField def) c
103
mkConstrFields :: THDef -> THConstr -> [DecQ] mkConstrFields def c = concat $ mapLayout (mkField def) c
103
mkConstrFields def c = concat $ mapLayout (mkField def) c
57
false
true
0
8
16
42
21
21
null
null
Jakehp/PLC
haskell/hw5.hs
mit
get_stop_words :: [Char] -> [[Char]] get_stop_words sentence = foldl (\ stopWords e -> if (is_member e $ splitter stop_words) && (not $ is_member e stopWords) then e:stopWords else stopWords ) [] (splitter sentence)
311
get_stop_words :: [Char] -> [[Char]] get_stop_words sentence = foldl (\ stopWords e -> if (is_member e $ splitter stop_words) && (not $ is_member e stopWords) then e:stopWords else stopWords ) [] (splitter sentence)
311
get_stop_words sentence = foldl (\ stopWords e -> if (is_member e $ splitter stop_words) && (not $ is_member e stopWords) then e:stopWords else stopWords ) [] (splitter sentence)
274
false
true
0
12
128
93
49
44
null
null
meteficha/biostockholm
src/Bio/Sequence/Stockholm/Document.hs
bsd-3-clause
-- | Helper to create 'ParseFeature'@s@. mkParseFeature :: (B.ByteString -> a -> B.ByteString) -> [(B.ByteString, a)] -> (B.ByteString -> a) -> ParseFeature a mkParseFeature modify anns mkOther = let annots = M.fromList anns in \feat -> let featMod = modify feat (error "mkParseF...
410
mkParseFeature :: (B.ByteString -> a -> B.ByteString) -> [(B.ByteString, a)] -> (B.ByteString -> a) -> ParseFeature a mkParseFeature modify anns mkOther = let annots = M.fromList anns in \feat -> let featMod = modify feat (error "mkParseFeature: never here") in f...
369
mkParseFeature modify anns mkOther = let annots = M.fromList anns in \feat -> let featMod = modify feat (error "mkParseFeature: never here") in fromMaybe (mkOther feat) $ M.lookup featMod annots
218
true
true
0
14
109
132
66
66
null
null
andrewthad/vinyl-vectors
src/Data/Vector/Vinyl/Default/NonEmpty/Tagged.hs
bsd-3-clause
-- | /O(1)/ Yield a slice of the vector without copying. The vector must -- contain at least @i+n@ elements but this is not checked. unsafeSlice :: G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs) => Int -- ^ @i@ starting index -> Int -- ^ @n@ length -> (Vector k...
454
unsafeSlice :: G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs) => Int -- ^ @i@ starting index -> Int -- ^ @n@ length -> (Vector k) (Rec (TaggedFunctor Identity) rs) -> (Vector k) (Rec (TaggedFunctor Identity) rs) unsafeSlice = G.unsafeSlic...
321
unsafeSlice = G.unsafeSlice
27
true
true
0
14
138
112
55
57
null
null
egison/egison
hs-src/Language/Egison/Math/Expr.hs
mit
apply _ _ _ = mzero
61
apply _ _ _ = mzero
61
apply _ _ _ = mzero
61
false
false
1
5
47
14
5
9
null
null
CulpaBS/wbBach
src/Futhark/CodeGen/Backends/GenericC.hs
bsd-3-clause
printArrayStm mem bt (dim:shape) = do i <- newVName "print_i" v <- newVName "print_elem" let dim' = dimSizeToExp dim shape' = cproduct $ map dimSizeToExp shape bt' = primTypeToCType bt printelem <- printArrayStm (var v) bt shape return [C.cstm|{ if ($exp:dim' == 0) { ...
877
printArrayStm mem bt (dim:shape) = do i <- newVName "print_i" v <- newVName "print_elem" let dim' = dimSizeToExp dim shape' = cproduct $ map dimSizeToExp shape bt' = primTypeToCType bt printelem <- printArrayStm (var v) bt shape return [C.cstm|{ if ($exp:dim' == 0) { ...
877
printArrayStm mem bt (dim:shape) = do i <- newVName "print_i" v <- newVName "print_elem" let dim' = dimSizeToExp dim shape' = cproduct $ map dimSizeToExp shape bt' = primTypeToCType bt printelem <- printArrayStm (var v) bt shape return [C.cstm|{ if ($exp:dim' == 0) { ...
877
false
false
0
11
413
106
50
56
null
null