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
coolhacks/scripts-hacks
examples/shellcheck-master/ShellCheck/Analytics.hs
mit
prop_checkSpacefulness7 = verifyTree checkSpacefulness "a=foo\\ bar; rm $a"
75
prop_checkSpacefulness7 = verifyTree checkSpacefulness "a=foo\\ bar; rm $a"
75
prop_checkSpacefulness7 = verifyTree checkSpacefulness "a=foo\\ bar; rm $a"
75
false
false
0
5
7
11
5
6
null
null
UCSD-PL/RefScript
src/Language/Rsc/Parser/Types.hs
bsd-3-clause
tVarP c = TVar <$> tVarP0 c
27
tVarP c = TVar <$> tVarP0 c
27
tVarP c = TVar <$> tVarP0 c
27
false
false
3
5
6
20
7
13
null
null
bitrauser/aoc
src/AOC2015/Day23.hs
bsd-3-clause
parseProgram :: String -> [State -> State] parseProgram stuff = (parseInsn . words) <$> lines stuff
99
parseProgram :: String -> [State -> State] parseProgram stuff = (parseInsn . words) <$> lines stuff
99
parseProgram stuff = (parseInsn . words) <$> lines stuff
56
false
true
0
7
15
39
20
19
null
null
mkaput/janus
spec/Language/Janus/TestUtil.hs
mit
shouldEvalThrowTypeError :: Evaluable a => a -> Expectation shouldEvalThrowTypeError ast = do result <- run ast case result of Left OpCallTypeError{..} -> True `shouldBe` True x -> expectationFailure $ "program did not throw TypeError, but instead returned:\n" ++ show x
288
shouldEvalThrowTypeError :: Evaluable a => a -> Expectation shouldEvalThrowTypeError ast = do result <- run ast case result of Left OpCallTypeError{..} -> True `shouldBe` True x -> expectationFailure $ "program did not throw TypeError, but instead returned:\n" ++ show x
288
shouldEvalThrowTypeError ast = do result <- run ast case result of Left OpCallTypeError{..} -> True `shouldBe` True x -> expectationFailure $ "program did not throw TypeError, but instead returned:\n" ++ show x
228
false
true
0
12
57
80
38
42
null
null
cabrera/elerea
FRP/Elerea/Legacy/Internal.hs
bsd-3-clause
commit :: forall a . Signal a -> IO () commit (S r) = do t <- readIORef r case t of Aged _ s -> do writeIORef r (Ready s) -- TODO: branching can be trivially parallelised case s of SNT s _ _ -> commit s SNA sf sx ...
1,342
commit :: forall a . Signal a -> IO () commit (S r) = do t <- readIORef r case t of Aged _ s -> do writeIORef r (Ready s) -- TODO: branching can be trivially parallelised case s of SNT s _ _ -> commit s SNA sf sx ...
1,342
commit (S r) = do t <- readIORef r case t of Aged _ s -> do writeIORef r (Ready s) -- TODO: branching can be trivially parallelised case s of SNT s _ _ -> commit s SNA sf sx -> commit sf >> commit sx ...
1,303
false
true
0
19
656
412
182
230
null
null
uduki/hsQt
Qtc/Gui/QPixmapCache.hs
bsd-2-clause
qPixmapCacheInsert :: ((String, QPixmap t2)) -> IO (Bool) qPixmapCacheInsert (x1, x2) = withBoolResult $ withCWString x1 $ \cstr_x1 -> withObjectPtr x2 $ \cobj_x2 -> qtc_QPixmapCache_insert cstr_x1 cobj_x2
219
qPixmapCacheInsert :: ((String, QPixmap t2)) -> IO (Bool) qPixmapCacheInsert (x1, x2) = withBoolResult $ withCWString x1 $ \cstr_x1 -> withObjectPtr x2 $ \cobj_x2 -> qtc_QPixmapCache_insert cstr_x1 cobj_x2
219
qPixmapCacheInsert (x1, x2) = withBoolResult $ withCWString x1 $ \cstr_x1 -> withObjectPtr x2 $ \cobj_x2 -> qtc_QPixmapCache_insert cstr_x1 cobj_x2
161
false
true
0
9
40
75
39
36
null
null
nomeata/ghc
utils/hpc/HpcMarkup.hs
bsd-3-clause
writeFileUsing :: String -> String -> IO () writeFileUsing filename text = do let dest_dir = reverse . dropWhile (\ x -> x /= '/') . reverse $ filename -- We need to check for the dest_dir each time, because we use sub-dirs for -- packages, and a single .tix file might contain information about -- many package. -...
556
writeFileUsing :: String -> String -> IO () writeFileUsing filename text = do let dest_dir = reverse . dropWhile (\ x -> x /= '/') . reverse $ filename -- We need to check for the dest_dir each time, because we use sub-dirs for -- packages, and a single .tix file might contain information about -- many package. -...
556
writeFileUsing filename text = do let dest_dir = reverse . dropWhile (\ x -> x /= '/') . reverse $ filename -- We need to check for the dest_dir each time, because we use sub-dirs for -- packages, and a single .tix file might contain information about -- many package. -- create the dest_dir if needed when (not ...
512
false
true
0
17
95
111
54
57
null
null
nick8325/kbc
src/Twee/Rule.hs
bsd-3-clause
reducesOriented :: Function f => Rule f -> Subst f -> Bool reducesOriented rule sub = oriented (orientation rule) && reducesWith undefined rule sub
149
reducesOriented :: Function f => Rule f -> Subst f -> Bool reducesOriented rule sub = oriented (orientation rule) && reducesWith undefined rule sub
149
reducesOriented rule sub = oriented (orientation rule) && reducesWith undefined rule sub
90
false
true
0
8
25
57
26
31
null
null
paulkeene/FP101x
chapter07/Parsing.hs
bsd-3-clause
expr :: Parser Int expr = do n <- nat ns <- many (do char '-' nat) return (foldl (-) n ns) -- Ignoring spacing ----------------
158
expr :: Parser Int expr = do n <- nat ns <- many (do char '-' nat) return (foldl (-) n ns) -- Ignoring spacing ----------------
158
expr = do n <- nat ns <- many (do char '-' nat) return (foldl (-) n ns) -- Ignoring spacing ----------------
139
false
true
0
12
56
63
30
33
null
null
neobrain/aeson
Data/Aeson.hs
bsd-3-clause
-- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'. -- If this fails due to incomplete or invalid input, 'Nothing' is -- returned. -- -- The input must consist solely of a JSON document, with no trailing -- data except for whitespace. -- -- This function parses immediately, but defers conversion. See...
430
decode :: (FromJSON a) => L.ByteString -> Maybe a decode = decodeWith jsonEOF fromJSON
86
decode = decodeWith jsonEOF fromJSON
36
true
true
0
7
72
43
26
17
null
null
daniel-j-h/asm-js-hs
src/Main.hs
bsd-3-clause
jsReify (UnaryPlus e) = "+" <> jsReify e
41
jsReify (UnaryPlus e) = "+" <> jsReify e
41
jsReify (UnaryPlus e) = "+" <> jsReify e
41
false
false
0
7
8
22
10
12
null
null
sdiehl/ghc
compiler/main/DynFlags.hs
bsd-3-clause
defaultFlags :: Settings -> [GeneralFlag] defaultFlags settings -- See Note [Updating flag description in the User's Guide] = [ Opt_AutoLinkPackages, Opt_DiagnosticsShowCaret, Opt_EmbedManifest, Opt_FlatCache, Opt_GenManifest, Opt_GhciHistory, Opt_GhciSandbox, Opt_HelpfulErro...
998
defaultFlags :: Settings -> [GeneralFlag] defaultFlags settings -- See Note [Updating flag description in the User's Guide] = [ Opt_AutoLinkPackages, Opt_DiagnosticsShowCaret, Opt_EmbedManifest, Opt_FlatCache, Opt_GenManifest, Opt_GhciHistory, Opt_GhciSandbox, Opt_HelpfulErro...
998
defaultFlags settings -- See Note [Updating flag description in the User's Guide] = [ Opt_AutoLinkPackages, Opt_DiagnosticsShowCaret, Opt_EmbedManifest, Opt_FlatCache, Opt_GenManifest, Opt_GhciHistory, Opt_GhciSandbox, Opt_HelpfulErrors, Opt_KeepHiFiles, Opt_KeepO...
956
false
true
8
8
241
155
88
67
null
null
sgillespie/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
-- | Does a type represent a floating-point number? isFloatingTy :: Type -> Bool isFloatingTy ty = isFloatTy ty || isDoubleTy ty
128
isFloatingTy :: Type -> Bool isFloatingTy ty = isFloatTy ty || isDoubleTy ty
76
isFloatingTy ty = isFloatTy ty || isDoubleTy ty
47
true
true
0
7
21
34
15
19
null
null
Yuras/plist
src/Text/XML/Plist/PlObject.hs
bsd-3-clause
fromPlArray :: Monad m => PlObject -> m [PlObject] fromPlArray (PlArray arr) = return arr
89
fromPlArray :: Monad m => PlObject -> m [PlObject] fromPlArray (PlArray arr) = return arr
89
fromPlArray (PlArray arr) = return arr
38
false
true
0
8
14
40
19
21
null
null
tnrangwi/CompareProgrammingUsingHolidayManager
haskell/SocketServer.hs
mit
_servePureCall (SyncLessShutdown handler) args storage priv = let (res, _, sd) = handler storage priv args in (storage, Just "Shutdown", res, NoSync, sd)
161
_servePureCall (SyncLessShutdown handler) args storage priv = let (res, _, sd) = handler storage priv args in (storage, Just "Shutdown", res, NoSync, sd)
161
_servePureCall (SyncLessShutdown handler) args storage priv = let (res, _, sd) = handler storage priv args in (storage, Just "Shutdown", res, NoSync, sd)
161
false
false
0
9
30
67
35
32
null
null
dkensinger/haskell
countdown.hs
gpl-3.0
valid' Sub x y = x > y
38
valid' Sub x y = x > y
38
valid' Sub x y = x > y
38
false
false
0
5
23
17
8
9
null
null
istehem/ACO-for-vasttrafik
ACO.hs
bsd-3-clause
addOneLine (x:y:xs) = newEdge : addOneLine (y:xs) where newEdge = (\((node1,label1),i1) ((node2,label2),i2) -> (node1,node2,i2)) x y
136
addOneLine (x:y:xs) = newEdge : addOneLine (y:xs) where newEdge = (\((node1,label1),i1) ((node2,label2),i2) -> (node1,node2,i2)) x y
136
addOneLine (x:y:xs) = newEdge : addOneLine (y:xs) where newEdge = (\((node1,label1),i1) ((node2,label2),i2) -> (node1,node2,i2)) x y
136
false
false
0
9
19
91
51
40
null
null
mrBliss/haddock
haddock-api/src/Haddock/Backends/LaTeX.hs
bsd-2-clause
pabrackets :: LaTeX -> LaTeX pabrackets h = text "[:" <> h <> text ":]"
71
pabrackets :: LaTeX -> LaTeX pabrackets h = text "[:" <> h <> text ":]"
71
pabrackets h = text "[:" <> h <> text ":]"
42
false
true
0
7
14
32
15
17
null
null
spechub/Hets
Proofs/StatusUtils.hs
gpl-2.0
clearElem :: HistElem -> HistElem clearElem e = case e of HistElem c -> HistElem $ clearLock c HistGroup r h -> HistGroup r $ clearHist h -- * methods that keep the change list clean {- | remove the contray changes out of the list if it's necessary, so that the list can stay clean. -}
291
clearElem :: HistElem -> HistElem clearElem e = case e of HistElem c -> HistElem $ clearLock c HistGroup r h -> HistGroup r $ clearHist h -- * methods that keep the change list clean {- | remove the contray changes out of the list if it's necessary, so that the list can stay clean. -}
291
clearElem e = case e of HistElem c -> HistElem $ clearLock c HistGroup r h -> HistGroup r $ clearHist h -- * methods that keep the change list clean {- | remove the contray changes out of the list if it's necessary, so that the list can stay clean. -}
257
false
true
0
9
62
66
30
36
null
null
brendanhay/gogol
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Messages/Trash.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). umtUploadProtocol :: Lens' UsersMessagesTrash (Maybe Text) umtUploadProtocol = lens _umtUploadProtocol (\ s a -> s{_umtUploadProtocol = a})
209
umtUploadProtocol :: Lens' UsersMessagesTrash (Maybe Text) umtUploadProtocol = lens _umtUploadProtocol (\ s a -> s{_umtUploadProtocol = a})
147
umtUploadProtocol = lens _umtUploadProtocol (\ s a -> s{_umtUploadProtocol = a})
88
true
true
1
9
33
51
25
26
null
null
swift-nav/plover
src/Language/Plover/Quote.hs
mit
ploverQuoteExp :: Parser Expr -> String -> Q Exp ploverQuoteExp parser s = do loc <- TH.location let parser' = do setPosition (newPos (TH.loc_filename loc) (fst $ TH.loc_start loc) (snd $ TH.loc_start loc)) ...
598
ploverQuoteExp :: Parser Expr -> String -> Q Exp ploverQuoteExp parser s = do loc <- TH.location let parser' = do setPosition (newPos (TH.loc_filename loc) (fst $ TH.loc_start loc) (snd $ TH.loc_start loc)) ...
598
ploverQuoteExp parser s = do loc <- TH.location let parser' = do setPosition (newPos (TH.loc_filename loc) (fst $ TH.loc_start loc) (snd $ TH.loc_start loc)) parser case parse parser' "" ...
549
false
true
0
18
237
166
78
88
null
null
phischu/fragnix
builtins/base/Data.Data.hs
bsd-3-clause
int16Type :: DataType int16Type = mkIntType "Data.Int.Int16"
60
int16Type :: DataType int16Type = mkIntType "Data.Int.Int16"
60
int16Type = mkIntType "Data.Int.Int16"
38
false
true
0
6
6
21
8
13
null
null
edsko/hackage-server
exes/ImportClient.hs
bsd-3-clause
importIndex :: Int -> FilePath -> URI -> IO () importIndex jobs indexFile baseURI = do info $ "Reading index file " ++ indexFile pkgs <- either fail return . readPkgIndex =<< LBS.readFile indexFile pkgs' <- evaluate (sortBy (comparing fst) pkgs) info $ "Uploading..." concForM_...
489
importIndex :: Int -> FilePath -> URI -> IO () importIndex jobs indexFile baseURI = do info $ "Reading index file " ++ indexFile pkgs <- either fail return . readPkgIndex =<< LBS.readFile indexFile pkgs' <- evaluate (sortBy (comparing fst) pkgs) info $ "Uploading..." concForM_...
489
importIndex jobs indexFile baseURI = do info $ "Reading index file " ++ indexFile pkgs <- either fail return . readPkgIndex =<< LBS.readFile indexFile pkgs' <- evaluate (sortBy (comparing fst) pkgs) info $ "Uploading..." concForM_ jobs pkgs' $ \tasks -> httpSession $ do ...
442
false
true
0
15
139
159
73
86
null
null
brodyberg/Notes
ProjectRosalind.hsproj/LearnHaskell/lib/ProjectRosalind/Motif/Combinator.hs
mit
count :: Int -> Parser a -> Parser [a] count = C.count
54
count :: Int -> Parser a -> Parser [a] count = C.count
54
count = C.count
15
false
true
0
8
11
30
15
15
null
null
tjhunter/karps
haskell/src/Spark/Core/Internal/ComputeDag.hs
apache-2.0
graphDataLexico :: ComputeDag v e -> [v] graphDataLexico cd = vertexData <$> toList (cdVertices cd)
99
graphDataLexico :: ComputeDag v e -> [v] graphDataLexico cd = vertexData <$> toList (cdVertices cd)
99
graphDataLexico cd = vertexData <$> toList (cdVertices cd)
58
false
true
0
8
14
39
19
20
null
null
opentower/carnap
Carnap/src/Carnap/Core/Data/Util.hs
gpl-3.0
sbloom :: (MonadVar (FixLang f) (StateT Int []), FirstOrder (FixLang f), UniformlyEq (FixLang f)) => [Buds (FixLang f)] -> [Blossoms (FixLang f)] -> FixLang f a -> StateT Int [] (FixLang f a) sbloom buds blossoms tree = do (Bud bud) <- S.lift buds (Blossom blossom) <- S.lift blossoms ...
1,172
sbloom :: (MonadVar (FixLang f) (StateT Int []), FirstOrder (FixLang f), UniformlyEq (FixLang f)) => [Buds (FixLang f)] -> [Blossoms (FixLang f)] -> FixLang f a -> StateT Int [] (FixLang f a) sbloom buds blossoms tree = do (Bud bud) <- S.lift buds (Blossom blossom) <- S.lift blossoms ...
1,172
sbloom buds blossoms tree = do (Bud bud) <- S.lift buds (Blossom blossom) <- S.lift blossoms case tree of (h :!$: t) -> do head <- S.lift [True,False] if head then do h' <- sbloom buds blossoms h ...
975
false
true
0
16
598
403
194
209
null
null
kim/amazonka
amazonka-s3/gen/Network/AWS/S3/CopyObject.hs
mpl-2.0
-- | Specifies the algorithm to use when decrypting the source object (e.g., -- AES256). coCopySourceSSECustomerAlgorithm :: Lens' CopyObject (Maybe Text) coCopySourceSSECustomerAlgorithm = lens _coCopySourceSSECustomerAlgorithm (\s a -> s { _coCopySourceSSECustomerAlgorithm = a })
294
coCopySourceSSECustomerAlgorithm :: Lens' CopyObject (Maybe Text) coCopySourceSSECustomerAlgorithm = lens _coCopySourceSSECustomerAlgorithm (\s a -> s { _coCopySourceSSECustomerAlgorithm = a })
205
coCopySourceSSECustomerAlgorithm = lens _coCopySourceSSECustomerAlgorithm (\s a -> s { _coCopySourceSSECustomerAlgorithm = a })
139
true
true
0
8
45
48
26
22
null
null
shayan-najd/QHaskell
QHaskell/Inference.hs
gpl-3.0
mxm :: [Nat] -> Nat mxm [] = Zro
32
mxm :: [Nat] -> Nat mxm [] = Zro
32
mxm [] = Zro
12
false
true
0
6
8
27
13
14
null
null
christiaanb/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
infix_RDR = dataQual_RDR gENERICS (fsLit "Infix")
54
infix_RDR = dataQual_RDR gENERICS (fsLit "Infix")
54
infix_RDR = dataQual_RDR gENERICS (fsLit "Infix")
54
false
false
0
7
10
17
8
9
null
null
kim/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs
mpl-2.0
-- | Whether load-based auto scaling is enabled for the layer. lbascEnable :: Lens' LoadBasedAutoScalingConfiguration (Maybe Bool) lbascEnable = lens _lbascEnable (\s a -> s { _lbascEnable = a })
195
lbascEnable :: Lens' LoadBasedAutoScalingConfiguration (Maybe Bool) lbascEnable = lens _lbascEnable (\s a -> s { _lbascEnable = a })
132
lbascEnable = lens _lbascEnable (\s a -> s { _lbascEnable = a })
64
true
true
0
9
29
46
25
21
null
null
sboosali/Haskell-DragonNaturallySpeaking
sources/Commands/Etc.hs
mit
findOn :: forall a b. (Ord b) => (a -> b) -- ^ the key on which to compare nodes for equality -> (a -> [a]) -- ^ generates candidates i.e. the node's neighbors -> a -- ^ the node -> [a] findOn key next input = go [] [input] where go :: Map b a -> [a] -> [a] go seen [] = Map.elems seen ...
709
findOn :: forall a b. (Ord b) => (a -> b) -- ^ the key on which to compare nodes for equality -> (a -> [a]) -- ^ generates candidates i.e. the node's neighbors -> a -- ^ the node -> [a] findOn key next input = go [] [input] where go :: Map b a -> [a] -> [a] go seen [] = Map.elems seen ...
709
findOn key next input = go [] [input] where go :: Map b a -> [a] -> [a] go seen [] = Map.elems seen go seen input = go (saw `Map.union` seen) frontier where saw = Map.fromList $ map ((,) <$> key <*> id) unseen frontier = concatMap next unseen unseen = filter ((`Map.notMember` seen) . key) inpu...
496
false
true
0
12
184
223
122
101
null
null
DaMSL/K3
src/Language/K3/Core/Literal.hs
apache-2.0
isLAnnotation :: Annotation Literal -> Bool isLAnnotation (LAnnotation _) = True
80
isLAnnotation :: Annotation Literal -> Bool isLAnnotation (LAnnotation _) = True
80
isLAnnotation (LAnnotation _) = True
36
false
true
0
6
10
31
14
17
null
null
danidiaz/streaming-eversion
src/Streaming/Eversion.hs
bsd-3-clause
evert :: (forall m r. Monad m => Stream (Of a) m r -> m (Of x r)) -> Fold a x -- ^ evert phi = simplify (generalEvertM phi)
130
evert :: (forall m r. Monad m => Stream (Of a) m r -> m (Of x r)) -> Fold a x evert phi = simplify (generalEvertM phi)
125
evert phi = simplify (generalEvertM phi)
40
true
true
0
12
36
77
38
39
null
null
michaelficarra/purescript
psci/Parser.hs
mit
parseDirective :: String -> Either String Command parseDirective cmd = case D.directivesFor' dstr of [(d, _)] -> commandFor d [] -> Left "Unrecognized directive. Type :? for help." ds -> Left ("Ambiguous directive. Possible matches: " ++ intercalate ", " (map snd ds) ++ ". Ty...
869
parseDirective :: String -> Either String Command parseDirective cmd = case D.directivesFor' dstr of [(d, _)] -> commandFor d [] -> Left "Unrecognized directive. Type :? for help." ds -> Left ("Ambiguous directive. Possible matches: " ++ intercalate ", " (map snd ds) ++ ". Ty...
869
parseDirective cmd = case D.directivesFor' dstr of [(d, _)] -> commandFor d [] -> Left "Unrecognized directive. Type :? for help." ds -> Left ("Ambiguous directive. Possible matches: " ++ intercalate ", " (map snd ds) ++ ". Type :? for help.") where (dstr, arg) = break is...
819
false
true
0
14
235
264
128
136
null
null
recursion-ninja/megaparsec
tests/Text/Megaparsec/StreamSpec.hs
bsd-2-clause
tlproxy :: Proxy TL.Text tlproxy = Proxy
40
tlproxy :: Proxy TL.Text tlproxy = Proxy
40
tlproxy = Proxy
15
false
true
1
6
6
20
8
12
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME :: Int wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000
85
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME :: Int wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000
85
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000
45
false
true
0
4
5
11
6
5
null
null
bredelings/BAli-Phy
haskell/Data/Either.hs
gpl-2.0
fromLeft _ (Left l) = l
23
fromLeft _ (Left l) = l
23
fromLeft _ (Left l) = l
23
false
false
0
7
5
17
8
9
null
null
jml/language-python
src/Language/Python/Common/ParserUtils.hs
bsd-3-clause
makeStarParam :: Token -> Maybe (IdentSpan, Maybe ExprSpan) -> ParameterSpan makeStarParam t1 Nothing = EndPositional (getSpan t1)
130
makeStarParam :: Token -> Maybe (IdentSpan, Maybe ExprSpan) -> ParameterSpan makeStarParam t1 Nothing = EndPositional (getSpan t1)
130
makeStarParam t1 Nothing = EndPositional (getSpan t1)
53
false
true
0
9
16
45
22
23
null
null
jtapolczai/Hephaestos
Crawling/Hephaestos/Fetch.hs
apache-2.0
-- |Downloads a whole resource and returns the contents as soon as the -- downloading process has finished. -- -- Calling this function is perfectly fine, but keep in mind that -- -- 1. the whole resource will be downloaded before it returns and -- 2. all of it will be kept in memory. -- -- For large files and mor...
572
downloadWhole :: FetchOptions -> URI -> IO BL.ByteString downloadWhole opts url = runResourceT $ do (_,content) <- download opts url consume content -- |Consumes an entire conduit and returns the contents.
212
downloadWhole opts url = runResourceT $ do (_,content) <- download opts url consume content -- |Consumes an entire conduit and returns the contents.
155
true
true
0
10
107
72
38
34
null
null
nevrenato/Hets_Fork
Common/Lib/Rel.hs
gpl-2.0
-- | map the values of a relation map :: (Ord a, Ord b) => (a -> b) -> Rel a -> Rel b map f = Rel . Map.mapKeysWith Set.union f . Map.map (Set.map f) . toMap
157
map :: (Ord a, Ord b) => (a -> b) -> Rel a -> Rel b map f = Rel . Map.mapKeysWith Set.union f . Map.map (Set.map f) . toMap
123
map f = Rel . Map.mapKeysWith Set.union f . Map.map (Set.map f) . toMap
71
true
true
0
10
37
89
43
46
null
null
zachsully/hakaru
haskell/Language/Hakaru/Evaluation/DisintegrationMonad.hs
bsd-3-clause
sizeInnermostInd :: (ABT Term abt) => Location (a :: Hakaru) -> Dis abt (abt '[] 'HNat) sizeInnermostInd l = (maybe (freeLocError l) return =<<) . select l $ \s -> do guard (length (statementInds s) >= 1) case s of SBind l' _ ixs -> do Refl <- locEq ...
738
sizeInnermostInd :: (ABT Term abt) => Location (a :: Hakaru) -> Dis abt (abt '[] 'HNat) sizeInnermostInd l = (maybe (freeLocError l) return =<<) . select l $ \s -> do guard (length (statementInds s) >= 1) case s of SBind l' _ ixs -> do Refl <- locEq ...
738
sizeInnermostInd l = (maybe (freeLocError l) return =<<) . select l $ \s -> do guard (length (statementInds s) >= 1) case s of SBind l' _ ixs -> do Refl <- locEq l l' Just $ unsafePush s >> return (indSize (he...
616
false
true
0
19
356
254
119
135
null
null
Gabriel439/Haskell-Dhall-Library
dhall/src/Dhall/Parser/Token.hs
bsd-3-clause
{-| Parse the @Integer@ built-in This corresponds to the @Integer@ rule from the official grammar -} _Integer :: Parser () _Integer = builtin "Integer"
156
_Integer :: Parser () _Integer = builtin "Integer"
50
_Integer = builtin "Integer"
28
true
true
0
7
28
26
11
15
null
null
olsner/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
plusSimplCount _ _ = panic "plusSimplCount"
77
plusSimplCount _ _ = panic "plusSimplCount"
77
plusSimplCount _ _ = panic "plusSimplCount"
77
false
false
1
5
39
14
6
8
null
null
gibiansky/hlint
data/Default.hs
bsd-3-clause
error = last (scanl f z x) ==> foldl f z x
42
error = last (scanl f z x) ==> foldl f z x
42
error = last (scanl f z x) ==> foldl f z x
42
false
false
1
8
11
33
14
19
null
null
mstksg/hledger
hledger/Hledger/Cli/CliOptions.hs
gpl-3.0
-- | Default width for hledger console output, when not otherwise specified. defaultWidth :: Int defaultWidth = 80
114
defaultWidth :: Int defaultWidth = 80
37
defaultWidth = 80
17
true
true
0
4
17
12
7
5
null
null
Saulzar/reflex-gloss-scene
examples/FrpZoo.hs
bsd-3-clause
foldMerge :: MonadReflex t m => a -> [Event t (a -> a)] -> m (Dynamic t a) foldMerge initial events = foldDyn ($) initial (mergeWith (.) events)
144
foldMerge :: MonadReflex t m => a -> [Event t (a -> a)] -> m (Dynamic t a) foldMerge initial events = foldDyn ($) initial (mergeWith (.) events)
144
foldMerge initial events = foldDyn ($) initial (mergeWith (.) events)
69
false
true
0
11
27
78
40
38
null
null
mostalive/yesod-splittest
Application.hs
mit
-- This function allocates resources (such as a database connection pool), -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFu...
989
makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf -- Initialize the logging middleware logWare <- mkRequestLogger def { outputFormat = if development then Detailed True e...
740
makeApplication conf = do foundation <- makeFoundation conf -- Initialize the logging middleware logWare <- mkRequestLogger def { outputFormat = if development then Detailed True else Apache FromSocket , destination = RequestLogger.Logger $ logger...
665
true
true
0
13
223
146
74
72
null
null
benzrf/cas
src/ProofCas/Backends/SFP/Paths.hs
gpl-3.0
parent :: StPath -> StPath parent = _2%~parent'
47
parent :: StPath -> StPath parent = _2%~parent'
47
parent = _2%~parent'
20
false
true
0
5
7
19
10
9
null
null
da-x/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
isQuietHsCmd :: HsCmd id -> Bool -- Parentheses do display something, but it gives little info and -- if we go deeper when we go inside them then we get ugly things -- like (...) isQuietHsCmd (HsCmdPar _) = True
211
isQuietHsCmd :: HsCmd id -> Bool isQuietHsCmd (HsCmdPar _) = True
65
isQuietHsCmd (HsCmdPar _) = True
32
true
true
0
9
39
36
17
19
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/ParseUtils.hs
bsd-3-clause
-- | Reuse a command line 'OptionField' as a config file 'FieldDescr'. -- commandOptionToField :: OptionField a -> FieldDescr a commandOptionToField = viewAsFieldDescr
167
commandOptionToField :: OptionField a -> FieldDescr a commandOptionToField = viewAsFieldDescr
93
commandOptionToField = viewAsFieldDescr
39
true
true
0
6
22
23
12
11
null
null
rueshyna/gogol
gogol-gmail/gen/Network/Google/Resource/Gmail/Users/Messages/Insert.hs
mpl-2.0
-- | Source for Gmail\'s internal date of the message. uInternalDateSource :: Lens' UsersMessagesInsert UsersMessagesInsertInternalDateSource uInternalDateSource = lens _uInternalDateSource (\ s a -> s{_uInternalDateSource = a})
236
uInternalDateSource :: Lens' UsersMessagesInsert UsersMessagesInsertInternalDateSource uInternalDateSource = lens _uInternalDateSource (\ s a -> s{_uInternalDateSource = a})
181
uInternalDateSource = lens _uInternalDateSource (\ s a -> s{_uInternalDateSource = a})
94
true
true
0
8
33
43
22
21
null
null
jaspervdj/what-morphism
src/WhatMorphism/TemplateHaskell.hs
bsd-3-clause
-------------------------------------------------------------------------------- conName :: Con -> Name conName (NormalC n _) = n
131
conName :: Con -> Name conName (NormalC n _) = n
50
conName (NormalC n _) = n
27
true
true
0
7
13
27
14
13
null
null
brendanhay/gogol
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
mpl-2.0
-- | Creates a value of 'NFSMount' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'nfsmTarget' nFSMount :: NFSMount nFSMount = NFSMount' {_nfsmTarget = Nothing}
250
nFSMount :: NFSMount nFSMount = NFSMount' {_nfsmTarget = Nothing}
69
nFSMount = NFSMount' {_nfsmTarget = Nothing}
44
true
true
1
7
46
28
16
12
null
null
dabrahams/gitlib
Data/Git/Oid.hs
mit
compareCOid :: COid -> COid -> Ordering (COid x) `compareCOid` (COid y) = let c = unsafePerformIO $ withForeignPtr x $ \x' -> withForeignPtr y $ \y' -> c'git_oid_cmp x' y' in c `compare` 0
234
compareCOid :: COid -> COid -> Ordering (COid x) `compareCOid` (COid y) = let c = unsafePerformIO $ withForeignPtr x $ \x' -> withForeignPtr y $ \y' -> c'git_oid_cmp x' y' in c `compare` 0
234
(COid x) `compareCOid` (COid y) = let c = unsafePerformIO $ withForeignPtr x $ \x' -> withForeignPtr y $ \y' -> c'git_oid_cmp x' y' in c `compare` 0
194
false
true
0
13
80
89
45
44
null
null
vdweegen/UvA-Software_Testing
Lab5/Willem/Lecture5NRC.hs
gpl-3.0
showGrid :: Grid -> IO() showGrid [as,bs,cs,ds,es,fs,gs,hs,is] = do putStrLn ("+-------+-------+-------+") showRow as; showRow bs; showRow cs putStrLn ("+-------+-------+-------+") showRow ds; showRow es; showRow fs putStrLn ("+-------+-------+-------+") showRow gs; showRow hs; showRow is putSt...
353
showGrid :: Grid -> IO() showGrid [as,bs,cs,ds,es,fs,gs,hs,is] = do putStrLn ("+-------+-------+-------+") showRow as; showRow bs; showRow cs putStrLn ("+-------+-------+-------+") showRow ds; showRow es; showRow fs putStrLn ("+-------+-------+-------+") showRow gs; showRow hs; showRow is putSt...
353
showGrid [as,bs,cs,ds,es,fs,gs,hs,is] = do putStrLn ("+-------+-------+-------+") showRow as; showRow bs; showRow cs putStrLn ("+-------+-------+-------+") showRow ds; showRow es; showRow fs putStrLn ("+-------+-------+-------+") showRow gs; showRow hs; showRow is putStrLn ("+-------+-------+--...
328
false
true
0
9
59
151
70
81
null
null
pparkkin/eta
compiler/ETA/BasicTypes/DataCon.hs
bsd-3-clause
-- | Extract the type for any given labelled field of the 'DataCon' dataConFieldType :: DataCon -> FieldLabel -> Type dataConFieldType con label = case lookup label (dcFields con `zip` dcOrigArgTys con) of Just ty -> ty Nothing -> pprPanic "dataConFieldType" (ppr con <+> ppr label) -- | The strictness ma...
429
dataConFieldType :: DataCon -> FieldLabel -> Type dataConFieldType con label = case lookup label (dcFields con `zip` dcOrigArgTys con) of Just ty -> ty Nothing -> pprPanic "dataConFieldType" (ppr con <+> ppr label) -- | The strictness markings written by the porgrammer. -- The list is in one-to-one corre...
361
dataConFieldType con label = case lookup label (dcFields con `zip` dcOrigArgTys con) of Just ty -> ty Nothing -> pprPanic "dataConFieldType" (ppr con <+> ppr label) -- | The strictness markings written by the porgrammer. -- The list is in one-to-one correspondence with the arity of the 'DataCon'
311
true
true
0
11
82
89
43
46
null
null
Teaspot-Studio/gpipe-test
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/autogen/Paths_gpipe_test.hs
bsd-3-clause
version :: Version version = Version [0,1,0,0] []
49
version :: Version version = Version [0,1,0,0] []
49
version = Version [0,1,0,0] []
30
false
true
0
6
7
30
17
13
null
null
byorgey/Idris-dev
src/Idris/Delaborate.hs
bsd-3-clause
delab' :: IState -> Term -> Bool -> PTerm delab' i t f = delabTy' i [] t f
74
delab' :: IState -> Term -> Bool -> PTerm delab' i t f = delabTy' i [] t f
74
delab' i t f = delabTy' i [] t f
32
false
true
0
7
18
41
20
21
null
null
hectorhon/autotrace2
app/Blc/Site.hs
bsd-3-clause
calculateAreaBlcs :: Key Area -> (Day, Day) -> Maybe (Entity User) -> AppM Text calculateAreaBlcs aid (start, end) mUser = case mUser of Nothing -> lift (left err500) Just (Entity uid _) -> do bids <- runDb (descendantBlcsOf aid) scheduleJob "Calculate area blcs" uid (job start end bids) redirect (viewA...
354
calculateAreaBlcs :: Key Area -> (Day, Day) -> Maybe (Entity User) -> AppM Text calculateAreaBlcs aid (start, end) mUser = case mUser of Nothing -> lift (left err500) Just (Entity uid _) -> do bids <- runDb (descendantBlcsOf aid) scheduleJob "Calculate area blcs" uid (job start end bids) redirect (viewA...
354
calculateAreaBlcs aid (start, end) mUser = case mUser of Nothing -> lift (left err500) Just (Entity uid _) -> do bids <- runDb (descendantBlcsOf aid) scheduleJob "Calculate area blcs" uid (job start end bids) redirect (viewAreaLink' aid) return undefined
274
false
true
2
11
72
149
69
80
null
null
lrassaby/harmlang
dist/build/autogen/Paths_harmlang.hs
mit
getLibexecDir = catchIO (getEnv "harmlang_libexecdir") (\_ -> return libexecdir)
80
getLibexecDir = catchIO (getEnv "harmlang_libexecdir") (\_ -> return libexecdir)
80
getLibexecDir = catchIO (getEnv "harmlang_libexecdir") (\_ -> return libexecdir)
80
false
false
0
8
8
28
14
14
null
null
39aldo39/klfc
src/KlcParse.hs
gpl-3.0
languageNames ∷ (Parser m, MonadFail m) ⇒ m () languageNames = do ["LANGUAGENAMES"] ← readLine void $ many (some hexDigitChar *> spacing *> endLine) pure ()
168
languageNames ∷ (Parser m, MonadFail m) ⇒ m () languageNames = do ["LANGUAGENAMES"] ← readLine void $ many (some hexDigitChar *> spacing *> endLine) pure ()
168
languageNames = do ["LANGUAGENAMES"] ← readLine void $ many (some hexDigitChar *> spacing *> endLine) pure ()
121
false
true
0
13
37
79
36
43
null
null
dysinger/amazonka
amazonka-s3/gen/Network/AWS/S3/UploadPart.hs
mpl-2.0
-- | Entity tag for the uploaded object. uprETag :: Lens' UploadPartResponse (Maybe Text) uprETag = lens _uprETag (\s a -> s { _uprETag = a })
142
uprETag :: Lens' UploadPartResponse (Maybe Text) uprETag = lens _uprETag (\s a -> s { _uprETag = a })
101
uprETag = lens _uprETag (\s a -> s { _uprETag = a })
52
true
true
0
9
26
46
25
21
null
null
HIPERFIT/futhark
src/Futhark/Analysis/UsageTable.hs
isc
inResultU = Usages 2
20
inResultU = Usages 2
20
inResultU = Usages 2
20
false
false
0
5
3
9
4
5
null
null
judah/haskeline
tests/Unit.hs
bsd-3-clause
legacyEncoding :: Bool legacyEncoding = False
45
legacyEncoding :: Bool legacyEncoding = False
45
legacyEncoding = False
22
false
true
0
4
5
11
6
5
null
null
albertov/esqueleto-textsearch
src/Database/Esqueleto/TextSearch/Types.hs
mit
tShow :: Show a => a -> Text tShow = fromString . show
54
tShow :: Show a => a -> Text tShow = fromString . show
54
tShow = fromString . show
25
false
true
1
8
12
34
14
20
null
null
mfine/ghc
compiler/main/DynFlags.hs
bsd-3-clause
wayDesc WayEventLog = "RTS Event Logging"
41
wayDesc WayEventLog = "RTS Event Logging"
41
wayDesc WayEventLog = "RTS Event Logging"
41
false
false
0
4
5
10
4
6
null
null
raventid/coursera_learning
haskell/will_kurt/capstone_mark_to_html.hs
mit
book2 :: Book book2 = Book { title = "A short story of Haskell" , author = "Brant, Kyle" }
104
book2 :: Book book2 = Book { title = "A short story of Haskell" , author = "Brant, Kyle" }
104
book2 = Book { title = "A short story of Haskell" , author = "Brant, Kyle" }
90
false
true
0
6
33
25
15
10
null
null
franrogers/pam
Codec/Image/PAM.hs
bsd-3-clause
toString :: PAM -> String toString (PAM (width, height) depth maxVal tuplType raster) = "P7\n" ++ "WIDTH " ++ show width ++ "\n" ++ "HEIGHT " ++ show height ++ "\n" ++ "DEPTH " ++ show depth ++ "\n" ++ "MAXVAL " ++ show maxVal ++ "\n" ++ maybe "" (("TUPLTYPE " ++) . (++ "\n")) tupl...
872
toString :: PAM -> String toString (PAM (width, height) depth maxVal tuplType raster) = "P7\n" ++ "WIDTH " ++ show width ++ "\n" ++ "HEIGHT " ++ show height ++ "\n" ++ "DEPTH " ++ show depth ++ "\n" ++ "MAXVAL " ++ show maxVal ++ "\n" ++ maybe "" (("TUPLTYPE " ++) . (++ "\n")) tupl...
872
toString (PAM (width, height) depth maxVal tuplType raster) = "P7\n" ++ "WIDTH " ++ show width ++ "\n" ++ "HEIGHT " ++ show height ++ "\n" ++ "DEPTH " ++ show depth ++ "\n" ++ "MAXVAL " ++ show maxVal ++ "\n" ++ maybe "" (("TUPLTYPE " ++) . (++ "\n")) tuplType ++ "ENDHDR\n" ...
846
false
true
16
13
379
315
163
152
null
null
lukexi/ghc-7.8-arm64
compiler/utils/ExtsCompat46.hs
bsd-3-clause
ltAddr# :: Addr# -> Addr# -> Bool ltAddr# a b = isTrue# (a `E.ltAddr#` b)
73
ltAddr# :: Addr# -> Addr# -> Bool ltAddr# a b = isTrue# (a `E.ltAddr#` b)
73
ltAddr# a b = isTrue# (a `E.ltAddr#` b)
39
false
true
0
8
14
43
21
22
null
null
d0kt0r0/InnerEar
src/InnerEar/Exercises/HarmonicDistortion.hs
gpl-3.0
renderAnswer :: Map String AudioBuffer -> Config -> (SourceNodeSpec, Maybe Time)-> Maybe Answer -> Synth () renderAnswer _ clipDb (src,dur) (Just (Answer True)) = buildSynth $ do let env = maybe (return EmptyGraph) (unitRectEnv (Millis 1)) dur synthSource src >> clipAt (Db clipDb) >> gain (Db $ fromIntegral $ -10) ...
377
renderAnswer :: Map String AudioBuffer -> Config -> (SourceNodeSpec, Maybe Time)-> Maybe Answer -> Synth () renderAnswer _ clipDb (src,dur) (Just (Answer True)) = buildSynth $ do let env = maybe (return EmptyGraph) (unitRectEnv (Millis 1)) dur synthSource src >> clipAt (Db clipDb) >> gain (Db $ fromIntegral $ -10) ...
377
renderAnswer _ clipDb (src,dur) (Just (Answer True)) = buildSynth $ do let env = maybe (return EmptyGraph) (unitRectEnv (Millis 1)) dur synthSource src >> clipAt (Db clipDb) >> gain (Db $ fromIntegral $ -10) >> env >> destination maybeDelete (fmap (+Sec 0.2) dur)
269
false
true
0
15
64
182
88
94
null
null
gereeter/bounded-intmap
src/Data/IntMap/Bounded/Strict.hs
mit
updateMinWithKey f m = updateWithKey f (fst (findMin m)) m
58
updateMinWithKey f m = updateWithKey f (fst (findMin m)) m
58
updateMinWithKey f m = updateWithKey f (fst (findMin m)) m
58
false
false
1
9
9
35
14
21
null
null
abhean/phffp-examples
src/Cipher.hs
bsd-3-clause
cipherCaesar :: String -> Int -> String cipherCaesar s offset = map (offsettedChar offset) s
92
cipherCaesar :: String -> Int -> String cipherCaesar s offset = map (offsettedChar offset) s
92
cipherCaesar s offset = map (offsettedChar offset) s
52
false
true
0
7
14
35
17
18
null
null
sjfloat/dnngraph
NN/DSL.hs
bsd-3-clause
xavier std' = def & FP._type' ?~ s "xavier" & _std ?~ std'
58
xavier std' = def & FP._type' ?~ s "xavier" & _std ?~ std'
58
xavier std' = def & FP._type' ?~ s "xavier" & _std ?~ std'
58
false
false
3
8
12
35
14
21
null
null
egison/egison
hs-src/Language/Egison/Primitives/Types.hs
mit
-- -- Transform -- integerToFloat :: String -> PrimitiveFunc integerToFloat = rationalToFloat
93
integerToFloat :: String -> PrimitiveFunc integerToFloat = rationalToFloat
74
integerToFloat = rationalToFloat
32
true
true
0
5
11
18
11
7
null
null
Some-T/Portfolio
HASKELL/Labs/H2/H2.hsproj/H2.hs
unlicense
w = length sleep
16
w = length sleep
16
w = length sleep
16
false
false
1
5
3
13
4
9
null
null
sos22/himap
HeaderParse.hs
gpl-3.0
utext :: Parser String utext = alternatives [liftM singleton noWsCtl, liftM singleton $ charRange 33 126, liftM singleton $ charRange 128 255, obsUtext]
202
utext :: Parser String utext = alternatives [liftM singleton noWsCtl, liftM singleton $ charRange 33 126, liftM singleton $ charRange 128 255, obsUtext]
202
utext = alternatives [liftM singleton noWsCtl, liftM singleton $ charRange 33 126, liftM singleton $ charRange 128 255, obsUtext]
179
false
true
0
8
72
64
29
35
null
null
beni55/IHaskell
src/IHaskell/IPython.hs
mit
makeAbsolute :: FilePath -> IO FilePath makeAbsolute = fmap FP.normalise . absolutize where absolutize path -- avoid the call to `getCurrentDirectory` if we can | FP.isRelative path = fmap (FP.</> path) getCurrentDirectory | otherwise = return path #endif
273
makeAbsolute :: FilePath -> IO FilePath makeAbsolute = fmap FP.normalise . absolutize where absolutize path -- avoid the call to `getCurrentDirectory` if we can | FP.isRelative path = fmap (FP.</> path) getCurrentDirectory | otherwise = return path #endif
273
makeAbsolute = fmap FP.normalise . absolutize where absolutize path -- avoid the call to `getCurrentDirectory` if we can | FP.isRelative path = fmap (FP.</> path) getCurrentDirectory | otherwise = return path #endif
233
false
true
0
9
55
73
35
38
null
null
olsner/ghc
compiler/nativeGen/RegAlloc/Linear/Main.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- Linear sweep to allocate registers -- | Do register allocation on some basic blocks. -- But be careful to allocate a block in an SCC only if it has -- an entry in the block map or it is the first block. -- linearRegAlloc :...
1,670
linearRegAlloc :: (Outputable instr, Instruction instr) => DynFlags -> [BlockId] -- ^ entry points -> BlockMap RegSet -- ^ live regs on entry to each basic block -> [SCC (LiveBasicBlock instr)] -- ^ instructions annotated with "deaths" -> UniqS...
1,373
linearRegAlloc dflags entry_ids block_live sccs = case platformArch platform of ArchX86 -> go $ (frInitFreeRegs platform :: X86.FreeRegs) ArchX86_64 -> go $ (frInitFreeRegs platform :: X86_64.FreeRegs) ArchSPARC -> go $ (frInitFreeRegs platform :: SPARC.FreeRegs) ArchSPARC64 ...
1,007
true
true
0
13
413
320
162
158
null
null
gianlucagiorgolo/glue-xle
DataStructures.hs
mit
into :: SigmaZipper -> Feature -> SigmaZipper into sz@(Top s_struct) feat | Map.member feat (contents s_struct) = Into [feat] [identifier s_struct] [Map.delete feat (contents s_struct)] ((contents s_struct) Map.! feat) | otherwise = sz
263
into :: SigmaZipper -> Feature -> SigmaZipper into sz@(Top s_struct) feat | Map.member feat (contents s_struct) = Into [feat] [identifier s_struct] [Map.delete feat (contents s_struct)] ((contents s_struct) Map.! feat) | otherwise = sz
263
into sz@(Top s_struct) feat | Map.member feat (contents s_struct) = Into [feat] [identifier s_struct] [Map.delete feat (contents s_struct)] ((contents s_struct) Map.! feat) | otherwise = sz
217
false
true
7
9
60
106
54
52
null
null
dmagyar/scurry
src/Scurry/Util.hs
bsd-3-clause
enumAllInMask :: ScurryMask -> ScurryAddress -> [ScurryAddress] enumAllInMask mask net = let l = networkLowAddress mask net h = networkHighAddress mask net in eh l h where eh l' h' = if l' == h' then h' : [] else l...
353
enumAllInMask :: ScurryMask -> ScurryAddress -> [ScurryAddress] enumAllInMask mask net = let l = networkLowAddress mask net h = networkHighAddress mask net in eh l h where eh l' h' = if l' == h' then h' : [] else l...
353
enumAllInMask mask net = let l = networkLowAddress mask net h = networkHighAddress mask net in eh l h where eh l' h' = if l' == h' then h' : [] else l' : (eh (incrementAddress l') h')
289
false
true
0
10
151
106
53
53
null
null
sulami/hGM
Handler/Premium.hs
bsd-3-clause
purchasePremium :: UserId -> TokenId -> Int -> Int -> Handler Html purchasePremium uid token time price = do let secKey = stripeSecretKey result <- liftIO $ stripe secKey $ chargeCardByToken token USD price Nothing case result of Left stripeError -> error $ show stripeError Right _ -> do ...
532
purchasePremium :: UserId -> TokenId -> Int -> Int -> Handler Html purchasePremium uid token time price = do let secKey = stripeSecretKey result <- liftIO $ stripe secKey $ chargeCardByToken token USD price Nothing case result of Left stripeError -> error $ show stripeError Right _ -> do ...
532
purchasePremium uid token time price = do let secKey = stripeSecretKey result <- liftIO $ stripe secKey $ chargeCardByToken token USD price Nothing case result of Left stripeError -> error $ show stripeError Right _ -> do addPremium uid (toInteger $ time * 30) setMessage . toHtml ...
465
false
true
0
15
136
159
73
86
null
null
ryzhyk/cocoon
cocoon/Parse.hs
apache-2.0
refine = withPos $ mkRefine <$ reserved "refine" <*> (commaSep identifier) <*> (braces $ many decl)
157
refine = withPos $ mkRefine <$ reserved "refine" <*> (commaSep identifier) <*> (braces $ many decl)
157
refine = withPos $ mkRefine <$ reserved "refine" <*> (commaSep identifier) <*> (braces $ many decl)
157
false
false
3
9
73
46
20
26
null
null
kojiromike/Idris-dev
src/Idris/Output.hs
bsd-3-clause
iputStrLn :: String -> Idris () iputStrLn s = do i <- getIState case idris_outputmode i of RawOutput h -> runIO $ hPutStrLn h s IdeMode n h -> runIO . hPutStrLn h $ convSExp "write-string" s n
248
iputStrLn :: String -> Idris () iputStrLn s = do i <- getIState case idris_outputmode i of RawOutput h -> runIO $ hPutStrLn h s IdeMode n h -> runIO . hPutStrLn h $ convSExp "write-string" s n
248
iputStrLn s = do i <- getIState case idris_outputmode i of RawOutput h -> runIO $ hPutStrLn h s IdeMode n h -> runIO . hPutStrLn h $ convSExp "write-string" s n
216
false
true
0
12
93
87
39
48
null
null
chocoluffy/courseography
hs/Css/Draw.hs
gpl-3.0
inputCSS :: Css inputCSS = "input" ? do fontSize (px 16) border solid (px 2) "#DCDCDC" roundCorners margin (px 5) (px 0) (px 5) (px 5) padding0 ":focus" & do {-border solid (px 2) "#FFD700"-} "box-shadow" -: "0 0 3px 1px #FFD700" {- Style for simple buttons. -}
302
inputCSS :: Css inputCSS = "input" ? do fontSize (px 16) border solid (px 2) "#DCDCDC" roundCorners margin (px 5) (px 0) (px 5) (px 5) padding0 ":focus" & do {-border solid (px 2) "#FFD700"-} "box-shadow" -: "0 0 3px 1px #FFD700" {- Style for simple buttons. -}
302
inputCSS = "input" ? do fontSize (px 16) border solid (px 2) "#DCDCDC" roundCorners margin (px 5) (px 0) (px 5) (px 5) padding0 ":focus" & do {-border solid (px 2) "#FFD700"-} "box-shadow" -: "0 0 3px 1px #FFD700" {- Style for simple buttons. -}
286
false
true
2
11
88
109
48
61
null
null
Jim-Holmstroem/csv-stream-plot
src/Expression.hs
bsd-3-clause
x1 = component 1
16
x1 = component 1
16
x1 = component 1
16
false
false
1
5
3
13
4
9
null
null
nominolo/haddock2
examples/hide-bug/A.hs
bsd-2-clause
f :: T; f = MkT
15
f :: T f = MkT
14
f = MkT
7
false
true
3
5
5
21
7
14
null
null
ivan-m/testbench
src/TestBench.hs
mit
runTestBenchDepth :: Depth -> TestBench -> IO [OpTree] runTestBenchDepth d = execWriterT . (`runReaderT` d) . getOpTrees
120
runTestBenchDepth :: Depth -> TestBench -> IO [OpTree] runTestBenchDepth d = execWriterT . (`runReaderT` d) . getOpTrees
120
runTestBenchDepth d = execWriterT . (`runReaderT` d) . getOpTrees
65
false
true
0
9
16
47
24
23
null
null
Stratege/NBody-Simulation
physics.hs
mit
num x = (x *~ one)
18
num x = (x *~ one)
18
num x = (x *~ one)
18
false
false
1
7
5
20
8
12
null
null
kazu-yamamoto/io-choice
test/IOChoiceSpec.hs
bsd-3-clause
spec :: Spec spec = describe "||>" $ do it "selects IO" $ do good ||> bad `shouldReturn` "good" bad ||> good `shouldReturn` "good" it "throws an error if all choices fail" $ do bad ||> bad `shouldThrow` isUserError it "can be used with goNext" $ do goNext ||> good `shouldRetu...
447
spec :: Spec spec = describe "||>" $ do it "selects IO" $ do good ||> bad `shouldReturn` "good" bad ||> good `shouldReturn` "good" it "throws an error if all choices fail" $ do bad ||> bad `shouldThrow` isUserError it "can be used with goNext" $ do goNext ||> good `shouldRetu...
447
spec = describe "||>" $ do it "selects IO" $ do good ||> bad `shouldReturn` "good" bad ||> good `shouldReturn` "good" it "throws an error if all choices fail" $ do bad ||> bad `shouldThrow` isUserError it "can be used with goNext" $ do goNext ||> good `shouldReturn` "good" ...
434
false
true
0
16
122
127
61
66
null
null
rueshyna/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | Creates a value of 'CommentThread' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ctEtag' -- -- * 'ctSnippet' -- -- * 'ctKind' -- -- * 'ctReplies' -- -- * 'ctId' commentThread :: CommentThread commentThread = CommentThre...
469
commentThread :: CommentThread commentThread = CommentThread' { _ctEtag = Nothing , _ctSnippet = Nothing , _ctKind = "youtube#commentThread" , _ctReplies = Nothing , _ctId = Nothing }
215
commentThread = CommentThread' { _ctEtag = Nothing , _ctSnippet = Nothing , _ctKind = "youtube#commentThread" , _ctReplies = Nothing , _ctId = Nothing }
180
true
true
0
6
108
56
40
16
null
null
silky/ImplicitCAD
Graphics/Implicit/ExtOpenScad/Util/OVal.hs
gpl-2.0
oTypeStr (ONum _ ) = "Number"
32
oTypeStr (ONum _ ) = "Number"
32
oTypeStr (ONum _ ) = "Number"
32
false
false
0
6
8
16
7
9
null
null
ecaustin/haskhol-math
src/HaskHOL/Lib/Pair.hs
bsd-2-clause
ruleGABS :: (PairCtxt thry, HOLThmRep thm cls thry) => thm -> HOL cls thry HOLThm ruleGABS = ruleMATCH_MP ruleGABS_pth where ruleGABS_pth :: PairCtxt thry => HOL cls thry HOLThm ruleGABS_pth = cacheProof "ruleGABS_pth" ctxtPair . prove [txt| (?) P ==> P (GABS P) |] $ tacSIM...
348
ruleGABS :: (PairCtxt thry, HOLThmRep thm cls thry) => thm -> HOL cls thry HOLThm ruleGABS = ruleMATCH_MP ruleGABS_pth where ruleGABS_pth :: PairCtxt thry => HOL cls thry HOLThm ruleGABS_pth = cacheProof "ruleGABS_pth" ctxtPair . prove [txt| (?) P ==> P (GABS P) |] $ tacSIM...
348
ruleGABS = ruleMATCH_MP ruleGABS_pth where ruleGABS_pth :: PairCtxt thry => HOL cls thry HOLThm ruleGABS_pth = cacheProof "ruleGABS_pth" ctxtPair . prove [txt| (?) P ==> P (GABS P) |] $ tacSIMP [defGABS, axSELECT, axETA]
256
false
true
2
7
94
102
53
49
null
null
zachsully/redo
dist/build/autogen/Paths_redo.hs
bsd-3-clause
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch
84
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch
84
catchIO = Exception.catch
25
false
true
0
9
14
39
19
20
null
null
ethercrow/yi
yi-core/src/Yi/Editor.hs
gpl-2.0
closeBufferAndWindowE :: EditorM () closeBufferAndWindowE = do -- Fetch the current buffer *before* closing the window. -- The tryCloseE, since it uses tabsA, will have the -- current buffer "fixed" to the buffer of the window that is -- brought into focus. If the current buffer is accessed after the -- tryCl...
517
closeBufferAndWindowE :: EditorM () closeBufferAndWindowE = do -- Fetch the current buffer *before* closing the window. -- The tryCloseE, since it uses tabsA, will have the -- current buffer "fixed" to the buffer of the window that is -- brought into focus. If the current buffer is accessed after the -- tryCl...
517
closeBufferAndWindowE = do -- Fetch the current buffer *before* closing the window. -- The tryCloseE, since it uses tabsA, will have the -- current buffer "fixed" to the buffer of the window that is -- brought into focus. If the current buffer is accessed after the -- tryCloseE then the current buffer may not...
481
false
true
0
8
104
42
22
20
null
null
Hara-Laboratory/subleq-mips
TestRFix2.hs
gpl-3.0
outputCsv :: CSV.ToRecord a => FilePath -> [BL.ByteString] -> [a] -> IO () outputCsv path header f = BL.writeFile path $ BL.concat [BL.intercalate "," header, "\n", CSV.encode f]
178
outputCsv :: CSV.ToRecord a => FilePath -> [BL.ByteString] -> [a] -> IO () outputCsv path header f = BL.writeFile path $ BL.concat [BL.intercalate "," header, "\n", CSV.encode f]
178
outputCsv path header f = BL.writeFile path $ BL.concat [BL.intercalate "," header, "\n", CSV.encode f]
103
false
true
0
10
27
92
44
48
null
null
whitehead1415/cql
src/Database/CQL/Protocol/Codec.hs
mpl-2.0
putNative (CqlInet x) = case x of IPv4 i -> putWord32le (toHostAddress i) IPv6 i -> do let (a, b, c, d) = toHostAddress6 i putWord32host a putWord32host b putWord32host c putWord32host d
239
putNative (CqlInet x) = case x of IPv4 i -> putWord32le (toHostAddress i) IPv6 i -> do let (a, b, c, d) = toHostAddress6 i putWord32host a putWord32host b putWord32host c putWord32host d
239
putNative (CqlInet x) = case x of IPv4 i -> putWord32le (toHostAddress i) IPv6 i -> do let (a, b, c, d) = toHostAddress6 i putWord32host a putWord32host b putWord32host c putWord32host d
239
false
false
0
13
85
96
42
54
null
null
jkarni/aeson
Data/Aeson/Types/Instances.hs
bsd-3-clause
-- | @withArray expected f value@ applies @f@ to the 'Array' when @value@ is an @Array@ -- and fails using @'typeMismatch' expected@ otherwise. withArray :: String -> (Array -> Parser a) -> Value -> Parser a withArray _ f (Array arr) = f arr
250
withArray :: String -> (Array -> Parser a) -> Value -> Parser a withArray _ f (Array arr) = f arr
104
withArray _ f (Array arr) = f arr
40
true
true
0
11
52
58
28
30
null
null
jstolarek/haddock
haddock-api/src/Haddock/Utils.hs
bsd-2-clause
markup m (DocHyperlink l) = markupHyperlink m l
58
markup m (DocHyperlink l) = markupHyperlink m l
58
markup m (DocHyperlink l) = markupHyperlink m l
58
false
false
0
7
18
22
10
12
null
null
olsner/ghc
compiler/nativeGen/RegAlloc/Liveness.hs
bsd-3-clause
liveness1 platform liveregs blockmap (LiveInstr instr _) | not_a_branch = (liveregs1, LiveInstr instr (Just $ Liveness { liveBorn = emptyUniqSet , liveDieRead = mkUniqSet r_dying , liveDieWrite = mkU...
2,294
liveness1 platform liveregs blockmap (LiveInstr instr _) | not_a_branch = (liveregs1, LiveInstr instr (Just $ Liveness { liveBorn = emptyUniqSet , liveDieRead = mkUniqSet r_dying , liveDieWrite = mkU...
2,294
liveness1 platform liveregs blockmap (LiveInstr instr _) | not_a_branch = (liveregs1, LiveInstr instr (Just $ Liveness { liveBorn = emptyUniqSet , liveDieRead = mkUniqSet r_dying , liveDieWrite = mkU...
2,294
false
false
9
13
972
349
188
161
null
null
kojiromike/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
process fn (MakeLemma updatefile l n) = makeLemma fn updatefile l n
71
process fn (MakeLemma updatefile l n) = makeLemma fn updatefile l n
71
process fn (MakeLemma updatefile l n) = makeLemma fn updatefile l n
71
false
false
0
7
15
30
14
16
null
null