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
-- ... | 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)
... | 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)
... | 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)
... | 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_fi... | 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_fi... | 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_fi... | 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 ... | 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.... | 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.... | 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" p... | 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
... | 1,345 | fileCollisionDialog :: ByteString -> IO (Maybe FCollisonMode)
fileCollisionDialog t = do
chooserDialog <- messageDialogNew Nothing
[DialogDestroyWithParent]
MessageQuestion
ButtonsNone
... | 1,345 | fileCollisionDialog t = do
chooserDialog <- messageDialogNew Nothing
[DialogDestroyWithParent]
MessageQuestion
ButtonsNone
(fromString "Target \"" `BS.append`
... | 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... | 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
= CN... | 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 )... | 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 )... | 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
... | 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
... | 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
... | 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.GraphM... | 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 = toGraphMor... | 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.GraphMo... | 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
-- modul... | 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 ind... | 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 mod... | 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 ()
run... | 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 ()
run... | 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 $ wi... | 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 ... | 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 ... | 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... | 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) $
fil... | 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 oriente... | 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.... | 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.... | 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 comp... | 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"]
... | 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"]
... | 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... | 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 arg... | 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 arg... | 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 arg... | 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 (docHT... | 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 (docHT... | 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 _ -> ... | 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):kSt... | 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):kSt... | 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 fir... | 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 ... | 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 ... | 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
... | 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 act... | 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 act... | 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
... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.