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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bkoropoff/Idris-dev | src/Pkg/Package.hs | bsd-3-clause | installPkg :: PkgDesc -> IO ()
installPkg pkgdesc
= inPkgDir pkgdesc $
do case (execout pkgdesc) of
Nothing -> do mapM_ (installIBC (pkgname pkgdesc)) (modules pkgdesc)
installIdx (pkgname pkgdesc)
Just o -> return () -- do nothing, keep executable l... | 561 | installPkg :: PkgDesc -> IO ()
installPkg pkgdesc
= inPkgDir pkgdesc $
do case (execout pkgdesc) of
Nothing -> do mapM_ (installIBC (pkgname pkgdesc)) (modules pkgdesc)
installIdx (pkgname pkgdesc)
Just o -> return () -- do nothing, keep executable l... | 561 | installPkg pkgdesc
= inPkgDir pkgdesc $
do case (execout pkgdesc) of
Nothing -> do mapM_ (installIBC (pkgname pkgdesc)) (modules pkgdesc)
installIdx (pkgname pkgdesc)
Just o -> return () -- do nothing, keep executable locally, for noe
map... | 530 | false | true | 0 | 18 | 148 | 136 | 63 | 73 | null | null |
futurice/postgresql-simple-url | src/Database/PostgreSQL/Simple/URL.hs | mit | uriToConnectInfo :: URI -> Maybe ConnectInfo
uriToConnectInfo uri
| uriScheme uri /= "postgres:" && uriScheme uri /= "postgresql:" = Nothing
| otherwise = ($ defaultConnectInfo) <$> mkConnectInfo uri | 203 | uriToConnectInfo :: URI -> Maybe ConnectInfo
uriToConnectInfo uri
| uriScheme uri /= "postgres:" && uriScheme uri /= "postgresql:" = Nothing
| otherwise = ($ defaultConnectInfo) <$> mkConnectInfo uri | 203 | uriToConnectInfo uri
| uriScheme uri /= "postgres:" && uriScheme uri /= "postgresql:" = Nothing
| otherwise = ($ defaultConnectInfo) <$> mkConnectInfo uri | 158 | false | true | 1 | 11 | 31 | 63 | 30 | 33 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 417175 = 5532 | 33 | getValueFromProduct 417175 = 5532 | 33 | getValueFromProduct 417175 = 5532 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
simonmichael/hledger | hledger-web/Hledger/Web/Widget/Common.hs | gpl-3.0 | removeDates :: Text -> [Text]
removeDates =
map quoteIfSpaced .
filter (\term ->
not $ T.isPrefixOf "date:" term || T.isPrefixOf "date2:" term) .
Query.words'' Query.prefixes | 194 | removeDates :: Text -> [Text]
removeDates =
map quoteIfSpaced .
filter (\term ->
not $ T.isPrefixOf "date:" term || T.isPrefixOf "date2:" term) .
Query.words'' Query.prefixes | 194 | removeDates =
map quoteIfSpaced .
filter (\term ->
not $ T.isPrefixOf "date:" term || T.isPrefixOf "date2:" term) .
Query.words'' Query.prefixes | 164 | false | true | 1 | 11 | 44 | 77 | 35 | 42 | null | null |
yiannist/ganeti | src/Ganeti/THH/PyRPC.hs | bsd-2-clause | upperFirst [] = [] | 22 | upperFirst [] = [] | 22 | upperFirst [] = [] | 22 | false | false | 1 | 6 | 7 | 17 | 6 | 11 | null | null |
Philonous/hs-acme | src/Network/Acme/Types.hs | mit | resourceName ResourceNewAuthz = "new-authz" | 45 | resourceName ResourceNewAuthz = "new-authz" | 45 | resourceName ResourceNewAuthz = "new-authz" | 45 | false | false | 0 | 4 | 5 | 10 | 4 | 6 | null | null |
tolysz/yesod | yesod-core/test/YesodCoreTest/ErrorHandling.hs | mit | getErrorR 8 = cacheSeconds undefined | 36 | getErrorR 8 = cacheSeconds undefined | 36 | getErrorR 8 = cacheSeconds undefined | 36 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
ulricha/dsh | src/Database/DSH/CL/Opt/PartialEval.hs | bsd-3-clause | fromLiteral :: Expr -> TransformC CL Val
fromLiteral (Lit _ val) = return val | 77 | fromLiteral :: Expr -> TransformC CL Val
fromLiteral (Lit _ val) = return val | 77 | fromLiteral (Lit _ val) = return val | 36 | false | true | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
pegartillo95/CaseGenerator | src/Bags.hs | bsd-3-clause | -- Multiset size
card::Bag a -> Int
card b = M.foldr (+) 0 b | 60 | card::Bag a -> Int
card b = M.foldr (+) 0 b | 43 | card b = M.foldr (+) 0 b | 24 | true | true | 0 | 6 | 13 | 33 | 17 | 16 | null | null |
osa1/language-lua | src/Text/PrettyPrint/Leijen.hs | bsd-3-clause | flatten other = other | 31 | flatten other = other | 31 | flatten other = other | 31 | false | false | 0 | 4 | 13 | 9 | 4 | 5 | null | null |
haskell-game/bgfx | Cubes.hs | bsd-3-clause | declarePosColorVertex :: IO (Ptr BgfxVertexDecl)
declarePosColorVertex =
do vertexDecl <- malloc
bgfxVertexDeclBegin vertexDecl BGFX_RENDERER_TYPE_NULL
bgfxVertexDeclAdd vertexDecl BGFX_ATTRIB_POSITION 3 BGFX_ATTRIB_TYPE_FLOAT False False
bgfxVertexDeclAdd vertexDecl BGFX_ATTRIB_COLOR0 4 BGFX_ATTRIB_TY... | 396 | declarePosColorVertex :: IO (Ptr BgfxVertexDecl)
declarePosColorVertex =
do vertexDecl <- malloc
bgfxVertexDeclBegin vertexDecl BGFX_RENDERER_TYPE_NULL
bgfxVertexDeclAdd vertexDecl BGFX_ATTRIB_POSITION 3 BGFX_ATTRIB_TYPE_FLOAT False False
bgfxVertexDeclAdd vertexDecl BGFX_ATTRIB_COLOR0 4 BGFX_ATTRIB_TY... | 396 | declarePosColorVertex =
do vertexDecl <- malloc
bgfxVertexDeclBegin vertexDecl BGFX_RENDERER_TYPE_NULL
bgfxVertexDeclAdd vertexDecl BGFX_ATTRIB_POSITION 3 BGFX_ATTRIB_TYPE_FLOAT False False
bgfxVertexDeclAdd vertexDecl BGFX_ATTRIB_COLOR0 4 BGFX_ATTRIB_TYPE_UINT8 True False
bgfxVertexDeclEnd vertex... | 347 | false | true | 1 | 8 | 58 | 83 | 34 | 49 | null | null |
olorin/amazonka | amazonka-autoscaling/test/Test/AWS/Gen/AutoScaling.hs | mpl-2.0 | testEnterStandby :: EnterStandby -> TestTree
testEnterStandby = req
"EnterStandby"
"fixture/EnterStandby.yaml" | 118 | testEnterStandby :: EnterStandby -> TestTree
testEnterStandby = req
"EnterStandby"
"fixture/EnterStandby.yaml" | 118 | testEnterStandby = req
"EnterStandby"
"fixture/EnterStandby.yaml" | 73 | false | true | 0 | 5 | 17 | 21 | 10 | 11 | null | null |
wjt/bustle | Bustle/Diagram.hs | lgpl-2.1 | voffset Below = (+) | 19 | voffset Below = (+) | 19 | voffset Below = (+) | 19 | false | false | 1 | 5 | 3 | 15 | 6 | 9 | null | null |
JustAHappyKid/log-browse | test/ParseTests.hs | mit | main = runTestTT tests | 22 | main = runTestTT tests | 22 | main = runTestTT tests | 22 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
rueshyna/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Posts/Insert.hs | mpl-2.0 | -- | ID of the blog to add the post to.
posBlogId :: Lens' PostsInsert Text
posBlogId
= lens _posBlogId (\ s a -> s{_posBlogId = a}) | 134 | posBlogId :: Lens' PostsInsert Text
posBlogId
= lens _posBlogId (\ s a -> s{_posBlogId = a}) | 94 | posBlogId
= lens _posBlogId (\ s a -> s{_posBlogId = a}) | 58 | true | true | 0 | 9 | 28 | 42 | 22 | 20 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/tests/test-bugs.hs | mit | issue45 :: Assertion
issue45 = build_issue 45 | 45 | issue45 :: Assertion
issue45 = build_issue 45 | 45 | issue45 = build_issue 45 | 24 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
orezpraw/gitit2 | Network/Gitit2.hs | gpl-2.0 | editForm :: HasGitit master
=> Maybe Edit
-> Html
-> MForm (HandlerT master IO) (FormResult Edit, WidgetT master IO ())
editForm mbedit = renderDivs $ Edit
<$> areq textareaField (fieldSettingsLabel MsgPageSource)
{fsId = Just "editpane"}
(editConte... | 599 | editForm :: HasGitit master
=> Maybe Edit
-> Html
-> MForm (HandlerT master IO) (FormResult Edit, WidgetT master IO ())
editForm mbedit = renderDivs $ Edit
<$> areq textareaField (fieldSettingsLabel MsgPageSource)
{fsId = Just "editpane"}
(editConte... | 599 | editForm mbedit = renderDivs $ Edit
<$> areq textareaField (fieldSettingsLabel MsgPageSource)
{fsId = Just "editpane"}
(editContents <$> mbedit)
<*> areq commentField (fieldSettingsLabel MsgChangeDescription)
(editComment <$> mbedit)
where commentField = chec... | 452 | false | true | 6 | 12 | 180 | 190 | 86 | 104 | null | null |
blamario/grampa | grammatical-parsers/src/Text/Grampa/ContextFree/LeftRecursive/Transformer.hs | bsd-2-clause | -- | Transform the computation carried by the parser.
tmap :: AmbiguityDecidable b => (m a -> m b) -> ParserT m g s a -> ParserT m g s b
tmap = mapPrimitive . Transformer.tmap | 175 | tmap :: AmbiguityDecidable b => (m a -> m b) -> ParserT m g s a -> ParserT m g s b
tmap = mapPrimitive . Transformer.tmap | 121 | tmap = mapPrimitive . Transformer.tmap | 38 | true | true | 0 | 10 | 35 | 70 | 32 | 38 | null | null |
haskell-distributed/distributed-process-platform | src/Control/Distributed/Process/Platform/Supervisor.hs | bsd-3-clause | isIntrinsic :: RestartPolicy -> Bool
isIntrinsic = (== Intrinsic) | 65 | isIntrinsic :: RestartPolicy -> Bool
isIntrinsic = (== Intrinsic) | 65 | isIntrinsic = (== Intrinsic) | 28 | false | true | 0 | 5 | 8 | 19 | 11 | 8 | null | null |
mrshannon/trees | src/Input/Keyboard/GLUT.hs | gpl-2.0 | changeAsciiKeyState 'X' ns k = k { xKey = ns } | 46 | changeAsciiKeyState 'X' ns k = k { xKey = ns } | 46 | changeAsciiKeyState 'X' ns k = k { xKey = ns } | 46 | false | false | 0 | 6 | 10 | 21 | 11 | 10 | null | null |
tranma/optparse-th | Options/Applicative/TH.hs | bsd-3-clause | appArgE p n (s:ss) = foldInfix
(infixE (Just (conE n)) lookupFmap (Just (pArgE s)))
lookupFapp
(map pArgE ss)
where pArgE t = varE $ funName p t | 152 | appArgE p n (s:ss) = foldInfix
(infixE (Just (conE n)) lookupFmap (Just (pArgE s)))
lookupFapp
(map pArgE ss)
where pArgE t = varE $ funName p t | 152 | appArgE p n (s:ss) = foldInfix
(infixE (Just (conE n)) lookupFmap (Just (pArgE s)))
lookupFapp
(map pArgE ss)
where pArgE t = varE $ funName p t | 152 | false | false | 0 | 10 | 34 | 90 | 43 | 47 | null | null |
upwawet/vision | src/Properties/Impex.hs | gpl-3.0 | importOne ::
WithXMMS
=> FilePath
-> ((String, String), Map String X.Property)
-> IO ()
importOne base ((url, args), props) =
medialibAddEntryEncoded xmms enc >>* do
liftIO $ medialibGetIdEncoded xmms enc >>* do
id <- result
unless (id == 0) $
liftIO $ setProps id props
where enc = ... | 456 | importOne ::
WithXMMS
=> FilePath
-> ((String, String), Map String X.Property)
-> IO ()
importOne base ((url, args), props) =
medialibAddEntryEncoded xmms enc >>* do
liftIO $ medialibGetIdEncoded xmms enc >>* do
id <- result
unless (id == 0) $
liftIO $ setProps id props
where enc = ... | 456 | importOne base ((url, args), props) =
medialibAddEntryEncoded xmms enc >>* do
liftIO $ medialibGetIdEncoded xmms enc >>* do
id <- result
unless (id == 0) $
liftIO $ setProps id props
where enc = (encodeURL url') ++ args
url' | isInfixOf "://" url = url
| otherwise ... | 360 | false | true | 5 | 15 | 134 | 186 | 89 | 97 | null | null |
monamonamonad/RegexDSL | src/Automaton/DFA.hs | bsd-3-clause | -- dfa1 が認識する言語と dfa2 が認識する言語の共通部分を認識する DFA を返す。
intersection :: (State s1, State s2, Alphabet alpha)
=> DFA s1 alpha -> DFA s2 alpha -> DFA (s1, s2) alpha
intersection = product | 194 | intersection :: (State s1, State s2, Alphabet alpha)
=> DFA s1 alpha -> DFA s2 alpha -> DFA (s1, s2) alpha
intersection = product | 145 | intersection = product | 22 | true | true | 0 | 9 | 46 | 62 | 32 | 30 | null | null |
dolio/irc-core | src/Client/State/Extensions.hs | isc | chat1 ::
Ptr FgnChat {- ^ serialized chat message -} ->
ClientState {- ^ client state -} ->
[(Int,ActiveExtension)] {- ^ extensions needing callback -} ->
IO (ClientState, Bool) {- ^ new state and allow -}
chat1 _ st [] = return (st, True) | 302 | chat1 ::
Ptr FgnChat {- ^ serialized chat message -} ->
ClientState {- ^ client state -} ->
[(Int,ActiveExtension)] {- ^ extensions needing callback -} ->
IO (ClientState, Bool)
chat1 _ st [] = return (st, True) | 265 | chat1 _ st [] = return (st, True) | 36 | true | true | 0 | 9 | 106 | 66 | 37 | 29 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MGunner.hs | bsd-3-clause | gunnerFramesDuck :: V.Vector MFrameT
gunnerFramesDuck =
V.fromList [ MFrameT (Just GameAI.aiMove) 1 (Just gunnerDuckDown)
, MFrameT (Just GameAI.aiMove) 1 Nothing
, MFrameT (Just GameAI.aiMove) 1 (Just gunnerDuckHold)
, MFrameT (Just GameAI.aiMove) 0 Nothing
... | 584 | gunnerFramesDuck :: V.Vector MFrameT
gunnerFramesDuck =
V.fromList [ MFrameT (Just GameAI.aiMove) 1 (Just gunnerDuckDown)
, MFrameT (Just GameAI.aiMove) 1 Nothing
, MFrameT (Just GameAI.aiMove) 1 (Just gunnerDuckHold)
, MFrameT (Just GameAI.aiMove) 0 Nothing
... | 584 | gunnerFramesDuck =
V.fromList [ MFrameT (Just GameAI.aiMove) 1 (Just gunnerDuckDown)
, MFrameT (Just GameAI.aiMove) 1 Nothing
, MFrameT (Just GameAI.aiMove) 1 (Just gunnerDuckHold)
, MFrameT (Just GameAI.aiMove) 0 Nothing
, MFrameT (Just GameAI... | 547 | false | true | 0 | 10 | 197 | 204 | 101 | 103 | null | null |
jsnajder/confusion-matrix | src/Statistics/ConfusionMatrix.hs | bsd-3-clause | macroPrecision :: Eq a => ConfMatrix a -> Double
macroPrecision cm@(CM cs _) = avg $ map (flip precisionOf cm) cs | 113 | macroPrecision :: Eq a => ConfMatrix a -> Double
macroPrecision cm@(CM cs _) = avg $ map (flip precisionOf cm) cs | 113 | macroPrecision cm@(CM cs _) = avg $ map (flip precisionOf cm) cs | 64 | false | true | 0 | 8 | 20 | 56 | 27 | 29 | null | null |
foreverbell/unlimited-plt-toys | extra/re/src/NFA.hs | bsd-3-clause | unNFA :: NFA -> (Seq.Seq [Edge TransitionRule], Int)
unNFA (NFA nfa) = (nfa, Seq.length nfa) | 92 | unNFA :: NFA -> (Seq.Seq [Edge TransitionRule], Int)
unNFA (NFA nfa) = (nfa, Seq.length nfa) | 92 | unNFA (NFA nfa) = (nfa, Seq.length nfa) | 39 | false | true | 0 | 9 | 14 | 52 | 27 | 25 | null | null |
rueshyna/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Folders/Logs/Delete.hs | mpl-2.0 | -- | OAuth access token.
fldAccessToken :: Lens' FoldersLogsDelete (Maybe Text)
fldAccessToken
= lens _fldAccessToken
(\ s a -> s{_fldAccessToken = a}) | 159 | fldAccessToken :: Lens' FoldersLogsDelete (Maybe Text)
fldAccessToken
= lens _fldAccessToken
(\ s a -> s{_fldAccessToken = a}) | 134 | fldAccessToken
= lens _fldAccessToken
(\ s a -> s{_fldAccessToken = a}) | 79 | true | true | 1 | 9 | 29 | 52 | 25 | 27 | null | null |
Undeterminant/taffybar | src/System/Taffybar/StrutProperties.hs | bsd-3-clause | -- | Reserve EWMH struts
setStrutProperties :: Window -> StrutProperties -> IO ()
setStrutProperties gtkWindow (left, right, top, bottom,
left_start_y, left_end_y,
right_start_y, right_end_y,
top_start_x, top_end_x,
... | 970 | setStrutProperties :: Window -> StrutProperties -> IO ()
setStrutProperties gtkWindow (left, right, top, bottom,
left_start_y, left_end_y,
right_start_y, right_end_y,
top_start_x, top_end_x,
b... | 945 | setStrutProperties gtkWindow (left, right, top, bottom,
left_start_y, left_end_y,
right_start_y, right_end_y,
top_start_x, top_end_x,
bottom_start_x, bottom_end_x) = do
let ptrWin = unsafe... | 888 | true | true | 0 | 14 | 446 | 214 | 110 | 104 | null | null |
kairne/repa-lts | Data/Array/Repa/Arbitrary.hs | bsd-3-clause | -- | Property tested for triple of unboxed random arrays with a given shape.
forAll3UShaped sh = forAll3 $ arbitraryUShaped sh | 126 | forAll3UShaped sh = forAll3 $ arbitraryUShaped sh | 49 | forAll3UShaped sh = forAll3 $ arbitraryUShaped sh | 49 | true | false | 0 | 6 | 20 | 17 | 8 | 9 | null | null |
owestphal/LootLanguage | src/BasicCategories.hs | bsd-3-clause | skillGems = activeGems | 22 | skillGems = activeGems | 22 | skillGems = activeGems | 22 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
dylanmc/cryptol | sbv/Data/SBV/Bridge/Yices.hs | bsd-3-clause | -- | Current solver instance, pointing to yices.
sbvCurrentSolver :: SMTConfig
sbvCurrentSolver = yices | 103 | sbvCurrentSolver :: SMTConfig
sbvCurrentSolver = yices | 54 | sbvCurrentSolver = yices | 24 | true | true | 0 | 4 | 13 | 12 | 7 | 5 | null | null |
ghulette/language-c-comments | src/Language/C/Comments/LineParser.hs | bsd-3-clause | joinBrokenLines [line] = [stripBreak line] | 42 | joinBrokenLines [line] = [stripBreak line] | 42 | joinBrokenLines [line] = [stripBreak line] | 42 | false | false | 0 | 6 | 4 | 19 | 9 | 10 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory/Tools/Wellformedness.hs | gpl-3.0 | ------------------------------------------------------------------------------
-- Checks
------------------------------------------------------------------------------
--- | Check that the protocol rules are well-formed.
sortsClashCheck :: HasFrees t => String -> t -> WfErrorReport
sortsClashCheck info t = case clashe... | 586 | sortsClashCheck :: HasFrees t => String -> t -> WfErrorReport
sortsClashCheck info t = case clashesOn removeSort id $ frees t of
[] -> []
cs -> return $
( "sorts"
, text info $-$ (nest 2 $ numbered' $ map prettyVarList cs)
)
where
removeSort lv = (lowerCase (lvarName lv... | 364 | sortsClashCheck info t = case clashesOn removeSort id $ frees t of
[] -> []
cs -> return $
( "sorts"
, text info $-$ (nest 2 $ numbered' $ map prettyVarList cs)
)
where
removeSort lv = (lowerCase (lvarName lv), lvarIdx lv)
-- | Report on sort clashes. | 302 | true | true | 0 | 14 | 123 | 132 | 67 | 65 | null | null |
adamschoenemann/wysas | src/Eval.hs | gpl-3.0 | writeProc [obj] = writeProc [obj, Port stdout] | 46 | writeProc [obj] = writeProc [obj, Port stdout] | 46 | writeProc [obj] = writeProc [obj, Port stdout] | 46 | false | false | 0 | 7 | 6 | 24 | 12 | 12 | null | null |
shlevy/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | isUnliftedTypeKind :: Kind -> Bool
isUnliftedTypeKind = is_TYPE is_unlifted
where
is_unlifted (TyConApp rr _args) = not (rr `hasKey` liftedRepDataConKey)
is_unlifted _ = False
-- | Is this the type 'RuntimeRep'? | 240 | isUnliftedTypeKind :: Kind -> Bool
isUnliftedTypeKind = is_TYPE is_unlifted
where
is_unlifted (TyConApp rr _args) = not (rr `hasKey` liftedRepDataConKey)
is_unlifted _ = False
-- | Is this the type 'RuntimeRep'? | 240 | isUnliftedTypeKind = is_TYPE is_unlifted
where
is_unlifted (TyConApp rr _args) = not (rr `hasKey` liftedRepDataConKey)
is_unlifted _ = False
-- | Is this the type 'RuntimeRep'? | 205 | false | true | 0 | 7 | 58 | 67 | 31 | 36 | null | null |
mihaimaruseac/HaCoTeB | old/src/HaCoTeB.hs | bsd-3-clause | representSection (Complete ('[':h) t)
| null extra = error ("Incomplete header" ++ " [" ++ h)
| headerID `isPrefixOf` "text" = representText t name extra
| headerID `isPrefixOf` "code" = representCode t name extra
| otherwise = error ("Invalid header" ++ " [" ++ h)
where
(header_data, extra) = span (/... | 456 | representSection (Complete ('[':h) t)
| null extra = error ("Incomplete header" ++ " [" ++ h)
| headerID `isPrefixOf` "text" = representText t name extra
| headerID `isPrefixOf` "code" = representCode t name extra
| otherwise = error ("Invalid header" ++ " [" ++ h)
where
(header_data, extra) = span (/... | 456 | representSection (Complete ('[':h) t)
| null extra = error ("Incomplete header" ++ " [" ++ h)
| headerID `isPrefixOf` "text" = representText t name extra
| headerID `isPrefixOf` "code" = representCode t name extra
| otherwise = error ("Invalid header" ++ " [" ++ h)
where
(header_data, extra) = span (/... | 456 | false | false | 3 | 9 | 102 | 158 | 82 | 76 | null | null |
leshchevds/ganeti | src/Ganeti/Metad/Config.hs | bsd-2-clause | getPublicOsParams :: JSObject JSValue -> Result (JSObject JSValue)
getPublicOsParams = getOsParams "osparams" "public" | 118 | getPublicOsParams :: JSObject JSValue -> Result (JSObject JSValue)
getPublicOsParams = getOsParams "osparams" "public" | 118 | getPublicOsParams = getOsParams "osparams" "public" | 51 | false | true | 0 | 9 | 12 | 37 | 16 | 21 | null | null |
joelburget/haste-compiler | libraries/haste-lib/src/Haste/Binary/Get.hs | bsd-3-clause | getFloat64le :: Get Double
getFloat64le =
Get $ \buf next -> Right (next+8, unsafePerformIO $ getF64le buf next) | 114 | getFloat64le :: Get Double
getFloat64le =
Get $ \buf next -> Right (next+8, unsafePerformIO $ getF64le buf next) | 114 | getFloat64le =
Get $ \buf next -> Right (next+8, unsafePerformIO $ getF64le buf next) | 87 | false | true | 3 | 9 | 19 | 51 | 24 | 27 | null | null |
aycanirican/network-transport-tcp | benchmarks/JustPingWithHeader.hs | bsd-3-clause | pingMessage :: ByteString
pingMessage = pack "ping123" | 54 | pingMessage :: ByteString
pingMessage = pack "ping123" | 54 | pingMessage = pack "ping123" | 28 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
IxpertaSolutions/freer-effects | bench/Core.hs | bsd-3-clause | runFHttp (Free.Free (FClose n)) = runFHttp n | 45 | runFHttp (Free.Free (FClose n)) = runFHttp n | 45 | runFHttp (Free.Free (FClose n)) = runFHttp n | 45 | false | false | 0 | 9 | 7 | 26 | 12 | 14 | null | null |
erochest/stat-nlp | Main.hs | apache-2.0 | -- | Fisher-Yates shuffle, modern algorithm
--
-- If the random number generator can return a random integer p ≤ j < q for
-- specified parameters p, q then following version could be used:
--
-- To shuffle an array a of n elements (indices 0..n-1):
-- for i from 0 to n − 2 do
-- j ← random integer such that i... | 578 | shuffle :: GenIO -> V.Vector x -> IO (V.Vector x)
shuffle g v' = do
v <- V.thaw v'
let n = MV.length v
forM_ [0..(n-2)] $ \i -> do
j <- uniformR (i+1, n-1) g
MV.swap v i j
V.freeze v | 216 | shuffle g v' = do
v <- V.thaw v'
let n = MV.length v
forM_ [0..(n-2)] $ \i -> do
j <- uniformR (i+1, n-1) g
MV.swap v i j
V.freeze v | 166 | true | true | 0 | 15 | 165 | 153 | 75 | 78 | null | null |
sannsyn/aeson-value-parser | library/AesonValueParser.hs | mit | string :: String a -> Value a
string (String parser) = Value $
ReaderT $ \case
Aeson.String x -> lift $ left (Error.message . fromMaybe "No details" . getLast) $ runExcept $ runReaderT parser x
_ -> empty
| 216 | string :: String a -> Value a
string (String parser) = Value $
ReaderT $ \case
Aeson.String x -> lift $ left (Error.message . fromMaybe "No details" . getLast) $ runExcept $ runReaderT parser x
_ -> empty
| 216 | string (String parser) = Value $
ReaderT $ \case
Aeson.String x -> lift $ left (Error.message . fromMaybe "No details" . getLast) $ runExcept $ runReaderT parser x
_ -> empty
| 186 | false | true | 4 | 15 | 49 | 99 | 45 | 54 | null | null |
ryna4c2e/chage | ChageComp.hs | mit | lookupVar :: Var -> State CompileState Reg
lookupVar var@(Var s) = do
vars <- use (frame.intVars)
case lookup var vars of
Nothing -> error $ "undefined variable: " ++ s
Just rg -> return rg
-- ポインタ変数を,シンボルテーブルから引っ張ってくる. | 232 | lookupVar :: Var -> State CompileState Reg
lookupVar var@(Var s) = do
vars <- use (frame.intVars)
case lookup var vars of
Nothing -> error $ "undefined variable: " ++ s
Just rg -> return rg
-- ポインタ変数を,シンボルテーブルから引っ張ってくる. | 232 | lookupVar var@(Var s) = do
vars <- use (frame.intVars)
case lookup var vars of
Nothing -> error $ "undefined variable: " ++ s
Just rg -> return rg
-- ポインタ変数を,シンボルテーブルから引っ張ってくる. | 189 | false | true | 11 | 7 | 49 | 85 | 43 | 42 | null | null |
thewoolleyman/haskellbook | 12/05/eric/MyMaybe.hs | unlicense | flipMaybe :: [Maybe a] -> Maybe [a]
flipMaybe maybeList =
if length maybeList /= length onlyJusts then
Nothing
else
Just onlyJusts
where onlyJusts = catMaybes maybeList | 182 | flipMaybe :: [Maybe a] -> Maybe [a]
flipMaybe maybeList =
if length maybeList /= length onlyJusts then
Nothing
else
Just onlyJusts
where onlyJusts = catMaybes maybeList | 182 | flipMaybe maybeList =
if length maybeList /= length onlyJusts then
Nothing
else
Just onlyJusts
where onlyJusts = catMaybes maybeList | 146 | false | true | 0 | 7 | 39 | 62 | 30 | 32 | null | null |
pedropazello/Haskell_99_problems | lists.hs | mit | -- Problem 16
{--
(**) Drop every N'th element from a list.
--}
dropEvery :: Eq a => [a] -> Int -> [a]
dropEvery [] _ = [] | 138 | dropEvery :: Eq a => [a] -> Int -> [a]
dropEvery [] _ = [] | 71 | dropEvery [] _ = [] | 23 | true | true | 0 | 8 | 43 | 48 | 24 | 24 | null | null |
brendanhay/gogol | gogol-resourcemanager/gen/Network/Google/ResourceManager/Types/Product.hs | mpl-2.0 | -- | The display name of the folder.
crmgcrmvfoDisplayName :: Lens' CloudResourceManagerGoogleCloudResourceManagerV2alpha1FolderOperation (Maybe Text)
crmgcrmvfoDisplayName
= lens _crmgcrmvfoDisplayName
(\ s a -> s{_crmgcrmvfoDisplayName = a}) | 251 | crmgcrmvfoDisplayName :: Lens' CloudResourceManagerGoogleCloudResourceManagerV2alpha1FolderOperation (Maybe Text)
crmgcrmvfoDisplayName
= lens _crmgcrmvfoDisplayName
(\ s a -> s{_crmgcrmvfoDisplayName = a}) | 214 | crmgcrmvfoDisplayName
= lens _crmgcrmvfoDisplayName
(\ s a -> s{_crmgcrmvfoDisplayName = a}) | 100 | true | true | 0 | 9 | 32 | 48 | 25 | 23 | null | null |
koba-e964/hayashii-mcc | SSA.hs | bsd-3-clause | nextOfTerm (TBr _ blk1 blk2) = [blk1, blk2] | 43 | nextOfTerm (TBr _ blk1 blk2) = [blk1, blk2] | 43 | nextOfTerm (TBr _ blk1 blk2) = [blk1, blk2] | 43 | false | false | 0 | 6 | 7 | 26 | 13 | 13 | null | null |
romanb/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types.hs | mpl-2.0 | -- | The name of the cluster parameter group family for the cluster.
cvClusterParameterGroupFamily :: Lens' ClusterVersion (Maybe Text)
cvClusterParameterGroupFamily =
lens _cvClusterParameterGroupFamily
(\s a -> s { _cvClusterParameterGroupFamily = a }) | 266 | cvClusterParameterGroupFamily :: Lens' ClusterVersion (Maybe Text)
cvClusterParameterGroupFamily =
lens _cvClusterParameterGroupFamily
(\s a -> s { _cvClusterParameterGroupFamily = a }) | 197 | cvClusterParameterGroupFamily =
lens _cvClusterParameterGroupFamily
(\s a -> s { _cvClusterParameterGroupFamily = a }) | 130 | true | true | 0 | 9 | 43 | 46 | 25 | 21 | null | null |
bryanmikaelian/99 | one.hs | mit | -- Find the last element in the list
lastElem :: [a] -> a
lastElem xs = head (reverse xs) | 90 | lastElem :: [a] -> a
lastElem xs = head (reverse xs) | 52 | lastElem xs = head (reverse xs) | 31 | true | true | 0 | 7 | 19 | 31 | 16 | 15 | null | null |
lihlcnkr/codejam | backup/src/R1/AmpleSyrup.hs | apache-2.0 | getTotalLineCount :: String -> Int
getTotalLineCount x =
let datas = words x
in read (head datas) | 105 | getTotalLineCount :: String -> Int
getTotalLineCount x =
let datas = words x
in read (head datas) | 105 | getTotalLineCount x =
let datas = words x
in read (head datas) | 70 | false | true | 0 | 9 | 24 | 41 | 19 | 22 | null | null |
peter-fogg/pardoc | tests/Tests/Readers/Markdown.hs | gpl-2.0 | markdownCDL :: String -> Pandoc
markdownCDL = readMarkdown def { readerExtensions = Set.insert
Ext_compact_definition_lists $ readerExtensions def } | 165 | markdownCDL :: String -> Pandoc
markdownCDL = readMarkdown def { readerExtensions = Set.insert
Ext_compact_definition_lists $ readerExtensions def } | 165 | markdownCDL = readMarkdown def { readerExtensions = Set.insert
Ext_compact_definition_lists $ readerExtensions def } | 133 | false | true | 0 | 10 | 34 | 38 | 19 | 19 | null | null |
garethrowlands/marsrover | test/GeometryTests.hs | bsd-3-clause | compassDirs = [N,E,S,W] | 23 | compassDirs = [N,E,S,W] | 23 | compassDirs = [N,E,S,W] | 23 | false | false | 0 | 5 | 2 | 18 | 11 | 7 | null | null |
lpeterse/koka | src/Common/NamePrim.hs | apache-2.0 | nameTpPure = preludeName "pure" | 36 | nameTpPure = preludeName "pure" | 36 | nameTpPure = preludeName "pure" | 36 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
d3sformal/bacon-core | test/RecPdr.hs | mit | vM' = intVar' nM | 17 | vM' = intVar' nM | 17 | vM' = intVar' nM | 17 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
bruno-cadorette/Baeta-Compiler | src/Parser/Build.hs | gpl-3.0 | mergeHeaderWithFunction :: Map String FunctionSignature -> [(TopLevelName, NonTypedExpr)] -> Either String [(Named Function)]
mergeHeaderWithFunction typeMap ((functionName, expr):xs) =
case Map.lookup functionName typeMap of
Just t -> ((Named functionName $ Function (Just t) expr) :) <$> mergeHeaderWithF... | 467 | mergeHeaderWithFunction :: Map String FunctionSignature -> [(TopLevelName, NonTypedExpr)] -> Either String [(Named Function)]
mergeHeaderWithFunction typeMap ((functionName, expr):xs) =
case Map.lookup functionName typeMap of
Just t -> ((Named functionName $ Function (Just t) expr) :) <$> mergeHeaderWithF... | 467 | mergeHeaderWithFunction typeMap ((functionName, expr):xs) =
case Map.lookup functionName typeMap of
Just t -> ((Named functionName $ Function (Just t) expr) :) <$> mergeHeaderWithFunction (delete functionName typeMap) xs
Nothing -> ((Named functionName $ Function Nothing expr) :) <$> mergeHeaderWi... | 341 | false | true | 0 | 14 | 74 | 161 | 82 | 79 | null | null |
adamrk/scheme2luac | src/Parser2.hs | bsd-3-clause | parSubseq :: Parser Char
parSubseq = parInit <|> digit <|> oneOf ['+', '-', '.', '@'] | 85 | parSubseq :: Parser Char
parSubseq = parInit <|> digit <|> oneOf ['+', '-', '.', '@'] | 85 | parSubseq = parInit <|> digit <|> oneOf ['+', '-', '.', '@'] | 60 | false | true | 6 | 6 | 14 | 48 | 25 | 23 | null | null |
DarrenMowat/blackbox | tests/results/SplitTests.hs | unlicense | test16 (Leaf t) = 0 | 19 | test16 (Leaf t) = 0 | 19 | test16 (Leaf t) = 0 | 19 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
wjt/bustle | Test/Regions.hs | lgpl-2.1 | shuffled xs = do
i <- choose (0, length xs - 1)
let x = xs !! i
pre = take i xs
post = drop (i + 1) xs
xs' <- shuffled (pre ++ post)
return (x:xs') | 183 | shuffled xs = do
i <- choose (0, length xs - 1)
let x = xs !! i
pre = take i xs
post = drop (i + 1) xs
xs' <- shuffled (pre ++ post)
return (x:xs') | 183 | shuffled xs = do
i <- choose (0, length xs - 1)
let x = xs !! i
pre = take i xs
post = drop (i + 1) xs
xs' <- shuffled (pre ++ post)
return (x:xs') | 183 | false | false | 0 | 12 | 73 | 102 | 49 | 53 | null | null |
dmbarbour/awelon | hsrc/AO/AOFile.hs | bsd-3-clause | -- prevent retry
specialIfNotUnique imp locations = emitWarning emsg where
emsg = L.concat (header:body)
header = T.unpack imp ++ " import ambiguous. Locations: "
body = fmap (showString "\n " . show) locations
-- load a specific import file. | 257 | specialIfNotUnique imp locations = emitWarning emsg where
emsg = L.concat (header:body)
header = T.unpack imp ++ " import ambiguous. Locations: "
body = fmap (showString "\n " . show) locations
-- load a specific import file. | 239 | specialIfNotUnique imp locations = emitWarning emsg where
emsg = L.concat (header:body)
header = T.unpack imp ++ " import ambiguous. Locations: "
body = fmap (showString "\n " . show) locations
-- load a specific import file. | 239 | true | false | 0 | 10 | 53 | 69 | 35 | 34 | null | null |
pgj/bead | src/Bead/View/RouteOf.hs | bsd-3-clause | newGroupAssignmentPreviewPath :: RoutePath
newGroupAssignmentPreviewPath = "/new-group-assignment-preview" | 106 | newGroupAssignmentPreviewPath :: RoutePath
newGroupAssignmentPreviewPath = "/new-group-assignment-preview" | 106 | newGroupAssignmentPreviewPath = "/new-group-assignment-preview" | 63 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
hackern/network-hans | src/Network/Socket/ByteString/Lazy.hs | bsd-3-clause | getContents :: Socket -> IO ByteString
getContents socket = lazyRead
where
lazyRead = unsafeInterleaveIO loop
loop =
do bstr <- recv socket 4096
if L.null bstr
then return L.empty
else do next <- lazyRead
return (bstr `L.append` next) | 288 | getContents :: Socket -> IO ByteString
getContents socket = lazyRead
where
lazyRead = unsafeInterleaveIO loop
loop =
do bstr <- recv socket 4096
if L.null bstr
then return L.empty
else do next <- lazyRead
return (bstr `L.append` next) | 288 | getContents socket = lazyRead
where
lazyRead = unsafeInterleaveIO loop
loop =
do bstr <- recv socket 4096
if L.null bstr
then return L.empty
else do next <- lazyRead
return (bstr `L.append` next) | 249 | false | true | 0 | 12 | 91 | 94 | 45 | 49 | null | null |
rubenmoor/skull | skull-server/src/Data/Functor/Extended.hs | mit | forEach
:: Functor m
=> m a
-> (a -> b)
-> m b
forEach = flip fmap | 74 | forEach
:: Functor m
=> m a
-> (a -> b)
-> m b
forEach = flip fmap | 74 | forEach = flip fmap | 19 | false | true | 0 | 10 | 25 | 48 | 21 | 27 | null | null |
abakst/liquidhaskell | src/Language/Haskell/Liquid/Parse.hs | bsd-3-clause | angles = Token.angles lexer | 41 | angles = Token.angles lexer | 41 | angles = Token.angles lexer | 41 | false | false | 0 | 6 | 17 | 11 | 5 | 6 | null | null |
kim/amazonka | amazonka/src/Network/AWS/EC2/Metadata.hs | mpl-2.0 | request :: Manager -> Text -> IO ByteString
request m url = do
rq <- parseUrl (Text.unpack url)
rs <- httpLbs (rq { responseTimeout = Just 2 }) m
return . LBS.toStrict $ responseBody rs | 197 | request :: Manager -> Text -> IO ByteString
request m url = do
rq <- parseUrl (Text.unpack url)
rs <- httpLbs (rq { responseTimeout = Just 2 }) m
return . LBS.toStrict $ responseBody rs | 197 | request m url = do
rq <- parseUrl (Text.unpack url)
rs <- httpLbs (rq { responseTimeout = Just 2 }) m
return . LBS.toStrict $ responseBody rs | 153 | false | true | 0 | 13 | 46 | 92 | 42 | 50 | null | null |
tfausak/exercism-solutions | haskell/raindrops/Raindrops.hs | mit | convert :: Int -> String
convert n
| null drops = show n
| otherwise = drops
where
divisibleBy d = n `rem` d == 0
drops = concat
[ if divisibleBy 3 then "Pling" else ""
, if divisibleBy 5 then "Plang" else ""
, if divisibleBy 7 then "Plong" else ""
... | 326 | convert :: Int -> String
convert n
| null drops = show n
| otherwise = drops
where
divisibleBy d = n `rem` d == 0
drops = concat
[ if divisibleBy 3 then "Pling" else ""
, if divisibleBy 5 then "Plang" else ""
, if divisibleBy 7 then "Plong" else ""
... | 326 | convert n
| null drops = show n
| otherwise = drops
where
divisibleBy d = n `rem` d == 0
drops = concat
[ if divisibleBy 3 then "Pling" else ""
, if divisibleBy 5 then "Plang" else ""
, if divisibleBy 7 then "Plong" else ""
] | 301 | false | true | 0 | 10 | 129 | 109 | 56 | 53 | null | null |
f1u77y/xmonad-contrib | XMonad/Layout/BinarySpacePartition.hs | bsd-3-clause | -- find out which borders have been pulled. We need the old and new rects and the mouse coordinates
changedDirs :: Rectangle -> Rectangle -> (Int,Int) -> [Direction2D]
changedDirs (Rectangle _ _ ow oh) (Rectangle _ _ w h) (mx,my) = catMaybes [lr, ud]
where lr = if ow==w then Nothing
else Just (if (fi mx ::... | 540 | changedDirs :: Rectangle -> Rectangle -> (Int,Int) -> [Direction2D]
changedDirs (Rectangle _ _ ow oh) (Rectangle _ _ w h) (mx,my) = catMaybes [lr, ud]
where lr = if ow==w then Nothing
else Just (if (fi mx :: Double) > (fi ow :: Double)/2 then R else L)
ud = if oh==h then Nothing
else Ju... | 440 | changedDirs (Rectangle _ _ ow oh) (Rectangle _ _ w h) (mx,my) = catMaybes [lr, ud]
where lr = if ow==w then Nothing
else Just (if (fi mx :: Double) > (fi ow :: Double)/2 then R else L)
ud = if oh==h then Nothing
else Just (if (fi my :: Double) > (fi oh :: Double)/2 then D else U)
-- no... | 372 | true | true | 1 | 14 | 128 | 199 | 110 | 89 | null | null |
knrafto/bash-config | src/Bash/Config/Lexer.hs | bsd-3-clause | -- | Redirection operators, not including heredoc operators.
redirOps :: [String]
redirOps = [">", "<", ">>", ">|", "<>", "<<<", "<&", ">&", "&>", "&>>"] | 153 | redirOps :: [String]
redirOps = [">", "<", ">>", ">|", "<>", "<<<", "<&", ">&", "&>", "&>>"] | 92 | redirOps = [">", "<", ">>", ">|", "<>", "<<<", "<&", ">&", "&>", "&>>"] | 71 | true | true | 0 | 5 | 22 | 45 | 29 | 16 | null | null |
simhu/cubical | CTT.hs | mit | showVal VI = "I" | 38 | showVal VI = "I" | 38 | showVal VI = "I" | 38 | false | false | 0 | 5 | 25 | 9 | 4 | 5 | null | null |
UCSD-PL/nano-js | Language/Nano/Typecheck/Types.hs | bsd-3-clause | infixOpId OpNEq = builtinId "OpNEq" | 35 | infixOpId OpNEq = builtinId "OpNEq" | 35 | infixOpId OpNEq = builtinId "OpNEq" | 35 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
mgsloan/quasi-extras | src/Language/Quasi/Ast/TH.hs | bsd-3-clause | cxtc = astQuoter True "Cxt" parseCxt | 37 | cxtc = astQuoter True "Cxt" parseCxt | 37 | cxtc = astQuoter True "Cxt" parseCxt | 37 | false | false | 0 | 5 | 6 | 13 | 6 | 7 | null | null |
olsner/ghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | emitMultiAssign regs rhss = do
dflags <- getDynFlags
ASSERT2( equalLength regs rhss, ppr regs $$ ppr rhss )
unscramble dflags ([1..] `zip` (regs `zip` rhss)) | 167 | emitMultiAssign regs rhss = do
dflags <- getDynFlags
ASSERT2( equalLength regs rhss, ppr regs $$ ppr rhss )
unscramble dflags ([1..] `zip` (regs `zip` rhss)) | 167 | emitMultiAssign regs rhss = do
dflags <- getDynFlags
ASSERT2( equalLength regs rhss, ppr regs $$ ppr rhss )
unscramble dflags ([1..] `zip` (regs `zip` rhss)) | 167 | false | false | 0 | 11 | 34 | 72 | 37 | 35 | null | null |
joozek78/stack | src/Stack/Types/Config.hs | bsd-3-clause | -- | Relative directory for the platform identifier
platformRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)
platformRelDir = asks getPlatform >>= parseRelDir . Distribution.Text.display | 218 | platformRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)
platformRelDir = asks getPlatform >>= parseRelDir . Distribution.Text.display | 166 | platformRelDir = asks getPlatform >>= parseRelDir . Distribution.Text.display | 77 | true | true | 0 | 8 | 29 | 60 | 31 | 29 | null | null |
ghcjs/ghcjs-base | test/Tests/Properties.hs | mit | sf_last p = (last . L.filter p) `eqP` (S.last . S.filter p) | 67 | sf_last p = (last . L.filter p) `eqP` (S.last . S.filter p) | 67 | sf_last p = (last . L.filter p) `eqP` (S.last . S.filter p) | 67 | false | false | 0 | 9 | 19 | 41 | 21 | 20 | null | null |
IreneKnapp/direct-http | Haskell/Network/HTTP.hs | mit | fromHeader HttpContentLanguage = UTF8.fromString "Content-Language" | 67 | fromHeader HttpContentLanguage = UTF8.fromString "Content-Language" | 67 | fromHeader HttpContentLanguage = UTF8.fromString "Content-Language" | 67 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
NorfairKing/the-notes | src/Functions/Application/Macro.hs | gpl-2.0 | -- |
-- > fn3 = app3
fn3 :: Note -> Note -> Note -> Note -> Note
fn3 = app3 | 75 | fn3 :: Note -> Note -> Note -> Note -> Note
fn3 = app3 | 54 | fn3 = app3 | 10 | true | true | 0 | 8 | 20 | 29 | 16 | 13 | null | null |
rvion/ride | jetpack/src/Options/Applicative/Extra/AsOpt.hs | bsd-3-clause | -- opt_handleParseResult :: forall a. ParserResult a -> IO a
opt_handleParseResult = I.handleParseResult | 104 | opt_handleParseResult = I.handleParseResult | 43 | opt_handleParseResult = I.handleParseResult | 43 | true | false | 1 | 6 | 12 | 13 | 5 | 8 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/Data/Typeable/Internal.hs | bsd-3-clause | showArgs _ [a] = showsPrec 10 a | 36 | showArgs _ [a] = showsPrec 10 a | 36 | showArgs _ [a] = showsPrec 10 a | 36 | false | false | 1 | 5 | 11 | 21 | 9 | 12 | null | null |
rueshyna/gogol | gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Delete.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
proUploadType :: Lens' ProjectsRulesetsDelete (Maybe Text)
proUploadType
= lens _proUploadType
(\ s a -> s{_proUploadType = a}) | 206 | proUploadType :: Lens' ProjectsRulesetsDelete (Maybe Text)
proUploadType
= lens _proUploadType
(\ s a -> s{_proUploadType = a}) | 135 | proUploadType
= lens _proUploadType
(\ s a -> s{_proUploadType = a}) | 76 | true | true | 1 | 9 | 34 | 51 | 25 | 26 | null | null |
awakenetworks/gRPC-haskell | core/tests/UnsafeTests.hs | apache-2.0 | roundtripMetadataKeyVals :: MetadataMap -> IO MetadataMap
roundtripMetadataKeyVals m = do
(kvPtr, l) <- createMetadata m
m' <- getAllMetadata kvPtr l
metadataFree kvPtr
return m' | 186 | roundtripMetadataKeyVals :: MetadataMap -> IO MetadataMap
roundtripMetadataKeyVals m = do
(kvPtr, l) <- createMetadata m
m' <- getAllMetadata kvPtr l
metadataFree kvPtr
return m' | 186 | roundtripMetadataKeyVals m = do
(kvPtr, l) <- createMetadata m
m' <- getAllMetadata kvPtr l
metadataFree kvPtr
return m' | 128 | false | true | 0 | 9 | 31 | 66 | 28 | 38 | null | null |
facebookincubator/duckling | Duckling/Time/TR/Rules.hs | bsd-3-clause | ruleMmdd :: Rule
ruleMmdd = Rule
{ name = "mm/dd"
, pattern =
[ regex "([012]?[1-9]|10|20|30|31)\\.(10|11|12|0?[1-9])\\.?"
]
, prod = \case
(Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do
d <- parseInt m1
m <- parseInt m2
tt $ monthDay m d
_ -> Nothing
} | 308 | ruleMmdd :: Rule
ruleMmdd = Rule
{ name = "mm/dd"
, pattern =
[ regex "([012]?[1-9]|10|20|30|31)\\.(10|11|12|0?[1-9])\\.?"
]
, prod = \case
(Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do
d <- parseInt m1
m <- parseInt m2
tt $ monthDay m d
_ -> Nothing
} | 308 | ruleMmdd = Rule
{ name = "mm/dd"
, pattern =
[ regex "([012]?[1-9]|10|20|30|31)\\.(10|11|12|0?[1-9])\\.?"
]
, prod = \case
(Token RegexMatch (GroupMatch (m1:m2:_)):_) -> do
d <- parseInt m1
m <- parseInt m2
tt $ monthDay m d
_ -> Nothing
} | 291 | false | true | 0 | 18 | 95 | 116 | 58 | 58 | null | null |
yliu120/K3 | src/Language/K3/Analysis/HMTypes/Inference.hs | apache-2.0 | mkCollectionQType _ qt = left $ "Invalid content record type: " ++ show qt | 74 | mkCollectionQType _ qt = left $ "Invalid content record type: " ++ show qt | 74 | mkCollectionQType _ qt = left $ "Invalid content record type: " ++ show qt | 74 | false | false | 0 | 6 | 13 | 22 | 10 | 12 | null | null |
roelvandijk/ftdi | System/FTDI/Properties.hs | bsd-3-clause | prop_baudRateError ∷ RealFrac α ⇒ α → (ChipType → BaudRate α → Bool)
prop_baudRateError maxError = \chip baudRate →
let b = nearestBaudRate chip baudRate
e = abs (b - baudRate) ÷ baudRate
in unBaudRate e ≤ maxError | 230 | prop_baudRateError ∷ RealFrac α ⇒ α → (ChipType → BaudRate α → Bool)
prop_baudRateError maxError = \chip baudRate →
let b = nearestBaudRate chip baudRate
e = abs (b - baudRate) ÷ baudRate
in unBaudRate e ≤ maxError | 230 | prop_baudRateError maxError = \chip baudRate →
let b = nearestBaudRate chip baudRate
e = abs (b - baudRate) ÷ baudRate
in unBaudRate e ≤ maxError | 161 | false | true | 2 | 13 | 53 | 93 | 44 | 49 | null | null |
keera-studios/hsQt | Qtc/Core/QLocale.hs | bsd-2-clause | qLocaleLanguageToString :: ((Language)) -> IO (String)
qLocaleLanguageToString (x1)
= withStringResult $
qtc_QLocale_languageToString (toCLong $ qEnum_toInt x1) | 166 | qLocaleLanguageToString :: ((Language)) -> IO (String)
qLocaleLanguageToString (x1)
= withStringResult $
qtc_QLocale_languageToString (toCLong $ qEnum_toInt x1) | 166 | qLocaleLanguageToString (x1)
= withStringResult $
qtc_QLocale_languageToString (toCLong $ qEnum_toInt x1) | 111 | false | true | 0 | 9 | 21 | 50 | 26 | 24 | null | null |
thielema/gitit | Network/Gitit.hs | gpl-2.0 | wikiHandlers :: [Handler]
wikiHandlers =
[ -- redirect /wiki -> /wiki/ when gitit is being served at /wiki
-- so that relative wikilinks on the page will work properly:
guardBareBase >> getWikiBase >>= \b -> movedPermanently (b ++ "/") (toResponse ())
, dir "_activity" showActivity
, dir "_go" goToP... | 1,833 | wikiHandlers :: [Handler]
wikiHandlers =
[ -- redirect /wiki -> /wiki/ when gitit is being served at /wiki
-- so that relative wikilinks on the page will work properly:
guardBareBase >> getWikiBase >>= \b -> movedPermanently (b ++ "/") (toResponse ())
, dir "_activity" showActivity
, dir "_go" goToP... | 1,833 | wikiHandlers =
[ -- redirect /wiki -> /wiki/ when gitit is being served at /wiki
-- so that relative wikilinks on the page will work properly:
guardBareBase >> getWikiBase >>= \b -> movedPermanently (b ++ "/") (toResponse ())
, dir "_activity" showActivity
, dir "_go" goToPage
, dir "_search" se... | 1,807 | false | true | 0 | 12 | 461 | 474 | 235 | 239 | null | null |
valderman/haste-app | src/Haste/App.hs | mit | -- | Create a remote endpoint for use with 'dispatchTo'.
remoteNode :: String -> Int -> Endpoint
remoteNode = WebSocket | 119 | remoteNode :: String -> Int -> Endpoint
remoteNode = WebSocket | 62 | remoteNode = WebSocket | 22 | true | true | 0 | 6 | 19 | 20 | 11 | 9 | null | null |
sgillespie/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | delListFromOccEnv (A x) y = A $ delListFromUFM x y | 51 | delListFromOccEnv (A x) y = A $ delListFromUFM x y | 51 | delListFromOccEnv (A x) y = A $ delListFromUFM x y | 51 | false | false | 0 | 7 | 10 | 26 | 12 | 14 | null | null |
oden-lang/oden | src/Oden/Scanner.hs | mit | isRegularFileOrDirectory :: FilePath -> Bool
isRegularFileOrDirectory f = f /= "." && f /= ".." | 95 | isRegularFileOrDirectory :: FilePath -> Bool
isRegularFileOrDirectory f = f /= "." && f /= ".." | 95 | isRegularFileOrDirectory f = f /= "." && f /= ".." | 50 | false | true | 0 | 7 | 14 | 30 | 15 | 15 | null | null |
robx/puzzle-draw | src/Data/Compose.hs | mit | handle f Sudoku = f R.sudoku D.sudoku | 37 | handle f Sudoku = f R.sudoku D.sudoku | 37 | handle f Sudoku = f R.sudoku D.sudoku | 37 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
hirokai/PaperServer | Parser/Publisher/Nature2.hs | bsd-2-clause | _nature2Reader = defaultReader {
supportedUrl = _supportedUrl,
-- supported = _supported,
title = anyLevel _title,
-- abstract = _abstract,
doi = anyLevel _doi,
journal = anyLevel _journal,
volume = anyLevel _volume,
pageFrom = anyLevel _pageFrom,
pageTo = anyLevel _pageTo,
year = anyLevel _year,
au... | 541 | _nature2Reader = defaultReader {
supportedUrl = _supportedUrl,
-- supported = _supported,
title = anyLevel _title,
-- abstract = _abstract,
doi = anyLevel _doi,
journal = anyLevel _journal,
volume = anyLevel _volume,
pageFrom = anyLevel _pageFrom,
pageTo = anyLevel _pageTo,
year = anyLevel _year,
au... | 541 | _nature2Reader = defaultReader {
supportedUrl = _supportedUrl,
-- supported = _supported,
title = anyLevel _title,
-- abstract = _abstract,
doi = anyLevel _doi,
journal = anyLevel _journal,
volume = anyLevel _volume,
pageFrom = anyLevel _pageFrom,
pageTo = anyLevel _pageTo,
year = anyLevel _year,
au... | 541 | false | false | 0 | 7 | 106 | 129 | 75 | 54 | null | null |
benweitzman/DivisionOfLabor | src/DivisionOfLabor-cli/Graphics/Vty/Widgets/HexGrid.hs | mit | hexGridKeyEvent w KDown _ = moveDown w >> return True | 53 | hexGridKeyEvent w KDown _ = moveDown w >> return True | 53 | hexGridKeyEvent w KDown _ = moveDown w >> return True | 53 | false | false | 0 | 6 | 9 | 23 | 10 | 13 | null | null |
typelead/epm | Cabal/Distribution/PackageDescription/Parse.hs | bsd-3-clause | validateBenchmark :: LineNo -> BenchmarkStanza -> ParseResult Benchmark
validateBenchmark line stanza =
case benchmarkStanzaBenchmarkType stanza of
Nothing -> return $
emptyBenchmark { benchmarkBuildInfo = benchmarkStanzaBuildInfo stanza }
Just tt@(BenchmarkTypeUnknown _ _) ->
return em... | 1,548 | validateBenchmark :: LineNo -> BenchmarkStanza -> ParseResult Benchmark
validateBenchmark line stanza =
case benchmarkStanzaBenchmarkType stanza of
Nothing -> return $
emptyBenchmark { benchmarkBuildInfo = benchmarkStanzaBuildInfo stanza }
Just tt@(BenchmarkTypeUnknown _ _) ->
return em... | 1,548 | validateBenchmark line stanza =
case benchmarkStanzaBenchmarkType stanza of
Nothing -> return $
emptyBenchmark { benchmarkBuildInfo = benchmarkStanzaBuildInfo stanza }
Just tt@(BenchmarkTypeUnknown _ _) ->
return emptyBenchmark {
benchmarkInterface = BenchmarkUnsupported tt,
... | 1,476 | false | true | 4 | 18 | 439 | 328 | 157 | 171 | null | null |
Hi-Angel/yi | yi-core/src/Yi/Buffer/Misc.hs | gpl-2.0 | shortIdentString :: Int -- ^ Number of characters to drop from FileBuffer names
-> FBuffer -- ^ Buffer to work with
-> T.Text
shortIdentString dl b = case b ^. identA of
MemBuffer bName -> "*" <> bName <> "*"
FileBuffer fName -> T.pack . joinPath . drop dl $ splitPath fName
-- | G... | 490 | shortIdentString :: Int -- ^ Number of characters to drop from FileBuffer names
-> FBuffer -- ^ Buffer to work with
-> T.Text
shortIdentString dl b = case b ^. identA of
MemBuffer bName -> "*" <> bName <> "*"
FileBuffer fName -> T.pack . joinPath . drop dl $ splitPath fName
-- | G... | 490 | shortIdentString dl b = case b ^. identA of
MemBuffer bName -> "*" <> bName <> "*"
FileBuffer fName -> T.pack . joinPath . drop dl $ splitPath fName
-- | Gets the buffer's identifier string, emphasising the 'MemBuffer':
--
-- >>> identString (MemBuffer "hello")
-- "*hello*"
-- >>> identString (FileBuffer "hello")
... | 330 | false | true | 0 | 11 | 115 | 88 | 46 | 42 | null | null |
factisresearch/HStringTemplate | Text/StringTemplate/Base.hs | bsd-3-clause | -- | Adds a set of global options to a single template
optInsertTmpl :: [(String, String)] -> StringTemplate a -> StringTemplate a
optInsertTmpl x st = st {senv = optInsert (map (second justSTR) x) (senv st)} | 208 | optInsertTmpl :: [(String, String)] -> StringTemplate a -> StringTemplate a
optInsertTmpl x st = st {senv = optInsert (map (second justSTR) x) (senv st)} | 153 | optInsertTmpl x st = st {senv = optInsert (map (second justSTR) x) (senv st)} | 77 | true | true | 0 | 11 | 35 | 73 | 38 | 35 | null | null |
raposalorx/mssbot | Text.hs | bsd-3-clause | regexUrl = "(http(s)?://)?(www.)?([a-zA-Z0-9\\-_]{1,}\\.){1,}[a-zA-Z]{2,4}(/)?[^ ]*" | 84 | regexUrl = "(http(s)?://)?(www.)?([a-zA-Z0-9\\-_]{1,}\\.){1,}[a-zA-Z]{2,4}(/)?[^ ]*" | 84 | regexUrl = "(http(s)?://)?(www.)?([a-zA-Z0-9\\-_]{1,}\\.){1,}[a-zA-Z]{2,4}(/)?[^ ]*" | 84 | false | false | 0 | 4 | 3 | 6 | 3 | 3 | null | null |
kcharter/iteratee-playpen | demo-incremental.hs | bsd-3-clause | doPure :: Show a => String -> a -> IO ()
doPure msg v = putStr msg >> putStr " " >> print v | 91 | doPure :: Show a => String -> a -> IO ()
doPure msg v = putStr msg >> putStr " " >> print v | 91 | doPure msg v = putStr msg >> putStr " " >> print v | 50 | false | true | 0 | 9 | 23 | 53 | 24 | 29 | null | null |
alphalambda/codeworld | codeworld-api/src/CodeWorld/EntryPoints.hs | apache-2.0 | drawControl _ _ PanningLayer = blank | 36 | drawControl _ _ PanningLayer = blank | 36 | drawControl _ _ PanningLayer = blank | 36 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
damoxc/ganeti | test/hs/Test/Ganeti/OpCodes.hs | gpl-2.0 | -- | Gets a node name in non-empty type.
genNodeNameNE :: Gen NonEmptyString
genNodeNameNE = genFQDN >>= mkNonEmpty | 115 | genNodeNameNE :: Gen NonEmptyString
genNodeNameNE = genFQDN >>= mkNonEmpty | 74 | genNodeNameNE = genFQDN >>= mkNonEmpty | 38 | true | true | 0 | 5 | 17 | 19 | 10 | 9 | null | null |
kim/amazonka | amazonka-datapipeline/gen/Network/AWS/DataPipeline/Types.hs | mpl-2.0 | -- | The value that the actual field value will be compared with.
oValues :: Lens' Operator [Text]
oValues = lens _oValues (\s a -> s { _oValues = a }) . _List | 159 | oValues :: Lens' Operator [Text]
oValues = lens _oValues (\s a -> s { _oValues = a }) . _List | 93 | oValues = lens _oValues (\s a -> s { _oValues = a }) . _List | 60 | true | true | 0 | 10 | 32 | 47 | 26 | 21 | null | null |
timorantalaiho/pong11 | src/GameLogic.hs | bsd-3-clause | withinBoardHeight :: Float -> Board -> Bool
withinBoardHeight yPos board = yPos >= 0.0 && yPos <= (boardHeight board) | 117 | withinBoardHeight :: Float -> Board -> Bool
withinBoardHeight yPos board = yPos >= 0.0 && yPos <= (boardHeight board) | 117 | withinBoardHeight yPos board = yPos >= 0.0 && yPos <= (boardHeight board) | 73 | false | true | 0 | 7 | 18 | 42 | 21 | 21 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.