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
zoranbosnjak/longrun
test/InMemoryLogger.hs
gpl-3.0
inMemoryLogger :: IO InMemoryLogger inMemoryLogger = do entries <- newMVar [] return $ InMemoryLogger entries
117
inMemoryLogger :: IO InMemoryLogger inMemoryLogger = do entries <- newMVar [] return $ InMemoryLogger entries
117
inMemoryLogger = do entries <- newMVar [] return $ InMemoryLogger entries
81
false
true
0
9
22
36
16
20
null
null
fmapfmapfmap/amazonka
amazonka-dynamodb/gen/Network/AWS/DynamoDB/UpdateItem.hs
mpl-2.0
-- | One or more substitution tokens for attribute names in an expression. -- The following are some use cases for using /ExpressionAttributeNames/: -- -- - To access an attribute whose name conflicts with a DynamoDB reserved -- word. -- -- - To create a placeholder for repeating occurrences of an attribute -- name in an expression. -- -- - To prevent special characters in an attribute name from being -- misinterpreted in an expression. -- -- Use the __#__ character in an expression to dereference an attribute -- name. For example, consider the following attribute name: -- -- - 'Percentile' -- -- The name of this attribute conflicts with a reserved word, so it cannot -- be used directly in an expression. (For the complete list of reserved -- words, see -- <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html Reserved Words> -- in the /Amazon DynamoDB Developer Guide/). To work around this, you -- could specify the following for /ExpressionAttributeNames/: -- -- - '{\"#P\":\"Percentile\"}' -- -- You could then use this substitution in an expression, as in this -- example: -- -- - '#P = :val' -- -- Tokens that begin with the __:__ character are /expression attribute -- values/, which are placeholders for the actual value at runtime. -- -- For more information on expression attribute names, see -- <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html Accessing Item Attributes> -- in the /Amazon DynamoDB Developer Guide/. uiExpressionAttributeNames :: Lens' UpdateItem (HashMap Text Text) uiExpressionAttributeNames = lens _uiExpressionAttributeNames (\ s a -> s{_uiExpressionAttributeNames = a}) . _Default . _Map
1,740
uiExpressionAttributeNames :: Lens' UpdateItem (HashMap Text Text) uiExpressionAttributeNames = lens _uiExpressionAttributeNames (\ s a -> s{_uiExpressionAttributeNames = a}) . _Default . _Map
192
uiExpressionAttributeNames = lens _uiExpressionAttributeNames (\ s a -> s{_uiExpressionAttributeNames = a}) . _Default . _Map
125
true
true
0
11
271
92
66
26
null
null
svenssonjoel/ArrowObsidian
Obsidian/ArrowObsidian/Printing.hs
bsd-3-clause
pprint (Op2 Max a b) = "max (" ++ a' ++ "," ++ b' ++ ")" where a' = pprint a b' = pprint b
111
pprint (Op2 Max a b) = "max (" ++ a' ++ "," ++ b' ++ ")" where a' = pprint a b' = pprint b
111
pprint (Op2 Max a b) = "max (" ++ a' ++ "," ++ b' ++ ")" where a' = pprint a b' = pprint b
111
false
false
0
8
45
53
26
27
null
null
ksaveljev/hake-2
src/Game/Monsters/MInfantry.hs
bsd-3-clause
frameStand01 :: Int frameStand01 = 1
36
frameStand01 :: Int frameStand01 = 1
36
frameStand01 = 1
16
false
true
0
4
5
11
6
5
null
null
lukemaurer/sequent-core
examples/SpecConstrExpl.hs
bsd-3-clause
satisfy, falsify :: Prop -> Env -> (Env -> Bool) -> Bool satisfy (Var x) env k = case Map.lookup x env of Just True -> k env Just False -> False Nothing -> k (Map.insert x True env)
202
satisfy, falsify :: Prop -> Env -> (Env -> Bool) -> Bool satisfy (Var x) env k = case Map.lookup x env of Just True -> k env Just False -> False Nothing -> k (Map.insert x True env)
201
satisfy (Var x) env k = case Map.lookup x env of Just True -> k env Just False -> False Nothing -> k (Map.insert x True env)
144
false
true
0
11
59
98
48
50
null
null
simonmichael/shelltestrunner
src/Preprocessor.hs
gpl-3.0
replace sub rep str = let compareLen = length sub subtoken = take compareLen str afterSubtoken = drop compareLen str (s:xs) = str in case sub == subtoken of False -> s:(replace sub rep xs) True -> rep ++(replace sub rep afterSubtoken) {- macros -> replacement -> input -}
421
replace sub rep str = let compareLen = length sub subtoken = take compareLen str afterSubtoken = drop compareLen str (s:xs) = str in case sub == subtoken of False -> s:(replace sub rep xs) True -> rep ++(replace sub rep afterSubtoken) {- macros -> replacement -> input -}
421
replace sub rep str = let compareLen = length sub subtoken = take compareLen str afterSubtoken = drop compareLen str (s:xs) = str in case sub == subtoken of False -> s:(replace sub rep xs) True -> rep ++(replace sub rep afterSubtoken) {- macros -> replacement -> input -}
421
false
false
0
12
198
109
54
55
null
null
begriffs/haskell-vim-now
scripts/setup_haskell.hs
mit
stackResolverPattern :: Turtle.Pattern Text stackResolverPattern = Turtle.prefix (Turtle.skip "resolver:" *> Turtle.skip Turtle.spaces *> Turtle.plus Turtle.dot)
166
stackResolverPattern :: Turtle.Pattern Text stackResolverPattern = Turtle.prefix (Turtle.skip "resolver:" *> Turtle.skip Turtle.spaces *> Turtle.plus Turtle.dot)
166
stackResolverPattern = Turtle.prefix (Turtle.skip "resolver:" *> Turtle.skip Turtle.spaces *> Turtle.plus Turtle.dot)
122
false
true
0
9
19
51
24
27
null
null
lambdageek/insomnia
src/Insomnia/Typecheck/ExtendModuleCtx.hs
bsd-3-clause
extendToplevelDeclCtx tr (ModuleTS fld bnd) kont = U.lunbind bnd $ \((_modIdent, U.unembed -> mtnf), rest) -> extendModuleCtxNF (ProjP (TopRefP tr) fld) mtnf . extendToplevelDeclCtx tr rest $ kont
204
extendToplevelDeclCtx tr (ModuleTS fld bnd) kont = U.lunbind bnd $ \((_modIdent, U.unembed -> mtnf), rest) -> extendModuleCtxNF (ProjP (TopRefP tr) fld) mtnf . extendToplevelDeclCtx tr rest $ kont
204
extendToplevelDeclCtx tr (ModuleTS fld bnd) kont = U.lunbind bnd $ \((_modIdent, U.unembed -> mtnf), rest) -> extendModuleCtxNF (ProjP (TopRefP tr) fld) mtnf . extendToplevelDeclCtx tr rest $ kont
204
false
false
3
11
35
88
43
45
null
null
dmvianna/haskellbook
src/Ch26-Morra.hs
unlicense
p2p :: Name -> IO (Command PersonGuess) p2p p = do putStr $ p ++ ": " input <- getChar _ <- getChar replicateM_ 12 $ putStrLn "\n" -- poor man's blank screen return $ parseInput input
193
p2p :: Name -> IO (Command PersonGuess) p2p p = do putStr $ p ++ ": " input <- getChar _ <- getChar replicateM_ 12 $ putStrLn "\n" -- poor man's blank screen return $ parseInput input
193
p2p p = do putStr $ p ++ ": " input <- getChar _ <- getChar replicateM_ 12 $ putStrLn "\n" -- poor man's blank screen return $ parseInput input
153
false
true
0
9
46
81
35
46
null
null
rethab/tagger
test/TestTagCompleter.hs
bsd-3-clause
tests = [ testCase "completeTrack" completeTrack , testCase "completeAlbum" completeAlbum , testCase "completeAll" completeAll , testCase "callService" callService , testCase "parseAlbum" parseAlbum , testCase "parseDate" test_parse_date , testProperty "uppercase" prop_first_upper , testProperty "preserve_tail" prop_preserve_tail , testProperty "zip_tracks_preserve_location" prop_tracks_preserve_location , testProperty "zip_tracks_preserve_file" prop_tracks_preserve_file , testProperty "zip_tracks_prefer_first" prop_tracks_prefer_first , testProperty "zip_albums_prefer_first" prop_albs_prefer_first , testProperty "zip_albums_zip_tracks" prop_albs_zip_tracks ]
771
tests = [ testCase "completeTrack" completeTrack , testCase "completeAlbum" completeAlbum , testCase "completeAll" completeAll , testCase "callService" callService , testCase "parseAlbum" parseAlbum , testCase "parseDate" test_parse_date , testProperty "uppercase" prop_first_upper , testProperty "preserve_tail" prop_preserve_tail , testProperty "zip_tracks_preserve_location" prop_tracks_preserve_location , testProperty "zip_tracks_preserve_file" prop_tracks_preserve_file , testProperty "zip_tracks_prefer_first" prop_tracks_prefer_first , testProperty "zip_albums_prefer_first" prop_albs_prefer_first , testProperty "zip_albums_zip_tracks" prop_albs_zip_tracks ]
771
tests = [ testCase "completeTrack" completeTrack , testCase "completeAlbum" completeAlbum , testCase "completeAll" completeAll , testCase "callService" callService , testCase "parseAlbum" parseAlbum , testCase "parseDate" test_parse_date , testProperty "uppercase" prop_first_upper , testProperty "preserve_tail" prop_preserve_tail , testProperty "zip_tracks_preserve_location" prop_tracks_preserve_location , testProperty "zip_tracks_preserve_file" prop_tracks_preserve_file , testProperty "zip_tracks_prefer_first" prop_tracks_prefer_first , testProperty "zip_albums_prefer_first" prop_albs_prefer_first , testProperty "zip_albums_zip_tracks" prop_albs_zip_tracks ]
771
false
false
1
7
158
114
55
59
null
null
tonymorris/ircbrowse
src/Ircbrowse/Types/Import.hs
bsd-3-clause
showChanInt HLedger = 11
24
showChanInt HLedger = 11
24
showChanInt HLedger = 11
24
false
false
0
5
3
9
4
5
null
null
ryantm/ghc
testsuite/tests/programs/maessen-hashtab/HashTest.hs
bsd-3-clause
{- For "fromList" and "toList" properties we're a bit sloppy: we perform multiple insertions for a key (potentially) but give nor promises about which one we will retrieve with lookup, or what order they'll be returned by toList (or if they'll all be returned at all). Thus we insert all occurrences of a key with the same value, and do all checking via lookups. -} prop_fromList :: HashFun -> List Int -> List Int -> Property prop_fromList hf (L l) (L ks) = null l `trivial` let assocs = map (\t -> (t,t)) l in ( do ht <- fromList (unHF hf) assocs lookups ht ks) ==. (map (`Prelude.lookup` assocs) ks)
619
prop_fromList :: HashFun -> List Int -> List Int -> Property prop_fromList hf (L l) (L ks) = null l `trivial` let assocs = map (\t -> (t,t)) l in ( do ht <- fromList (unHF hf) assocs lookups ht ks) ==. (map (`Prelude.lookup` assocs) ks)
249
prop_fromList hf (L l) (L ks) = null l `trivial` let assocs = map (\t -> (t,t)) l in ( do ht <- fromList (unHF hf) assocs lookups ht ks) ==. (map (`Prelude.lookup` assocs) ks)
188
true
true
0
15
127
137
70
67
null
null
Happstack/happstack-server
src/Happstack/Server/RqData.hs
bsd-3-clause
look :: (Functor m, Monad m, HasRqData m) => String -> m String look = fmap LU.toString . lookBS
96
look :: (Functor m, Monad m, HasRqData m) => String -> m String look = fmap LU.toString . lookBS
96
look = fmap LU.toString . lookBS
32
false
true
0
7
18
48
24
24
null
null
kazu-yamamoto/http-types
Network/HTTP/Types/Status.hs
bsd-3-clause
-- | Bad Request 400 status400 :: Status status400 = mkStatus 400 "Bad Request"
79
status400 :: Status status400 = mkStatus 400 "Bad Request"
58
status400 = mkStatus 400 "Bad Request"
38
true
true
0
6
13
25
10
15
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Text/Greek/NewTestament/SBL.hs
mit
osisText :: Traversal' Document Element osisText = root . elo "osis" ./ elo "osisText"
86
osisText :: Traversal' Document Element osisText = root . elo "osis" ./ elo "osisText"
86
osisText = root . elo "osis" ./ elo "osisText"
46
false
true
0
7
13
30
14
16
null
null
cleichner/gitit
src/Network/Gitit/Feed.hs
gpl-2.0
getDiff fs _ to (Added fp) = do contents <- retrieve fs fp to return [Second $ lines contents]
98
getDiff fs _ to (Added fp) = do contents <- retrieve fs fp to return [Second $ lines contents]
98
getDiff fs _ to (Added fp) = do contents <- retrieve fs fp to return [Second $ lines contents]
98
false
false
1
11
22
56
23
33
null
null
TomHammersley/HaskellRenderer
app/src/ShadowCache.hs
gpl-2.0
setCache (ShadowCache value0 value1 value2 value3 _ value5) 4 value = ShadowCache value0 value1 value2 value3 value value5
122
setCache (ShadowCache value0 value1 value2 value3 _ value5) 4 value = ShadowCache value0 value1 value2 value3 value value5
122
setCache (ShadowCache value0 value1 value2 value3 _ value5) 4 value = ShadowCache value0 value1 value2 value3 value value5
122
false
false
1
7
17
44
20
24
null
null
phischu/fragnix
builtins/integer-gmp/GHC.Integer.Type.hs
bsd-3-clause
complementInteger (Jn# bn) = Jp# (minusBigNatWord bn 1##)
57
complementInteger (Jn# bn) = Jp# (minusBigNatWord bn 1##)
57
complementInteger (Jn# bn) = Jp# (minusBigNatWord bn 1##)
57
false
false
0
7
7
26
12
14
null
null
ocramz/monad-bayes
test/TestConditional.hs
mit
discreteWeights :: Fractional a => [a] discreteWeights = [0.0001, 0.9999]
73
discreteWeights :: Fractional a => [a] discreteWeights = [0.0001, 0.9999]
73
discreteWeights = [0.0001, 0.9999]
34
false
true
0
8
9
34
16
18
null
null
ksaveljev/hake-2
src/Client/CL.hs
bsd-3-clause
pauseF :: XCommandT pauseF = XCommandT "CL.pauseF" (do maxClientsValue <- CVar.variableValue "maxclients" state <- use $ globals.gServerState if maxClientsValue > 1 || state == 0 then CVar.setValueI "paused" 0 else do pausedValue <- liftM (^.cvValue) clPausedCVar CVar.setValueF "paused" pausedValue )
354
pauseF :: XCommandT pauseF = XCommandT "CL.pauseF" (do maxClientsValue <- CVar.variableValue "maxclients" state <- use $ globals.gServerState if maxClientsValue > 1 || state == 0 then CVar.setValueI "paused" 0 else do pausedValue <- liftM (^.cvValue) clPausedCVar CVar.setValueF "paused" pausedValue )
354
pauseF = XCommandT "CL.pauseF" (do maxClientsValue <- CVar.variableValue "maxclients" state <- use $ globals.gServerState if maxClientsValue > 1 || state == 0 then CVar.setValueI "paused" 0 else do pausedValue <- liftM (^.cvValue) clPausedCVar CVar.setValueF "paused" pausedValue )
334
false
true
0
14
92
107
49
58
null
null
mit-plv/riscv-semantics
src/Spec/ExecuteF.hs
bsd-3-clause
runFPUnary :: (RiscvMachine p t) => (RoundingMode -> Word32 -> F32Result) -> RoundingMode -> Int32 -> p Int32 runFPUnary f roundMode x = do let Result y flags = f roundMode (fromIntegral x) updateFFlags flags if (invalid flags) then return canonicalNaN else return (fromIntegral y)
297
runFPUnary :: (RiscvMachine p t) => (RoundingMode -> Word32 -> F32Result) -> RoundingMode -> Int32 -> p Int32 runFPUnary f roundMode x = do let Result y flags = f roundMode (fromIntegral x) updateFFlags flags if (invalid flags) then return canonicalNaN else return (fromIntegral y)
297
runFPUnary f roundMode x = do let Result y flags = f roundMode (fromIntegral x) updateFFlags flags if (invalid flags) then return canonicalNaN else return (fromIntegral y)
187
false
true
0
13
60
121
56
65
null
null
hasufell/hsfm
src/HSFM/GUI/Gtk/Dialogs.hs
gpl-2.0
fileCollisionDialog :: ByteString -> IO (Maybe FCollisonMode) fileCollisionDialog t = do chooserDialog <- messageDialogNew Nothing [DialogDestroyWithParent] MessageQuestion ButtonsNone (fromString "Target \"" `BS.append` t `BS.append` fromString "\" exists, how to proceed?") _ <- dialogAddButton chooserDialog "Cancel" (ResponseUser 0) _ <- dialogAddButton chooserDialog "Overwrite" (ResponseUser 1) _ <- dialogAddButton chooserDialog "Overwrite all" (ResponseUser 2) _ <- dialogAddButton chooserDialog "Skip" (ResponseUser 3) _ <- dialogAddButton chooserDialog "Rename" (ResponseUser 4) rID <- dialogRun chooserDialog widgetDestroy chooserDialog case rID of ResponseUser 0 -> return Nothing ResponseUser 1 -> return (Just Overwrite) ResponseUser 2 -> return (Just OverwriteAll) ResponseUser 3 -> return (Just Skip) ResponseUser 4 -> do mfn <- textInputDialog (fromString "Enter new name") (takeFileName t) forM mfn $ \fn -> do pfn <- P.parseRel (fromString fn) return $ Rename pfn _ -> throwIO UnknownDialogButton
1,345
fileCollisionDialog :: ByteString -> IO (Maybe FCollisonMode) fileCollisionDialog t = do chooserDialog <- messageDialogNew Nothing [DialogDestroyWithParent] MessageQuestion ButtonsNone (fromString "Target \"" `BS.append` t `BS.append` fromString "\" exists, how to proceed?") _ <- dialogAddButton chooserDialog "Cancel" (ResponseUser 0) _ <- dialogAddButton chooserDialog "Overwrite" (ResponseUser 1) _ <- dialogAddButton chooserDialog "Overwrite all" (ResponseUser 2) _ <- dialogAddButton chooserDialog "Skip" (ResponseUser 3) _ <- dialogAddButton chooserDialog "Rename" (ResponseUser 4) rID <- dialogRun chooserDialog widgetDestroy chooserDialog case rID of ResponseUser 0 -> return Nothing ResponseUser 1 -> return (Just Overwrite) ResponseUser 2 -> return (Just OverwriteAll) ResponseUser 3 -> return (Just Skip) ResponseUser 4 -> do mfn <- textInputDialog (fromString "Enter new name") (takeFileName t) forM mfn $ \fn -> do pfn <- P.parseRel (fromString fn) return $ Rename pfn _ -> throwIO UnknownDialogButton
1,345
fileCollisionDialog t = do chooserDialog <- messageDialogNew Nothing [DialogDestroyWithParent] MessageQuestion ButtonsNone (fromString "Target \"" `BS.append` t `BS.append` fromString "\" exists, how to proceed?") _ <- dialogAddButton chooserDialog "Cancel" (ResponseUser 0) _ <- dialogAddButton chooserDialog "Overwrite" (ResponseUser 1) _ <- dialogAddButton chooserDialog "Overwrite all" (ResponseUser 2) _ <- dialogAddButton chooserDialog "Skip" (ResponseUser 3) _ <- dialogAddButton chooserDialog "Rename" (ResponseUser 4) rID <- dialogRun chooserDialog widgetDestroy chooserDialog case rID of ResponseUser 0 -> return Nothing ResponseUser 1 -> return (Just Overwrite) ResponseUser 2 -> return (Just OverwriteAll) ResponseUser 3 -> return (Just Skip) ResponseUser 4 -> do mfn <- textInputDialog (fromString "Enter new name") (takeFileName t) forM mfn $ \fn -> do pfn <- P.parseRel (fromString fn) return $ Rename pfn _ -> throwIO UnknownDialogButton
1,283
false
true
0
20
459
352
159
193
null
null
ibabushkin/morgue
src/Data/Morgue/Options.hs
bsd-3-clause
handleNestedErrors :: (Exception e1, Exception e2) => Either e1 (Either e2 b) -> IO b handleNestedErrors (Left e) = TIO.hPutStrLn stderr (pack $ displayException e) >> exitFailure
221
handleNestedErrors :: (Exception e1, Exception e2) => Either e1 (Either e2 b) -> IO b handleNestedErrors (Left e) = TIO.hPutStrLn stderr (pack $ displayException e) >> exitFailure
221
handleNestedErrors (Left e) = TIO.hPutStrLn stderr (pack $ displayException e) >> exitFailure
97
false
true
0
9
68
76
37
39
null
null
YoEight/spellcheck
lib/Data/Spellcheck/HolbrookCorpus.hs
mit
parseError :: Parser SentenceToken parseError = do word <- "<ERR targ=" .*> takeWhile1 (/= '>') char '>' err <- takeWhile1 (/= '<') string "</ERR>" `mplus` fail "Not ended by </ERR>" let dat = datum word (Just err) return $ SDatum dat
259
parseError :: Parser SentenceToken parseError = do word <- "<ERR targ=" .*> takeWhile1 (/= '>') char '>' err <- takeWhile1 (/= '<') string "</ERR>" `mplus` fail "Not ended by </ERR>" let dat = datum word (Just err) return $ SDatum dat
259
parseError = do word <- "<ERR targ=" .*> takeWhile1 (/= '>') char '>' err <- takeWhile1 (/= '<') string "</ERR>" `mplus` fail "Not ended by </ERR>" let dat = datum word (Just err) return $ SDatum dat
224
false
true
0
12
65
97
45
52
null
null
uduki/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qCast_QProgressBar :: Object a -> IO (QProgressBar ()) qCast_QProgressBar _qobj = return (objectCast _qobj)
109
qCast_QProgressBar :: Object a -> IO (QProgressBar ()) qCast_QProgressBar _qobj = return (objectCast _qobj)
109
qCast_QProgressBar _qobj = return (objectCast _qobj)
54
false
true
0
10
15
46
20
26
null
null
brodyberg/Notes
ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/Matching.hs
mit
-- isItTwo :: Integer -> Bool -- isItTwo 2 = True -- isItTwo _ = False -- warning: [-Woverlapping-patterns] -- isItTwo :: Integer -> Bool -- isItTwo _ = False -- isItTwo 2 = True -- warning: [-Wincomplete-patterns] -- isItTwo 3 -- *** Exception: Non-exhaustive patterns in function isItTwo isItTwo :: Integer -> Bool isItTwo 2 = True
337
isItTwo :: Integer -> Bool isItTwo 2 = True
43
isItTwo 2 = True
16
true
true
0
7
61
34
20
14
null
null
momomimachli/Hedsql-tests
src/Database/Hedsql/Examples/Create.hs
gpl-3.0
createUnique :: CreateStmt dbVendor createUnique = createTable "People" [wrap (col "passportNo" (varchar 256)) /++ unique]
126
createUnique :: CreateStmt dbVendor createUnique = createTable "People" [wrap (col "passportNo" (varchar 256)) /++ unique]
126
createUnique = createTable "People" [wrap (col "passportNo" (varchar 256)) /++ unique]
90
false
true
0
12
18
50
22
28
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 41070 = 3765
32
getValueFromProduct 41070 = 3765
32
getValueFromProduct 41070 = 3765
32
false
false
0
5
3
9
4
5
null
null
fmapfmapfmap/amazonka
amazonka-s3/test/Test/AWS/Gen/S3.hs
mpl-2.0
testGetBucketLogging :: GetBucketLogging -> TestTree testGetBucketLogging = req "GetBucketLogging" "fixture/GetBucketLogging.yaml"
138
testGetBucketLogging :: GetBucketLogging -> TestTree testGetBucketLogging = req "GetBucketLogging" "fixture/GetBucketLogging.yaml"
138
testGetBucketLogging = req "GetBucketLogging" "fixture/GetBucketLogging.yaml"
85
false
true
0
5
17
21
10
11
null
null
nickbart1980/pandoc
src/Text/Pandoc/Writers/FB2.hs
gpl-2.0
paraToPlain (Para inlines : rest) = let p = (Plain (inlines ++ [LineBreak])) in p : paraToPlain rest
109
paraToPlain (Para inlines : rest) = let p = (Plain (inlines ++ [LineBreak])) in p : paraToPlain rest
109
paraToPlain (Para inlines : rest) = let p = (Plain (inlines ++ [LineBreak])) in p : paraToPlain rest
109
false
false
0
13
26
53
26
27
null
null
JacquesCarette/literate-scientific-software
code/drasil-utils/Utils/Drasil/Fold.hs
bsd-2-clause
-- | Parses a list of integers into a nice sentence (ie. S "1, 4-7, and 13") foldNums :: String -> [Int] -> Sentence foldNums s x = foldlList Comma List $ map S (numList s x)
174
foldNums :: String -> [Int] -> Sentence foldNums s x = foldlList Comma List $ map S (numList s x)
97
foldNums s x = foldlList Comma List $ map S (numList s x)
57
true
true
0
8
36
50
25
25
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/program-structure/2015-06-george-wilson-classy-optics/src/P5.hs
unlicense
dbcBad = DbConfig "BAD" "sche for BAD"
40
dbcBad = DbConfig "BAD" "sche for BAD"
40
dbcBad = DbConfig "BAD" "sche for BAD"
40
false
false
1
5
8
14
5
9
null
null
AndreasPK/stack
src/Data/Store/VersionTagged.hs
bsd-3-clause
versionedDecodeOrLoad :: Data a => VersionConfig a -> Q Exp versionedDecodeOrLoad vc = [| versionedDecodeOrLoadImpl $(wrapVersion vc) $(checkVersion vc) |]
155
versionedDecodeOrLoad :: Data a => VersionConfig a -> Q Exp versionedDecodeOrLoad vc = [| versionedDecodeOrLoadImpl $(wrapVersion vc) $(checkVersion vc) |]
155
versionedDecodeOrLoad vc = [| versionedDecodeOrLoadImpl $(wrapVersion vc) $(checkVersion vc) |]
95
false
true
0
7
19
34
17
17
null
null
astro/haskell-torrent
src/Data/ByteString/Parser.hs
bsd-2-clause
getInt32be :: Parser Int32 getInt32be = fmap fromIntegral getWord32be
69
getInt32be :: Parser Int32 getInt32be = fmap fromIntegral getWord32be
69
getInt32be = fmap fromIntegral getWord32be
42
false
true
0
5
8
19
9
10
null
null
maggy96/haskell
cis194/05-IO/HW05.hs
mit
filterT :: Maybe [TId] -> Maybe [Transaction] -> Maybe [Transaction] filterT (Just v) (Just t) = Just $ filter (\x -> elem (tid x) v) t
135
filterT :: Maybe [TId] -> Maybe [Transaction] -> Maybe [Transaction] filterT (Just v) (Just t) = Just $ filter (\x -> elem (tid x) v) t
135
filterT (Just v) (Just t) = Just $ filter (\x -> elem (tid x) v) t
66
false
true
0
11
25
82
41
41
null
null
kalhauge/typeical
src/Text/Typeical/Readers/SyntaxTree.hs
mit
recTerm :: Stream s m Char => Gramma -> SyntaxTree -> Term -> ParserT s m SyntaxTree recTerm bnf t term = try $ do skipWs values <- catMaybes <$> sep parsers spaces return $ SyntaxTree term (t:values) where parsers = map (try . token bnf) (tail term)
266
recTerm :: Stream s m Char => Gramma -> SyntaxTree -> Term -> ParserT s m SyntaxTree recTerm bnf t term = try $ do skipWs values <- catMaybes <$> sep parsers spaces return $ SyntaxTree term (t:values) where parsers = map (try . token bnf) (tail term)
266
recTerm bnf t term = try $ do skipWs values <- catMaybes <$> sep parsers spaces return $ SyntaxTree term (t:values) where parsers = map (try . token bnf) (tail term)
181
false
true
0
11
63
123
57
66
null
null
phischu/fragnix
builtins/ghc-prim/GHC.Prim.hs
bsd-3-clause
-- | Add two vectors element-wise. plusInt8X16# :: Int8X16# -> Int8X16# -> Int8X16# plusInt8X16# = plusInt8X16#
113
plusInt8X16# :: Int8X16# -> Int8X16# -> Int8X16# plusInt8X16# = plusInt8X16#
76
plusInt8X16# = plusInt8X16#
27
true
true
0
8
17
27
12
15
null
null
jwiegley/ghc-release
libraries/time/test/TestParseTime.hs
gpl-3.0
prop_parse_format :: (Eq t, FormatTime t, ParseTime t) => FormatString t -> t -> Bool prop_parse_format (FormatString f) t = parse f (format f t) == Just t
155
prop_parse_format :: (Eq t, FormatTime t, ParseTime t) => FormatString t -> t -> Bool prop_parse_format (FormatString f) t = parse f (format f t) == Just t
155
prop_parse_format (FormatString f) t = parse f (format f t) == Just t
69
false
true
0
11
27
79
37
42
null
null
dschalk/score3
Fm.hs
mit
h4 :: (String, String, String, String, String, String, String, String) -> String h4 (a',b',c',d',e',f',g', goal) = "((" ++ a' ++ b' ++ c' ++ ")" ++ f' ++ e' ++ ")" ++ d' ++ g' ++ ") = " ++ goal ++ "<br> "
209
h4 :: (String, String, String, String, String, String, String, String) -> String h4 (a',b',c',d',e',f',g', goal) = "((" ++ a' ++ b' ++ c' ++ ")" ++ f' ++ e' ++ ")" ++ d' ++ g' ++ ") = " ++ goal ++ "<br> "
209
h4 (a',b',c',d',e',f',g', goal) = "((" ++ a' ++ b' ++ c' ++ ")" ++ f' ++ e' ++ ")" ++ d' ++ g' ++ ") = " ++ goal ++ "<br> "
128
false
true
0
16
48
114
65
49
null
null
pheaver/BitVector
Data/BitVector/Util.hs
bsd-3-clause
maskWidth :: (Bits a, Integral a) => Int -> a -> a maskWidth w x = x .&. (2^w-1)
80
maskWidth :: (Bits a, Integral a) => Int -> a -> a maskWidth w x = x .&. (2^w-1)
80
maskWidth w x = x .&. (2^w-1)
29
false
true
0
8
18
54
28
26
null
null
UCSD-PL/RefScript
src/Language/Rsc/Liquid/Environment.hs
bsd-3-clause
envGetContextCast :: CGEnv -> AnnLq -> Cast -------------------------------------------------------------------------------- envGetContextCast g a | [t ] <- [ t_ | TypeCast ξ t_ <- fFact a, ξ == cge_ctx g ] = CType t | [es] <- [ es_ | DeadCast ξ es_ <- fFact a, ξ == cge_ctx g ] = CDead es | otherwise = CNo
321
envGetContextCast :: CGEnv -> AnnLq -> Cast envGetContextCast g a | [t ] <- [ t_ | TypeCast ξ t_ <- fFact a, ξ == cge_ctx g ] = CType t | [es] <- [ es_ | DeadCast ξ es_ <- fFact a, ξ == cge_ctx g ] = CDead es | otherwise = CNo
240
envGetContextCast g a | [t ] <- [ t_ | TypeCast ξ t_ <- fFact a, ξ == cge_ctx g ] = CType t | [es] <- [ es_ | DeadCast ξ es_ <- fFact a, ξ == cge_ctx g ] = CDead es | otherwise = CNo
196
true
true
0
12
69
139
64
75
null
null
literate-unitb/literate-unitb
src/UnitB/Event.hs
mit
old' :: (EventRefinement evt expr,Ord a) => Getter (Event' expr) (Map a b) -> Getter evt [(a,b)] old' = getItems old
127
old' :: (EventRefinement evt expr,Ord a) => Getter (Event' expr) (Map a b) -> Getter evt [(a,b)] old' = getItems old
127
old' = getItems old
19
false
true
0
10
31
74
36
38
null
null
psg-titech/cfrp
src/Language/CFrp/KNormal.hs
mit
kNormalize :: TypedExpr -> TypedKExpr kNormalize te = runST $ do counter <- newSTRef 0 kNormalize' counter te
113
kNormalize :: TypedExpr -> TypedKExpr kNormalize te = runST $ do counter <- newSTRef 0 kNormalize' counter te
113
kNormalize te = runST $ do counter <- newSTRef 0 kNormalize' counter te
75
false
true
0
9
21
40
18
22
null
null
AlexanderPankiv/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
tcQual = mk_known_key_name tcName
35
tcQual = mk_known_key_name tcName
35
tcQual = mk_known_key_name tcName
35
false
false
0
5
5
9
4
5
null
null
danpalmer/trac-to-phabricator
src/Phabricator.hs
bsd-3-clause
commitTransaction :: TicketMap -> C 'Ticket -> ManiphestTicket -> ManiphestCommit -> Maybe Action commitTransaction tm conn n ManiphestCommit{..} = mkOneAction tm conn n (ManiphestChange (MCComment commitComment) mc_time mc_author ) where commitComment = T.unwords ["This ticket was mentioned in", mc_id]
398
commitTransaction :: TicketMap -> C 'Ticket -> ManiphestTicket -> ManiphestCommit -> Maybe Action commitTransaction tm conn n ManiphestCommit{..} = mkOneAction tm conn n (ManiphestChange (MCComment commitComment) mc_time mc_author ) where commitComment = T.unwords ["This ticket was mentioned in", mc_id]
398
commitTransaction tm conn n ManiphestCommit{..} = mkOneAction tm conn n (ManiphestChange (MCComment commitComment) mc_time mc_author ) where commitComment = T.unwords ["This ticket was mentioned in", mc_id]
282
false
true
0
9
132
94
46
48
null
null
input-output-hk/cardano-sl
client/src/Pos/Client/Txp/History.hs
apache-2.0
getTxsByPredicate :: ([Address] -> Bool) -> Maybe ChainDifficulty -> Maybe Timestamp -> [(WithHash Tx, TxWitness)] -> UtxoM (Map TxId TxHistoryEntry) getTxsByPredicate pr mDiff mTs txs = go txs mempty where go [] !acc = return acc go ((wh@(WithHash tx txId), _wit) : rest) !acc = do inputs <- getSenders tx let outgoings = toList $ txOutAddress <$> _txOutputs tx let incomings = map txOutAddress inputs applyTxToUtxo wh let acc' = if pr (incomings ++ outgoings) then M.insert txId (THEntry txId tx mDiff inputs outgoings mTs) acc else acc go rest acc' -- | Select transactions related to one of given addresses
729
getTxsByPredicate :: ([Address] -> Bool) -> Maybe ChainDifficulty -> Maybe Timestamp -> [(WithHash Tx, TxWitness)] -> UtxoM (Map TxId TxHistoryEntry) getTxsByPredicate pr mDiff mTs txs = go txs mempty where go [] !acc = return acc go ((wh@(WithHash tx txId), _wit) : rest) !acc = do inputs <- getSenders tx let outgoings = toList $ txOutAddress <$> _txOutputs tx let incomings = map txOutAddress inputs applyTxToUtxo wh let acc' = if pr (incomings ++ outgoings) then M.insert txId (THEntry txId tx mDiff inputs outgoings mTs) acc else acc go rest acc' -- | Select transactions related to one of given addresses
729
getTxsByPredicate pr mDiff mTs txs = go txs mempty where go [] !acc = return acc go ((wh@(WithHash tx txId), _wit) : rest) !acc = do inputs <- getSenders tx let outgoings = toList $ txOutAddress <$> _txOutputs tx let incomings = map txOutAddress inputs applyTxToUtxo wh let acc' = if pr (incomings ++ outgoings) then M.insert txId (THEntry txId tx mDiff inputs outgoings mTs) acc else acc go rest acc' -- | Select transactions related to one of given addresses
559
false
true
0
14
219
255
120
135
null
null
ucam-cl-dtg/naps-camfort
Extensions/Units.hs
mit
addCol :: UnitVarCategory -> State UnitEnv Int addCol category = do (matrix, vector) <- gets linearSystem let m = ncols matrix + 1 linearSystem =: (extendTo 0 0 m matrix, vector) unitVarCats <<++ category tmpColsAdded << m return m
258
addCol :: UnitVarCategory -> State UnitEnv Int addCol category = do (matrix, vector) <- gets linearSystem let m = ncols matrix + 1 linearSystem =: (extendTo 0 0 m matrix, vector) unitVarCats <<++ category tmpColsAdded << m return m
258
addCol category = do (matrix, vector) <- gets linearSystem let m = ncols matrix + 1 linearSystem =: (extendTo 0 0 m matrix, vector) unitVarCats <<++ category tmpColsAdded << m return m
211
false
true
0
12
65
102
46
56
null
null
jfranklin9000/urbit
pkg/hs/proto/lib/Dashboard.hs
mit
byFast :: JetName -> Maybe Jet byFast = flip lookup fast where fast :: HashMap JetName Jet fast = mapFromList $ map (\(n, _, j) -> (n, j)) jets
153
byFast :: JetName -> Maybe Jet byFast = flip lookup fast where fast :: HashMap JetName Jet fast = mapFromList $ map (\(n, _, j) -> (n, j)) jets
153
byFast = flip lookup fast where fast :: HashMap JetName Jet fast = mapFromList $ map (\(n, _, j) -> (n, j)) jets
122
false
true
1
9
38
73
39
34
null
null
a143753/AOJ
0371.hs
apache-2.0
main = do _ <- getLine c <- getContents let i = map read $ lines c :: [Int] o = ans i print o
107
main = do _ <- getLine c <- getContents let i = map read $ lines c :: [Int] o = ans i print o
107
main = do _ <- getLine c <- getContents let i = map read $ lines c :: [Int] o = ans i print o
107
false
false
0
11
38
59
27
32
null
null
peter-fogg/pardoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
example :: OrgParser (F Blocks) example = try $ do return . return . exampleCode =<< unlines <$> many1 exampleLine
116
example :: OrgParser (F Blocks) example = try $ do return . return . exampleCode =<< unlines <$> many1 exampleLine
116
example = try $ do return . return . exampleCode =<< unlines <$> many1 exampleLine
84
false
true
0
11
21
46
22
24
null
null
rodrigo-machado/verigraph
src/library/GrLang/Value.hs
gpl-3.0
-- | Ensure no names are repeated within each graph. normalizeRule :: GrRule -> GrRule normalizeRule (Production l r nacs) = let TypedGraphMorphism typedInter typedLhs (Graph.GraphMorphism _ _ nodeRelL edgeRelL) = l TypedGraphMorphism _ typedRhs (Graph.GraphMorphism _ _ nodeRelR edgeRelR) = r Graph.GraphMorphism lhs tgraph nodeTypLhs edgeTypLhs = toGraphMorphism typedLhs Graph.GraphMorphism inter _ nodeTypInter edgeTypInter = toGraphMorphism typedInter Graph.GraphMorphism rhs _ nodeTypRhs edgeTypRhs = toGraphMorphism typedRhs [lhs', inter', rhs', tgraph'] = map normalizeTypeGraph [lhs, inter, rhs, tgraph] typedLhs' = fromGraphMorphism $ Graph.GraphMorphism lhs' tgraph' nodeTypLhs edgeTypLhs typedInter' = fromGraphMorphism $ Graph.GraphMorphism inter' tgraph' nodeTypInter edgeTypInter typedRhs' = fromGraphMorphism $ Graph.GraphMorphism rhs' tgraph' nodeTypRhs edgeTypRhs l' = TypedGraphMorphism typedInter' typedLhs' (Graph.GraphMorphism inter' lhs' nodeRelL edgeRelL) r' = TypedGraphMorphism typedInter' typedRhs' (Graph.GraphMorphism inter' rhs' nodeRelR edgeRelR) normalizeNac (TypedGraphMorphism _ typedNac (Graph.GraphMorphism _ _ nodeRel edgeRel)) = let Graph.GraphMorphism nac _ nodeTypNac edgeTypNac = toGraphMorphism typedNac nac' = normalizeTypeGraph nac typedNac' = fromGraphMorphism $ Graph.GraphMorphism nac' tgraph' nodeTypNac edgeTypNac in TypedGraphMorphism typedLhs' typedNac' (Graph.GraphMorphism lhs' nac' nodeRel edgeRel) in Production l' r' (map normalizeNac nacs)
1,606
normalizeRule :: GrRule -> GrRule normalizeRule (Production l r nacs) = let TypedGraphMorphism typedInter typedLhs (Graph.GraphMorphism _ _ nodeRelL edgeRelL) = l TypedGraphMorphism _ typedRhs (Graph.GraphMorphism _ _ nodeRelR edgeRelR) = r Graph.GraphMorphism lhs tgraph nodeTypLhs edgeTypLhs = toGraphMorphism typedLhs Graph.GraphMorphism inter _ nodeTypInter edgeTypInter = toGraphMorphism typedInter Graph.GraphMorphism rhs _ nodeTypRhs edgeTypRhs = toGraphMorphism typedRhs [lhs', inter', rhs', tgraph'] = map normalizeTypeGraph [lhs, inter, rhs, tgraph] typedLhs' = fromGraphMorphism $ Graph.GraphMorphism lhs' tgraph' nodeTypLhs edgeTypLhs typedInter' = fromGraphMorphism $ Graph.GraphMorphism inter' tgraph' nodeTypInter edgeTypInter typedRhs' = fromGraphMorphism $ Graph.GraphMorphism rhs' tgraph' nodeTypRhs edgeTypRhs l' = TypedGraphMorphism typedInter' typedLhs' (Graph.GraphMorphism inter' lhs' nodeRelL edgeRelL) r' = TypedGraphMorphism typedInter' typedRhs' (Graph.GraphMorphism inter' rhs' nodeRelR edgeRelR) normalizeNac (TypedGraphMorphism _ typedNac (Graph.GraphMorphism _ _ nodeRel edgeRel)) = let Graph.GraphMorphism nac _ nodeTypNac edgeTypNac = toGraphMorphism typedNac nac' = normalizeTypeGraph nac typedNac' = fromGraphMorphism $ Graph.GraphMorphism nac' tgraph' nodeTypNac edgeTypNac in TypedGraphMorphism typedLhs' typedNac' (Graph.GraphMorphism lhs' nac' nodeRel edgeRel) in Production l' r' (map normalizeNac nacs)
1,553
normalizeRule (Production l r nacs) = let TypedGraphMorphism typedInter typedLhs (Graph.GraphMorphism _ _ nodeRelL edgeRelL) = l TypedGraphMorphism _ typedRhs (Graph.GraphMorphism _ _ nodeRelR edgeRelR) = r Graph.GraphMorphism lhs tgraph nodeTypLhs edgeTypLhs = toGraphMorphism typedLhs Graph.GraphMorphism inter _ nodeTypInter edgeTypInter = toGraphMorphism typedInter Graph.GraphMorphism rhs _ nodeTypRhs edgeTypRhs = toGraphMorphism typedRhs [lhs', inter', rhs', tgraph'] = map normalizeTypeGraph [lhs, inter, rhs, tgraph] typedLhs' = fromGraphMorphism $ Graph.GraphMorphism lhs' tgraph' nodeTypLhs edgeTypLhs typedInter' = fromGraphMorphism $ Graph.GraphMorphism inter' tgraph' nodeTypInter edgeTypInter typedRhs' = fromGraphMorphism $ Graph.GraphMorphism rhs' tgraph' nodeTypRhs edgeTypRhs l' = TypedGraphMorphism typedInter' typedLhs' (Graph.GraphMorphism inter' lhs' nodeRelL edgeRelL) r' = TypedGraphMorphism typedInter' typedRhs' (Graph.GraphMorphism inter' rhs' nodeRelR edgeRelR) normalizeNac (TypedGraphMorphism _ typedNac (Graph.GraphMorphism _ _ nodeRel edgeRel)) = let Graph.GraphMorphism nac _ nodeTypNac edgeTypNac = toGraphMorphism typedNac nac' = normalizeTypeGraph nac typedNac' = fromGraphMorphism $ Graph.GraphMorphism nac' tgraph' nodeTypNac edgeTypNac in TypedGraphMorphism typedLhs' typedNac' (Graph.GraphMorphism lhs' nac' nodeRel edgeRel) in Production l' r' (map normalizeNac nacs)
1,519
true
true
0
15
281
418
205
213
null
null
unisonweb/platform
parser-typechecker/src/Unison/Util/Bytes.hs
mit
drop :: Int -> Bytes -> Bytes drop n b0@(Bytes bs) = go (T.dropUntil (> Sum n) bs) where go s = Bytes $ case T.viewl s of head T.:< tail -> if (size b0 - getSum (T.measure s)) == n then s else dropView (n - (size b0 - getSum (T.measure s))) head T.<| tail _ -> s
284
drop :: Int -> Bytes -> Bytes drop n b0@(Bytes bs) = go (T.dropUntil (> Sum n) bs) where go s = Bytes $ case T.viewl s of head T.:< tail -> if (size b0 - getSum (T.measure s)) == n then s else dropView (n - (size b0 - getSum (T.measure s))) head T.<| tail _ -> s
284
drop n b0@(Bytes bs) = go (T.dropUntil (> Sum n) bs) where go s = Bytes $ case T.viewl s of head T.:< tail -> if (size b0 - getSum (T.measure s)) == n then s else dropView (n - (size b0 - getSum (T.measure s))) head T.<| tail _ -> s
254
false
true
0
21
80
166
83
83
null
null
michiexile/hplex
pershom/src/Math/Misc/Nat.hs
bsd-3-clause
toInteger :: N -> Integer toInteger = fromIntegral . toInt
58
toInteger :: N -> Integer toInteger = fromIntegral . toInt
58
toInteger = fromIntegral . toInt
32
false
true
0
5
9
19
10
9
null
null
massysett/turnpike
library/lib/Turnpike/Module.hs
bsd-3-clause
-- | Renames this module. rename :: FullName.T -- ^ New name -> T -> T rename new (T c s e) = T c' s e where c' = X.concat . go . X.lines $ c go = undefined -- | Parses a line with the @module@ keyword and the name of module. -- Returns the column position of the beginning of the name of the -- module (the first column is indexed at 0) and the number of -- characters in the module name.
408
rename :: FullName.T -- ^ New name -> T -> T rename new (T c s e) = T c' s e where c' = X.concat . go . X.lines $ c go = undefined -- | Parses a line with the @module@ keyword and the name of module. -- Returns the column position of the beginning of the name of the -- module (the first column is indexed at 0) and the number of -- characters in the module name.
382
rename new (T c s e) = T c' s e where c' = X.concat . go . X.lines $ c go = undefined -- | Parses a line with the @module@ keyword and the name of module. -- Returns the column position of the beginning of the name of the -- module (the first column is indexed at 0) and the number of -- characters in the module name.
329
true
true
6
10
104
95
43
52
null
null
Tarrasch/Hong
Fal/Fal.hs
bsd-3-clause
color2 = red `untilB` (lbp ->> blue .|. key ->> yellow)
55
color2 = red `untilB` (lbp ->> blue .|. key ->> yellow)
55
color2 = red `untilB` (lbp ->> blue .|. key ->> yellow)
55
false
false
1
10
10
31
15
16
null
null
GaloisInc/halvm-ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
68
composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
68
composeAName = varQual gHC_DESUGAR (fsLit ">>>") composeAIdKey
68
false
false
1
7
12
22
9
13
null
null
sdiehl/ghc
compiler/types/Type.hs
bsd-3-clause
nonDetCmpTypesX :: RnEnv2 -> [Type] -> [Type] -> Ordering nonDetCmpTypesX _ [] [] = EQ
102
nonDetCmpTypesX :: RnEnv2 -> [Type] -> [Type] -> Ordering nonDetCmpTypesX _ [] [] = EQ
102
nonDetCmpTypesX _ [] [] = EQ
44
false
true
0
10
30
46
22
24
null
null
DanielSchuessler/hstri
Blender/Blenderable.hs
gpl-3.0
ba_edgeImmersion :: (ShowToDim2 s, OrdToDim1 s, PreDeltaSet2 s) => Blenderable s -> Ed s -> EdgeImmersion ba_edgeImmersion = pr_edgeImmersion . ba_pr
172
ba_edgeImmersion :: (ShowToDim2 s, OrdToDim1 s, PreDeltaSet2 s) => Blenderable s -> Ed s -> EdgeImmersion ba_edgeImmersion = pr_edgeImmersion . ba_pr
172
ba_edgeImmersion = pr_edgeImmersion . ba_pr
43
false
true
0
9
43
57
26
31
null
null
JohnLato/iteratee
src/Data/Iteratee/Iteratee.hs
bsd-3-clause
identity :: Iteratee s m () identity = idone ()
47
identity :: Iteratee s m () identity = idone ()
47
identity = idone ()
19
false
true
1
6
9
28
12
16
null
null
sdiehl/ghc
compiler/typecheck/TcOrigin.hs
bsd-3-clause
pprCtO ExprSigOrigin = text "an expression type signature"
66
pprCtO ExprSigOrigin = text "an expression type signature"
66
pprCtO ExprSigOrigin = text "an expression type signature"
66
false
false
0
5
15
12
5
7
null
null
tphyahoo/haskoin
haskoin-core/tests/Network/Haskoin/Crypto/Mnemonic/Units.hs
unlicense
tests :: [Test] tests = [ testGroup "Entropy to mnemonic sentence" toMnemonicTest , testGroup "Mnemonic sentence to entropy" fromMnemonicTest , testGroup "Mnemonic sentence to seed" mnemonicToSeedTest ]
218
tests :: [Test] tests = [ testGroup "Entropy to mnemonic sentence" toMnemonicTest , testGroup "Mnemonic sentence to entropy" fromMnemonicTest , testGroup "Mnemonic sentence to seed" mnemonicToSeedTest ]
218
tests = [ testGroup "Entropy to mnemonic sentence" toMnemonicTest , testGroup "Mnemonic sentence to entropy" fromMnemonicTest , testGroup "Mnemonic sentence to seed" mnemonicToSeedTest ]
202
false
true
0
7
42
45
21
24
null
null
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Directory/Types/Product.hs
mpl-2.0
-- | Kind of resource this is. aliKind :: Lens' Aliases Text aliKind = lens _aliKind (\ s a -> s{_aliKind = a})
111
aliKind :: Lens' Aliases Text aliKind = lens _aliKind (\ s a -> s{_aliKind = a})
80
aliKind = lens _aliKind (\ s a -> s{_aliKind = a})
50
true
true
0
9
22
40
22
18
null
null
nushio3/citation-resolve
attic/persist.hs
bsd-3-clause
main :: IO () main = do runResourceT $ withSqlitePool "mytest.db3" 10 $ \pool -> do flip runSqlPool pool $ runMigration migrateAll flip runSqlPool pool $ do insert $ PersistentReference "arXiv:1234.5678" "On the persistent management of the reference" return () runResourceT $ withSqlitePool "mytest.db3" 10 $ \pool -> do flip runSqlPool pool $ do insert $ PersistentReference "arXiv:1234.7171" "Yorualogistics" return ()
520
main :: IO () main = do runResourceT $ withSqlitePool "mytest.db3" 10 $ \pool -> do flip runSqlPool pool $ runMigration migrateAll flip runSqlPool pool $ do insert $ PersistentReference "arXiv:1234.5678" "On the persistent management of the reference" return () runResourceT $ withSqlitePool "mytest.db3" 10 $ \pool -> do flip runSqlPool pool $ do insert $ PersistentReference "arXiv:1234.7171" "Yorualogistics" return ()
520
main = do runResourceT $ withSqlitePool "mytest.db3" 10 $ \pool -> do flip runSqlPool pool $ runMigration migrateAll flip runSqlPool pool $ do insert $ PersistentReference "arXiv:1234.5678" "On the persistent management of the reference" return () runResourceT $ withSqlitePool "mytest.db3" 10 $ \pool -> do flip runSqlPool pool $ do insert $ PersistentReference "arXiv:1234.7171" "Yorualogistics" return ()
506
false
true
0
16
159
143
61
82
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Prolog.hs
gpl-2.0
parseRules ("Prolog","region_marker") = (((parseRules ("Prolog","1-comment"))) <|> (currentContext >>= \x -> guard (x == ("Prolog","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok))
204
parseRules ("Prolog","region_marker") = (((parseRules ("Prolog","1-comment"))) <|> (currentContext >>= \x -> guard (x == ("Prolog","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok))
204
parseRules ("Prolog","region_marker") = (((parseRules ("Prolog","1-comment"))) <|> (currentContext >>= \x -> guard (x == ("Prolog","region_marker")) >> pDefault >>= withAttribute RegionMarkerTok))
204
false
false
0
15
26
76
42
34
null
null
momomimachli/Hedsql
src/Database/Hedsql/Common/CodeGenerator.hs
gpl-3.0
codeGenJoinTTableFunc :: JoinTypeTable dbVendor -> Doc codeGenJoinTTableFunc joinType = case joinType of CrossJoin -> "CROSS JOIN" NaturalFullJoin -> "NATURAL FULL JOIN" NaturalLeftJoin -> "NATURAL LEFT JOIN" NaturalInnerJoin -> "NATURAL INNER JOIN" NaturalRightJoin -> "NATURAL RIGHT JOIN" {-| Generic quotation function. Quotes a string such as table to "table" (the quotation parameter will vary depending on the provided parameter). On top of this, it will escape quote inside the string by doubling those quotes. For example: ta"ble will become "ta""ble". The output is a document which can then be pretty printed. -}
679
codeGenJoinTTableFunc :: JoinTypeTable dbVendor -> Doc codeGenJoinTTableFunc joinType = case joinType of CrossJoin -> "CROSS JOIN" NaturalFullJoin -> "NATURAL FULL JOIN" NaturalLeftJoin -> "NATURAL LEFT JOIN" NaturalInnerJoin -> "NATURAL INNER JOIN" NaturalRightJoin -> "NATURAL RIGHT JOIN" {-| Generic quotation function. Quotes a string such as table to "table" (the quotation parameter will vary depending on the provided parameter). On top of this, it will escape quote inside the string by doubling those quotes. For example: ta"ble will become "ta""ble". The output is a document which can then be pretty printed. -}
679
codeGenJoinTTableFunc joinType = case joinType of CrossJoin -> "CROSS JOIN" NaturalFullJoin -> "NATURAL FULL JOIN" NaturalLeftJoin -> "NATURAL LEFT JOIN" NaturalInnerJoin -> "NATURAL INNER JOIN" NaturalRightJoin -> "NATURAL RIGHT JOIN" {-| Generic quotation function. Quotes a string such as table to "table" (the quotation parameter will vary depending on the provided parameter). On top of this, it will escape quote inside the string by doubling those quotes. For example: ta"ble will become "ta""ble". The output is a document which can then be pretty printed. -}
624
false
true
5
6
147
65
28
37
null
null
green-haskell/ghc
compiler/typecheck/TcEvidence.hs
bsd-3-clause
mkTcLRCo lr co = TcLRCo lr co
40
mkTcLRCo lr co = TcLRCo lr co
40
mkTcLRCo lr co = TcLRCo lr co
40
false
false
0
5
17
16
7
9
null
null
beni55/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
bsd-3-clause
-- | Read a vector from specified index of mutable array. readDoubleX4Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,DoubleX4# #) readDoubleX4Array# = let x = x in x
185
readDoubleX4Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,DoubleX4# #) readDoubleX4Array# = let x = x in x
125
readDoubleX4Array# = let x = x in x
35
true
true
0
11
34
56
25
31
null
null
ezyang/ghc
utils/genapply/Main.hs
bsd-3-clause
findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = Just (vreg, (vregs,fregs,dregs,lregs))
95
findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = Just (vreg, (vregs,fregs,dregs,lregs))
95
findAvailableReg P (vreg:vregs, fregs, dregs, lregs) = Just (vreg, (vregs,fregs,dregs,lregs))
95
false
false
0
6
11
50
28
22
null
null
danr/hipspec
examples/old-examples/quickspec/Lists2.hs
gpl-3.0
tailS _ = myUndefined
21
tailS _ = myUndefined
21
tailS _ = myUndefined
21
false
false
0
4
3
10
4
6
null
null
markmandel/cis194
src/week1/lecture/lists.hs
apache-2.0
hailstone :: Integer -> Integer hailstone n | n `mod` 2 == 0 = n `div` 2 | otherwise = 3*n + 1
103
hailstone :: Integer -> Integer hailstone n | n `mod` 2 == 0 = n `div` 2 | otherwise = 3*n + 1
103
hailstone n | n `mod` 2 == 0 = n `div` 2 | otherwise = 3*n + 1
71
false
true
1
9
31
56
29
27
null
null
akerber47/train
Main.hs
bsd-3-clause
-- Inverse image of derivative at given oriented edge (and given preimage -- vertex). Error if given vertex is not preimage of given edge's 1st vertex. derivativePreimage :: GraphMap -> SG.Vertex -> SG.Edge -> [SG.Edge] derivativePreimage g@(GraphMap sg _ _) v e = assert (elem v $ vertexPreimage g v1) $ filter ((==(Just e)) . derivative g) . SG.incedges $ sg !. v where v1 = SG.startvertex $ sg !- e -- All possible derivative preimages at given oriented edge.
479
derivativePreimage :: GraphMap -> SG.Vertex -> SG.Edge -> [SG.Edge] derivativePreimage g@(GraphMap sg _ _) v e = assert (elem v $ vertexPreimage g v1) $ filter ((==(Just e)) . derivative g) . SG.incedges $ sg !. v where v1 = SG.startvertex $ sg !- e -- All possible derivative preimages at given oriented edge.
327
derivativePreimage g@(GraphMap sg _ _) v e = assert (elem v $ vertexPreimage g v1) $ filter ((==(Just e)) . derivative g) . SG.incedges $ sg !. v where v1 = SG.startvertex $ sg !- e -- All possible derivative preimages at given oriented edge.
259
true
true
0
14
96
131
68
63
null
null
kawu/feature-structure
src/NLP/FeatureStructure/Graph/Tests.hs
bsd-2-clause
checkTrans :: SGraphID -> SGraphID -> SGraphID -> Bool checkTrans s1 s2 s3 = check c12 c13 c23 where check LT x LT = x == LT check _ _ _ = True (g1, i1) = toGraphID s1 (g2, i2) = toGraphID s2 (g3, i3) = toGraphID s3 c12 = G.compare' g1 i1 g2 i2 c13 = G.compare' g1 i1 g3 i3 c23 = G.compare' g2 i2 g3 i3 -- -- | Transitivity of the comparison. -- checkTrans' -- :: GraphID Int Int Char Char -- -> GraphID Int Int Char Char -- -> GraphID Int Int Char Char -- -> Bool -- checkTrans' s1 s2 s3 = -- check c12 c13 c23 -- where -- check LT x LT = x == LT -- check _ _ _ = True -- (g1, i1) = toGraphID s1 -- (g2, i2) = toGraphID s2 -- (g3, i3) = toGraphID s3 -- c12 = G.compare' g1 i1 g2 i2 -- c13 = G.compare' g1 i1 g3 i3 -- c23 = G.compare' g2 i2 g3 i3 -- | Size of the result of mapIDs (+1) should not change. -- Moreover, the result should still be valid (not corrupted). -- Finally, the two graph should be equal to each other.
1,020
checkTrans :: SGraphID -> SGraphID -> SGraphID -> Bool checkTrans s1 s2 s3 = check c12 c13 c23 where check LT x LT = x == LT check _ _ _ = True (g1, i1) = toGraphID s1 (g2, i2) = toGraphID s2 (g3, i3) = toGraphID s3 c12 = G.compare' g1 i1 g2 i2 c13 = G.compare' g1 i1 g3 i3 c23 = G.compare' g2 i2 g3 i3 -- -- | Transitivity of the comparison. -- checkTrans' -- :: GraphID Int Int Char Char -- -> GraphID Int Int Char Char -- -> GraphID Int Int Char Char -- -> Bool -- checkTrans' s1 s2 s3 = -- check c12 c13 c23 -- where -- check LT x LT = x == LT -- check _ _ _ = True -- (g1, i1) = toGraphID s1 -- (g2, i2) = toGraphID s2 -- (g3, i3) = toGraphID s3 -- c12 = G.compare' g1 i1 g2 i2 -- c13 = G.compare' g1 i1 g3 i3 -- c23 = G.compare' g2 i2 g3 i3 -- | Size of the result of mapIDs (+1) should not change. -- Moreover, the result should still be valid (not corrupted). -- Finally, the two graph should be equal to each other.
1,020
checkTrans s1 s2 s3 = check c12 c13 c23 where check LT x LT = x == LT check _ _ _ = True (g1, i1) = toGraphID s1 (g2, i2) = toGraphID s2 (g3, i3) = toGraphID s3 c12 = G.compare' g1 i1 g2 i2 c13 = G.compare' g1 i1 g3 i3 c23 = G.compare' g2 i2 g3 i3 -- -- | Transitivity of the comparison. -- checkTrans' -- :: GraphID Int Int Char Char -- -> GraphID Int Int Char Char -- -> GraphID Int Int Char Char -- -> Bool -- checkTrans' s1 s2 s3 = -- check c12 c13 c23 -- where -- check LT x LT = x == LT -- check _ _ _ = True -- (g1, i1) = toGraphID s1 -- (g2, i2) = toGraphID s2 -- (g3, i3) = toGraphID s3 -- c12 = G.compare' g1 i1 g2 i2 -- c13 = G.compare' g1 i1 g3 i3 -- c23 = G.compare' g2 i2 g3 i3 -- | Size of the result of mapIDs (+1) should not change. -- Moreover, the result should still be valid (not corrupted). -- Finally, the two graph should be equal to each other.
965
false
true
0
7
301
181
101
80
null
null
ekmett/wxHaskell
wxdirect/src/ParseC.hs
lgpl-2.1
pargs3 :: Parser [String] pargs3 = do a1 <- identifier _ <- comma a2 <- identifier _ <- comma a3 <- identifier return [a1,a2,a3]
167
pargs3 :: Parser [String] pargs3 = do a1 <- identifier _ <- comma a2 <- identifier _ <- comma a3 <- identifier return [a1,a2,a3]
167
pargs3 = do a1 <- identifier _ <- comma a2 <- identifier _ <- comma a3 <- identifier return [a1,a2,a3]
141
false
true
0
8
62
69
32
37
null
null
GaloisInc/verification-game
web-prover/exes/SolveEasy.hs
bsd-3-clause
options :: OptSpec Opts options = OptSpec { progDefaults = Opts { optFun = Nothing , optGroup = Nothing , optTask = Nothing } , progParamDocs = [] , progParams = \p _ -> Left ("Unexpected parameter: " ++ show p) , progOptions = [ Option [] ["fun-name"] "Choose the name of the function to work on" $ ReqArg "NAME" $ \s o -> Right o { optFun = Just (funName (Text.pack s)) } , Option [] ["fun-hash"] "Choose the hash of the function to work on" $ ReqArg "HASH" $ \s o -> Right o { optFun = Just (rawFunName s) } , Option [] ["group"] "Choose the group for the task to work on" $ ReqArg "TAKS_GROUP" $ \s o -> case parseTaskGroup (Text.pack s) of Just g -> Right o { optGroup = Just g } Nothing -> Left $ "Invalid task group: " ++ show s , Option [] ["task"] "Choose the task to work on" $ ReqArg "TASK_NAME" $ \s o -> Right o { optTask = Just (Text.pack s) } ] }
1,091
options :: OptSpec Opts options = OptSpec { progDefaults = Opts { optFun = Nothing , optGroup = Nothing , optTask = Nothing } , progParamDocs = [] , progParams = \p _ -> Left ("Unexpected parameter: " ++ show p) , progOptions = [ Option [] ["fun-name"] "Choose the name of the function to work on" $ ReqArg "NAME" $ \s o -> Right o { optFun = Just (funName (Text.pack s)) } , Option [] ["fun-hash"] "Choose the hash of the function to work on" $ ReqArg "HASH" $ \s o -> Right o { optFun = Just (rawFunName s) } , Option [] ["group"] "Choose the group for the task to work on" $ ReqArg "TAKS_GROUP" $ \s o -> case parseTaskGroup (Text.pack s) of Just g -> Right o { optGroup = Just g } Nothing -> Left $ "Invalid task group: " ++ show s , Option [] ["task"] "Choose the task to work on" $ ReqArg "TASK_NAME" $ \s o -> Right o { optTask = Just (Text.pack s) } ] }
1,091
options = OptSpec { progDefaults = Opts { optFun = Nothing , optGroup = Nothing , optTask = Nothing } , progParamDocs = [] , progParams = \p _ -> Left ("Unexpected parameter: " ++ show p) , progOptions = [ Option [] ["fun-name"] "Choose the name of the function to work on" $ ReqArg "NAME" $ \s o -> Right o { optFun = Just (funName (Text.pack s)) } , Option [] ["fun-hash"] "Choose the hash of the function to work on" $ ReqArg "HASH" $ \s o -> Right o { optFun = Just (rawFunName s) } , Option [] ["group"] "Choose the group for the task to work on" $ ReqArg "TAKS_GROUP" $ \s o -> case parseTaskGroup (Text.pack s) of Just g -> Right o { optGroup = Just g } Nothing -> Left $ "Invalid task group: " ++ show s , Option [] ["task"] "Choose the task to work on" $ ReqArg "TASK_NAME" $ \s o -> Right o { optTask = Just (Text.pack s) } ] }
1,067
false
true
0
19
407
343
178
165
null
null
Philonous/xmpp-daemon
client/Main.hs
mit
main = getArgs >>= \case [] -> printUsage (cmd:args) -> case cmd of "getip" -> case args of [p] -> getIP p _ -> printUsage "addpeer" -> case args of [p] -> addPeer p _ -> printUsage "rmpeer" -> case args of [p] -> rmPeer p _ -> printUsage _ -> printUsage
416
main = getArgs >>= \case [] -> printUsage (cmd:args) -> case cmd of "getip" -> case args of [p] -> getIP p _ -> printUsage "addpeer" -> case args of [p] -> addPeer p _ -> printUsage "rmpeer" -> case args of [p] -> rmPeer p _ -> printUsage _ -> printUsage
416
main = getArgs >>= \case [] -> printUsage (cmd:args) -> case cmd of "getip" -> case args of [p] -> getIP p _ -> printUsage "addpeer" -> case args of [p] -> addPeer p _ -> printUsage "rmpeer" -> case args of [p] -> rmPeer p _ -> printUsage _ -> printUsage
416
false
false
3
15
213
134
65
69
null
null
christiaanb/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
printIdKey = mkPreludeMiscIdUnique 37
56
printIdKey = mkPreludeMiscIdUnique 37
56
printIdKey = mkPreludeMiscIdUnique 37
56
false
false
0
5
22
9
4
5
null
null
mpickering/HaRe
old/testing/introPattern/MultiParamIn1_TokOut.hs
bsd-3-clause
f :: Maybe Int -> [Int] -> Int f (Just x) y@[] = (hd y) + (fromMaybe x)
71
f :: Maybe Int -> [Int] -> Int f (Just x) y@[] = (hd y) + (fromMaybe x)
71
f (Just x) y@[] = (hd y) + (fromMaybe x)
40
false
true
5
7
17
61
30
31
null
null
ajscholl/primitive-simd
bench/Bench.hs
bsd-3-clause
distanceSimd1 :: (VG.Vector v f, SIMDVector f, Num f, Floating (Elem f)) => v f -> v f -> Elem f distanceSimd1 = distanceDiff1Helper (sqrt . sumVector)
151
distanceSimd1 :: (VG.Vector v f, SIMDVector f, Num f, Floating (Elem f)) => v f -> v f -> Elem f distanceSimd1 = distanceDiff1Helper (sqrt . sumVector)
151
distanceSimd1 = distanceDiff1Helper (sqrt . sumVector)
54
false
true
0
8
26
75
37
38
null
null
peter-fogg/pardoc
src/Text/Pandoc/Readers/Haddock.hs
gpl-2.0
docHToBlocks :: DocH String Identifier -> Blocks docHToBlocks d' = case d' of DocEmpty -> mempty DocAppend (DocParagraph (DocHeader h)) (DocParagraph (DocAName ident)) -> B.headerWith (ident,[],[]) (headerLevel h) (docHToInlines False $ headerTitle h) DocAppend d1 d2 -> mappend (docHToBlocks d1) (docHToBlocks d2) DocString _ -> inlineFallback DocParagraph (DocAName h) -> B.plain $ docHToInlines False $ DocAName h DocParagraph x -> B.para $ docHToInlines False x DocIdentifier _ -> inlineFallback DocIdentifierUnchecked _ -> inlineFallback DocModule s -> B.plain $ docHToInlines False $ DocModule s DocWarning _ -> mempty -- TODO DocEmphasis _ -> inlineFallback DocMonospaced _ -> inlineFallback DocBold _ -> inlineFallback DocHeader h -> B.header (headerLevel h) (docHToInlines False $ headerTitle h) DocUnorderedList items -> B.bulletList (map docHToBlocks items) DocOrderedList items -> B.orderedList (map docHToBlocks items) DocDefList items -> B.definitionList (map (\(d,t) -> (docHToInlines False d, [consolidatePlains $ docHToBlocks t])) items) DocCodeBlock (DocString s) -> B.codeBlockWith ("",[],[]) s DocCodeBlock d -> B.para $ docHToInlines True d DocHyperlink _ -> inlineFallback DocPic _ -> inlineFallback DocAName _ -> inlineFallback DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s) DocExamples es -> mconcat $ map (\e -> makeExample ">>>" (exampleExpression e) (exampleResult e)) es where inlineFallback = B.plain $ docHToInlines False d' consolidatePlains = B.fromList . consolidatePlains' . B.toList consolidatePlains' zs@(Plain _ : _) = let (xs, ys) = span isPlain zs in Para (concatMap extractContents xs) : consolidatePlains' ys consolidatePlains' (x : xs) = x : consolidatePlains' xs consolidatePlains' [] = [] isPlain (Plain _) = True isPlain _ = False extractContents (Plain xs) = xs extractContents _ = []
2,167
docHToBlocks :: DocH String Identifier -> Blocks docHToBlocks d' = case d' of DocEmpty -> mempty DocAppend (DocParagraph (DocHeader h)) (DocParagraph (DocAName ident)) -> B.headerWith (ident,[],[]) (headerLevel h) (docHToInlines False $ headerTitle h) DocAppend d1 d2 -> mappend (docHToBlocks d1) (docHToBlocks d2) DocString _ -> inlineFallback DocParagraph (DocAName h) -> B.plain $ docHToInlines False $ DocAName h DocParagraph x -> B.para $ docHToInlines False x DocIdentifier _ -> inlineFallback DocIdentifierUnchecked _ -> inlineFallback DocModule s -> B.plain $ docHToInlines False $ DocModule s DocWarning _ -> mempty -- TODO DocEmphasis _ -> inlineFallback DocMonospaced _ -> inlineFallback DocBold _ -> inlineFallback DocHeader h -> B.header (headerLevel h) (docHToInlines False $ headerTitle h) DocUnorderedList items -> B.bulletList (map docHToBlocks items) DocOrderedList items -> B.orderedList (map docHToBlocks items) DocDefList items -> B.definitionList (map (\(d,t) -> (docHToInlines False d, [consolidatePlains $ docHToBlocks t])) items) DocCodeBlock (DocString s) -> B.codeBlockWith ("",[],[]) s DocCodeBlock d -> B.para $ docHToInlines True d DocHyperlink _ -> inlineFallback DocPic _ -> inlineFallback DocAName _ -> inlineFallback DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s) DocExamples es -> mconcat $ map (\e -> makeExample ">>>" (exampleExpression e) (exampleResult e)) es where inlineFallback = B.plain $ docHToInlines False d' consolidatePlains = B.fromList . consolidatePlains' . B.toList consolidatePlains' zs@(Plain _ : _) = let (xs, ys) = span isPlain zs in Para (concatMap extractContents xs) : consolidatePlains' ys consolidatePlains' (x : xs) = x : consolidatePlains' xs consolidatePlains' [] = [] isPlain (Plain _) = True isPlain _ = False extractContents (Plain xs) = xs extractContents _ = []
2,167
docHToBlocks d' = case d' of DocEmpty -> mempty DocAppend (DocParagraph (DocHeader h)) (DocParagraph (DocAName ident)) -> B.headerWith (ident,[],[]) (headerLevel h) (docHToInlines False $ headerTitle h) DocAppend d1 d2 -> mappend (docHToBlocks d1) (docHToBlocks d2) DocString _ -> inlineFallback DocParagraph (DocAName h) -> B.plain $ docHToInlines False $ DocAName h DocParagraph x -> B.para $ docHToInlines False x DocIdentifier _ -> inlineFallback DocIdentifierUnchecked _ -> inlineFallback DocModule s -> B.plain $ docHToInlines False $ DocModule s DocWarning _ -> mempty -- TODO DocEmphasis _ -> inlineFallback DocMonospaced _ -> inlineFallback DocBold _ -> inlineFallback DocHeader h -> B.header (headerLevel h) (docHToInlines False $ headerTitle h) DocUnorderedList items -> B.bulletList (map docHToBlocks items) DocOrderedList items -> B.orderedList (map docHToBlocks items) DocDefList items -> B.definitionList (map (\(d,t) -> (docHToInlines False d, [consolidatePlains $ docHToBlocks t])) items) DocCodeBlock (DocString s) -> B.codeBlockWith ("",[],[]) s DocCodeBlock d -> B.para $ docHToInlines True d DocHyperlink _ -> inlineFallback DocPic _ -> inlineFallback DocAName _ -> inlineFallback DocProperty s -> B.codeBlockWith ("",["property","haskell"],[]) (trim s) DocExamples es -> mconcat $ map (\e -> makeExample ">>>" (exampleExpression e) (exampleResult e)) es where inlineFallback = B.plain $ docHToInlines False d' consolidatePlains = B.fromList . consolidatePlains' . B.toList consolidatePlains' zs@(Plain _ : _) = let (xs, ys) = span isPlain zs in Para (concatMap extractContents xs) : consolidatePlains' ys consolidatePlains' (x : xs) = x : consolidatePlains' xs consolidatePlains' [] = [] isPlain (Plain _) = True isPlain _ = False extractContents (Plain xs) = xs extractContents _ = []
2,118
false
true
8
16
567
760
366
394
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2014-Alejandro_Serrano_Mena-Beginning_Haskell/old/code/src/C02.hs
unlicense
specialClient :: Client -> Bool specialClient (clientName -> "Mr. Alejandro") = True
88
specialClient :: Client -> Bool specialClient (clientName -> "Mr. Alejandro") = True
88
specialClient (clientName -> "Mr. Alejandro") = True
56
false
true
0
6
15
29
14
15
null
null
jgm/pandoc2
Text/Pandoc2/Reader/TeXMath.hs
gpl-2.0
expToInlines :: Exp -> Maybe Inlines expToInlines (ENumber s) = return $ str s
78
expToInlines :: Exp -> Maybe Inlines expToInlines (ENumber s) = return $ str s
78
expToInlines (ENumber s) = return $ str s
41
false
true
0
7
13
34
16
18
null
null
jchitel/ProjectEuler.hs
Problems/Utils/Prime.hs
mit
getNextK :: (Integral a) => [[a]] -> (a, [[a]]) getNextK ((k00:k01:k0Stack):(k10:k11:k1Stack):kStacks) | (k00 == (-1)) = (k01, k0Stack:(k10:k11:k1Stack):kStacks) -- first list hasn't been opened, return its first item | (k10 == (-1) && k00 < k11) = (k00, (k01:k0Stack):(k10:k11:k1Stack):kStacks) -- second list hasn't been opened but first is still less, return the first | (k10 == (-1) && k00 == k11) = (k00, (k01:k0Stack):k1Stack:kStacks) -- second list hasn't been opened and first is equal to second, return it and remove from both | (k10 == (-1)) = (k11, (k00:k01:k0Stack):k1Stack:kStacks) -- second list hasn't been opened and first is greater than second, return second and leave first | (k00 < nextMinK) = (k00, (k01:k0Stack):(k10:k11:k1Stack):kStacks) -- both lists have been opened and first is less than the minimum of the rest, return the first and leave the rest as it was | (k00 == nextMinK) = (k00, (k01:k0Stack):nextKStacks) -- both lists opened, first is equal to the min of the rest, return first, keep the new remaining lists | otherwise = (nextMinK, (k00:k01:k0Stack):nextKStacks) -- both lists opened, first is greater than the min of the rest, keep first, keep the new remaining lists where (nextMinK, nextKStacks) = getNextK ((k10:k11:k1Stack):kStacks) -- if we need to check the next list, drop the first list and recurse -- This generates all k-values, literally all of them. It uses the formula i+j+2ij and returns a list of lists where each list has a fixed i value, -- and contains the k's for every possible value of j, in ascending order.
1,728
getNextK :: (Integral a) => [[a]] -> (a, [[a]]) getNextK ((k00:k01:k0Stack):(k10:k11:k1Stack):kStacks) | (k00 == (-1)) = (k01, k0Stack:(k10:k11:k1Stack):kStacks) -- first list hasn't been opened, return its first item | (k10 == (-1) && k00 < k11) = (k00, (k01:k0Stack):(k10:k11:k1Stack):kStacks) -- second list hasn't been opened but first is still less, return the first | (k10 == (-1) && k00 == k11) = (k00, (k01:k0Stack):k1Stack:kStacks) -- second list hasn't been opened and first is equal to second, return it and remove from both | (k10 == (-1)) = (k11, (k00:k01:k0Stack):k1Stack:kStacks) -- second list hasn't been opened and first is greater than second, return second and leave first | (k00 < nextMinK) = (k00, (k01:k0Stack):(k10:k11:k1Stack):kStacks) -- both lists have been opened and first is less than the minimum of the rest, return the first and leave the rest as it was | (k00 == nextMinK) = (k00, (k01:k0Stack):nextKStacks) -- both lists opened, first is equal to the min of the rest, return first, keep the new remaining lists | otherwise = (nextMinK, (k00:k01:k0Stack):nextKStacks) -- both lists opened, first is greater than the min of the rest, keep first, keep the new remaining lists where (nextMinK, nextKStacks) = getNextK ((k10:k11:k1Stack):kStacks) -- if we need to check the next list, drop the first list and recurse -- This generates all k-values, literally all of them. It uses the formula i+j+2ij and returns a list of lists where each list has a fixed i value, -- and contains the k's for every possible value of j, in ascending order.
1,728
getNextK ((k00:k01:k0Stack):(k10:k11:k1Stack):kStacks) | (k00 == (-1)) = (k01, k0Stack:(k10:k11:k1Stack):kStacks) -- first list hasn't been opened, return its first item | (k10 == (-1) && k00 < k11) = (k00, (k01:k0Stack):(k10:k11:k1Stack):kStacks) -- second list hasn't been opened but first is still less, return the first | (k10 == (-1) && k00 == k11) = (k00, (k01:k0Stack):k1Stack:kStacks) -- second list hasn't been opened and first is equal to second, return it and remove from both | (k10 == (-1)) = (k11, (k00:k01:k0Stack):k1Stack:kStacks) -- second list hasn't been opened and first is greater than second, return second and leave first | (k00 < nextMinK) = (k00, (k01:k0Stack):(k10:k11:k1Stack):kStacks) -- both lists have been opened and first is less than the minimum of the rest, return the first and leave the rest as it was | (k00 == nextMinK) = (k00, (k01:k0Stack):nextKStacks) -- both lists opened, first is equal to the min of the rest, return first, keep the new remaining lists | otherwise = (nextMinK, (k00:k01:k0Stack):nextKStacks) -- both lists opened, first is greater than the min of the rest, keep first, keep the new remaining lists where (nextMinK, nextKStacks) = getNextK ((k10:k11:k1Stack):kStacks) -- if we need to check the next list, drop the first list and recurse -- This generates all k-values, literally all of them. It uses the formula i+j+2ij and returns a list of lists where each list has a fixed i value, -- and contains the k's for every possible value of j, in ascending order.
1,680
false
true
1
13
413
447
247
200
null
null
alopatindev/math
approx/lineral_cosine_interpolation.hs
gpl-3.0
--glue xss = (head xss) ++ (glue (tail xss)) glue [[x]] = [x]
61
glue [[x]] = [x]
16
glue [[x]] = [x]
16
true
false
0
6
12
20
11
9
null
null
liff/adventofcode-2016
app/Day5.hs
bsd-3-clause
digitFromByte :: Word8 -> Char digitFromByte digit = let c = if digit < 0xa then digit + 0x30 else (digit - 10) + 0x61 in chr (fromIntegral c)
174
digitFromByte :: Word8 -> Char digitFromByte digit = let c = if digit < 0xa then digit + 0x30 else (digit - 10) + 0x61 in chr (fromIntegral c)
174
digitFromByte digit = let c = if digit < 0xa then digit + 0x30 else (digit - 10) + 0x61 in chr (fromIntegral c)
143
false
true
0
12
60
65
33
32
null
null
tanakh/hsmsgpack
src/Data/MessagePack/Stream.hs
bsd-3-clause
-- | Unpack objects from handle. unpackObjectsFromHandle :: Handle -> IO [Object] unpackObjectsFromHandle h = unpackObjects =<< feederFromHandle h
148
unpackObjectsFromHandle :: Handle -> IO [Object] unpackObjectsFromHandle h = unpackObjects =<< feederFromHandle h
115
unpackObjectsFromHandle h = unpackObjects =<< feederFromHandle h
66
true
true
0
7
20
32
16
16
null
null
VictorLoren/quantum-computer-haskell
QuantumComputer/ConstantStates.hs
mit
bell11 = applyGate (CNOT 1 0) $ bell1 `combineStates` qstate1
61
bell11 = applyGate (CNOT 1 0) $ bell1 `combineStates` qstate1
61
bell11 = applyGate (CNOT 1 0) $ bell1 `combineStates` qstate1
61
false
false
1
8
9
31
14
17
null
null
joshuaclayton/timeline
server/Timeline/Server/Server.hs
mit
renderJSON :: (Monad m, A.ToJSON a) => a -> S.ActionT TL.Text m () renderJSON = S.text . E.decodeUtf8 . A.encode
112
renderJSON :: (Monad m, A.ToJSON a) => a -> S.ActionT TL.Text m () renderJSON = S.text . E.decodeUtf8 . A.encode
112
renderJSON = S.text . E.decodeUtf8 . A.encode
45
false
true
1
9
19
66
31
35
null
null
atodorov/bdcs
src/BDCS/Import/RPM.hs
lgpl-2.1
consume :: (MonadBaseControl IO m, MonadIO m, MonadThrow m, MonadError CsError m) => ContentStore -> FilePath -> Consumer RPM m Bool consume repo db = await >>= \case Just rpm -> lift (runExceptT $ checkAndRunSqlite (T.pack db) (rpmExistsInMDDB rpm)) >>= \case Left e -> throwError (CsError $ show e) Right True -> return False Right False -> unsafeConsume repo db rpm Nothing -> return False -- Like consume, but does not first check to see if the RPM has previously been imported. Running -- this could result in a very confused, incorrect mddb. It is currently for internal use only, -- but that might change in the future. If so, its type should also change to be a Consumer.
742
consume :: (MonadBaseControl IO m, MonadIO m, MonadThrow m, MonadError CsError m) => ContentStore -> FilePath -> Consumer RPM m Bool consume repo db = await >>= \case Just rpm -> lift (runExceptT $ checkAndRunSqlite (T.pack db) (rpmExistsInMDDB rpm)) >>= \case Left e -> throwError (CsError $ show e) Right True -> return False Right False -> unsafeConsume repo db rpm Nothing -> return False -- Like consume, but does not first check to see if the RPM has previously been imported. Running -- this could result in a very confused, incorrect mddb. It is currently for internal use only, -- but that might change in the future. If so, its type should also change to be a Consumer.
742
consume repo db = await >>= \case Just rpm -> lift (runExceptT $ checkAndRunSqlite (T.pack db) (rpmExistsInMDDB rpm)) >>= \case Left e -> throwError (CsError $ show e) Right True -> return False Right False -> unsafeConsume repo db rpm Nothing -> return False -- Like consume, but does not first check to see if the RPM has previously been imported. Running -- this could result in a very confused, incorrect mddb. It is currently for internal use only, -- but that might change in the future. If so, its type should also change to be a Consumer.
609
false
true
0
16
181
174
84
90
null
null
brendanhay/gogol
gogol-cloudidentity/gen/Network/Google/CloudIdentity/Types/Product.hs
mpl-2.0
-- | Output only. Status of the dynamic group. dgmStatus :: Lens' DynamicGroupMetadata (Maybe DynamicGroupStatus) dgmStatus = lens _dgmStatus (\ s a -> s{_dgmStatus = a})
172
dgmStatus :: Lens' DynamicGroupMetadata (Maybe DynamicGroupStatus) dgmStatus = lens _dgmStatus (\ s a -> s{_dgmStatus = a})
125
dgmStatus = lens _dgmStatus (\ s a -> s{_dgmStatus = a})
58
true
true
0
9
27
48
25
23
null
null
lamdu/lamdu
src/Lamdu/GUI/Monad.hs
gpl-3.0
run :: _ => (T.Tag -> MkProperty' o Text) -> (ExprGui.Expr Sugar.Term i o -> GuiM env i o (Responsive o)) -> (ExprGui.Expr Sugar.Binder i o -> GuiM env i o (Responsive o)) -> Anchors.GuiAnchors i o -> env -> GuiM env i o a -> i a run assocTagName_ makeSubexpr mkBinder theGuiAnchors env (GuiM action) = runReaderT action Askable { _aAssocTagName = assocTagName_ , _aState = env ^. has , _aTextEditStyle = env ^. has , _aStdSpacing = env ^. Spacer.stdSpacing , _aAnimIdPrefix = ["outermost"] , _aConfig = env ^. has , _aTheme = env ^. has , _aSettings = env ^. has , _aMakeSubexpression = makeSubexpr , _aMakeBinder = mkBinder , _aGuiAnchors = theGuiAnchors , _aDepthLeft = env ^. Config.hasConfig . Config.maxExprDepth , _aMScopeId = Just topLevelScopeId & pure , _aStyle = env ^. has , _aDirLayout = env ^. has , _aEnv = env }
927
run :: _ => (T.Tag -> MkProperty' o Text) -> (ExprGui.Expr Sugar.Term i o -> GuiM env i o (Responsive o)) -> (ExprGui.Expr Sugar.Binder i o -> GuiM env i o (Responsive o)) -> Anchors.GuiAnchors i o -> env -> GuiM env i o a -> i a run assocTagName_ makeSubexpr mkBinder theGuiAnchors env (GuiM action) = runReaderT action Askable { _aAssocTagName = assocTagName_ , _aState = env ^. has , _aTextEditStyle = env ^. has , _aStdSpacing = env ^. Spacer.stdSpacing , _aAnimIdPrefix = ["outermost"] , _aConfig = env ^. has , _aTheme = env ^. has , _aSettings = env ^. has , _aMakeSubexpression = makeSubexpr , _aMakeBinder = mkBinder , _aGuiAnchors = theGuiAnchors , _aDepthLeft = env ^. Config.hasConfig . Config.maxExprDepth , _aMScopeId = Just topLevelScopeId & pure , _aStyle = env ^. has , _aDirLayout = env ^. has , _aEnv = env }
927
run assocTagName_ makeSubexpr mkBinder theGuiAnchors env (GuiM action) = runReaderT action Askable { _aAssocTagName = assocTagName_ , _aState = env ^. has , _aTextEditStyle = env ^. has , _aStdSpacing = env ^. Spacer.stdSpacing , _aAnimIdPrefix = ["outermost"] , _aConfig = env ^. has , _aTheme = env ^. has , _aSettings = env ^. has , _aMakeSubexpression = makeSubexpr , _aMakeBinder = mkBinder , _aGuiAnchors = theGuiAnchors , _aDepthLeft = env ^. Config.hasConfig . Config.maxExprDepth , _aMScopeId = Just topLevelScopeId & pure , _aStyle = env ^. has , _aDirLayout = env ^. has , _aEnv = env }
673
false
true
0
13
247
317
171
146
null
null
alexander-at-github/eta
compiler/ETA/TypeCheck/TcType.hs
bsd-3-clause
orphNamesOfCo (ForAllCo _ co) = orphNamesOfCo co
54
orphNamesOfCo (ForAllCo _ co) = orphNamesOfCo co
54
orphNamesOfCo (ForAllCo _ co) = orphNamesOfCo co
54
false
false
0
6
12
21
9
12
null
null
frerich/pandoc
src/Text/Pandoc/Writers/LaTeX.hs
gpl-2.0
toBabel ("en":"AU":_) = "australian"
43
toBabel ("en":"AU":_) = "australian"
43
toBabel ("en":"AU":_) = "australian"
43
false
false
0
8
10
20
10
10
null
null
DNNX/invariant-functors
src/Data/Functor/Invariant/TH/Internal.hs
bsd-2-clause
constructorName (InfixC _ name _ ) = name
46
constructorName (InfixC _ name _ ) = name
46
constructorName (InfixC _ name _ ) = name
46
false
false
0
7
12
19
9
10
null
null
lpeterse/koka
src/Backend/JavaScript/FromCore.hs
apache-2.0
withNameSubstitutions :: [(TName, Doc)] -> Asm a -> Asm a withNameSubstitutions subs asm = withEnv (\env -> env{ substEnv = subs ++ substEnv env }) asm
153
withNameSubstitutions :: [(TName, Doc)] -> Asm a -> Asm a withNameSubstitutions subs asm = withEnv (\env -> env{ substEnv = subs ++ substEnv env }) asm
153
withNameSubstitutions subs asm = withEnv (\env -> env{ substEnv = subs ++ substEnv env }) asm
95
false
true
0
11
27
72
36
36
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
action_385 (182#) = happyShift action_202
41
action_385 (182#) = happyShift action_202
41
action_385 (182#) = happyShift action_202
41
false
false
0
6
4
15
7
8
null
null
randen/haddock
haddock-api/src/Haddock/Backends/LaTeX.hs
bsd-2-clause
latexStripTrailingWhitespace other = other
42
latexStripTrailingWhitespace other = other
42
latexStripTrailingWhitespace other = other
42
false
false
0
5
3
9
4
5
null
null
sol/wai
warp/Network/Wai/Handler/Warp/MultiMap.hs
mit
top (Tom x _) = x
17
top (Tom x _) = x
17
top (Tom x _) = x
17
false
false
0
6
5
18
8
10
null
null
NCrashed/sinister
src/client/Graphics/Render/Common.hs
mit
emptyFrameBufferAlpha :: FrameBuffer RGBAFormat () () emptyFrameBufferAlpha = newFrameBufferColor (RGBA 0 0)
109
emptyFrameBufferAlpha :: FrameBuffer RGBAFormat () () emptyFrameBufferAlpha = newFrameBufferColor (RGBA 0 0)
108
emptyFrameBufferAlpha = newFrameBufferColor (RGBA 0 0)
54
false
true
0
7
12
33
16
17
null
null
faylang/fay-server
src/Language/Fay/ReactiveMvc.hs
bsd-3-clause
modelReact :: Foreign a => EventType -> Model x -> Model a -> (a -> Fay ()) -> Fay () modelReact typ (Model guid _ _) (Model _ _ callbacks_ref) action = do callbacks <- readRef callbacks_ref writeRef callbacks_ref (callbacks ++ [Callback guid typ action]) -- | Render the view with the model's value.
305
modelReact :: Foreign a => EventType -> Model x -> Model a -> (a -> Fay ()) -> Fay () modelReact typ (Model guid _ _) (Model _ _ callbacks_ref) action = do callbacks <- readRef callbacks_ref writeRef callbacks_ref (callbacks ++ [Callback guid typ action]) -- | Render the view with the model's value.
305
modelReact typ (Model guid _ _) (Model _ _ callbacks_ref) action = do callbacks <- readRef callbacks_ref writeRef callbacks_ref (callbacks ++ [Callback guid typ action]) -- | Render the view with the model's value.
219
false
true
0
13
58
122
58
64
null
null
urbanslug/ghc
testsuite/tests/rename/should_compile/T17e.hs
bsd-3-clause
foo :: () foo = let True = True in ()
37
foo :: () foo = let True = True in ()
37
foo = let True = True in ()
27
false
true
0
8
10
27
13
14
null
null