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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dr-Horv/Advent-of-code | day16/day16.hs | mit | has3trees :: SueInfo -> Bool
has3trees si = maybeHasX (==) 3 $ trees si | 71 | has3trees :: SueInfo -> Bool
has3trees si = maybeHasX (==) 3 $ trees si | 71 | has3trees si = maybeHasX (==) 3 $ trees si | 42 | false | true | 0 | 6 | 13 | 32 | 16 | 16 | null | null |
nataren/youtrack | src/YouTrack.hs | apache-2.0 | buildAuthOptions :: YouTrackAuth -> Options
buildAuthOptions auth = defaults &
header "Accept" .~ ["application/json"] &
header "Cookie" .~ [C.append (C.pack "JSESSIONID=") (sessionId auth), C.append (C.pack "jetbrains.charisma.main.security.PRINCIPAL=") (principal auth)] | 320 | buildAuthOptions :: YouTrackAuth -> Options
buildAuthOptions auth = defaults &
header "Accept" .~ ["application/json"] &
header "Cookie" .~ [C.append (C.pack "JSESSIONID=") (sessionId auth), C.append (C.pack "jetbrains.charisma.main.security.PRINCIPAL=") (principal auth)] | 320 | buildAuthOptions auth = defaults &
header "Accept" .~ ["application/json"] &
header "Cookie" .~ [C.append (C.pack "JSESSIONID=") (sessionId auth), C.append (C.pack "jetbrains.charisma.main.security.PRINCIPAL=") (principal auth)] | 276 | false | true | 0 | 10 | 75 | 91 | 45 | 46 | null | null |
urbanslug/ghc | compiler/cmm/CmmType.hs | bsd-3-clause | -- log_2 of the width in bytes, useful for generating shifts.
widthInLog :: Width -> Int
widthInLog W8 = 0 | 108 | widthInLog :: Width -> Int
widthInLog W8 = 0 | 46 | widthInLog W8 = 0 | 19 | true | true | 0 | 5 | 21 | 19 | 10 | 9 | null | null |
esengie/algebraic-checker | test/NaturalCategory.hs | bsd-3-clause | -- <-- ugly?
-- dom (id x) == dom (!x)
domId :: Expr MyProof
domId = N.proofAx (DomId "x") [] [] | 97 | domId :: Expr MyProof
domId = N.proofAx (DomId "x") [] [] | 57 | domId = N.proofAx (DomId "x") [] [] | 35 | true | true | 1 | 7 | 21 | 38 | 18 | 20 | null | null |
google/ghc-source-gen | src/GHC/SourceGen/Type/Internal.hs | bsd-3-clause | needsParenForOp t = case t of
HsOpTy{} -> True
_ -> needsParenForFun t | 78 | needsParenForOp t = case t of
HsOpTy{} -> True
_ -> needsParenForFun t | 78 | needsParenForOp t = case t of
HsOpTy{} -> True
_ -> needsParenForFun t | 78 | false | false | 1 | 8 | 20 | 35 | 15 | 20 | null | null |
christiaanb/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | parseArgs ("--dumpdefuns":n:ns) = DumpDefun n : (parseArgs ns) | 63 | parseArgs ("--dumpdefuns":n:ns) = DumpDefun n : (parseArgs ns) | 63 | parseArgs ("--dumpdefuns":n:ns) = DumpDefun n : (parseArgs ns) | 63 | false | false | 0 | 7 | 8 | 34 | 16 | 18 | null | null |
dongy7/raytracer | src/Render/Raytracer.hs | mit | -- gets intersection color with reflection
colorPoint :: Int -> Maybe PosIntersection -> Scene -> Color
colorPoint (-1) _ _ = (0.0, 0.0, 0.0) | 145 | colorPoint :: Int -> Maybe PosIntersection -> Scene -> Color
colorPoint (-1) _ _ = (0.0, 0.0, 0.0) | 102 | colorPoint (-1) _ _ = (0.0, 0.0, 0.0) | 41 | true | true | 3 | 6 | 27 | 48 | 27 | 21 | null | null |
nimia/bottle | bottlelib/Graphics/UI/Bottle/EventMap.hs | gpl-3.0 | prettyKey :: Key -> String
prettyKey (CharKey x) = [toLower x] | 62 | prettyKey :: Key -> String
prettyKey (CharKey x) = [toLower x] | 62 | prettyKey (CharKey x) = [toLower x] | 35 | false | true | 0 | 6 | 10 | 34 | 16 | 18 | null | null |
tdidriksen/copatterns | src/findus/test/TestPrograms.hs | mit | -- Natural numbers
natBody :: Type
natBody = TVari [
("Z", []),
("S", [TRecTypeVar "nat"])
] | 128 | natBody :: Type
natBody = TVari [
("Z", []),
("S", [TRecTypeVar "nat"])
] | 108 | natBody = TVari [
("Z", []),
("S", [TRecTypeVar "nat"])
] | 92 | true | true | 0 | 9 | 51 | 41 | 24 | 17 | null | null |
dmvianna/haskellbook | src/Ch18-Monad.hs | unlicense | bindingAndSequencing :: IO ()
bindingAndSequencing = do
putStrLn "Name pls: "
name <- getLine
putStrLn ("y helo thar: " ++ name) | 134 | bindingAndSequencing :: IO ()
bindingAndSequencing = do
putStrLn "Name pls: "
name <- getLine
putStrLn ("y helo thar: " ++ name) | 134 | bindingAndSequencing = do
putStrLn "Name pls: "
name <- getLine
putStrLn ("y helo thar: " ++ name) | 104 | false | true | 0 | 9 | 26 | 42 | 19 | 23 | null | null |
ierton/vsim | src/VSimR/User.hs | bsd-3-clause | step :: (Time,[Ptr (Process s)]) -> VSim s ()
step (t,ps) = concat `liftM` mapM (deref >=> runProcess t) ps >>= commit t | 121 | step :: (Time,[Ptr (Process s)]) -> VSim s ()
step (t,ps) = concat `liftM` mapM (deref >=> runProcess t) ps >>= commit t | 120 | step (t,ps) = concat `liftM` mapM (deref >=> runProcess t) ps >>= commit t | 74 | false | true | 0 | 10 | 23 | 81 | 41 | 40 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Server/Doc.hs | mit | renderDoc :: forall v m . (Var v, Monad m)
=> PPE.PrettyPrintEnvDecl
-> (Reference -> m (Maybe (Term v ())))
-> (Referent -> m (Maybe (Type v ())))
-> (Term v () -> m (Maybe (Term v ())))
-> (Reference -> m (Maybe (DD.Decl v ())))
-> Term v ()
-> m D... | 8,588 | renderDoc :: forall v m . (Var v, Monad m)
=> PPE.PrettyPrintEnvDecl
-> (Reference -> m (Maybe (Term v ())))
-> (Referent -> m (Maybe (Type v ())))
-> (Term v () -> m (Maybe (Term v ())))
-> (Reference -> m (Maybe (DD.Decl v ())))
-> Term v ()
-> m D... | 8,588 | renderDoc pped terms typeOf eval types tm = eval tm >>= \case
Nothing -> pure $ Word "🆘 doc rendering failed during evaluation"
Just tm -> go tm
where
go = \case
DD.Doc2Word txt -> pure $ Word txt
DD.Doc2Code d -> Code <$> go d
DD.Doc2CodeBlock lang d -> CodeBlock lang <$> go d
DD.Doc2Bold d ->... | 8,265 | false | true | 4 | 25 | 2,369 | 3,195 | 1,532 | 1,663 | null | null |
mit-plv/riscv-semantics | src/Spec/CSRGetSet.hs | bsd-3-clause | setCSR SScratch val = setCSRField Field.SScratch val | 52 | setCSR SScratch val = setCSRField Field.SScratch val | 52 | setCSR SScratch val = setCSRField Field.SScratch val | 52 | false | false | 0 | 6 | 6 | 18 | 8 | 10 | null | null |
valderman/haste-app | src/Haste/App/Sandbox.hs | mit | -- | Called in sandbox to report to host that it's done loading dependencies.
doneLoadingDeps :: IO ()
doneLoadingDeps = ffi "(function(){parent.postMessage(__haste_prog_id,'*');})" | 181 | doneLoadingDeps :: IO ()
doneLoadingDeps = ffi "(function(){parent.postMessage(__haste_prog_id,'*');})" | 103 | doneLoadingDeps = ffi "(function(){parent.postMessage(__haste_prog_id,'*');})" | 78 | true | true | 0 | 6 | 21 | 20 | 10 | 10 | null | null |
yliu120/K3 | src/Language/K3/Core/Type.hs | apache-2.0 | isTUID _ = False | 23 | isTUID _ = False | 23 | isTUID _ = False | 23 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
ekmett/text | tests/Tests/Properties.hs | bsd-2-clause | s_tail_s = tail `eqP` (unpackS . S.unstream . S.tail) | 64 | s_tail_s = tail `eqP` (unpackS . S.unstream . S.tail) | 64 | s_tail_s = tail `eqP` (unpackS . S.unstream . S.tail) | 64 | false | false | 0 | 9 | 19 | 27 | 15 | 12 | null | null |
ondrasej/heavenly-bodies | src/HBodies/Game/State.hs | apache-2.0 | -- | Sets the asteroid the player collided with.
setAsteroidCollision :: AsteroidState.State
-- ^ The asteroid the player collided with.
-> Update ()
setAsteroidCollision asteroid = MonadState.modify'$ \d ->
d { getAsteroidCollision = Just asteroid } | 296 | setAsteroidCollision :: AsteroidState.State
-- ^ The asteroid the player collided with.
-> Update ()
setAsteroidCollision asteroid = MonadState.modify'$ \d ->
d { getAsteroidCollision = Just asteroid } | 247 | setAsteroidCollision asteroid = MonadState.modify'$ \d ->
d { getAsteroidCollision = Just asteroid } | 104 | true | true | 0 | 9 | 81 | 49 | 26 | 23 | null | null |
igraves/flow-arrow | Control/Arrow/Flow.hs | bsd-3-clause | {-| Convenience function for returning a value -}
finished :: a -> Stalled a
finished a = Stalled $ Just a | 107 | finished :: a -> Stalled a
finished a = Stalled $ Just a | 56 | finished a = Stalled $ Just a | 29 | true | true | 0 | 6 | 21 | 29 | 14 | 15 | null | null |
HJvT/com | System/Win32/Com/Exception.hs | bsd-3-clause | oLEOBJ_S_FIRST :: HRESULT
oLEOBJ_S_FIRST = word32ToInt32 (0x00040180 ::Word32) | 78 | oLEOBJ_S_FIRST :: HRESULT
oLEOBJ_S_FIRST = word32ToInt32 (0x00040180 ::Word32) | 78 | oLEOBJ_S_FIRST = word32ToInt32 (0x00040180 ::Word32) | 52 | false | true | 0 | 6 | 7 | 26 | 12 | 14 | null | null |
uecmma/LTSHaskell-slack-bot | src/Bot/Config.hs | mit | allBotInfo :: ParserInfo BotOptions
allBotInfo = info
(helper <*> botOptionsParser)
$ fullDesc
<> progDesc "LTSHaskell Slack Bot"
<> header "notification updating of LTSHaskell" | 188 | allBotInfo :: ParserInfo BotOptions
allBotInfo = info
(helper <*> botOptionsParser)
$ fullDesc
<> progDesc "LTSHaskell Slack Bot"
<> header "notification updating of LTSHaskell" | 188 | allBotInfo = info
(helper <*> botOptionsParser)
$ fullDesc
<> progDesc "LTSHaskell Slack Bot"
<> header "notification updating of LTSHaskell" | 152 | false | true | 7 | 6 | 33 | 49 | 20 | 29 | null | null |
vincenthz/hs-packer | Tests/Tests.hs | bsd-2-clause | test_property_hole :: DataBytes -> Bool
test_property_hole dbytes =
dbytes == r2
where
p1 = runPacker dbytes
r1 = runParser p1
p2 = runPacker r1
r2 = runParser p2
runPacker :: DataBytes -> B.ByteString
runPacker (DataBytes bs) = runPacking (B.length bs + 4) (packer bs)
runParser :: B.... | 676 | test_property_hole :: DataBytes -> Bool
test_property_hole dbytes =
dbytes == r2
where
p1 = runPacker dbytes
r1 = runParser p1
p2 = runPacker r1
r2 = runParser p2
runPacker :: DataBytes -> B.ByteString
runPacker (DataBytes bs) = runPacking (B.length bs + 4) (packer bs)
runParser :: B.... | 676 | test_property_hole dbytes =
dbytes == r2
where
p1 = runPacker dbytes
r1 = runParser p1
p2 = runPacker r1
r2 = runParser p2
runPacker :: DataBytes -> B.ByteString
runPacker (DataBytes bs) = runPacking (B.length bs + 4) (packer bs)
runParser :: B.ByteString -> DataBytes
runParser = ... | 636 | false | true | 21 | 7 | 185 | 207 | 104 | 103 | null | null |
siddhanathan/ghc | compiler/ghci/ByteCodeAsm.hs | bsd-3-clause | return_ubx V16 = error "return_ubx: vector" | 43 | return_ubx V16 = error "return_ubx: vector" | 43 | return_ubx V16 = error "return_ubx: vector" | 43 | false | false | 1 | 5 | 5 | 15 | 5 | 10 | null | null |
jamesdabbs/pi-base-2 | src/Universe.hs | bsd-3-clause | contains :: SpaceId -> PropertyId -> Universe -> Bool
contains sid pid = M.member pid . attributes sid | 102 | contains :: SpaceId -> PropertyId -> Universe -> Bool
contains sid pid = M.member pid . attributes sid | 102 | contains sid pid = M.member pid . attributes sid | 48 | false | true | 1 | 9 | 17 | 46 | 20 | 26 | null | null |
ilyasergey/GHC-XAppFix | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr platform (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t',
ptext (sLit "b"),
char '\t',
pprCLabel_asm platform lbl
] | 179 | pprInstr platform (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t',
ptext (sLit "b"),
char '\t',
pprCLabel_asm platform lbl
] | 179 | pprInstr platform (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t',
ptext (sLit "b"),
char '\t',
pprCLabel_asm platform lbl
] | 179 | false | false | 0 | 9 | 62 | 53 | 26 | 27 | null | null |
bitemyapp/hakaru | Language/Hakaru/Lambda.hs | bsd-3-clause | -- raw lit is a pain to use. These are nicer
dbl :: Double -> Double
dbl = lit | 79 | dbl :: Double -> Double
dbl = lit | 33 | dbl = lit | 9 | true | true | 0 | 7 | 19 | 23 | 10 | 13 | null | null |
nevrenato/Hets_Fork | Common/AnnoParser.hs | gpl-2.0 | annoteGroup :: Pos -> Annote_word -> GenParser Char st Annotation
annoteGroup p s =
let aP = do
annoteLines <- plainBlock "(" ")%"
q <- getPos
return $ Unparsed_anno s (Group_anno $ mylines annoteLines)
$ Range [p, dec q]
in case s of
Annote_word w -> case lookup w ... | 510 | annoteGroup :: Pos -> Annote_word -> GenParser Char st Annotation
annoteGroup p s =
let aP = do
annoteLines <- plainBlock "(" ")%"
q <- getPos
return $ Unparsed_anno s (Group_anno $ mylines annoteLines)
$ Range [p, dec q]
in case s of
Annote_word w -> case lookup w ... | 510 | annoteGroup p s =
let aP = do
annoteLines <- plainBlock "(" ")%"
q <- getPos
return $ Unparsed_anno s (Group_anno $ mylines annoteLines)
$ Range [p, dec q]
in case s of
Annote_word w -> case lookup w $ swapTable semantic_anno_table of
Just sa -> return $ S... | 444 | false | true | 0 | 20 | 170 | 189 | 88 | 101 | null | null |
erochest/whatisdh | Application.hs | bsd-2-clause | canonicalizeKey pair = pair | 27 | canonicalizeKey pair = pair | 27 | canonicalizeKey pair = pair | 27 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ajtulloch/dnngraph | NN/Visualize.hs | bsd-3-clause | pdf = render Pdf | 16 | pdf = render Pdf | 16 | pdf = render Pdf | 16 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
mzini/hosa | src/HoSA/Utils.hs | mit | uniqueToInt :: Unique -> Int
uniqueToInt (Unique i) = i | 55 | uniqueToInt :: Unique -> Int
uniqueToInt (Unique i) = i | 55 | uniqueToInt (Unique i) = i | 26 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
lynnard/cocos2d-hs | generator/Graphics/UI/Cocos2d/Generator/Interface/Event.hs | bsd-3-clause | c_EventListenerMouse :: Class
c_EventListenerMouse =
addReqIncludes [includeStd "base/CCEventListenerMouse.h"] $
makeClass (ident1 "cocos2d" "EventListenerMouse") Nothing [c_EventListener]
[ mkStaticMethod "create" [] $ ptrT $ objT c_EventListenerMouse
, makeClassVariable "onMouseDown" Nothing (callba... | 664 | c_EventListenerMouse :: Class
c_EventListenerMouse =
addReqIncludes [includeStd "base/CCEventListenerMouse.h"] $
makeClass (ident1 "cocos2d" "EventListenerMouse") Nothing [c_EventListener]
[ mkStaticMethod "create" [] $ ptrT $ objT c_EventListenerMouse
, makeClassVariable "onMouseDown" Nothing (callba... | 664 | c_EventListenerMouse =
addReqIncludes [includeStd "base/CCEventListenerMouse.h"] $
makeClass (ident1 "cocos2d" "EventListenerMouse") Nothing [c_EventListener]
[ mkStaticMethod "create" [] $ ptrT $ objT c_EventListenerMouse
, makeClassVariable "onMouseDown" Nothing (callbackT cb_EventMouseCallback) Non... | 634 | false | true | 0 | 10 | 98 | 154 | 73 | 81 | null | null |
jbapple/unique | BraunUnique.hs | mit | insert :: Ord a => a -> Unique a -> Unique a
insert x (Unique 0 _) = Unique 1 (B.fromList [B.fromList [x]]) | 107 | insert :: Ord a => a -> Unique a -> Unique a
insert x (Unique 0 _) = Unique 1 (B.fromList [B.fromList [x]]) | 107 | insert x (Unique 0 _) = Unique 1 (B.fromList [B.fromList [x]]) | 62 | false | true | 0 | 10 | 22 | 69 | 33 | 36 | null | null |
Pixelgebra/tilepin | src/Internal/Colors.hs | mit | --
clrPink = V4 255 105 180 255 | 33 | clrPink = V4 255 105 180 255 | 30 | clrPink = V4 255 105 180 255 | 30 | true | false | 0 | 5 | 9 | 16 | 8 | 8 | null | null |
NickAger/LearningHaskell | haskellForMacMiscPlayground/Diagrams.hsproj/ExampleStocks.hs | mit | pricesARMH =
[ (mkDate 55105,(6.65,6.83,6.65,6.86))
, (mkDate 55104,(6.87,7.0,7.0,7.02))
, (mkDate 55103,(6.88,6.92,6.95,6.97))
, (mkDate 55102,(6.62,6.63,6.81,6.82))
, (mkDate 55099,(6.69,6.88,6.72,6.88))
, (mkDate 55098,(6.55,6.69,6.64,6.88))
, (mkDate 55097,(6.8,6.87,6.8,6.94))
, (mk... | 2,780 | pricesARMH =
[ (mkDate 55105,(6.65,6.83,6.65,6.86))
, (mkDate 55104,(6.87,7.0,7.0,7.02))
, (mkDate 55103,(6.88,6.92,6.95,6.97))
, (mkDate 55102,(6.62,6.63,6.81,6.82))
, (mkDate 55099,(6.69,6.88,6.72,6.88))
, (mkDate 55098,(6.55,6.69,6.64,6.88))
, (mkDate 55097,(6.8,6.87,6.8,6.94))
, (mk... | 2,780 | pricesARMH =
[ (mkDate 55105,(6.65,6.83,6.65,6.86))
, (mkDate 55104,(6.87,7.0,7.0,7.02))
, (mkDate 55103,(6.88,6.92,6.95,6.97))
, (mkDate 55102,(6.62,6.63,6.81,6.82))
, (mkDate 55099,(6.69,6.88,6.72,6.88))
, (mkDate 55098,(6.55,6.69,6.64,6.88))
, (mkDate 55097,(6.8,6.87,6.8,6.94))
, (mk... | 2,780 | false | false | 0 | 7 | 462 | 1,566 | 978 | 588 | null | null |
andyarvanitis/Idris-dev | src/Idris/Core/CaseTree.hs | bsd-3-clause | isVarPat (PAny : ps , _) = True | 33 | isVarPat (PAny : ps , _) = True | 33 | isVarPat (PAny : ps , _) = True | 33 | false | false | 0 | 7 | 9 | 19 | 10 | 9 | null | null |
brendanhay/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/Triggers/List.hs | mpl-2.0 | -- | Creates a value of 'AccountsContainersWorkspacesTriggersList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acwtl1Parent'
--
-- * 'acwtl1Xgafv'
--
-- * 'acwtl1UploadProtocol'
--
-- * 'acwtl1AccessToken'
--
-- * 'acwtl1UploadTyp... | 840 | accountsContainersWorkspacesTriggersList
:: Text -- ^ 'acwtl1Parent'
-> AccountsContainersWorkspacesTriggersList
accountsContainersWorkspacesTriggersList pAcwtl1Parent_ =
AccountsContainersWorkspacesTriggersList'
{ _acwtl1Parent = pAcwtl1Parent_
, _acwtl1Xgafv = Nothing
, _acwtl1UploadProtocol = N... | 466 | accountsContainersWorkspacesTriggersList pAcwtl1Parent_ =
AccountsContainersWorkspacesTriggersList'
{ _acwtl1Parent = pAcwtl1Parent_
, _acwtl1Xgafv = Nothing
, _acwtl1UploadProtocol = Nothing
, _acwtl1AccessToken = Nothing
, _acwtl1UploadType = Nothing
, _acwtl1PageToken = Nothing
, _acwtl... | 345 | true | true | 0 | 7 | 140 | 89 | 58 | 31 | null | null |
christiaanb/Idris-dev | src/Idris/ElabDecls.hs | bsd-3-clause | pbinds (Bind n (PVar t) sc) = do attack; patbind n
pbinds sc | 94 | pbinds (Bind n (PVar t) sc) = do attack; patbind n
pbinds sc | 94 | pbinds (Bind n (PVar t) sc) = do attack; patbind n
pbinds sc | 94 | false | false | 0 | 9 | 46 | 41 | 18 | 23 | null | null |
qnikst/distributed-process-task | tests/TestTaskQueues.hs | bsd-3-clause | testSimplePoolJobBlocksCaller :: TestResult (AsyncResult (Either ExitReason String))
-> Process ()
testSimplePoolJobBlocksCaller result = do
pid <- startPool 1
-- we do a non-blocking test first
job <- return $ ($(mkClosure 'sampleTask) (seconds 2, "foobar"))
callAsync pid job >>= ... | 341 | testSimplePoolJobBlocksCaller :: TestResult (AsyncResult (Either ExitReason String))
-> Process ()
testSimplePoolJobBlocksCaller result = do
pid <- startPool 1
-- we do a non-blocking test first
job <- return $ ($(mkClosure 'sampleTask) (seconds 2, "foobar"))
callAsync pid job >>= ... | 341 | testSimplePoolJobBlocksCaller result = do
pid <- startPool 1
-- we do a non-blocking test first
job <- return $ ($(mkClosure 'sampleTask) (seconds 2, "foobar"))
callAsync pid job >>= wait >>= stash result | 212 | false | true | 0 | 13 | 79 | 104 | 49 | 55 | null | null |
beni55/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ WriteOffAddrOp_Float [] [a,o,i,v] = PrimInline [j| `a`.dv.setFloat32(`o`+(`i`<<2), `v`,true); |] | 110 | genPrim _ _ WriteOffAddrOp_Float [] [a,o,i,v] = PrimInline [j| `a`.dv.setFloat32(`o`+(`i`<<2), `v`,true); |] | 110 | genPrim _ _ WriteOffAddrOp_Float [] [a,o,i,v] = PrimInline [j| `a`.dv.setFloat32(`o`+(`i`<<2), `v`,true); |] | 110 | false | false | 0 | 6 | 13 | 38 | 22 | 16 | null | null |
robx/puzzle-draw | tests/tests.hs | mit | test_plain_edge_grid :: Assertion
test_plain_edge_grid = Right (gn, gc, sort es) @=? res'
where
res = parseEither parsePlainEdgeGrid edgeGrid_1
res' = fmap (\(x, y, e) -> (x, y, sort e)) res
gn :: Grid.Grid N (Maybe MasyuPearl)
gn =
Map.mapKeys fromCoord
. Map.fromList
$ [ ((0, 0... | 942 | test_plain_edge_grid :: Assertion
test_plain_edge_grid = Right (gn, gc, sort es) @=? res'
where
res = parseEither parsePlainEdgeGrid edgeGrid_1
res' = fmap (\(x, y, e) -> (x, y, sort e)) res
gn :: Grid.Grid N (Maybe MasyuPearl)
gn =
Map.mapKeys fromCoord
. Map.fromList
$ [ ((0, 0... | 942 | test_plain_edge_grid = Right (gn, gc, sort es) @=? res'
where
res = parseEither parsePlainEdgeGrid edgeGrid_1
res' = fmap (\(x, y, e) -> (x, y, sort e)) res
gn :: Grid.Grid N (Maybe MasyuPearl)
gn =
Map.mapKeys fromCoord
. Map.fromList
$ [ ((0, 0), Just MBlack),
((0, ... | 908 | false | true | 13 | 9 | 380 | 443 | 257 | 186 | null | null |
trxeste/wrk | haskell/myBlog/Application.hs | bsd-3-clause | -- | The @main@ function for an executable running this site.
appMain :: IO ()
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environ... | 821 | appMain :: IO ()
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the... | 759 | appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from ... | 742 | true | true | 0 | 9 | 167 | 75 | 39 | 36 | null | null |
JPMoresmau/leksah | src/IDE/Metainfo/Provider.hs | gpl-2.0 | searchInScope (Prefix False) l _ | T.null l = [] | 48 | searchInScope (Prefix False) l _ | T.null l = [] | 48 | searchInScope (Prefix False) l _ | T.null l = [] | 48 | false | false | 0 | 9 | 9 | 32 | 14 | 18 | null | null |
mstksg/neural | src/Data/Neural/HMatrix/Recurrent/Dropout.hs | mit | applyMask
:: KnownNet i hs o
=> NetMask i hs o
-> Network i hs o
-> Network i hs o
applyMask = \case
MaskOL -> id
MaskIL m nm -> \case
NetIL (RLayer b wI wS s) nn ->
let mM = diag m
nnMasked = case applyMask nm nn of
NetOL (FLayer b' w') ->
... | 599 | applyMask
:: KnownNet i hs o
=> NetMask i hs o
-> Network i hs o
-> Network i hs o
applyMask = \case
MaskOL -> id
MaskIL m nm -> \case
NetIL (RLayer b wI wS s) nn ->
let mM = diag m
nnMasked = case applyMask nm nn of
NetOL (FLayer b' w') ->
... | 599 | applyMask = \case
MaskOL -> id
MaskIL m nm -> \case
NetIL (RLayer b wI wS s) nn ->
let mM = diag m
nnMasked = case applyMask nm nn of
NetOL (FLayer b' w') ->
NetOL (FLayer b' (w' <> mM))
NetIL (RLayer b' wI' w... | 500 | false | true | 0 | 22 | 279 | 259 | 125 | 134 | null | null |
minoki/LambdaQuest | src/LambdaQuest/SystemF/Eval.hs | bsd-3-clause | termSubst = termSubstD 0 | 24 | termSubst = termSubstD 0 | 24 | termSubst = termSubstD 0 | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
nick-orton/euler | src/Euler/Numz.hs | gpl-3.0 | -- |Fibinacci Series: <http://oeis.org/A000045>
fib :: [Integer] -> [Integer]
fib (y : z : xs) = y + z : fib (y + z : y : z : xs) | 129 | fib :: [Integer] -> [Integer]
fib (y : z : xs) = y + z : fib (y + z : y : z : xs) | 81 | fib (y : z : xs) = y + z : fib (y + z : y : z : xs) | 51 | true | true | 0 | 11 | 29 | 70 | 36 | 34 | null | null |
FranklinChen/Hugs | dotnet/lib/Dotnet/System/Xml/XmlReader.hs | bsd-3-clause | readElementStringNameURI :: String -> String -> XmlReader a -> IO String
readElementStringNameURI str uri = invoke "ReadElementString" (str,uri) | 144 | readElementStringNameURI :: String -> String -> XmlReader a -> IO String
readElementStringNameURI str uri = invoke "ReadElementString" (str,uri) | 144 | readElementStringNameURI str uri = invoke "ReadElementString" (str,uri) | 71 | false | true | 0 | 8 | 17 | 45 | 22 | 23 | null | null |
rvion/lamdu | Lamdu/Sugar/Names/Walk.hs | gpl-3.0 | withBinderParams (VarParam fp) =
opWithParamName (isFunctionType (fp ^. fpAnnotation . aInferredType))
(fp ^. fpInfo . npiName)
<&> VarParam . \newName -> fp & fpInfo . npiName .~ newName | 199 | withBinderParams (VarParam fp) =
opWithParamName (isFunctionType (fp ^. fpAnnotation . aInferredType))
(fp ^. fpInfo . npiName)
<&> VarParam . \newName -> fp & fpInfo . npiName .~ newName | 199 | withBinderParams (VarParam fp) =
opWithParamName (isFunctionType (fp ^. fpAnnotation . aInferredType))
(fp ^. fpInfo . npiName)
<&> VarParam . \newName -> fp & fpInfo . npiName .~ newName | 199 | false | false | 2 | 10 | 39 | 76 | 37 | 39 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Parse.hs | bsd-3-clause | funcSortP = parens $ FFunc <$> intP <* comma <*> sortsP | 55 | funcSortP = parens $ FFunc <$> intP <* comma <*> sortsP | 55 | funcSortP = parens $ FFunc <$> intP <* comma <*> sortsP | 55 | false | false | 0 | 8 | 10 | 22 | 11 | 11 | null | null |
arnabgho/HLearn | src/HLearn/History.hs | bsd-3-clause | -- else P.head $ P.words $ show $ typeRep [a]
-- | Print the current iteration of the optimization.
infoItr :: DisplayInfo
infoItr r _ = "; "++show (numReports r) | 167 | infoItr :: DisplayInfo
infoItr r _ = "; "++show (numReports r) | 62 | infoItr r _ = "; "++show (numReports r) | 39 | true | true | 0 | 8 | 34 | 31 | 16 | 15 | null | null |
clarkcb/xsearch | haskell/hssearch/test/HsSearch/FileTypesTest.hs | mit | getFileTypeTests :: IO [Test]
getFileTypeTests = do
let archiveFile = "archive.zip"
let binaryFile = "binary.exe"
let codeFile = "FileTypes.hs"
let textFile = "text.txt"
let xmlFile = "markup.xml"
let unknownFile = "unknown.xyz"
archiveFileType <- getFileType archiveFile
binaryFileType <- getFileType bi... | 984 | getFileTypeTests :: IO [Test]
getFileTypeTests = do
let archiveFile = "archive.zip"
let binaryFile = "binary.exe"
let codeFile = "FileTypes.hs"
let textFile = "text.txt"
let xmlFile = "markup.xml"
let unknownFile = "unknown.xyz"
archiveFileType <- getFileType archiveFile
binaryFileType <- getFileType bi... | 984 | getFileTypeTests = do
let archiveFile = "archive.zip"
let binaryFile = "binary.exe"
let codeFile = "FileTypes.hs"
let textFile = "text.txt"
let xmlFile = "markup.xml"
let unknownFile = "unknown.xyz"
archiveFileType <- getFileType archiveFile
binaryFileType <- getFileType binaryFile
codeFileType <- get... | 954 | false | true | 18 | 11 | 190 | 209 | 107 | 102 | null | null |
markus-git/co-feldspar | src/Feldspar/Software/Optimize.hs | bsd-3-clause | --
simplifyUp a = constFold a | 30 | simplifyUp a = constFold a | 26 | simplifyUp a = constFold a | 26 | true | false | 0 | 5 | 6 | 13 | 6 | 7 | null | null |
sinelaw/infernu | src/Infernu/Parse.hs | gpl-2.0 | fromExpression f (ES3.UnaryAssignExpr z op (ES3.LDot _ objExpr name)) = assignToProperty f z objExpr (EPropName name) (addConstant z op (EProp (src z) objExpr' (EPropName name))) Nothing
where objExpr' = fromExpression f objExpr | 230 | fromExpression f (ES3.UnaryAssignExpr z op (ES3.LDot _ objExpr name)) = assignToProperty f z objExpr (EPropName name) (addConstant z op (EProp (src z) objExpr' (EPropName name))) Nothing
where objExpr' = fromExpression f objExpr | 230 | fromExpression f (ES3.UnaryAssignExpr z op (ES3.LDot _ objExpr name)) = assignToProperty f z objExpr (EPropName name) (addConstant z op (EProp (src z) objExpr' (EPropName name))) Nothing
where objExpr' = fromExpression f objExpr | 230 | false | false | 0 | 11 | 33 | 99 | 48 | 51 | null | null |
brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Jobs/Patch.hs | mpl-2.0 | -- | Creates a value of 'ProjectsRegionsJobsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'prjpXgafv'
--
-- * 'prjpJobId'
--
-- * 'prjpUploadProtocol'
--
-- * 'prjpUpdateMask'
--
-- * 'prjpAccessToken'
--
-- * 'prjpUploadType'... | 1,033 | projectsRegionsJobsPatch
:: Text -- ^ 'prjpJobId'
-> Job -- ^ 'prjpPayload'
-> Text -- ^ 'prjpRegion'
-> Text -- ^ 'prjpProjectId'
-> ProjectsRegionsJobsPatch
projectsRegionsJobsPatch pPrjpJobId_ pPrjpPayload_ pPrjpRegion_ pPrjpProjectId_ =
ProjectsRegionsJobsPatch'
{ _prjpXgafv = Nothing
... | 622 | projectsRegionsJobsPatch pPrjpJobId_ pPrjpPayload_ pPrjpRegion_ pPrjpProjectId_ =
ProjectsRegionsJobsPatch'
{ _prjpXgafv = Nothing
, _prjpJobId = pPrjpJobId_
, _prjpUploadProtocol = Nothing
, _prjpUpdateMask = Nothing
, _prjpAccessToken = Nothing
, _prjpUploadType = Nothing
, _prjpPayload ... | 443 | true | true | 0 | 10 | 206 | 134 | 88 | 46 | null | null |
deontologician/orbRPG | Game/OrbRPG/Combinations.hs | gpl-3.0 | E Erbium @>> L Mu = L Lambda | 28 | E Erbium @>> L Mu = L Lambda | 28 | E Erbium @>> L Mu = L Lambda | 28 | false | false | 0 | 6 | 7 | 21 | 8 | 13 | null | null |
nh2/darcs-fastconvert | Export.hs | bsd-3-clause | dumpFiles :: [AnchoredPath] -> ExportM ()
dumpFiles files = forM_ files $ \file -> do
isfile <- lift $ fileExists file
isdir <- lift $ directoryExists file
when isfile $ do
bits <- lift $ readFile file
dumpBits [ BLU.fromString $ "M 100644 inline " ++ anchorPath "" file
, BLU.fromString $ "da... | 719 | dumpFiles :: [AnchoredPath] -> ExportM ()
dumpFiles files = forM_ files $ \file -> do
isfile <- lift $ fileExists file
isdir <- lift $ directoryExists file
when isfile $ do
bits <- lift $ readFile file
dumpBits [ BLU.fromString $ "M 100644 inline " ++ anchorPath "" file
, BLU.fromString $ "da... | 719 | dumpFiles files = forM_ files $ \file -> do
isfile <- lift $ fileExists file
isdir <- lift $ directoryExists file
when isfile $ do
bits <- lift $ readFile file
dumpBits [ BLU.fromString $ "M 100644 inline " ++ anchorPath "" file
, BLU.fromString $ "data " ++ show (BL.length bits)
... | 677 | false | true | 0 | 19 | 237 | 277 | 128 | 149 | null | null |
elieux/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | -- | Sort a list by comparing the results of a key function applied to each
-- element. @sortOn f@ is equivalent to @sortBy (comparing f)@, but has the
-- performance advantage of only evaluating @f@ once for each element in the
-- input list. This is called the decorate-sort-undecorate paradigm, or
-- Schwartzian tr... | 481 | sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn f =
map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x)) | 131 | sortOn f =
map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x)) | 89 | true | true | 0 | 13 | 97 | 106 | 58 | 48 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | happyReduction_229 _ _ _ = notHappyAtAll | 41 | happyReduction_229 _ _ _ = notHappyAtAll | 41 | happyReduction_229 _ _ _ = notHappyAtAll | 41 | false | false | 0 | 5 | 6 | 13 | 6 | 7 | null | null |
junjihashimoto/hsverilog | src/HsVerilog/Verilog/Internal.hs | bsd-3-clause | instOutputPort :: T.Text -> Circuit -> [(Signal,Signal)]
instOutputPort name cir =
let op = coutput cir
ren v = (v,v{sname=name <> "_" <> sname v})
in map ren op | 172 | instOutputPort :: T.Text -> Circuit -> [(Signal,Signal)]
instOutputPort name cir =
let op = coutput cir
ren v = (v,v{sname=name <> "_" <> sname v})
in map ren op | 172 | instOutputPort name cir =
let op = coutput cir
ren v = (v,v{sname=name <> "_" <> sname v})
in map ren op | 115 | false | true | 0 | 13 | 39 | 87 | 45 | 42 | null | null |
andorp/bead | src/Bead/Domain/Relationships.hs | bsd-3-clause | submissionTableInfoPermissions = ObjectPermissions [
(P_Open, P_Course), (P_Open, P_Assignment)
] | 103 | submissionTableInfoPermissions = ObjectPermissions [
(P_Open, P_Course), (P_Open, P_Assignment)
] | 103 | submissionTableInfoPermissions = ObjectPermissions [
(P_Open, P_Course), (P_Open, P_Assignment)
] | 103 | false | false | 0 | 7 | 14 | 27 | 16 | 11 | null | null |
Thhethssmuz/ppp | src/Writer.hs | mit | writer :: WriterOptions
writer = def
{ writerTemplate = fmap (BS.unpack . BS.fromStrict)
. lookup "template.tex" $ emb
, writerHighlightStyle = Just tango
, writerVariables = [ ("ppp-version", showVersion version) ]
} | 269 | writer :: WriterOptions
writer = def
{ writerTemplate = fmap (BS.unpack . BS.fromStrict)
. lookup "template.tex" $ emb
, writerHighlightStyle = Just tango
, writerVariables = [ ("ppp-version", showVersion version) ]
} | 269 | writer = def
{ writerTemplate = fmap (BS.unpack . BS.fromStrict)
. lookup "template.tex" $ emb
, writerHighlightStyle = Just tango
, writerVariables = [ ("ppp-version", showVersion version) ]
} | 245 | false | true | 0 | 13 | 83 | 81 | 41 | 40 | null | null |
glutamate/probably-baysig | src/Math/Probably/Sampler.hs | bsd-3-clause | normal :: Double -> Double -> Prob Double
normal mean variance = do
u <- unormal
return (u * (sqrt variance) + mean) | 122 | normal :: Double -> Double -> Prob Double
normal mean variance = do
u <- unormal
return (u * (sqrt variance) + mean) | 122 | normal mean variance = do
u <- unormal
return (u * (sqrt variance) + mean) | 80 | false | true | 0 | 12 | 28 | 57 | 27 | 30 | null | null |
bartoszw/yelca | Handler/Util.hs | gpl-2.0 | simpleLoanHash :: Loan -> Text
simpleLoanHash loan = (pack $ show $ loanS loan) <>
" P" <> (pack $ show $ principalS loan) <>
" D" <> (pack $ show $ durationS loan) <>
" R" <> (pack $ showWithLenDec 6 2 $ 100 * rateS loan) | 289 | simpleLoanHash :: Loan -> Text
simpleLoanHash loan = (pack $ show $ loanS loan) <>
" P" <> (pack $ show $ principalS loan) <>
" D" <> (pack $ show $ durationS loan) <>
" R" <> (pack $ showWithLenDec 6 2 $ 100 * rateS loan) | 289 | simpleLoanHash loan = (pack $ show $ loanS loan) <>
" P" <> (pack $ show $ principalS loan) <>
" D" <> (pack $ show $ durationS loan) <>
" R" <> (pack $ showWithLenDec 6 2 $ 100 * rateS loan) | 258 | false | true | 0 | 13 | 114 | 107 | 53 | 54 | null | null |
tjakway/ghcjvm | compiler/utils/Bag.hs | bsd-3-clause | foldBag t u e (TwoBags b1 b2) = foldBag t u (foldBag t u e b2) b1 | 65 | foldBag t u e (TwoBags b1 b2) = foldBag t u (foldBag t u e b2) b1 | 65 | foldBag t u e (TwoBags b1 b2) = foldBag t u (foldBag t u e b2) b1 | 65 | false | false | 0 | 7 | 16 | 44 | 21 | 23 | null | null |
dterei/Scraps | haskell/prettyGenerics/D1.hs | bsd-3-clause | comma :: Doc
comma = DocStr (Chr ',') | 37 | comma :: Doc
comma = DocStr (Chr ',') | 37 | comma = DocStr (Chr ',') | 24 | false | true | 0 | 7 | 7 | 20 | 10 | 10 | null | null |
SKA-ScienceDataProcessor/RC | MS5/dna/flow/Flow/Halide.hs | apache-2.0 | halideRepr :: dim -> HalideRepr dim val abs
halideRepr = HalideRepr ReadAccess | 78 | halideRepr :: dim -> HalideRepr dim val abs
halideRepr = HalideRepr ReadAccess | 78 | halideRepr = HalideRepr ReadAccess | 34 | false | true | 0 | 7 | 11 | 30 | 13 | 17 | null | null |
bgwines/horse-control | src/Horse/Utils.hs | bsd-3-clause | fromEitherMaybeDefault (Left _) (Just y) = y | 45 | fromEitherMaybeDefault (Left _) (Just y) = y | 45 | fromEitherMaybeDefault (Left _) (Just y) = y | 45 | false | false | 1 | 6 | 7 | 26 | 11 | 15 | null | null |
wehu/hw | src/Utils.hs | apache-2.0 | currentFile :: Q Exp
currentFile = do
loc <- location
return $ LitE (StringL $ loc_filename loc) | 104 | currentFile :: Q Exp
currentFile = do
loc <- location
return $ LitE (StringL $ loc_filename loc) | 104 | currentFile = do
loc <- location
return $ LitE (StringL $ loc_filename loc) | 83 | false | true | 0 | 12 | 24 | 47 | 20 | 27 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Relaxng.hs | gpl-2.0 | pEndLine = do
updateState $ \st -> st{ synStPrevNonspace = False }
context <- currentContext
contexts <- synStContexts `fmap` getState
st <- getState
if length contexts >= 2
then case context of
_ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False }
("RELAX NG","norma... | 641 | pEndLine = do
updateState $ \st -> st{ synStPrevNonspace = False }
context <- currentContext
contexts <- synStContexts `fmap` getState
st <- getState
if length contexts >= 2
then case context of
_ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False }
("RELAX NG","norma... | 641 | pEndLine = do
updateState $ \st -> st{ synStPrevNonspace = False }
context <- currentContext
contexts <- synStContexts `fmap` getState
st <- getState
if length contexts >= 2
then case context of
_ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False }
("RELAX NG","norma... | 641 | false | false | 0 | 15 | 159 | 242 | 124 | 118 | null | null |
NICTA/radian | test/hunit_tests.hs | bsd-3-clause | tests :: Test
tests =
TestList $ fmap TestCase [
t180
, t90
, t359
, t360
, t3600
, t1
, tneg180
, f0
, f1
, fneg1
, f3
] | 149 | tests :: Test
tests =
TestList $ fmap TestCase [
t180
, t90
, t359
, t360
, t3600
, t1
, tneg180
, f0
, f1
, fneg1
, f3
] | 149 | tests =
TestList $ fmap TestCase [
t180
, t90
, t359
, t360
, t3600
, t1
, tneg180
, f0
, f1
, fneg1
, f3
] | 135 | false | true | 0 | 7 | 59 | 53 | 32 | 21 | null | null |
pikajude/kevin | src/Kevin/IRC/Packet.hs | gpl-3.0 | colonParam :: Parser T.Text
colonParam = char ':' *> takeWhile (notInClass "\x0\xd\xa") | 87 | colonParam :: Parser T.Text
colonParam = char ':' *> takeWhile (notInClass "\x0\xd\xa") | 87 | colonParam = char ':' *> takeWhile (notInClass "\x0\xd\xa") | 59 | false | true | 0 | 8 | 11 | 37 | 16 | 21 | null | null |
HairyDude/heal | EveApi/Types.hs | bsd-2-clause | subsystemSlot SubsystemSlot6 = Just 6 | 37 | subsystemSlot SubsystemSlot6 = Just 6 | 37 | subsystemSlot SubsystemSlot6 = Just 6 | 37 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
haskellbr/missingh | missingh-all/src/Network/Utils.hs | mit | showSockAddr (SockAddrUnix x) = return $ "UNIX socket at " ++ x | 63 | showSockAddr (SockAddrUnix x) = return $ "UNIX socket at " ++ x | 63 | showSockAddr (SockAddrUnix x) = return $ "UNIX socket at " ++ x | 63 | false | false | 0 | 6 | 11 | 24 | 11 | 13 | null | null |
cshung/MiscLab | Haskell99/q36.hs | mit | primeFactorsMult :: Int -> [(Int, Int)]
primeFactorsMult x = case (tryPrimeFactorsMult x) of Left result -> result
Right message -> error message | 200 | primeFactorsMult :: Int -> [(Int, Int)]
primeFactorsMult x = case (tryPrimeFactorsMult x) of Left result -> result
Right message -> error message | 200 | primeFactorsMult x = case (tryPrimeFactorsMult x) of Left result -> result
Right message -> error message | 160 | false | true | 0 | 8 | 76 | 58 | 29 | 29 | null | null |
silkapp/heist | src/Heist/Interpreted/Internal.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- | Like runChildrenWith but using literal text rather than dynamic splices.
runChildrenWithText :: (Monad n) => [(Text, Text)] -> Splice n
runChildrenWithText = runChildrenWithTrans textSplice | 273 | runChildrenWithText :: (Monad n) => [(Text, Text)] -> Splice n
runChildrenWithText = runChildrenWithTrans textSplice | 116 | runChildrenWithText = runChildrenWithTrans textSplice | 53 | true | true | 0 | 8 | 26 | 41 | 23 | 18 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Traversals.hs | isc | walkExpM tv (BasicOp (Concat _ x ys size)) =
walkOnVName tv x >> mapM_ (walkOnVName tv) ys >> walkOnSubExp tv size | 116 | walkExpM tv (BasicOp (Concat _ x ys size)) =
walkOnVName tv x >> mapM_ (walkOnVName tv) ys >> walkOnSubExp tv size | 116 | walkExpM tv (BasicOp (Concat _ x ys size)) =
walkOnVName tv x >> mapM_ (walkOnVName tv) ys >> walkOnSubExp tv size | 116 | false | false | 0 | 9 | 22 | 58 | 27 | 31 | null | null |
msullivan/advent-of-code | 2018/A21a.hs | mit | eval_instr' Iban = (.&.) | 24 | eval_instr' Iban = (.&.) | 24 | eval_instr' Iban = (.&.) | 24 | false | false | 1 | 5 | 3 | 15 | 6 | 9 | null | null |
ghcjs/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ Word16EqOp [r] [x,y] = PrimInline $ r |= if10 (x .===. y) | 77 | genPrim _ _ Word16EqOp [r] [x,y] = PrimInline $ r |= if10 (x .===. y) | 77 | genPrim _ _ Word16EqOp [r] [x,y] = PrimInline $ r |= if10 (x .===. y) | 77 | false | false | 0 | 8 | 22 | 44 | 23 | 21 | null | null |
meiersi/scyther-proof | src/Scyther/Theory/Html.hs | gpl-3.0 | insertExplanation :: String -> HtmlMarkup Int
insertExplanation e = do
expls <- gets htmlExpls
case M.lookup e expls of
Just ref -> return ref
Nothing -> do
st <- get
let ref = htmlNextExplRef st
put $ st { htmlNextExplRef = succ ref, htmlExpls = M.insert e ref expls }
return ref | 317 | insertExplanation :: String -> HtmlMarkup Int
insertExplanation e = do
expls <- gets htmlExpls
case M.lookup e expls of
Just ref -> return ref
Nothing -> do
st <- get
let ref = htmlNextExplRef st
put $ st { htmlNextExplRef = succ ref, htmlExpls = M.insert e ref expls }
return ref | 317 | insertExplanation e = do
expls <- gets htmlExpls
case M.lookup e expls of
Just ref -> return ref
Nothing -> do
st <- get
let ref = htmlNextExplRef st
put $ st { htmlNextExplRef = succ ref, htmlExpls = M.insert e ref expls }
return ref | 271 | false | true | 0 | 16 | 88 | 121 | 55 | 66 | null | null |
gbaz/cabal | cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs | bsd-3-clause | merge (Constrained rs) (Constrained ss) = Right (Constrained (rs ++ ss)) | 78 | merge (Constrained rs) (Constrained ss) = Right (Constrained (rs ++ ss)) | 78 | merge (Constrained rs) (Constrained ss) = Right (Constrained (rs ++ ss)) | 78 | false | false | 1 | 9 | 16 | 41 | 19 | 22 | null | null |
li-zhirui/EoplLangs | src/SimpleModule/Evaluator.hs | bsd-3-clause | unaryOps :: [(UnaryOp, ExpressedValue -> EvaluateResult)]
unaryOps = concat [unaryNum2Num, unaryNum2Bool, unaryBool2Bool]
where
n2nTrans = unaryOpConverter unpackNum ExprNum
unaryNum2Num = fmap (second n2nTrans) unaryNumToNumOpMap
n2bTrans = unaryOpConverter unpackNum ExprBool
unaryNum2Bool = fmap (se... | 465 | unaryOps :: [(UnaryOp, ExpressedValue -> EvaluateResult)]
unaryOps = concat [unaryNum2Num, unaryNum2Bool, unaryBool2Bool]
where
n2nTrans = unaryOpConverter unpackNum ExprNum
unaryNum2Num = fmap (second n2nTrans) unaryNumToNumOpMap
n2bTrans = unaryOpConverter unpackNum ExprBool
unaryNum2Bool = fmap (se... | 465 | unaryOps = concat [unaryNum2Num, unaryNum2Bool, unaryBool2Bool]
where
n2nTrans = unaryOpConverter unpackNum ExprNum
unaryNum2Num = fmap (second n2nTrans) unaryNumToNumOpMap
n2bTrans = unaryOpConverter unpackNum ExprBool
unaryNum2Bool = fmap (second n2bTrans) unaryNumToBoolOpMap
b2bTrans = unaryOpC... | 407 | false | true | 5 | 7 | 71 | 117 | 61 | 56 | null | null |
cullina/Extractor | src/Matrix.hs | bsd-3-clause | lookupBB (_,_,c,_) (True, False) = c | 37 | lookupBB (_,_,c,_) (True, False) = c | 37 | lookupBB (_,_,c,_) (True, False) = c | 37 | false | false | 0 | 6 | 6 | 29 | 17 | 12 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/StorageEvent.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent.storageArea Mozilla StorageEvent.storageArea documentation>
getStorageArea :: (MonadDOM m) => StorageEvent -> m (Maybe Storage)
getStorageArea self
= liftDOM ((self ^. js "storageArea") >>= fromJSVal) | 271 | getStorageArea :: (MonadDOM m) => StorageEvent -> m (Maybe Storage)
getStorageArea self
= liftDOM ((self ^. js "storageArea") >>= fromJSVal) | 142 | getStorageArea self
= liftDOM ((self ^. js "storageArea") >>= fromJSVal) | 74 | true | true | 0 | 10 | 28 | 62 | 30 | 32 | null | null |
koengit/zeldspar | src/Zeldspar/Parallel.hs | bsd-3-clause | foldParZ chs acc (ConnP s a b) f = foldParZ s acc a f >>= \acc' -> foldParZ chs acc' b f | 88 | foldParZ chs acc (ConnP s a b) f = foldParZ s acc a f >>= \acc' -> foldParZ chs acc' b f | 88 | foldParZ chs acc (ConnP s a b) f = foldParZ s acc a f >>= \acc' -> foldParZ chs acc' b f | 88 | false | false | 0 | 7 | 21 | 52 | 25 | 27 | null | null |
fpco/fay | tests/RecDecl.hs | bsd-3-clause | -- Record updates
r1' = r1{ i = 10 } | 36 | r1' = r1{ i = 10 } | 18 | r1' = r1{ i = 10 } | 18 | true | false | 1 | 7 | 9 | 23 | 10 | 13 | null | null |
bitemyapp/lets-lens | src/Lets/GetSetLens.hs | bsd-3-clause | -- |
--
-- >>> setStreet fred "Some Other St"
-- Person 24 "Fred" (Address "Some Other St" "Fredville" (Locality "Fredmania" "New South Fred" "Fredalia"))
--
-- >>> setStreet mary "Some Other St"
-- Person 28 "Mary" (Address "Some Other St" "Maryland" (Locality "Mary Mary" "Western Mary" "Maristan"))
setStreet ::
Per... | 385 | setStreet ::
Person
-> String
-> Person
setStreet =
error "todo: setStreet" | 83 | setStreet =
error "todo: setStreet" | 37 | true | true | 0 | 8 | 67 | 36 | 19 | 17 | null | null |
ezyang/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (BCCFAR cond blockid prediction) = vcat [
hcat [
text "\tb",
pprCond (condNegate cond),
neg_prediction,
text "\t$+8"
],
hcat [
text "\tb\t",
ppr lbl
]
]
where lbl = mkLocalBlockLabel (getUnique block... | 471 | pprInstr (BCCFAR cond blockid prediction) = vcat [
hcat [
text "\tb",
pprCond (condNegate cond),
neg_prediction,
text "\t$+8"
],
hcat [
text "\tb\t",
ppr lbl
]
]
where lbl = mkLocalBlockLabel (getUnique block... | 471 | pprInstr (BCCFAR cond blockid prediction) = vcat [
hcat [
text "\tb",
pprCond (condNegate cond),
neg_prediction,
text "\t$+8"
],
hcat [
text "\tb\t",
ppr lbl
]
]
where lbl = mkLocalBlockLabel (getUnique block... | 471 | false | false | 1 | 11 | 212 | 130 | 62 | 68 | null | null |
alpha22jp/simplenote.hs | Simplenote.hs | mit | posixTimeToStr :: POSIXTime -> String
posixTimeToStr = formatTime defaultTimeLocale "%s%Q" . posixSecondsToUTCTime | 114 | posixTimeToStr :: POSIXTime -> String
posixTimeToStr = formatTime defaultTimeLocale "%s%Q" . posixSecondsToUTCTime | 114 | posixTimeToStr = formatTime defaultTimeLocale "%s%Q" . posixSecondsToUTCTime | 76 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
thalerjonathan/phd | coding/learning/haskell/grahambook/Code_Solutions/countdown.hs | gpl-3.0 | perms (x:xs) = concat (map (interleave x) (perms xs)) | 53 | perms (x:xs) = concat (map (interleave x) (perms xs)) | 53 | perms (x:xs) = concat (map (interleave x) (perms xs)) | 53 | false | false | 0 | 9 | 8 | 39 | 19 | 20 | null | null |
wavewave/madgraph-auto-dataset | src/HEP/Automation/MadGraph/Dataset/Set20110516set2.hs | gpl-3.0 | sets :: [Int]
sets = [1,2..80] | 30 | sets :: [Int]
sets = [1,2..80] | 30 | sets = [1,2..80] | 16 | false | true | 0 | 7 | 5 | 29 | 14 | 15 | null | null |
rahulmutt/ghcvm | compiler/Eta/SimplCore/OccurAnal.hs | bsd-3-clause | {-
Note [Use one-shot information]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The occurrrence analyser propagates one-shot-lambda information in two situation
* Applications: eg build (\cn -> blah)
Propagate one-shot info from the strictness signature of 'build' to
the \cn
* Let-bindings: eg let f = \c. let ...... | 1,722 | occAnalAlt :: (OccEnv, Maybe (Id, CoreExpr))
-> CoreAlt
-> (UsageDetails, Alt IdWithOccInfo)
occAnalAlt (env, scrut_bind) (con, bndrs, rhs)
= case occAnal env rhs of { (rhs_usage1, rhs1) ->
let
(alt_usg, tagged_bndrs) = tagLamBinders rhs_usage1 bndrs
... | 503 | occAnalAlt (env, scrut_bind) (con, bndrs, rhs)
= case occAnal env rhs of { (rhs_usage1, rhs1) ->
let
(alt_usg, tagged_bndrs) = tagLamBinders rhs_usage1 bndrs
-- See Note [Binders in case alternatives]
(alt_usg', rhs2) =
wrapAltRHS env scrut_bind alt_usg ... | 388 | true | true | 0 | 12 | 406 | 149 | 84 | 65 | null | null |
jean-edouard/manager | updatemgr/UpdateMgr/UpdateReqHandler.hs | gpl-2.0 | handleUpdateReq (NotifyUpdateDownloadProgress p) = eitherErr . liftRpc $
notifyComCitrixXenclientUpdatemgrUpdateDownloadProgress updatemgrObjectPath (realToFrac $ dlComplete p) (realToFrac $ dlSpeed p) | 205 | handleUpdateReq (NotifyUpdateDownloadProgress p) = eitherErr . liftRpc $
notifyComCitrixXenclientUpdatemgrUpdateDownloadProgress updatemgrObjectPath (realToFrac $ dlComplete p) (realToFrac $ dlSpeed p) | 205 | handleUpdateReq (NotifyUpdateDownloadProgress p) = eitherErr . liftRpc $
notifyComCitrixXenclientUpdatemgrUpdateDownloadProgress updatemgrObjectPath (realToFrac $ dlComplete p) (realToFrac $ dlSpeed p) | 205 | false | false | 0 | 9 | 21 | 50 | 24 | 26 | null | null |
brownsys/nettle-openflow | src/Nettle/Ethernet/AddressResolutionProtocol.hs | bsd-3-clause | ipProtocolType = 0x0800 | 38 | ipProtocolType = 0x0800 | 38 | ipProtocolType = 0x0800 | 38 | false | false | 0 | 4 | 17 | 6 | 3 | 3 | null | null |
keithodulaigh/Hets | HasCASL/Sublogic.hs | gpl-2.0 | sl_typeItem :: TypeItem -> Sublogic
sl_typeItem tyIt = case tyIt of
TypeDecl l k _ -> comp_list $ sl_kind k : map sl_typePattern l
SubtypeDecl l _ _ -> comp_list $ need_sub : map sl_typePattern l
IsoDecl l _ -> comp_list $ need_sub : map sl_typePattern l
SubtypeDefn tp _ t term _ -> comp_list
[ ... | 666 | sl_typeItem :: TypeItem -> Sublogic
sl_typeItem tyIt = case tyIt of
TypeDecl l k _ -> comp_list $ sl_kind k : map sl_typePattern l
SubtypeDecl l _ _ -> comp_list $ need_sub : map sl_typePattern l
IsoDecl l _ -> comp_list $ need_sub : map sl_typePattern l
SubtypeDefn tp _ t term _ -> comp_list
[ ... | 666 | sl_typeItem tyIt = case tyIt of
TypeDecl l k _ -> comp_list $ sl_kind k : map sl_typePattern l
SubtypeDecl l _ _ -> comp_list $ need_sub : map sl_typePattern l
IsoDecl l _ -> comp_list $ need_sub : map sl_typePattern l
SubtypeDefn tp _ t term _ -> comp_list
[ need_sub
, sl_typePattern tp... | 630 | false | true | 14 | 8 | 195 | 163 | 86 | 77 | null | null |
futtetennista/IntroductionToFunctionalProgramming | PiH/src/Exercises.hs | mit | alabel (Bin l r) =
Bin <$> alabel l <*> alabel r | 50 | alabel (Bin l r) =
Bin <$> alabel l <*> alabel r | 50 | alabel (Bin l r) =
Bin <$> alabel l <*> alabel r | 50 | false | false | 0 | 7 | 13 | 31 | 14 | 17 | null | null |
hpacheco/HAAP | examples/minimalistic/MMDraw.hs | mit | componentsToArrow (0,y) | y < 0 = (y,90) | 40 | componentsToArrow (0,y) | y < 0 = (y,90) | 40 | componentsToArrow (0,y) | y < 0 = (y,90) | 40 | false | false | 0 | 8 | 7 | 31 | 16 | 15 | null | null |
Mathnerd314/lamdu | bottlelib/Graphics/UI/Bottle/EventMap.hs | gpl-3.0 | keyEventMap :: KeyEvent -> Doc -> a -> EventMap a
keyEventMap eventType doc handler =
mempty
{ _emKeyMap = Map.singleton eventType $ DocHandler doc handler
} | 163 | keyEventMap :: KeyEvent -> Doc -> a -> EventMap a
keyEventMap eventType doc handler =
mempty
{ _emKeyMap = Map.singleton eventType $ DocHandler doc handler
} | 163 | keyEventMap eventType doc handler =
mempty
{ _emKeyMap = Map.singleton eventType $ DocHandler doc handler
} | 113 | false | true | 0 | 10 | 31 | 63 | 29 | 34 | null | null |
cspollard/bcalib | src/BCalib/JF.hs | bsd-3-clause | readJFs :: MonadIO m => TR m (ZipList JFInfo)
readJFs = do
nvtx <- readI "jetsJetFitter_nVTX"
mass <- fmap (/ 1e3) <$> readD "jetsJetFitter_mass"
nsts <- readI "jetsJetFitter_nSingleTracks"
ntsav <- readI "jetsJetFitter_nTracksAtVtx"
efrac <- readD "jetsJetFitter_energyFraction"
n2tpair <- readI "jetsJetFit... | 813 | readJFs :: MonadIO m => TR m (ZipList JFInfo)
readJFs = do
nvtx <- readI "jetsJetFitter_nVTX"
mass <- fmap (/ 1e3) <$> readD "jetsJetFitter_mass"
nsts <- readI "jetsJetFitter_nSingleTracks"
ntsav <- readI "jetsJetFitter_nTracksAtVtx"
efrac <- readD "jetsJetFitter_energyFraction"
n2tpair <- readI "jetsJetFit... | 813 | readJFs = do
nvtx <- readI "jetsJetFitter_nVTX"
mass <- fmap (/ 1e3) <$> readD "jetsJetFitter_mass"
nsts <- readI "jetsJetFitter_nSingleTracks"
ntsav <- readI "jetsJetFitter_nTracksAtVtx"
efrac <- readD "jetsJetFitter_energyFraction"
n2tpair <- readI "jetsJetFitter_N2Tpair"
llr <- readD "jetsJetFitter_log... | 767 | false | true | 2 | 17 | 187 | 249 | 109 | 140 | null | null |
quickdudley/varroa | Reinforcement.hs | agpl-3.0 | actorSolidarity _ = 0 | 21 | actorSolidarity _ = 0 | 21 | actorSolidarity _ = 0 | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
vito/atomo-old | Atomo/Parser.hs | mit | aImport :: Parser AtomoVal
aImport = do reserved "import"
from <- option "" (symbol "from" >> aModule)
colon
whiteSpace
targets <- case from of
"" -> commaSep1 aModule
_ -> commaSep1 (aReference <|> symbol "*")... | 386 | aImport :: Parser AtomoVal
aImport = do reserved "import"
from <- option "" (symbol "from" >> aModule)
colon
whiteSpace
targets <- case from of
"" -> commaSep1 aModule
_ -> commaSep1 (aReference <|> symbol "*")... | 386 | aImport = do reserved "import"
from <- option "" (symbol "from" >> aModule)
colon
whiteSpace
targets <- case from of
"" -> commaSep1 aModule
_ -> commaSep1 (aReference <|> symbol "*")
return $ AImp... | 359 | false | true | 3 | 14 | 174 | 108 | 46 | 62 | null | null |
jmacmahon/syllabify | Linguisticks/Statistics/Processing.hs | agpl-3.0 | -- Several passes, but premature optimisation is the root of all evil
consonantLength = fromIntegral . length . filter (`elem` consonants) | 138 | consonantLength = fromIntegral . length . filter (`elem` consonants) | 68 | consonantLength = fromIntegral . length . filter (`elem` consonants) | 68 | true | false | 1 | 7 | 20 | 27 | 14 | 13 | null | null |
blanu/juicer | puree.hs | gpl-2.0 | main :: IO ()
main = do
maybeFeed <- thaw
case maybeFeed of
Nothing -> return ()
Just (Feed _ posts) -> do
let post@(Post title desc) = posts !! 0
printTags desc
let p = parse desc
putStrLn $ show p | 234 | main :: IO ()
main = do
maybeFeed <- thaw
case maybeFeed of
Nothing -> return ()
Just (Feed _ posts) -> do
let post@(Post title desc) = posts !! 0
printTags desc
let p = parse desc
putStrLn $ show p | 234 | main = do
maybeFeed <- thaw
case maybeFeed of
Nothing -> return ()
Just (Feed _ posts) -> do
let post@(Post title desc) = posts !! 0
printTags desc
let p = parse desc
putStrLn $ show p | 220 | false | true | 1 | 19 | 77 | 116 | 50 | 66 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.