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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
expipiplus1/vulkan | generate-new/src/Render/Stmts/Poke/SiblingInfo.hs | bsd-3-clause | getSiblingInfo
:: forall a r
. (HasErr r, HasSiblingInfo a r)
=> CName
-> Sem r (SiblingInfo a)
getSiblingInfo n =
note ("Unable to find info for: " <> unCName n) . ($ n) =<< input | 191 | getSiblingInfo
:: forall a r
. (HasErr r, HasSiblingInfo a r)
=> CName
-> Sem r (SiblingInfo a)
getSiblingInfo n =
note ("Unable to find info for: " <> unCName n) . ($ n) =<< input | 191 | getSiblingInfo n =
note ("Unable to find info for: " <> unCName n) . ($ n) =<< input | 86 | false | true | 0 | 11 | 46 | 82 | 41 | 41 | null | null |
AlexanderPankiv/ghc | compiler/cmm/PprC.hs | bsd-3-clause | cLoad :: CmmExpr -> CmmType -> SDoc
cLoad expr rep
= sdocWithPlatform $ \platform ->
if bewareLoadStoreAlignment (platformArch platform)
then let decl = machRepCType rep <+> ptext (sLit "x") <> semi
struct = ptext (sLit "struct") <+> braces (decl)
packed_attr = ptext (sLit "__attribute__((packed))")
cast = parens (struct <+> packed_attr <> char '*')
in parens (cast <+> pprExpr1 expr) <> ptext (sLit "->x")
else char '*' <> parens (cCast (machRepPtrCType rep) expr)
where -- On these platforms, unaligned loads are known to cause problems
bewareLoadStoreAlignment ArchAlpha = True
bewareLoadStoreAlignment ArchMipseb = True
bewareLoadStoreAlignment ArchMipsel = True
bewareLoadStoreAlignment (ArchARM {}) = True
bewareLoadStoreAlignment ArchARM64 = True
-- Pessimistically assume that they will also cause problems
-- on unknown arches
bewareLoadStoreAlignment ArchUnknown = True
bewareLoadStoreAlignment _ = False | 1,110 | cLoad :: CmmExpr -> CmmType -> SDoc
cLoad expr rep
= sdocWithPlatform $ \platform ->
if bewareLoadStoreAlignment (platformArch platform)
then let decl = machRepCType rep <+> ptext (sLit "x") <> semi
struct = ptext (sLit "struct") <+> braces (decl)
packed_attr = ptext (sLit "__attribute__((packed))")
cast = parens (struct <+> packed_attr <> char '*')
in parens (cast <+> pprExpr1 expr) <> ptext (sLit "->x")
else char '*' <> parens (cCast (machRepPtrCType rep) expr)
where -- On these platforms, unaligned loads are known to cause problems
bewareLoadStoreAlignment ArchAlpha = True
bewareLoadStoreAlignment ArchMipseb = True
bewareLoadStoreAlignment ArchMipsel = True
bewareLoadStoreAlignment (ArchARM {}) = True
bewareLoadStoreAlignment ArchARM64 = True
-- Pessimistically assume that they will also cause problems
-- on unknown arches
bewareLoadStoreAlignment ArchUnknown = True
bewareLoadStoreAlignment _ = False | 1,110 | cLoad expr rep
= sdocWithPlatform $ \platform ->
if bewareLoadStoreAlignment (platformArch platform)
then let decl = machRepCType rep <+> ptext (sLit "x") <> semi
struct = ptext (sLit "struct") <+> braces (decl)
packed_attr = ptext (sLit "__attribute__((packed))")
cast = parens (struct <+> packed_attr <> char '*')
in parens (cast <+> pprExpr1 expr) <> ptext (sLit "->x")
else char '*' <> parens (cCast (machRepPtrCType rep) expr)
where -- On these platforms, unaligned loads are known to cause problems
bewareLoadStoreAlignment ArchAlpha = True
bewareLoadStoreAlignment ArchMipseb = True
bewareLoadStoreAlignment ArchMipsel = True
bewareLoadStoreAlignment (ArchARM {}) = True
bewareLoadStoreAlignment ArchARM64 = True
-- Pessimistically assume that they will also cause problems
-- on unknown arches
bewareLoadStoreAlignment ArchUnknown = True
bewareLoadStoreAlignment _ = False | 1,074 | false | true | 4 | 15 | 319 | 275 | 130 | 145 | null | null |
nevrenato/HetsAlloy | Comorphisms/SuleCFOL2SoftFOL.hs | gpl-2.0 | toCKType :: CType -> CKType
toCKType ct = case ct of
CSort -> CKSort
CVar _ -> CKVar
CPred _ -> CKPred
COp _ -> CKOp
-- | CASL Ids with Types mapped to SPIdentifier | 173 | toCKType :: CType -> CKType
toCKType ct = case ct of
CSort -> CKSort
CVar _ -> CKVar
CPred _ -> CKPred
COp _ -> CKOp
-- | CASL Ids with Types mapped to SPIdentifier | 173 | toCKType ct = case ct of
CSort -> CKSort
CVar _ -> CKVar
CPred _ -> CKPred
COp _ -> CKOp
-- | CASL Ids with Types mapped to SPIdentifier | 145 | false | true | 0 | 8 | 43 | 56 | 27 | 29 | null | null |
jbetzend/statMusic | src/Parser.hs | gpl-3.0 | parseOctave :: Parser Octave
parseOctave = do string "<octave>"
o <- decimal
string "</octave>"
pure o
-- ex: <duration>8</duration> | 184 | parseOctave :: Parser Octave
parseOctave = do string "<octave>"
o <- decimal
string "</octave>"
pure o
-- ex: <duration>8</duration> | 184 | parseOctave = do string "<octave>"
o <- decimal
string "</octave>"
pure o
-- ex: <duration>8</duration> | 155 | false | true | 1 | 8 | 70 | 44 | 17 | 27 | null | null |
tsahyt/lmrbot | src/Pipes/Network.hs | agpl-3.0 | toHandleLine :: MonadIO m => Handle -> Consumer ByteString m ()
toHandleLine h = do
x <- await
liftIO (B.hPutStrLn h x)
toHandleLine h | 146 | toHandleLine :: MonadIO m => Handle -> Consumer ByteString m ()
toHandleLine h = do
x <- await
liftIO (B.hPutStrLn h x)
toHandleLine h | 146 | toHandleLine h = do
x <- await
liftIO (B.hPutStrLn h x)
toHandleLine h | 82 | false | true | 0 | 10 | 35 | 63 | 28 | 35 | null | null |
dsorokin/aivika-experiment-chart | examples/MachineBreakdowns/Experiment.hs | bsd-3-clause | queueCountStats :: ResultTransform
queueCountStats =
T.tr $ T.queueCountStats inputQueue | 90 | queueCountStats :: ResultTransform
queueCountStats =
T.tr $ T.queueCountStats inputQueue | 90 | queueCountStats =
T.tr $ T.queueCountStats inputQueue | 55 | false | true | 0 | 7 | 10 | 22 | 11 | 11 | null | null |
rehno-lindeque/poet | src/haskell/LangLang/Parser.hs | gpl-3.0 | subexpression :: Parser Expression
subexpression = tokenId >-> Atom ! tokenChar '(' -# expression #- tokenChar ')' | 114 | subexpression :: Parser Expression
subexpression = tokenId >-> Atom ! tokenChar '(' -# expression #- tokenChar ')' | 114 | subexpression = tokenId >-> Atom ! tokenChar '(' -# expression #- tokenChar ')' | 79 | false | true | 1 | 8 | 16 | 39 | 17 | 22 | null | null |
zouppen/stratum-tool | src-nossl/Connection.hs | agpl-3.0 | connGetLine :: Conn -> IO BS.ByteString
connGetLine = BS.hGetLine | 65 | connGetLine :: Conn -> IO BS.ByteString
connGetLine = BS.hGetLine | 65 | connGetLine = BS.hGetLine | 25 | false | true | 0 | 7 | 8 | 22 | 11 | 11 | null | null |
mhwombat/exp-uivector-cluster-wains | src/ALife/Creatur/Wain/UIVector/Cluster/Universe.hs | bsd-3-clause | cCSQDeltaE :: Setting Double
cCSQDeltaE = requiredSetting "csqDeltaE" | 69 | cCSQDeltaE :: Setting Double
cCSQDeltaE = requiredSetting "csqDeltaE" | 69 | cCSQDeltaE = requiredSetting "csqDeltaE" | 40 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
li-zhirui/EoplLangs | src/LetLang/Parser.hs | bsd-3-clause | keyWord :: String -> Parser ()
keyWord w = string w *> notFollowedBy alphaNumChar *> spaceConsumer | 98 | keyWord :: String -> Parser ()
keyWord w = string w *> notFollowedBy alphaNumChar *> spaceConsumer | 98 | keyWord w = string w *> notFollowedBy alphaNumChar *> spaceConsumer | 67 | false | true | 2 | 8 | 15 | 43 | 19 | 24 | null | null |
adituv/qbscript | src/Compiler/QbScript/CodeGen.hs | bsd-3-clause | putQbValueData (QbVector3 x y z) = lift $ putWord32BE 0x00010000 >> putFloat32BE x >> putFloat32BE y >> putFloat32BE z | 118 | putQbValueData (QbVector3 x y z) = lift $ putWord32BE 0x00010000 >> putFloat32BE x >> putFloat32BE y >> putFloat32BE z | 118 | putQbValueData (QbVector3 x y z) = lift $ putWord32BE 0x00010000 >> putFloat32BE x >> putFloat32BE y >> putFloat32BE z | 118 | false | false | 0 | 9 | 18 | 47 | 21 | 26 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | Relative amount of time the slowest shard spent on writing output.
eqsWriteRatioMax :: Lens' ExplainQueryStage (Maybe Double)
eqsWriteRatioMax
= lens _eqsWriteRatioMax
(\ s a -> s{_eqsWriteRatioMax = a})
. mapping _Coerce | 240 | eqsWriteRatioMax :: Lens' ExplainQueryStage (Maybe Double)
eqsWriteRatioMax
= lens _eqsWriteRatioMax
(\ s a -> s{_eqsWriteRatioMax = a})
. mapping _Coerce | 168 | eqsWriteRatioMax
= lens _eqsWriteRatioMax
(\ s a -> s{_eqsWriteRatioMax = a})
. mapping _Coerce | 109 | true | true | 0 | 10 | 46 | 55 | 28 | 27 | null | null |
droundy/franchise | Distribution/Franchise/Jhc.hs | bsd-3-clause | lookForModuleExporting :: String -> String -> String -> C Bool
lookForModuleExporting m i c =
do putSnoln $ "checking module "++m++" ... "
x <- tryModule m i c
case x of
(ExitSuccess, _) -> do putS "found"
return True
(_, e) -> do putV e
ps <- seekModuleInLibraries m
if null ps
then do putS "no package found"
return False
else do putV $ unwords ("looking in packages":ps)
tryPackages ps
where tryPackages [] = return False
tryPackages (p:ps) =
do addPackages [p]
putSnoln $ "looking in package "++p++" ... "
x <- tryModule m i c
case x of
(ExitSuccess, _) -> do putS "found"
return True
(_, e) -> do putV e
removePackages [p]
tryPackages ps | 1,089 | lookForModuleExporting :: String -> String -> String -> C Bool
lookForModuleExporting m i c =
do putSnoln $ "checking module "++m++" ... "
x <- tryModule m i c
case x of
(ExitSuccess, _) -> do putS "found"
return True
(_, e) -> do putV e
ps <- seekModuleInLibraries m
if null ps
then do putS "no package found"
return False
else do putV $ unwords ("looking in packages":ps)
tryPackages ps
where tryPackages [] = return False
tryPackages (p:ps) =
do addPackages [p]
putSnoln $ "looking in package "++p++" ... "
x <- tryModule m i c
case x of
(ExitSuccess, _) -> do putS "found"
return True
(_, e) -> do putV e
removePackages [p]
tryPackages ps | 1,089 | lookForModuleExporting m i c =
do putSnoln $ "checking module "++m++" ... "
x <- tryModule m i c
case x of
(ExitSuccess, _) -> do putS "found"
return True
(_, e) -> do putV e
ps <- seekModuleInLibraries m
if null ps
then do putS "no package found"
return False
else do putV $ unwords ("looking in packages":ps)
tryPackages ps
where tryPackages [] = return False
tryPackages (p:ps) =
do addPackages [p]
putSnoln $ "looking in package "++p++" ... "
x <- tryModule m i c
case x of
(ExitSuccess, _) -> do putS "found"
return True
(_, e) -> do putV e
removePackages [p]
tryPackages ps | 1,026 | false | true | 0 | 18 | 564 | 303 | 138 | 165 | null | null |
green-haskell/ghc | libraries/base/GHC/List.hs | bsd-3-clause | maximum xs = foldl1 max xs | 40 | maximum xs = foldl1 max xs | 40 | maximum xs = foldl1 max xs | 40 | false | false | 1 | 5 | 19 | 19 | 6 | 13 | null | null |
coghex/abridgefaraway | src/ABFA/Map.hs | bsd-3-clause | calcBiome BCrags = 5 | 23 | calcBiome BCrags = 5 | 23 | calcBiome BCrags = 5 | 23 | false | false | 1 | 5 | 6 | 13 | 4 | 9 | null | null |
prb/perpubplat | src/Blog/Model/CommentForm.hs | bsd-3-clause | new_comment_form :: String -> String -> String -> String -> CommentForm
new_comment_form n e u b = CommentForm (Field "name" n Nothing)
(Field "email" e Nothing) (Field "URL" u Nothing) (Field "body" b Nothing) | 237 | new_comment_form :: String -> String -> String -> String -> CommentForm
new_comment_form n e u b = CommentForm (Field "name" n Nothing)
(Field "email" e Nothing) (Field "URL" u Nothing) (Field "body" b Nothing) | 237 | new_comment_form n e u b = CommentForm (Field "name" n Nothing)
(Field "email" e Nothing) (Field "URL" u Nothing) (Field "body" b Nothing) | 165 | false | true | 0 | 8 | 60 | 85 | 42 | 43 | null | null |
Dronte/Operads | Math/Operad.hs | bsd-3-clause | -- | The element m3(1,2,3)
m3 :: DecoratedTree Integer
m3 = corolla 3 [1,2,3] | 77 | m3 :: DecoratedTree Integer
m3 = corolla 3 [1,2,3] | 50 | m3 = corolla 3 [1,2,3] | 22 | true | true | 0 | 6 | 13 | 35 | 17 | 18 | null | null |
notabotanist/fuzzy-octo-adventure | NabRay.hs | bsd-3-clause | extraScene :: Light.LitScene
extraScene = Light.insertLitObj cyl myScene where
cyl = Light.LitObject 0.2 0 0 (Light.plasticMat ambient (0.8, 0.8, 0))
(Scene.Cylinder (Vect.Vec3 4 2 1) (Vect.mkNormal (Vect.Vec3 0 1 0)) 1 2)
-- |Adds a light extra to myScene | 263 | extraScene :: Light.LitScene
extraScene = Light.insertLitObj cyl myScene where
cyl = Light.LitObject 0.2 0 0 (Light.plasticMat ambient (0.8, 0.8, 0))
(Scene.Cylinder (Vect.Vec3 4 2 1) (Vect.mkNormal (Vect.Vec3 0 1 0)) 1 2)
-- |Adds a light extra to myScene | 263 | extraScene = Light.insertLitObj cyl myScene where
cyl = Light.LitObject 0.2 0 0 (Light.plasticMat ambient (0.8, 0.8, 0))
(Scene.Cylinder (Vect.Vec3 4 2 1) (Vect.mkNormal (Vect.Vec3 0 1 0)) 1 2)
-- |Adds a light extra to myScene | 234 | false | true | 1 | 12 | 45 | 122 | 56 | 66 | null | null |
pauldoo/scratch | ProgrammingInHaskell/Ex8.hs | isc | nat :: Parser Int
nat =
do
xs <- many1 digit
return (read xs) | 81 | nat :: Parser Int
nat =
do
xs <- many1 digit
return (read xs) | 81 | nat =
do
xs <- many1 digit
return (read xs) | 63 | false | true | 1 | 10 | 33 | 40 | 16 | 24 | null | null |
NightRa/Idris-dev | src/Idris/Core/ProofState.hs | bsd-3-clause | updateEnv ns [] = [] | 20 | updateEnv ns [] = [] | 20 | updateEnv ns [] = [] | 20 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
mookerji/libsbp | haskell/src/SwiftNav/SBP/Navigation.hs | lgpl-3.0 | msgPosEcef :: Word16
msgPosEcef = 0x0200 | 40 | msgPosEcef :: Word16
msgPosEcef = 0x0200 | 40 | msgPosEcef = 0x0200 | 19 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
sgillespie/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey | 70 | uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey | 70 | uAddrTyConName = tcQual gHC_GENERICS (fsLit "UAddr") uAddrTyConKey | 70 | false | false | 0 | 7 | 10 | 19 | 9 | 10 | null | null |
niteria/deterministic-fvs | Tests.hs | mit | test4 :: Term
test4 = foldr ($) test1 (replicate 1000 leftF) | 60 | test4 :: Term
test4 = foldr ($) test1 (replicate 1000 leftF) | 60 | test4 = foldr ($) test1 (replicate 1000 leftF) | 46 | false | true | 0 | 7 | 10 | 36 | 16 | 20 | null | null |
acowley/ghc | compiler/utils/Outputable.hs | bsd-3-clause | darrow = unicodeSyntax (char '⇒') (docToSDoc $ Pretty.ptext (sLit "=>")) | 76 | darrow = unicodeSyntax (char '⇒') (docToSDoc $ Pretty.ptext (sLit "=>")) | 76 | darrow = unicodeSyntax (char '⇒') (docToSDoc $ Pretty.ptext (sLit "=>")) | 76 | false | false | 0 | 10 | 13 | 35 | 17 | 18 | null | null |
UBMLtonGroup/timberc | src/Env.hs | bsd-3-clause | addTEnv0 te env = env { typeEnv0 = te ++ typeEnv0 env } | 81 | addTEnv0 te env = env { typeEnv0 = te ++ typeEnv0 env } | 81 | addTEnv0 te env = env { typeEnv0 = te ++ typeEnv0 env } | 81 | false | false | 0 | 8 | 38 | 26 | 13 | 13 | null | null |
pminten/xhaskell | pascals-triangle/pascals-triangle_test.hs | mit | triangleTests :: [Test]
triangleTests =
[ testCase "1 row" $
[[1]] @=? take 1 (triangle :: [[Int]])
, testCase "2 rows" $
[[1], [1, 1]] @=? take 2 (triangle :: [[Int]])
, testCase "3 rows" $
[[1], [1, 1], [1, 2, 1]] @=? take 3 (triangle :: [[Int]])
, testCase "4 rows" $
[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] @=? take 4 (triangle :: [[Int]])
, testCase "5th row" $
[1, 4, 6, 4, 1] @=? (row 5 :: [Int])
, testCase "20th row" $
[(1 :: Int), 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378
, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1] @=? row 20
, testCase "201st row maximum" $
(product [101..200] `div` product [1..100] :: Integer) @=? row 201 !! 100
] | 721 | triangleTests :: [Test]
triangleTests =
[ testCase "1 row" $
[[1]] @=? take 1 (triangle :: [[Int]])
, testCase "2 rows" $
[[1], [1, 1]] @=? take 2 (triangle :: [[Int]])
, testCase "3 rows" $
[[1], [1, 1], [1, 2, 1]] @=? take 3 (triangle :: [[Int]])
, testCase "4 rows" $
[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] @=? take 4 (triangle :: [[Int]])
, testCase "5th row" $
[1, 4, 6, 4, 1] @=? (row 5 :: [Int])
, testCase "20th row" $
[(1 :: Int), 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378
, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1] @=? row 20
, testCase "201st row maximum" $
(product [101..200] `div` product [1..100] :: Integer) @=? row 201 !! 100
] | 721 | triangleTests =
[ testCase "1 row" $
[[1]] @=? take 1 (triangle :: [[Int]])
, testCase "2 rows" $
[[1], [1, 1]] @=? take 2 (triangle :: [[Int]])
, testCase "3 rows" $
[[1], [1, 1], [1, 2, 1]] @=? take 3 (triangle :: [[Int]])
, testCase "4 rows" $
[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] @=? take 4 (triangle :: [[Int]])
, testCase "5th row" $
[1, 4, 6, 4, 1] @=? (row 5 :: [Int])
, testCase "20th row" $
[(1 :: Int), 19, 171, 969, 3876, 11628, 27132, 50388, 75582, 92378
, 92378, 75582, 50388, 27132, 11628, 3876, 969, 171, 19, 1] @=? row 20
, testCase "201st row maximum" $
(product [101..200] `div` product [1..100] :: Integer) @=? row 201 !! 100
] | 697 | false | true | 0 | 12 | 181 | 401 | 238 | 163 | null | null |
shlevy/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | cafRefsE p (Let b e) = cafRefsEs p (rhssOfBind b) || cafRefsE p e | 75 | cafRefsE p (Let b e) = cafRefsEs p (rhssOfBind b) || cafRefsE p e | 75 | cafRefsE p (Let b e) = cafRefsEs p (rhssOfBind b) || cafRefsE p e | 75 | false | false | 0 | 8 | 23 | 39 | 18 | 21 | null | null |
nfjinjing/level5 | src/MusicPad/Model/Note.hs | bsd-3-clause | touch_note_only :: Game State -> Int -> Int -> IO ()
touch_note_only g x y = do
enabled <- is_note_enabled g x y
if enabled
then
disable_note g x y
else
enable_note g x y | 194 | touch_note_only :: Game State -> Int -> Int -> IO ()
touch_note_only g x y = do
enabled <- is_note_enabled g x y
if enabled
then
disable_note g x y
else
enable_note g x y | 194 | touch_note_only g x y = do
enabled <- is_note_enabled g x y
if enabled
then
disable_note g x y
else
enable_note g x y | 141 | false | true | 0 | 9 | 58 | 77 | 36 | 41 | null | null |
yalpul/CENG242 | H99/11-20/p14.hs | gpl-3.0 | [] = [] | 7 | [] = [] | 7 | [] = [] | 7 | false | false | 1 | 6 | 2 | 14 | 5 | 9 | null | null |
qsn/rhcalc | src/Operators.hs | mit | op_reverse [List a] = [List $ reverse a] | 44 | op_reverse [List a] = [List $ reverse a] | 44 | op_reverse [List a] = [List $ reverse a] | 44 | false | false | 0 | 7 | 11 | 26 | 12 | 14 | null | null |
kaashif/hs-irc-osric | exe/Main.hs | agpl-3.0 | main :: IO ()
main = OSRIC.Main.main | 36 | main :: IO ()
main = OSRIC.Main.main | 36 | main = OSRIC.Main.main | 22 | false | true | 0 | 7 | 6 | 25 | 11 | 14 | null | null |
rhofour/rlglue-haskell-codec | src/RL_Glue/Network.hs | apache-2.0 | kAgentStep = 6 :: Word32 | 29 | kAgentStep = 6 :: Word32 | 29 | kAgentStep = 6 :: Word32 | 29 | false | false | 0 | 4 | 9 | 9 | 5 | 4 | null | null |
m-alvarez/jhc | src/Util/Once.hs | mit | unOnce :: Once a -> IO a -> IO a
runOnce (Once ref) action = do
b <- readIORef ref
case b of
Just x -> return x
Nothing -> do
r <- action
writeIORef ref (Just r)
return r
-- | run first argument once, after which perform the second
| 293 | runOnce :: Once a -> IO a -> IO a
runOnce (Once ref) action = do
b <- readIORef ref
case b of
Just x -> return x
Nothing -> do
r <- action
writeIORef ref (Just r)
return r
-- | run first argument once, after which perform the second | 293 | runOnce (Once ref) action = do
b <- readIORef ref
case b of
Just x -> return x
Nothing -> do
r <- action
writeIORef ref (Just r)
return r
-- | run first argument once, after which perform the second | 259 | false | true | 0 | 14 | 112 | 102 | 45 | 57 | null | null |
phadej/range-set-list | src/Data/RangeSet/IntMap.hs | mit | -- | /O(log n)/. Is the entire range contained within the set?
containsRange :: (Int, Int) -> RIntSet -> Bool
containsRange (x,y) s
| x <= y = contains' x y s
| otherwise = True | 181 | containsRange :: (Int, Int) -> RIntSet -> Bool
containsRange (x,y) s
| x <= y = contains' x y s
| otherwise = True | 118 | containsRange (x,y) s
| x <= y = contains' x y s
| otherwise = True | 71 | true | true | 1 | 8 | 39 | 62 | 32 | 30 | null | null |
nushio3/ghc | compiler/basicTypes/VarSet.hs | bsd-3-clause | delVarSet = delOneFromUniqSet | 35 | delVarSet = delOneFromUniqSet | 35 | delVarSet = delOneFromUniqSet | 35 | false | false | 0 | 4 | 8 | 6 | 3 | 3 | null | null |
lbodor/geodesy-domain-model | src/test/resources/solutions/final/weekly/sinex-subset.hs | bsd-3-clause | filterSinexFiles :: Integer -> Integer -> [Text] -> IO ()
filterSinexFiles start end files = mapM_ TIO.putStrLn (filter p files)
where
week :: Text -> Integer
week file = case T.decimal (T.drop (T.length sinexDir + 3) file) of
Right (n, _) -> n
Left _ -> -1
p file = let n = week file in (n >= start) && (n <= end) | 385 | filterSinexFiles :: Integer -> Integer -> [Text] -> IO ()
filterSinexFiles start end files = mapM_ TIO.putStrLn (filter p files)
where
week :: Text -> Integer
week file = case T.decimal (T.drop (T.length sinexDir + 3) file) of
Right (n, _) -> n
Left _ -> -1
p file = let n = week file in (n >= start) && (n <= end) | 385 | filterSinexFiles start end files = mapM_ TIO.putStrLn (filter p files)
where
week :: Text -> Integer
week file = case T.decimal (T.drop (T.length sinexDir + 3) file) of
Right (n, _) -> n
Left _ -> -1
p file = let n = week file in (n >= start) && (n <= end) | 327 | false | true | 0 | 12 | 133 | 170 | 84 | 86 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Math/Rectangle.hs | mit | isInRect :: (Real a, Real b) => Point a -> Rectangle b -> Bool
isInRect p r = x p `isIn` xI r && y p `isIn` yI r | 112 | isInRect :: (Real a, Real b) => Point a -> Rectangle b -> Bool
isInRect p r = x p `isIn` xI r && y p `isIn` yI r | 112 | isInRect p r = x p `isIn` xI r && y p `isIn` yI r | 49 | false | true | 0 | 8 | 28 | 73 | 36 | 37 | null | null |
beni55/text | tests/Tests/Properties.hs | bsd-2-clause | t_dropWhile p = L.dropWhile p `eqP` (unpackS . T.dropWhile p) | 65 | t_dropWhile p = L.dropWhile p `eqP` (unpackS . T.dropWhile p) | 65 | t_dropWhile p = L.dropWhile p `eqP` (unpackS . T.dropWhile p) | 65 | false | false | 0 | 9 | 13 | 32 | 16 | 16 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | exprCtOrigin (OpApp _ (L _ op) _ _) = exprCtOrigin op | 53 | exprCtOrigin (OpApp _ (L _ op) _ _) = exprCtOrigin op | 53 | exprCtOrigin (OpApp _ (L _ op) _ _) = exprCtOrigin op | 53 | false | false | 0 | 8 | 10 | 33 | 15 | 18 | null | null |
reinh/Hask8080 | src/Hask8080/Instructions.hs | mit | adc r = error "fatal: adc not yet implemented" | 52 | adc r = error "fatal: adc not yet implemented" | 52 | adc r = error "fatal: adc not yet implemented" | 52 | false | false | 0 | 5 | 14 | 12 | 5 | 7 | null | null |
jozefg/c-dsl | src/Language/C/DSL/Decl.hs | mit | -- | Identical to fun except this annotates the list of attributes given
-- as a list of strings.
annotatedFun :: [CDeclSpec] -> String -> [Maybe CExpr -> CDecl] -> [String] -> CStat -> CFunDef
annotatedFun specs name args annots body = CFunDef specs decl [] body undefNode
where decl = CDeclr (Just $ fromString name)
[CFunDeclr (Right (fmap ($Nothing) args, False)) [] undefNode]
Nothing attrs undefNode
attrs :: [CAttr]
attrs = map (\ s -> CAttr (fromString s) [] undefNode) annots | 532 | annotatedFun :: [CDeclSpec] -> String -> [Maybe CExpr -> CDecl] -> [String] -> CStat -> CFunDef
annotatedFun specs name args annots body = CFunDef specs decl [] body undefNode
where decl = CDeclr (Just $ fromString name)
[CFunDeclr (Right (fmap ($Nothing) args, False)) [] undefNode]
Nothing attrs undefNode
attrs :: [CAttr]
attrs = map (\ s -> CAttr (fromString s) [] undefNode) annots | 434 | annotatedFun specs name args annots body = CFunDef specs decl [] body undefNode
where decl = CDeclr (Just $ fromString name)
[CFunDeclr (Right (fmap ($Nothing) args, False)) [] undefNode]
Nothing attrs undefNode
attrs :: [CAttr]
attrs = map (\ s -> CAttr (fromString s) [] undefNode) annots | 338 | true | true | 0 | 14 | 129 | 175 | 92 | 83 | null | null |
ihc/futhark | src/Futhark/Actions.hs | isc | interpretAction :: Show error =>
(FilePath -> T.Text -> Either error [Value])
-> Name
-> Action SOACS
interpretAction parser entry =
Action { actionName = "Interpret"
, actionDescription = "Run the program via an interpreter."
, actionProcedure = liftIO . interpret parser entry
} | 360 | interpretAction :: Show error =>
(FilePath -> T.Text -> Either error [Value])
-> Name
-> Action SOACS
interpretAction parser entry =
Action { actionName = "Interpret"
, actionDescription = "Run the program via an interpreter."
, actionProcedure = liftIO . interpret parser entry
} | 360 | interpretAction parser entry =
Action { actionName = "Interpret"
, actionDescription = "Run the program via an interpreter."
, actionProcedure = liftIO . interpret parser entry
} | 207 | false | true | 0 | 11 | 123 | 84 | 44 | 40 | null | null |
kim/amazonka | amazonka-lambda/gen/Network/AWS/Lambda/UploadFunction.hs | mpl-2.0 | -- | The runtime environment for the Lambda function.
ufrRuntime :: Lens' UploadFunctionResponse (Maybe Runtime)
ufrRuntime = lens _ufrRuntime (\s a -> s { _ufrRuntime = a }) | 174 | ufrRuntime :: Lens' UploadFunctionResponse (Maybe Runtime)
ufrRuntime = lens _ufrRuntime (\s a -> s { _ufrRuntime = a }) | 120 | ufrRuntime = lens _ufrRuntime (\s a -> s { _ufrRuntime = a }) | 61 | true | true | 1 | 9 | 27 | 51 | 25 | 26 | null | null |
ezyang/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | simplCountN :: SimplCount -> Int
simplCountN (VerySimplCount n) = n | 75 | simplCountN :: SimplCount -> Int
simplCountN (VerySimplCount n) = n | 75 | simplCountN (VerySimplCount n) = n | 42 | false | true | 0 | 6 | 17 | 28 | 13 | 15 | null | null |
kishoredbn/barrelfish | tools/mackerel/BitFieldDriver.hs | mit | -- Device representation structure generator
device_struct_def :: Dev.Rec -> [String]
device_struct_def d =
[ C.multi_comment "Device representation structure",
C.typedef dev_t (unlines strct) ]
where
args = map convert_arg (Dev.args d)
strct = C.struct dev_t ( [ C.comment "Device arguments" ]
++
[ (C.struct_field n v) | Arg n v <- args ]
++
[ C.comment "Shadow registers" ]
++
[ device_struct_shadow s | s <- (Dev.shdws d)]
) | 685 | device_struct_def :: Dev.Rec -> [String]
device_struct_def d =
[ C.multi_comment "Device representation structure",
C.typedef dev_t (unlines strct) ]
where
args = map convert_arg (Dev.args d)
strct = C.struct dev_t ( [ C.comment "Device arguments" ]
++
[ (C.struct_field n v) | Arg n v <- args ]
++
[ C.comment "Shadow registers" ]
++
[ device_struct_shadow s | s <- (Dev.shdws d)]
) | 626 | device_struct_def d =
[ C.multi_comment "Device representation structure",
C.typedef dev_t (unlines strct) ]
where
args = map convert_arg (Dev.args d)
strct = C.struct dev_t ( [ C.comment "Device arguments" ]
++
[ (C.struct_field n v) | Arg n v <- args ]
++
[ C.comment "Shadow registers" ]
++
[ device_struct_shadow s | s <- (Dev.shdws d)]
) | 585 | true | true | 1 | 13 | 324 | 160 | 81 | 79 | null | null |
ublubu/shapes | shapes/src/Physics/Constraint.hs | mit | -- | Use a Lagrangian multiplier to update a pair of objects.
applyLagrangian2 :: Diag6 -- ^ Inverse mass
-> V6 -- ^ Jacobian
-> Lagrangian
-> (PhysicalObj, PhysicalObj)
-> (PhysicalObj, PhysicalObj)
applyLagrangian2 im j lagr = constrainedVel6 %~ f
where f v6 = updateVelocity2_ v6 im (constraintImpulse2 j lagr)
| 384 | applyLagrangian2 :: Diag6 -- ^ Inverse mass
-> V6 -- ^ Jacobian
-> Lagrangian
-> (PhysicalObj, PhysicalObj)
-> (PhysicalObj, PhysicalObj)
applyLagrangian2 im j lagr = constrainedVel6 %~ f
where f v6 = updateVelocity2_ v6 im (constraintImpulse2 j lagr)
| 322 | applyLagrangian2 im j lagr = constrainedVel6 %~ f
where f v6 = updateVelocity2_ v6 im (constraintImpulse2 j lagr)
| 116 | true | true | 0 | 9 | 120 | 78 | 42 | 36 | null | null |
573/leksah | src/IDE/Keymap.hs | gpl-2.0 | lexeme = P.lexeme lexer | 23 | lexeme = P.lexeme lexer | 23 | lexeme = P.lexeme lexer | 23 | false | false | 1 | 5 | 3 | 15 | 5 | 10 | null | null |
mrmonday/Idris-dev | src/Idris/Primitives.hs | bsd-3-clause | concatWord16 :: (Word16, Word16) -> Word32
concatWord16 (high, low) = fromIntegral high .|. (fromIntegral low `shiftL` 16) | 122 | concatWord16 :: (Word16, Word16) -> Word32
concatWord16 (high, low) = fromIntegral high .|. (fromIntegral low `shiftL` 16) | 122 | concatWord16 (high, low) = fromIntegral high .|. (fromIntegral low `shiftL` 16) | 79 | false | true | 0 | 8 | 16 | 49 | 27 | 22 | null | null |
aostiles/LiveHaskell | src/IHaskell/Eval/Hoogle.hs | mit | query :: String -> IO (Either String String)
query str = do
let request = getRequest $ queryUrl str
response <- simpleHTTP request
return $ case response of
Left err -> Left $ show err
Right resp -> Right $ rspBody resp
where
queryUrl :: String -> String
queryUrl = printf "http://www.haskell.org/hoogle/?hoogle=%s&mode=json" . urlEncode
-- | Search for a query on Hoogle.
-- Return all search results. | 427 | query :: String -> IO (Either String String)
query str = do
let request = getRequest $ queryUrl str
response <- simpleHTTP request
return $ case response of
Left err -> Left $ show err
Right resp -> Right $ rspBody resp
where
queryUrl :: String -> String
queryUrl = printf "http://www.haskell.org/hoogle/?hoogle=%s&mode=json" . urlEncode
-- | Search for a query on Hoogle.
-- Return all search results. | 427 | query str = do
let request = getRequest $ queryUrl str
response <- simpleHTTP request
return $ case response of
Left err -> Left $ show err
Right resp -> Right $ rspBody resp
where
queryUrl :: String -> String
queryUrl = printf "http://www.haskell.org/hoogle/?hoogle=%s&mode=json" . urlEncode
-- | Search for a query on Hoogle.
-- Return all search results. | 382 | false | true | 0 | 12 | 91 | 134 | 60 | 74 | null | null |
andorp/bead | src/Bead/Persistence/NoSQLDir.hs | bsd-3-clause | parseConfig :: String -> Config
parseConfig _ = Config | 54 | parseConfig :: String -> Config
parseConfig _ = Config | 54 | parseConfig _ = Config | 22 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/ZoneOperations/Get.hs | mpl-2.0 | -- | Name of the Operations resource to return.
zogOperation :: Lens' ZoneOperationsGet Text
zogOperation
= lens _zogOperation (\ s a -> s{_zogOperation = a}) | 160 | zogOperation :: Lens' ZoneOperationsGet Text
zogOperation
= lens _zogOperation (\ s a -> s{_zogOperation = a}) | 112 | zogOperation
= lens _zogOperation (\ s a -> s{_zogOperation = a}) | 67 | true | true | 0 | 9 | 26 | 42 | 22 | 20 | null | null |
yaxu/embedded | tidal/light/hs/Sound/Tidal/Light.hs | gpl-3.0 | light :: Shape
light = Shape {params = [s_p,
n_p,
pan_p,
begin_p,
end_p,
dur_p
],
cpsStamp = True,
latency = 0.29
} | 309 | light :: Shape
light = Shape {params = [s_p,
n_p,
pan_p,
begin_p,
end_p,
dur_p
],
cpsStamp = True,
latency = 0.29
} | 309 | light = Shape {params = [s_p,
n_p,
pan_p,
begin_p,
end_p,
dur_p
],
cpsStamp = True,
latency = 0.29
} | 294 | false | true | 0 | 8 | 215 | 56 | 32 | 24 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MMutant.hs | bsd-3-clause | framePain301 :: Int
framePain301 = 45 | 37 | framePain301 :: Int
framePain301 = 45 | 37 | framePain301 = 45 | 17 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-gen/Language/Drasil/Generate.hs | bsd-2-clause | -- | Generate the output artifacts (TeX+Makefile or HTML)
prnt :: PrintingInformation -> DocSpec -> Document -> IO ()
prnt sm dt@(DocSpec Website fn) body =
do prntDoc dt body sm
outh2 <- openFile ("Website/" ++ fn ++ ".css") WriteMode
hPutStrLn outh2 $ render (makeCSS body)
hClose outh2 | 305 | prnt :: PrintingInformation -> DocSpec -> Document -> IO ()
prnt sm dt@(DocSpec Website fn) body =
do prntDoc dt body sm
outh2 <- openFile ("Website/" ++ fn ++ ".css") WriteMode
hPutStrLn outh2 $ render (makeCSS body)
hClose outh2 | 247 | prnt sm dt@(DocSpec Website fn) body =
do prntDoc dt body sm
outh2 <- openFile ("Website/" ++ fn ++ ".css") WriteMode
hPutStrLn outh2 $ render (makeCSS body)
hClose outh2 | 187 | true | true | 0 | 11 | 64 | 105 | 49 | 56 | null | null |
chreekat/yesod | yesod-core/Yesod/Logger.hs | bsd-2-clause | handleToLogFun :: Handle -> ([LogStr] -> IO ())
handleToLogFun = hPutLogStr | 75 | handleToLogFun :: Handle -> ([LogStr] -> IO ())
handleToLogFun = hPutLogStr | 75 | handleToLogFun = hPutLogStr | 27 | false | true | 0 | 9 | 10 | 30 | 16 | 14 | null | null |
amalloy/advent-of-code-2016 | 12/hs/Day12/src/Day12/Parser.hs | mit | arg = space *> (Lit <$> int
<|> Reg <$> anyChar) | 64 | arg = space *> (Lit <$> int
<|> Reg <$> anyChar) | 64 | arg = space *> (Lit <$> int
<|> Reg <$> anyChar) | 64 | false | false | 3 | 9 | 26 | 31 | 14 | 17 | null | null |
wereHamster/nauva | pkg/hs/nauva-catalog/src/Nauva/Catalog/TH.hs | mit | renderInline :: Inline -> Q Exp -- [Q Element]
renderInline i = case i of
(InlineText str) ->
[| [str_ str] |]
(InlineItalic is) ->
appE [| \x -> [i_ $ mconcat x] |] (ListE <$> mapM renderInline is)
(InlineBold is) ->
appE [| \x -> [strong_ $ mconcat x] |] (ListE <$> mapM renderInline is)
(InlineLink url _title is) ->
appE [| \x -> [a_ [href_ url] (mconcat x)] |] (ListE <$> mapM renderInline is)
(InlineCode str) ->
[| [pageCode [str_ str]] |]
(InlineHtml _) ->
[| [str_ "TODO: InlineHtml"] |]
(InlineImage url _ _) ->
[| [img_ [src_ url]] |]
(InlineFootnoteRef _) ->
[| [str_ "TODO: InlineFootnoteRef"] |]
(InlineFootnote _) ->
[| [str_ "TODO: InlineFootnote"] |] | 783 | renderInline :: Inline -> Q Exp
renderInline i = case i of
(InlineText str) ->
[| [str_ str] |]
(InlineItalic is) ->
appE [| \x -> [i_ $ mconcat x] |] (ListE <$> mapM renderInline is)
(InlineBold is) ->
appE [| \x -> [strong_ $ mconcat x] |] (ListE <$> mapM renderInline is)
(InlineLink url _title is) ->
appE [| \x -> [a_ [href_ url] (mconcat x)] |] (ListE <$> mapM renderInline is)
(InlineCode str) ->
[| [pageCode [str_ str]] |]
(InlineHtml _) ->
[| [str_ "TODO: InlineHtml"] |]
(InlineImage url _ _) ->
[| [img_ [src_ url]] |]
(InlineFootnoteRef _) ->
[| [str_ "TODO: InlineFootnoteRef"] |]
(InlineFootnote _) ->
[| [str_ "TODO: InlineFootnote"] |] | 768 | renderInline i = case i of
(InlineText str) ->
[| [str_ str] |]
(InlineItalic is) ->
appE [| \x -> [i_ $ mconcat x] |] (ListE <$> mapM renderInline is)
(InlineBold is) ->
appE [| \x -> [strong_ $ mconcat x] |] (ListE <$> mapM renderInline is)
(InlineLink url _title is) ->
appE [| \x -> [a_ [href_ url] (mconcat x)] |] (ListE <$> mapM renderInline is)
(InlineCode str) ->
[| [pageCode [str_ str]] |]
(InlineHtml _) ->
[| [str_ "TODO: InlineHtml"] |]
(InlineImage url _ _) ->
[| [img_ [src_ url]] |]
(InlineFootnoteRef _) ->
[| [str_ "TODO: InlineFootnoteRef"] |]
(InlineFootnote _) ->
[| [str_ "TODO: InlineFootnote"] |] | 736 | true | true | 9 | 8 | 233 | 229 | 122 | 107 | null | null |
haskellGardener/transient | src/Transient/Base.hs | gpl-3.0 | delSData :: ( MonadState EventF m,Typeable a) => a -> m ()
delSData= delSessionData | 83 | delSData :: ( MonadState EventF m,Typeable a) => a -> m ()
delSData= delSessionData | 83 | delSData= delSessionData | 24 | false | true | 0 | 8 | 13 | 37 | 19 | 18 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Misc.hs | bsd-3-clause | mapNs ns f xs = foldl (\xs n -> mapN n f xs) xs ns | 50 | mapNs ns f xs = foldl (\xs n -> mapN n f xs) xs ns | 50 | mapNs ns f xs = foldl (\xs n -> mapN n f xs) xs ns | 50 | false | false | 0 | 8 | 14 | 37 | 18 | 19 | null | null |
rueshyna/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | Connected time in milliseconds.
psdConnectedTimestampMillis :: Lens' PeerSessionDiagnostics (Maybe Int64)
psdConnectedTimestampMillis
= lens _psdConnectedTimestampMillis
(\ s a -> s{_psdConnectedTimestampMillis = a})
. mapping _Coerce | 253 | psdConnectedTimestampMillis :: Lens' PeerSessionDiagnostics (Maybe Int64)
psdConnectedTimestampMillis
= lens _psdConnectedTimestampMillis
(\ s a -> s{_psdConnectedTimestampMillis = a})
. mapping _Coerce | 216 | psdConnectedTimestampMillis
= lens _psdConnectedTimestampMillis
(\ s a -> s{_psdConnectedTimestampMillis = a})
. mapping _Coerce | 142 | true | true | 0 | 10 | 39 | 55 | 28 | 27 | null | null |
stefanocerruti/haskell-primer-alpha | src/TimeSeries.hs | bsd-3-clause | movingAvg :: (Real a) => [Maybe a] -> Int -> [Maybe Double]
movingAvg [] _ = [] | 79 | movingAvg :: (Real a) => [Maybe a] -> Int -> [Maybe Double]
movingAvg [] _ = [] | 79 | movingAvg [] _ = [] | 19 | false | true | 0 | 9 | 16 | 49 | 25 | 24 | null | null |
brendanhay/gogol | gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs | mpl-2.0 | -- | The border to put at the top of the range.
uborTop :: Lens' UpdateBOrdersRequest (Maybe BOrder)
uborTop = lens _uborTop (\ s a -> s{_uborTop = a}) | 151 | uborTop :: Lens' UpdateBOrdersRequest (Maybe BOrder)
uborTop = lens _uborTop (\ s a -> s{_uborTop = a}) | 103 | uborTop = lens _uborTop (\ s a -> s{_uborTop = a}) | 50 | true | true | 1 | 9 | 28 | 52 | 25 | 27 | null | null |
mattias-lundell/timber-llvm | src/LLVMPP.hs | bsd-3-clause | ppGlobalValue :: LLVMValue -> Doc
ppGlobalValue r@(LLVMRegister typ reg (TagGlobal linkage Nothing)) =
ppValWOtyp r <+> equals <+> pp linkage <+>
pp (if isPtr typ then drop1Ptr typ else typ) | 210 | ppGlobalValue :: LLVMValue -> Doc
ppGlobalValue r@(LLVMRegister typ reg (TagGlobal linkage Nothing)) =
ppValWOtyp r <+> equals <+> pp linkage <+>
pp (if isPtr typ then drop1Ptr typ else typ) | 208 | ppGlobalValue r@(LLVMRegister typ reg (TagGlobal linkage Nothing)) =
ppValWOtyp r <+> equals <+> pp linkage <+>
pp (if isPtr typ then drop1Ptr typ else typ) | 174 | false | true | 0 | 10 | 49 | 77 | 38 | 39 | null | null |
Kotolegokot/Underlisp | src/Base.hs | gpl-3.0 | isBuiltIn BuiltIn {} = True | 27 | isBuiltIn BuiltIn {} = True | 27 | isBuiltIn BuiltIn {} = True | 27 | false | false | 0 | 6 | 4 | 13 | 6 | 7 | null | null |
hsyl20/ViperVM | haskus-system/src/lib/Haskus/System/Linux/Internals/FileSystem.hs | bsd-3-clause | -- | BLKRASET set read ahead for block device
ioctlSetReadAhead :: MonadInIO m => Int64 -> Handle -> FlowT '[ErrorCode] m ()
ioctlSetReadAhead = ioctlSignal 0x12 98 | 164 | ioctlSetReadAhead :: MonadInIO m => Int64 -> Handle -> FlowT '[ErrorCode] m ()
ioctlSetReadAhead = ioctlSignal 0x12 98 | 118 | ioctlSetReadAhead = ioctlSignal 0x12 98 | 39 | true | true | 0 | 10 | 26 | 46 | 23 | 23 | null | null |
facebookincubator/duckling | Duckling/Ordinal/AR/Corpus.hs | bsd-3-clause | corpus :: Corpus
corpus = (testContext {locale = makeLocale AR Nothing}, testOptions, allExamples) | 98 | corpus :: Corpus
corpus = (testContext {locale = makeLocale AR Nothing}, testOptions, allExamples) | 98 | corpus = (testContext {locale = makeLocale AR Nothing}, testOptions, allExamples) | 81 | false | true | 0 | 9 | 12 | 40 | 20 | 20 | null | null |
gnn/Hets | Common/LibName.hs | gpl-2.0 | prettyVersionNumber :: VersionNumber -> [Doc]
prettyVersionNumber (VersionNumber v _) =
[keyword versionS, hcat $ punctuate dot $ map codeToken v] | 148 | prettyVersionNumber :: VersionNumber -> [Doc]
prettyVersionNumber (VersionNumber v _) =
[keyword versionS, hcat $ punctuate dot $ map codeToken v] | 148 | prettyVersionNumber (VersionNumber v _) =
[keyword versionS, hcat $ punctuate dot $ map codeToken v] | 102 | false | true | 0 | 8 | 21 | 54 | 27 | 27 | null | null |
paul-rouse/yesod-auth-hashdb | test/IntegrationTest.hs | mit | integrationSpec :: SpecWith MyTestApp
integrationSpec = do
describe "The home page" $ do
it "can be accessed" $ do
YT.get HomeR
YT.statusIs 200
describe "The protected page" $ do
it "requires login" $ do
needsLogin GET ("/prot" :: Text)
it "looks right after login by a valid user" $ do
_ <- doLogin "paul" "MyPassword"
YT.get ProtectedR
YT.statusIs 200
YT.bodyContains "OK, you are logged in so you are allowed to see this!"
it "can't be accessed after login then logout" $ do
_ <- doLogin "paul" "MyPassword"
YT.get $ AuthR LogoutR
-- That `get` will get the form from Yesod.Core.Handler.redirectToPost
-- which will not be submitted automatically without javascript
YT.bodyContains "please click on the button below to be redirected"
-- so we do the redirection ourselves:
YT.request $ do
YT.setMethod "POST"
YT.setUrl $ AuthR LogoutR
-- yesod-core-1.4.19 added the CSRF token to the redirectToPost form
YT.addToken
YT.get HomeR
YT.statusIs 200
YT.bodyContains "Your current auth ID: Nothing"
YT.get ProtectedR
YT.statusIs 303
describe "Login" $ do
it "fails when incorrect password given" $ do
loc <- doLoginPart1 "paul" "WrongPassword"
checkFailedLogin loc
it "fails when unknown user name given" $ do
loc <- doLoginPart1 "xyzzy" "WrongPassword"
checkFailedLogin loc
describe "JSON Login" $ do
it "JSON access to protected page gives JSON object with auth URL" $ do
YT.request $ do
YT.setMethod "GET"
YT.setUrl ProtectedR
YT.addRequestHeader ("Accept", "application/json")
YT.statusIs 401
auth <- getBodyJSON
YT.assertEq "Authentication URL" auth (Just $ AuthUrl authUrl)
it "Custom loginHandler using submitRouteHashDB has correct URL in JSON" $ do
YT.request $ do
YT.setMethod "GET"
YT.setUrl authUrl
YT.addRequestHeader ("Accept", "application/json")
YT.statusIs 200
login <- getBodyJSON
YT.assertEq "Login URL" login (Just $ LoginUrl loginUrl)
-- This example needs yesod-test >= 1.5.0.1, since older ones use wrong
-- content type for JSON (https://github.com/yesodweb/yesod/issues/1063).
it "Sending JSON username and password produces JSON success message" $ do
-- This first request is only to get the CSRF token cookie, used below
YT.request $ do
YT.setMethod "GET"
YT.setUrl authUrl
YT.addRequestHeader ("Accept", "application/json")
YT.request $ do
YT.setMethod "POST"
YT.setUrl loginUrl
YT.addRequestHeader ("Accept", "application/json")
YT.addRequestHeader ("Content-Type", "application/json; charset=utf-8")
YT.setRequestBody "{\"username\":\"paul\",\"password\":\"MyPassword\"}"
-- CSRF token is being checked, since yesod-core >= 1.4.14 is forced
YT.addTokenFromCookie
YT.statusIs 200
msg <- getBodyJSON
YT.assertEq "Login success" msg (Just $ SuccessMsg successMsg) | 3,276 | integrationSpec :: SpecWith MyTestApp
integrationSpec = do
describe "The home page" $ do
it "can be accessed" $ do
YT.get HomeR
YT.statusIs 200
describe "The protected page" $ do
it "requires login" $ do
needsLogin GET ("/prot" :: Text)
it "looks right after login by a valid user" $ do
_ <- doLogin "paul" "MyPassword"
YT.get ProtectedR
YT.statusIs 200
YT.bodyContains "OK, you are logged in so you are allowed to see this!"
it "can't be accessed after login then logout" $ do
_ <- doLogin "paul" "MyPassword"
YT.get $ AuthR LogoutR
-- That `get` will get the form from Yesod.Core.Handler.redirectToPost
-- which will not be submitted automatically without javascript
YT.bodyContains "please click on the button below to be redirected"
-- so we do the redirection ourselves:
YT.request $ do
YT.setMethod "POST"
YT.setUrl $ AuthR LogoutR
-- yesod-core-1.4.19 added the CSRF token to the redirectToPost form
YT.addToken
YT.get HomeR
YT.statusIs 200
YT.bodyContains "Your current auth ID: Nothing"
YT.get ProtectedR
YT.statusIs 303
describe "Login" $ do
it "fails when incorrect password given" $ do
loc <- doLoginPart1 "paul" "WrongPassword"
checkFailedLogin loc
it "fails when unknown user name given" $ do
loc <- doLoginPart1 "xyzzy" "WrongPassword"
checkFailedLogin loc
describe "JSON Login" $ do
it "JSON access to protected page gives JSON object with auth URL" $ do
YT.request $ do
YT.setMethod "GET"
YT.setUrl ProtectedR
YT.addRequestHeader ("Accept", "application/json")
YT.statusIs 401
auth <- getBodyJSON
YT.assertEq "Authentication URL" auth (Just $ AuthUrl authUrl)
it "Custom loginHandler using submitRouteHashDB has correct URL in JSON" $ do
YT.request $ do
YT.setMethod "GET"
YT.setUrl authUrl
YT.addRequestHeader ("Accept", "application/json")
YT.statusIs 200
login <- getBodyJSON
YT.assertEq "Login URL" login (Just $ LoginUrl loginUrl)
-- This example needs yesod-test >= 1.5.0.1, since older ones use wrong
-- content type for JSON (https://github.com/yesodweb/yesod/issues/1063).
it "Sending JSON username and password produces JSON success message" $ do
-- This first request is only to get the CSRF token cookie, used below
YT.request $ do
YT.setMethod "GET"
YT.setUrl authUrl
YT.addRequestHeader ("Accept", "application/json")
YT.request $ do
YT.setMethod "POST"
YT.setUrl loginUrl
YT.addRequestHeader ("Accept", "application/json")
YT.addRequestHeader ("Content-Type", "application/json; charset=utf-8")
YT.setRequestBody "{\"username\":\"paul\",\"password\":\"MyPassword\"}"
-- CSRF token is being checked, since yesod-core >= 1.4.14 is forced
YT.addTokenFromCookie
YT.statusIs 200
msg <- getBodyJSON
YT.assertEq "Login success" msg (Just $ SuccessMsg successMsg) | 3,276 | integrationSpec = do
describe "The home page" $ do
it "can be accessed" $ do
YT.get HomeR
YT.statusIs 200
describe "The protected page" $ do
it "requires login" $ do
needsLogin GET ("/prot" :: Text)
it "looks right after login by a valid user" $ do
_ <- doLogin "paul" "MyPassword"
YT.get ProtectedR
YT.statusIs 200
YT.bodyContains "OK, you are logged in so you are allowed to see this!"
it "can't be accessed after login then logout" $ do
_ <- doLogin "paul" "MyPassword"
YT.get $ AuthR LogoutR
-- That `get` will get the form from Yesod.Core.Handler.redirectToPost
-- which will not be submitted automatically without javascript
YT.bodyContains "please click on the button below to be redirected"
-- so we do the redirection ourselves:
YT.request $ do
YT.setMethod "POST"
YT.setUrl $ AuthR LogoutR
-- yesod-core-1.4.19 added the CSRF token to the redirectToPost form
YT.addToken
YT.get HomeR
YT.statusIs 200
YT.bodyContains "Your current auth ID: Nothing"
YT.get ProtectedR
YT.statusIs 303
describe "Login" $ do
it "fails when incorrect password given" $ do
loc <- doLoginPart1 "paul" "WrongPassword"
checkFailedLogin loc
it "fails when unknown user name given" $ do
loc <- doLoginPart1 "xyzzy" "WrongPassword"
checkFailedLogin loc
describe "JSON Login" $ do
it "JSON access to protected page gives JSON object with auth URL" $ do
YT.request $ do
YT.setMethod "GET"
YT.setUrl ProtectedR
YT.addRequestHeader ("Accept", "application/json")
YT.statusIs 401
auth <- getBodyJSON
YT.assertEq "Authentication URL" auth (Just $ AuthUrl authUrl)
it "Custom loginHandler using submitRouteHashDB has correct URL in JSON" $ do
YT.request $ do
YT.setMethod "GET"
YT.setUrl authUrl
YT.addRequestHeader ("Accept", "application/json")
YT.statusIs 200
login <- getBodyJSON
YT.assertEq "Login URL" login (Just $ LoginUrl loginUrl)
-- This example needs yesod-test >= 1.5.0.1, since older ones use wrong
-- content type for JSON (https://github.com/yesodweb/yesod/issues/1063).
it "Sending JSON username and password produces JSON success message" $ do
-- This first request is only to get the CSRF token cookie, used below
YT.request $ do
YT.setMethod "GET"
YT.setUrl authUrl
YT.addRequestHeader ("Accept", "application/json")
YT.request $ do
YT.setMethod "POST"
YT.setUrl loginUrl
YT.addRequestHeader ("Accept", "application/json")
YT.addRequestHeader ("Content-Type", "application/json; charset=utf-8")
YT.setRequestBody "{\"username\":\"paul\",\"password\":\"MyPassword\"}"
-- CSRF token is being checked, since yesod-core >= 1.4.14 is forced
YT.addTokenFromCookie
YT.statusIs 200
msg <- getBodyJSON
YT.assertEq "Login success" msg (Just $ SuccessMsg successMsg) | 3,238 | false | true | 0 | 17 | 956 | 654 | 278 | 376 | null | null |
DougBurke/swish | tests/N3FormatterTest.hs | lgpl-2.1 | commonPrefixes :: B.Builder
commonPrefixes = commonPrefixesN [0..3] | 67 | commonPrefixes :: B.Builder
commonPrefixes = commonPrefixesN [0..3] | 67 | commonPrefixes = commonPrefixesN [0..3] | 39 | false | true | 0 | 6 | 6 | 21 | 11 | 10 | null | null |
trbauer/progargs | Prog/Args/Args.hs | mit | -- sets the default value used if the option is not parsed (in IO context)
withDefaultIO :: OptSpec o -> (o -> IO o) -> OptSpec o
withDefaultIO os f = os {osDerived = Just f} | 174 | withDefaultIO :: OptSpec o -> (o -> IO o) -> OptSpec o
withDefaultIO os f = os {osDerived = Just f} | 99 | withDefaultIO os f = os {osDerived = Just f} | 44 | true | true | 0 | 9 | 35 | 52 | 26 | 26 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT43.hs | gpl-3.0 | x /= y = not (x == y) | 21 | x /= y = not (x == y) | 21 | x /= y = not (x == y) | 21 | false | false | 3 | 7 | 7 | 26 | 11 | 15 | null | null |
kuitang/monad-learner | static.hs | mit | v = vec2 5 0 & 0 & 3 & 7 | 24 | v = vec2 5 0 & 0 & 3 & 7 | 24 | v = vec2 5 0 & 0 & 3 & 7 | 24 | false | false | 1 | 8 | 10 | 27 | 11 | 16 | null | null |
phischu/fragnix | benchmarks/containers/Data.Sequence.hs | bsd-3-clause | initsDigit (Three a b c) = Three (One a) (Two a b) (Three a b c) | 64 | initsDigit (Three a b c) = Three (One a) (Two a b) (Three a b c) | 64 | initsDigit (Three a b c) = Three (One a) (Two a b) (Three a b c) | 64 | false | false | 0 | 7 | 15 | 52 | 24 | 28 | null | null |
Ekleog/hasklate | src/Main.hs | mit | funDeclToCpp :: MirDecl -> CppMonad ()
funDeclToCpp d = do
traceM (show d ++ "\n")
declOnce d
tellOne $ (tplArgListToCpp (args d))
tellOne $ "struct " ++ (name d) ++ (if not (null (args d)) then "_impl" else "") ++ (tplSpecToCpp (args d) False) ++ " {"
tellOne $ " using value = " ++ (expToCpp (value d) True) ++ "::value;"
tellOne $ "};\n"
-- Send the [String] argument list twice | 403 | funDeclToCpp :: MirDecl -> CppMonad ()
funDeclToCpp d = do
traceM (show d ++ "\n")
declOnce d
tellOne $ (tplArgListToCpp (args d))
tellOne $ "struct " ++ (name d) ++ (if not (null (args d)) then "_impl" else "") ++ (tplSpecToCpp (args d) False) ++ " {"
tellOne $ " using value = " ++ (expToCpp (value d) True) ++ "::value;"
tellOne $ "};\n"
-- Send the [String] argument list twice | 403 | funDeclToCpp d = do
traceM (show d ++ "\n")
declOnce d
tellOne $ (tplArgListToCpp (args d))
tellOne $ "struct " ++ (name d) ++ (if not (null (args d)) then "_impl" else "") ++ (tplSpecToCpp (args d) False) ++ " {"
tellOne $ " using value = " ++ (expToCpp (value d) True) ++ "::value;"
tellOne $ "};\n"
-- Send the [String] argument list twice | 364 | false | true | 0 | 16 | 92 | 175 | 83 | 92 | null | null |
ian-ross/ggp | players/manual-player.hs | bsd-3-clause | main :: IO ()
main = run 9147 manualHandler | 43 | main :: IO ()
main = run 9147 manualHandler | 43 | main = run 9147 manualHandler | 29 | false | true | 0 | 6 | 8 | 21 | 10 | 11 | null | null |
kmyk/forth-to-brainfuck | Main.hs | mit | ifL' :: [Brainfuck] -> [Brainfuck] -> [Brainfuck]
ifL' thn els = readBrainfuck $ concat
[ ">+<[[-]>-<<"
, showBrainfuck thn
, ">]>[-<<"
, showBrainfuck els
, ">>]<<"
] | 191 | ifL' :: [Brainfuck] -> [Brainfuck] -> [Brainfuck]
ifL' thn els = readBrainfuck $ concat
[ ">+<[[-]>-<<"
, showBrainfuck thn
, ">]>[-<<"
, showBrainfuck els
, ">>]<<"
] | 191 | ifL' thn els = readBrainfuck $ concat
[ ">+<[[-]>-<<"
, showBrainfuck thn
, ">]>[-<<"
, showBrainfuck els
, ">>]<<"
] | 141 | false | true | 0 | 7 | 50 | 61 | 33 | 28 | null | null |
zhensydow/ptrader | examples/example01.hs | gpl-3.0 | -- -----------------------------------------------------------------------------
stocks :: [String]
stocks = ["ENG.MC","SAN.MC","TEF.MC","OHL.MC","FER.MC"] | 155 | stocks :: [String]
stocks = ["ENG.MC","SAN.MC","TEF.MC","OHL.MC","FER.MC"] | 74 | stocks = ["ENG.MC","SAN.MC","TEF.MC","OHL.MC","FER.MC"] | 55 | true | true | 0 | 7 | 7 | 37 | 20 | 17 | null | null |
mvr/at | src/Math/Algebra/ChainComplex/Tensor.hs | bsd-3-clause | tensorReduction ::
(ChainComplex a1, ChainComplex a2, ChainComplex b1, ChainComplex b2) =>
a1 ->
a2 ->
b1 ->
b2 ->
Reduction a1 b1 ->
Reduction a2 b2 ->
Reduction (Tensor a1 a2) (Tensor b1 b2)
tensorReduction a1 a2 b1 b2 (Reduction f1 g1 h1) (Reduction f2 g2 h2) = Reduction f' g' h'
where
f' = tensorMorphism a1 a2 f1 f2
g' = tensorMorphism b1 b2 g1 g2
h' = (tensorMorphism a1 a2 h1 (g2 . f2)) + (tensorMorphism a1 a2 id h2)
-- Convenience: | 472 | tensorReduction ::
(ChainComplex a1, ChainComplex a2, ChainComplex b1, ChainComplex b2) =>
a1 ->
a2 ->
b1 ->
b2 ->
Reduction a1 b1 ->
Reduction a2 b2 ->
Reduction (Tensor a1 a2) (Tensor b1 b2)
tensorReduction a1 a2 b1 b2 (Reduction f1 g1 h1) (Reduction f2 g2 h2) = Reduction f' g' h'
where
f' = tensorMorphism a1 a2 f1 f2
g' = tensorMorphism b1 b2 g1 g2
h' = (tensorMorphism a1 a2 h1 (g2 . f2)) + (tensorMorphism a1 a2 id h2)
-- Convenience: | 472 | tensorReduction a1 a2 b1 b2 (Reduction f1 g1 h1) (Reduction f2 g2 h2) = Reduction f' g' h'
where
f' = tensorMorphism a1 a2 f1 f2
g' = tensorMorphism b1 b2 g1 g2
h' = (tensorMorphism a1 a2 h1 (g2 . f2)) + (tensorMorphism a1 a2 id h2)
-- Convenience: | 263 | false | true | 2 | 14 | 114 | 206 | 102 | 104 | null | null |
23Skidoo/xmlhtml | src/Text/XmlHtml/TextParser.hs | bsd-3-clause | parseText :: Parser a -- ^ The parser to match
-> String -- ^ Name of the source file (can be @\"\"@)
-> Text -- ^ Text to parse
-> Either String a -- Either an error message or the result
parseText p src t = inLeft show (P.parse p src t)
where inLeft :: (a -> b) -> Either a c -> Either b c
inLeft f (Left x) = Left (f x)
inLeft _ (Right x) = Right x
------------------------------------------------------------------------------
-- | Consume input as long as the predicate returns 'True', and return the
-- consumed input. This parser does not fail. If it matches no input, it
-- will return an empty string. | 694 | parseText :: Parser a -- ^ The parser to match
-> String -- ^ Name of the source file (can be @\"\"@)
-> Text -- ^ Text to parse
-> Either String a
parseText p src t = inLeft show (P.parse p src t)
where inLeft :: (a -> b) -> Either a c -> Either b c
inLeft f (Left x) = Left (f x)
inLeft _ (Right x) = Right x
------------------------------------------------------------------------------
-- | Consume input as long as the predicate returns 'True', and return the
-- consumed input. This parser does not fail. If it matches no input, it
-- will return an empty string. | 652 | parseText p src t = inLeft show (P.parse p src t)
where inLeft :: (a -> b) -> Either a c -> Either b c
inLeft f (Left x) = Left (f x)
inLeft _ (Right x) = Right x
------------------------------------------------------------------------------
-- | Consume input as long as the predicate returns 'True', and return the
-- consumed input. This parser does not fail. If it matches no input, it
-- will return an empty string. | 444 | true | true | 4 | 8 | 199 | 137 | 71 | 66 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | brazenly = id | 13 | brazenly = id | 13 | brazenly = id | 13 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
jozefg/hasquito | src/Language/Hasquito/JSify.hs | mit | pushArg :: Expr -> CodeGenM Stmt
pushArg e = jname "ARG_STACK" >>= pushStack e | 78 | pushArg :: Expr -> CodeGenM Stmt
pushArg e = jname "ARG_STACK" >>= pushStack e | 78 | pushArg e = jname "ARG_STACK" >>= pushStack e | 45 | false | true | 0 | 6 | 13 | 31 | 14 | 17 | null | null |
urbanslug/ghc | testsuite/tests/module/mod139.hs | bsd-3-clause | a = Mod139_B.x | 14 | a = Mod139_B.x | 14 | a = Mod139_B.x | 14 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
laurencer/confluence-sync | vendor/haxr/Network/XmlRpc/Pretty.hs | bsd-3-clause | contentB (CMisc m _) = misc m | 37 | contentB (CMisc m _) = misc m | 37 | contentB (CMisc m _) = misc m | 37 | false | false | 0 | 7 | 14 | 20 | 9 | 11 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/GHC/Misc.hs | bsd-3-clause | lintCoreBindings :: [Var] -> CoreProgram -> (Bag MsgDoc, Bag MsgDoc)
lintCoreBindings = CoreLint.lintCoreBindings CoreDoNothing | 127 | lintCoreBindings :: [Var] -> CoreProgram -> (Bag MsgDoc, Bag MsgDoc)
lintCoreBindings = CoreLint.lintCoreBindings CoreDoNothing | 127 | lintCoreBindings = CoreLint.lintCoreBindings CoreDoNothing | 58 | false | true | 0 | 8 | 13 | 39 | 20 | 19 | null | null |
martin-kolinek/some-board-game-rules | test/Workplaces/Farming.hs | mit | farmingWorkplaceTests :: TestTree
farmingWorkplaceTests = localOption (QuickCheckMaxRatio 200) $ testGroup "Farming workplace tests" $ [
testProperty "Starting working starts cutting forest" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
builtBuildings <- getsUniverse currentlyBuiltBuildings <*> pure playerId
assert $ builtBuildings == [DoubleSmallBuildingDesc Grass Field],
testProperty "Planting crops is available" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
plCrops <- getsUniverse isPlantingCrops <*> pure playerId
assert $ plCrops,
testProperty "Planting crops starts next player" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
checkPlayerHasValidOccupants playerId
applyToUniverse $ plantCrops playerId []
validateNextPlayer playerId
] | 890 | farmingWorkplaceTests :: TestTree
farmingWorkplaceTests = localOption (QuickCheckMaxRatio 200) $ testGroup "Farming workplace tests" $ [
testProperty "Starting working starts cutting forest" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
builtBuildings <- getsUniverse currentlyBuiltBuildings <*> pure playerId
assert $ builtBuildings == [DoubleSmallBuildingDesc Grass Field],
testProperty "Planting crops is available" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
plCrops <- getsUniverse isPlantingCrops <*> pure playerId
assert $ plCrops,
testProperty "Planting crops starts next player" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
checkPlayerHasValidOccupants playerId
applyToUniverse $ plantCrops playerId []
validateNextPlayer playerId
] | 890 | farmingWorkplaceTests = localOption (QuickCheckMaxRatio 200) $ testGroup "Farming workplace tests" $ [
testProperty "Starting working starts cutting forest" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
builtBuildings <- getsUniverse currentlyBuiltBuildings <*> pure playerId
assert $ builtBuildings == [DoubleSmallBuildingDesc Grass Field],
testProperty "Planting crops is available" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
plCrops <- getsUniverse isPlantingCrops <*> pure playerId
assert $ plCrops,
testProperty "Planting crops starts next player" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInFarming
checkPlayerHasValidOccupants playerId
applyToUniverse $ plantCrops playerId []
validateNextPlayer playerId
] | 856 | false | true | 0 | 13 | 166 | 214 | 100 | 114 | null | null |
np/propellor | src/Utility/Monad.hs | bsd-2-clause | after :: Monad m => m b -> m a -> m a
after = observe . const | 61 | after :: Monad m => m b -> m a -> m a
after = observe . const | 61 | after = observe . const | 23 | false | true | 0 | 8 | 17 | 39 | 18 | 21 | null | null |
TomMD/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | ge_RDR = nameRdrName geName | 44 | ge_RDR = nameRdrName geName | 44 | ge_RDR = nameRdrName geName | 44 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
gbataille/pandoc | src/Text/Pandoc/Writers/DokuWiki.hs | gpl-2.0 | inlineToDokuWiki _ (Code _ str) =
-- In dokuwiki, text surrounded by '' is really just a font statement, i.e. <tt>,
-- and so other formatting can be present inside.
-- However, in pandoc, and markdown, inlined code doesn't contain formatting.
-- So I have opted for using %% to disable all formatting inside inline code blocks.
-- This gives the best results when converting from other formats to dokuwiki, even if
-- the resultand code is a little ugly, for short strings that don't contain formatting
-- characters.
-- It does mean that if pandoc could ever read dokuwiki, and so round-trip the format,
-- any formatting inside inlined code blocks would be lost, or presented incorrectly.
return $ "''%%" ++ str ++ "%%''" | 744 | inlineToDokuWiki _ (Code _ str) =
-- In dokuwiki, text surrounded by '' is really just a font statement, i.e. <tt>,
-- and so other formatting can be present inside.
-- However, in pandoc, and markdown, inlined code doesn't contain formatting.
-- So I have opted for using %% to disable all formatting inside inline code blocks.
-- This gives the best results when converting from other formats to dokuwiki, even if
-- the resultand code is a little ugly, for short strings that don't contain formatting
-- characters.
-- It does mean that if pandoc could ever read dokuwiki, and so round-trip the format,
-- any formatting inside inlined code blocks would be lost, or presented incorrectly.
return $ "''%%" ++ str ++ "%%''" | 744 | inlineToDokuWiki _ (Code _ str) =
-- In dokuwiki, text surrounded by '' is really just a font statement, i.e. <tt>,
-- and so other formatting can be present inside.
-- However, in pandoc, and markdown, inlined code doesn't contain formatting.
-- So I have opted for using %% to disable all formatting inside inline code blocks.
-- This gives the best results when converting from other formats to dokuwiki, even if
-- the resultand code is a little ugly, for short strings that don't contain formatting
-- characters.
-- It does mean that if pandoc could ever read dokuwiki, and so round-trip the format,
-- any formatting inside inlined code blocks would be lost, or presented incorrectly.
return $ "''%%" ++ str ++ "%%''" | 744 | false | false | 0 | 7 | 144 | 40 | 24 | 16 | null | null |
tidalcycles/tidal-midi | Sound/Tidal/MIDI/CC.hs | gpl-3.0 | (cc109, cc109_p) = pF "cc109" (Just 0) | 38 | (cc109, cc109_p) = pF "cc109" (Just 0) | 38 | (cc109, cc109_p) = pF "cc109" (Just 0) | 38 | false | false | 0 | 6 | 6 | 25 | 12 | 13 | null | null |
siddhanathan/yi | yi-language/src/Yi/Regex.hs | gpl-2.0 | mapLeft f (Left a) = Left (f a) | 31 | mapLeft f (Left a) = Left (f a) | 31 | mapLeft f (Left a) = Left (f a) | 31 | false | false | 0 | 7 | 7 | 28 | 12 | 16 | null | null |
mydaum/cabal | Cabal/Distribution/Types/ComponentName.hs | bsd-3-clause | -- | This gets the underlying unqualified component name. In fact, it is
-- guaranteed to uniquely identify a component, returning
-- @Nothing@ if the 'ComponentName' was for the public
-- library.
componentNameString :: ComponentName -> Maybe UnqualComponentName
componentNameString CLibName = Nothing | 302 | componentNameString :: ComponentName -> Maybe UnqualComponentName
componentNameString CLibName = Nothing | 104 | componentNameString CLibName = Nothing | 38 | true | true | 0 | 6 | 41 | 25 | 14 | 11 | null | null |
dmbarbour/haskell-vcache | hsrc_lib/Database/VCache/Alloc.hs | bsd-2-clause | addr2pvar' :: (VCacheable a) => VSpace -> Address -> Memory -> IO (Memory, PVar a)
addr2pvar' = _addr2pvar undefined | 116 | addr2pvar' :: (VCacheable a) => VSpace -> Address -> Memory -> IO (Memory, PVar a)
addr2pvar' = _addr2pvar undefined | 116 | addr2pvar' = _addr2pvar undefined | 33 | false | true | 0 | 11 | 18 | 47 | 24 | 23 | null | null |
magnusjonsson/unitc | app/Type.hs | bsd-2-clause | assignable :: Type -> Type -> Bool
assignable to from =
case (to, from) of
(Zero, Zero) -> True
(Zero, _) -> False
(Ptr (Fun _ _ _), Fun _ _ _) -> assignable to (Ptr from)
(Ptr Void, Arr from') -> True
(Ptr to', Arr from') -> isJust (merge to' from')
_ -> isJust (merge to from) | 304 | assignable :: Type -> Type -> Bool
assignable to from =
case (to, from) of
(Zero, Zero) -> True
(Zero, _) -> False
(Ptr (Fun _ _ _), Fun _ _ _) -> assignable to (Ptr from)
(Ptr Void, Arr from') -> True
(Ptr to', Arr from') -> isJust (merge to' from')
_ -> isJust (merge to from) | 304 | assignable to from =
case (to, from) of
(Zero, Zero) -> True
(Zero, _) -> False
(Ptr (Fun _ _ _), Fun _ _ _) -> assignable to (Ptr from)
(Ptr Void, Arr from') -> True
(Ptr to', Arr from') -> isJust (merge to' from')
_ -> isJust (merge to from) | 269 | false | true | 0 | 11 | 83 | 165 | 84 | 81 | null | null |
fredmorcos/attic | projects/pet/archive/pet_haskell_old_parsers/ParserOld2.hs | isc | failEnd :: Eq a => String -> Parser a p ()
failEnd m = isEnd >>= \e -> when e $ failList $ "Unexpected end" : [m] | 113 | failEnd :: Eq a => String -> Parser a p ()
failEnd m = isEnd >>= \e -> when e $ failList $ "Unexpected end" : [m] | 113 | failEnd m = isEnd >>= \e -> when e $ failList $ "Unexpected end" : [m] | 70 | false | true | 0 | 10 | 26 | 61 | 30 | 31 | null | null |
Chatanga/kage | src/Graphics/Color.hs | mit | orchid = mkColor 218 112 214 | 28 | orchid = mkColor 218 112 214 | 28 | orchid = mkColor 218 112 214 | 28 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
tolysz/Haxl | tests/TestUtils.hs | bsd-3-clause | id1 :: Haxl Id
id1 = lookupInput "A" | 36 | id1 :: Haxl Id
id1 = lookupInput "A" | 36 | id1 = lookupInput "A" | 21 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
mocnik-science/chorale | src/Chorale/Common.hs | mit | -- | append a char as often as needed in order to return a string of given length where the given string ist justified right
justifyRight :: Int -> Char -> String -> String
justifyRight n c s = replicate (max 0 $ n - length s) c ++ s | 233 | justifyRight :: Int -> Char -> String -> String
justifyRight n c s = replicate (max 0 $ n - length s) c ++ s | 108 | justifyRight n c s = replicate (max 0 $ n - length s) c ++ s | 60 | true | true | 0 | 10 | 49 | 57 | 28 | 29 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_389 (32#) = happyGoto action_19 | 38 | action_389 (32#) = happyGoto action_19 | 38 | action_389 (32#) = happyGoto action_19 | 38 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
JPMoresmau/leksah | src/IDE/Session.hs | gpl-2.0 | recover pp (LogSt p) = void (recoverState pp p) | 60 | recover pp (LogSt p) = void (recoverState pp p) | 60 | recover pp (LogSt p) = void (recoverState pp p) | 60 | false | false | 0 | 7 | 21 | 28 | 13 | 15 | null | null |
mrakgr/futhark | src/Language/Futhark/Attributes.hs | bsd-3-clause | addArrayAliases :: ArrayTypeBase shape asf vn
-> (asf vn -> ast vn)
-> ArrayTypeBase shape ast vn
addArrayAliases (PrimArray et dims u als) f =
PrimArray et dims u $ f als | 205 | addArrayAliases :: ArrayTypeBase shape asf vn
-> (asf vn -> ast vn)
-> ArrayTypeBase shape ast vn
addArrayAliases (PrimArray et dims u als) f =
PrimArray et dims u $ f als | 205 | addArrayAliases (PrimArray et dims u als) f =
PrimArray et dims u $ f als | 75 | false | true | 0 | 9 | 65 | 77 | 36 | 41 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.