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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F28.hs | bsd-3-clause | -- glUniformHandleui64NV -------------------------------------------------------
glUniformHandleui64NV
:: MonadIO m
=> GLint -- ^ @location@.
-> GLuint64 -- ^ @value@.
-> m ()
glUniformHandleui64NV v1 v2 = liftIO $ dyn843 ptr_glUniformHandleui64NV v1 v2 | 262 | glUniformHandleui64NV
:: MonadIO m
=> GLint -- ^ @location@.
-> GLuint64 -- ^ @value@.
-> m ()
glUniformHandleui64NV v1 v2 = liftIO $ dyn843 ptr_glUniformHandleui64NV v1 v2 | 180 | glUniformHandleui64NV v1 v2 = liftIO $ dyn843 ptr_glUniformHandleui64NV v1 v2 | 77 | true | true | 0 | 10 | 38 | 54 | 26 | 28 | null | null |
defanor/pancake | Pancake/Command.hs | gpl-3.0 | -- | Basic (constant) command parser.
basicCommand :: Parser Command
basicCommand = choice . map (\(s, c) -> try (string s <* eof) *> pure c) $
[ ("quit", Quit)
, ("[", Back)
, ("]", Forward)
, (",", GoTo Nothing RCurrent)
, ("help", Help)
, ("?", ShowCurrent)
, ("redisplay", Redisplay)
, ("", More)] | 317 | basicCommand :: Parser Command
basicCommand = choice . map (\(s, c) -> try (string s <* eof) *> pure c) $
[ ("quit", Quit)
, ("[", Back)
, ("]", Forward)
, (",", GoTo Nothing RCurrent)
, ("help", Help)
, ("?", ShowCurrent)
, ("redisplay", Redisplay)
, ("", More)] | 279 | basicCommand = choice . map (\(s, c) -> try (string s <* eof) *> pure c) $
[ ("quit", Quit)
, ("[", Back)
, ("]", Forward)
, (",", GoTo Nothing RCurrent)
, ("help", Help)
, ("?", ShowCurrent)
, ("redisplay", Redisplay)
, ("", More)] | 248 | true | true | 0 | 14 | 68 | 137 | 81 | 56 | null | null |
brendanhay/gogol | gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Snapshots/Patch.hs | mpl-2.0 | -- | The name of the snapshot.
ppName :: Lens' ProjectsSnapshotsPatch Text
ppName = lens _ppName (\ s a -> s{_ppName = a}) | 122 | ppName :: Lens' ProjectsSnapshotsPatch Text
ppName = lens _ppName (\ s a -> s{_ppName = a}) | 91 | ppName = lens _ppName (\ s a -> s{_ppName = a}) | 47 | true | true | 0 | 9 | 22 | 40 | 22 | 18 | null | null |
jfischoff/hs-mitsuba | tests/Tests/Mitsuba/Types.hs | bsd-3-clause | -- Third
-- This is different
-- all of sudden
case_obj_2_toXML
= actualObj2 `assertElement` [xmlQQ|
<shape type="obj">
<transform name="toWorld"/>
<boolean name="faceNormals" value="false"/>
<boolean name="flipTexCoords" value="false"/>
<float name="maxSmoothAngle" value="0.0"/>
<string name=... | 980 | case_obj_2_toXML
= actualObj2 `assertElement` [xmlQQ|
<shape type="obj">
<transform name="toWorld"/>
<boolean name="faceNormals" value="false"/>
<boolean name="flipTexCoords" value="false"/>
<float name="maxSmoothAngle" value="0.0"/>
<string name="filename" value="myShape.obj"/>
<bsdf... | 932 | case_obj_2_toXML
= actualObj2 `assertElement` [xmlQQ|
<shape type="obj">
<transform name="toWorld"/>
<boolean name="faceNormals" value="false"/>
<boolean name="flipTexCoords" value="false"/>
<float name="maxSmoothAngle" value="0.0"/>
<string name="filename" value="myShape.obj"/>
<bsdf... | 932 | true | false | 1 | 5 | 193 | 22 | 14 | 8 | null | null |
sol/aeson | benchmarks/Typed/TH.hs | bsd-3-clause | encodeDirect :: Result -> L.ByteString
encodeDirect = encode | 60 | encodeDirect :: Result -> L.ByteString
encodeDirect = encode | 60 | encodeDirect = encode | 21 | false | true | 0 | 6 | 7 | 17 | 9 | 8 | null | null |
bananu7/Hate | src/Hate/Graphics/Backend/Common/Util.hs | mit | vertexLayoutToGLLayout StripVertexLayout = GL.TriangleStrip | 59 | vertexLayoutToGLLayout StripVertexLayout = GL.TriangleStrip | 59 | vertexLayoutToGLLayout StripVertexLayout = GL.TriangleStrip | 59 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
comonoidial/ALFIN | TestCases.hs | mit | rbmMClausify = rbm "Clausify" [2,1] | 38 | rbmMClausify = rbm "Clausify" [2,1] | 38 | rbmMClausify = rbm "Clausify" [2,1] | 38 | false | false | 0 | 6 | 7 | 17 | 9 | 8 | null | null |
mdipirro/functional-languages-homeworks | Project/Parser.hs | gpl-3.0 | alphanum :: Parser Char
alphanum = sat isAlphaNum | 49 | alphanum :: Parser Char
alphanum = sat isAlphaNum | 49 | alphanum = sat isAlphaNum | 25 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
xmonad/xmonad-testing | configs/issues/118-avoid-struts.hs | bsd-2-clause | --------------------------------------------------------------------------------
main :: IO ()
main = do
putStrLn "XMonad starting..."
xmonad cfg
where
cfg = desktopConfig `additionalKeysP`
[ ("M-S-w", addWorkspacePrompt xpcfg)
]
xpcfg = def { font = "xft:monospace:size=9"
... | 334 | main :: IO ()
main = do
putStrLn "XMonad starting..."
xmonad cfg
where
cfg = desktopConfig `additionalKeysP`
[ ("M-S-w", addWorkspacePrompt xpcfg)
]
xpcfg = def { font = "xft:monospace:size=9"
} | 253 | main = do
putStrLn "XMonad starting..."
xmonad cfg
where
cfg = desktopConfig `additionalKeysP`
[ ("M-S-w", addWorkspacePrompt xpcfg)
]
xpcfg = def { font = "xft:monospace:size=9"
} | 239 | true | true | 2 | 8 | 89 | 86 | 39 | 47 | null | null |
christinem/courseography | app/Css/Constants.hs | gpl-3.0 | -- |Defines the CSS for a wide stroke.
wideStroke :: Css
wideStroke = "stroke-width" -: "3" | 91 | wideStroke :: Css
wideStroke = "stroke-width" -: "3" | 52 | wideStroke = "stroke-width" -: "3" | 34 | true | true | 0 | 6 | 15 | 23 | 10 | 13 | null | null |
randrade23/html-render | src/HTMLRender/HTMLPretty.hs | mit | toString :: Value -> String
toString (String s) = s | 51 | toString :: Value -> String
toString (String s) = s | 51 | toString (String s) = s | 23 | false | true | 0 | 9 | 9 | 30 | 13 | 17 | null | null |
rosenbergdm/language-r | src/Language/R/backup/Generator.hs | bsd-3-clause | charLiteral = T.charLiteral rlang | 39 | charLiteral = T.charLiteral rlang | 39 | charLiteral = T.charLiteral rlang | 39 | false | false | 0 | 6 | 9 | 11 | 5 | 6 | null | null |
sseefried/shady-graphics | src/Shady/Image.hs | agpl-3.0 | -- | Generalized disk/ball, given radius
disk :: (InnerSpace p, Scalar p ~ FloatE) => FloatE -> PRegion p
disk s = udisk . (^/ s) | 129 | disk :: (InnerSpace p, Scalar p ~ FloatE) => FloatE -> PRegion p
disk s = udisk . (^/ s) | 88 | disk s = udisk . (^/ s) | 23 | true | true | 1 | 9 | 25 | 56 | 27 | 29 | null | null |
shlevy/ghc | libraries/base/Control/Exception/Base.hs | bsd-3-clause | bracketOnError
:: IO a -- ^ computation to run first (\"acquire resource\")
-> (a -> IO b) -- ^ computation to run last (\"release resource\")
-> (a -> IO c) -- ^ computation to run in-between
-> IO c -- returns the value from the in-between computation
bracketOnError b... | 535 | bracketOnError
:: IO a -- ^ computation to run first (\"acquire resource\")
-> (a -> IO b) -- ^ computation to run last (\"release resource\")
-> (a -> IO c) -- ^ computation to run in-between
-> IO c
bracketOnError before after thing =
mask $ \restore -> do
a <- before
... | 474 | bracketOnError before after thing =
mask $ \restore -> do
a <- before
restore (thing a) `onException` after a
-----
-- |A pattern match failed. The @String@ gives information about the
-- source location of the pattern. | 231 | true | true | 2 | 12 | 145 | 106 | 53 | 53 | null | null |
olsner/ghc | compiler/coreSyn/CoreStats.hs | bsd-3-clause | exprStats :: CoreExpr -> CoreStats
exprStats (Var {}) = oneTM | 68 | exprStats :: CoreExpr -> CoreStats
exprStats (Var {}) = oneTM | 68 | exprStats (Var {}) = oneTM | 33 | false | true | 0 | 7 | 16 | 25 | 13 | 12 | null | null |
mettekou/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | lookupWithDefaultModuleEnv :: ModuleEnv a -> a -> Module -> a
lookupWithDefaultModuleEnv (ModuleEnv e) x m =
Map.findWithDefault x (NDModule m) e | 147 | lookupWithDefaultModuleEnv :: ModuleEnv a -> a -> Module -> a
lookupWithDefaultModuleEnv (ModuleEnv e) x m =
Map.findWithDefault x (NDModule m) e | 147 | lookupWithDefaultModuleEnv (ModuleEnv e) x m =
Map.findWithDefault x (NDModule m) e | 85 | false | true | 0 | 7 | 22 | 54 | 26 | 28 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | The request entries to be processed in the batch.
pcbrcEntries :: Lens' ProductstatusesCustomBatchRequest [ProductstatusesCustomBatchRequestEntry]
pcbrcEntries
= lens _pcbrcEntries (\ s a -> s{_pcbrcEntries = a})
. _Default
. _Coerce | 252 | pcbrcEntries :: Lens' ProductstatusesCustomBatchRequest [ProductstatusesCustomBatchRequestEntry]
pcbrcEntries
= lens _pcbrcEntries (\ s a -> s{_pcbrcEntries = a})
. _Default
. _Coerce | 197 | pcbrcEntries
= lens _pcbrcEntries (\ s a -> s{_pcbrcEntries = a})
. _Default
. _Coerce | 100 | true | true | 0 | 11 | 44 | 53 | 28 | 25 | null | null |
chrys-h/ftag | app/Main.hs | mit | runC env (CmdLsvals t e) = runFTag env (listVals t e) >>= mapM_ (liftIO . putStrLn . show) | 90 | runC env (CmdLsvals t e) = runFTag env (listVals t e) >>= mapM_ (liftIO . putStrLn . show) | 90 | runC env (CmdLsvals t e) = runFTag env (listVals t e) >>= mapM_ (liftIO . putStrLn . show) | 90 | false | false | 0 | 9 | 17 | 50 | 24 | 26 | null | null |
jagg/search | src/Trie.hs | apache-2.0 | union (Node _ m) (Leaf x) = Node (Just x) m | 43 | union (Node _ m) (Leaf x) = Node (Just x) m | 43 | union (Node _ m) (Leaf x) = Node (Just x) m | 43 | false | false | 0 | 7 | 10 | 36 | 17 | 19 | null | null |
SantiMunin/harmony | harmony-commandline/Main.hs | gpl-3.0 | parseServer (Just "js") = OG.generateJSServer | 45 | parseServer (Just "js") = OG.generateJSServer | 45 | parseServer (Just "js") = OG.generateJSServer | 45 | false | false | 0 | 7 | 4 | 17 | 8 | 9 | null | null |
TomMD/mellow | src/Mellow.hs | bsd-3-clause | -- |
-- Example handle event:
-- * 'esc' quit
-- * 's' save the frame
defaultEventHandler :: (s -> IO RGBA) -> Event -> s -> IO s
defaultEventHandler _ (EventKey (SpecialKey KeyEsc) _ _ _) _ = exitSuccess | 208 | defaultEventHandler :: (s -> IO RGBA) -> Event -> s -> IO s
defaultEventHandler _ (EventKey (SpecialKey KeyEsc) _ _ _) _ = exitSuccess | 134 | defaultEventHandler _ (EventKey (SpecialKey KeyEsc) _ _ _) _ = exitSuccess | 74 | true | true | 0 | 9 | 43 | 65 | 34 | 31 | null | null |
4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/Input/ADL1/CtxError.hs | gpl-3.0 | whenError a@(Checked _) _ = a | 29 | whenError a@(Checked _) _ = a | 29 | whenError a@(Checked _) _ = a | 29 | false | false | 0 | 8 | 5 | 20 | 10 | 10 | null | null |
melted/idris-java | src/IRTS/Java/JTypes.hs | bsd-3-clause | sourceTypes (LNoOp) = repeat objectType | 39 | sourceTypes (LNoOp) = repeat objectType | 39 | sourceTypes (LNoOp) = repeat objectType | 39 | false | false | 0 | 5 | 4 | 16 | 7 | 9 | null | null |
haskell-suite/haskell-packages | src/Distribution/HaskellSuite/Packages.hs | mit | haskellPackagesDir :: IO FilePath
haskellPackagesDir = getAppUserDataDirectory "haskell-packages" | 97 | haskellPackagesDir :: IO FilePath
haskellPackagesDir = getAppUserDataDirectory "haskell-packages" | 97 | haskellPackagesDir = getAppUserDataDirectory "haskell-packages" | 63 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
tjakway/ghcjvm | compiler/prelude/PrelNames.hs | bsd-3-clause | uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey | 68 | uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey | 68 | uRecTyConName = tcQual gHC_GENERICS (fsLit "URec") uRecTyConKey | 68 | false | false | 0 | 7 | 11 | 19 | 9 | 10 | null | null |
jystic/ssa-anf | src/ANF/SCCP.hs | bsd-3-clause | specialiseAtoms :: (Show n, Ord n) => VarEnv n -> [Atom n] -> [Atom n]
specialiseAtoms vEnv = map (specialiseAtom vEnv) | 119 | specialiseAtoms :: (Show n, Ord n) => VarEnv n -> [Atom n] -> [Atom n]
specialiseAtoms vEnv = map (specialiseAtom vEnv) | 119 | specialiseAtoms vEnv = map (specialiseAtom vEnv) | 48 | false | true | 0 | 9 | 20 | 61 | 30 | 31 | null | null |
haBuu/tfs-website | Application.hs | mit | ---------------------------------------------
-- Functions for use in development with GHCi
---------------------------------------------
-- | Run a handler
handler :: Handler a -> IO a
handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h | 257 | handler :: Handler a -> IO a
handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h | 99 | handler h = getAppSettings >>= makeFoundation >>= flip unsafeHandler h | 70 | true | true | 0 | 6 | 32 | 41 | 21 | 20 | null | null |
rueshyna/gogol | gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs | mpl-2.0 | paThoroughfareName :: Lens' PostalAddress (Maybe Text)
paThoroughfareName
= lens _paThoroughfareName
(\ s a -> s{_paThoroughfareName = a}) | 146 | paThoroughfareName :: Lens' PostalAddress (Maybe Text)
paThoroughfareName
= lens _paThoroughfareName
(\ s a -> s{_paThoroughfareName = a}) | 146 | paThoroughfareName
= lens _paThoroughfareName
(\ s a -> s{_paThoroughfareName = a}) | 91 | false | true | 0 | 8 | 24 | 48 | 24 | 24 | null | null |
yaxu/smooth | Stream.hs | gpl-3.0 | hasDefault (F _ Nothing) = False | 32 | hasDefault (F _ Nothing) = False | 32 | hasDefault (F _ Nothing) = False | 32 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/ExtensionPredicates.hs | bsd-3-clause | -- | Is the <https://www.opengl.org/registry/specs/SGIS/texture_filter4.txt SGIS_texture_filter4> extension supported?
-- Note that in the presence of multiple contexts with different capabilities,
-- this might be wrong. Use 'glGetSGISTextureFilter4' in those cases instead.
gl_SGIS_texture_filter4 :: Bool
gl_SGIS_text... | 377 | gl_SGIS_texture_filter4 :: Bool
gl_SGIS_texture_filter4 = member "GL_SGIS_texture_filter4" extensions | 101 | gl_SGIS_texture_filter4 = member "GL_SGIS_texture_filter4" extensions | 69 | true | true | 0 | 5 | 38 | 19 | 11 | 8 | null | null |
ikirill/ComputationalMathematics | Cube/Nifty.hs | gpl-3.0 | -- }}}
-- {{{ Monad utility functions
ifElseM :: Monad m => m Bool -> m a -> m a -> m a
ifElseM guard one two = do x <- guard; if x then one else two
| 152 | ifElseM :: Monad m => m Bool -> m a -> m a -> m a
ifElseM guard one two = do x <- guard; if x then one else two
| 112 | ifElseM guard one two = do x <- guard; if x then one else two
| 62 | true | true | 0 | 9 | 40 | 70 | 34 | 36 | null | null |
mlite/hLLVM | src/Llvm/Query/Conversion.hs | bsd-3-clause | getUniqueInteger (T _ (C_u32 s)) = fromIntegral s | 49 | getUniqueInteger (T _ (C_u32 s)) = fromIntegral s | 49 | getUniqueInteger (T _ (C_u32 s)) = fromIntegral s | 49 | false | false | 0 | 8 | 7 | 27 | 12 | 15 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/DialogFlow/Types.hs | mpl-2.0 | -- | View, manage and query your Dialogflow agents
dialogFlowScope :: Proxy '["https://www.googleapis.com/auth/dialogflow"]
dialogFlowScope = Proxy | 147 | dialogFlowScope :: Proxy '["https://www.googleapis.com/auth/dialogflow"]
dialogFlowScope = Proxy | 96 | dialogFlowScope = Proxy | 23 | true | true | 0 | 7 | 15 | 20 | 11 | 9 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | supplyProvided ZergEgg = 0 | 26 | supplyProvided ZergEgg = 0 | 26 | supplyProvided ZergEgg = 0 | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
markgrebe/Blankeroids | Blankeroids/Graphics.hs | bsd-3-clause | renderPolygons :: Double -> [Polygon] -> Canvas ()
renderPolygons lwidth p = do
mapM_ (renderPolygon lwidth) p | 114 | renderPolygons :: Double -> [Polygon] -> Canvas ()
renderPolygons lwidth p = do
mapM_ (renderPolygon lwidth) p | 114 | renderPolygons lwidth p = do
mapM_ (renderPolygon lwidth) p | 63 | false | true | 0 | 10 | 20 | 51 | 23 | 28 | null | null |
DanielWaterworth/Idris-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | ftyToTy (FArith (ATInt (ITVec e c)))
= VectorType (fromIntegral c) (IntegerType (fromIntegral $ nativeTyWidth e)) | 117 | ftyToTy (FArith (ATInt (ITVec e c)))
= VectorType (fromIntegral c) (IntegerType (fromIntegral $ nativeTyWidth e)) | 117 | ftyToTy (FArith (ATInt (ITVec e c)))
= VectorType (fromIntegral c) (IntegerType (fromIntegral $ nativeTyWidth e)) | 117 | false | false | 0 | 11 | 18 | 56 | 27 | 29 | null | null |
naoto-ogawa/h-xproto-mysql | src/DataBase/MySQLX/Model.hs | mit | removeAps = \c -> if c == '\"' then [] else [c] | 47 | removeAps = \c -> if c == '\"' then [] else [c] | 47 | removeAps = \c -> if c == '\"' then [] else [c] | 47 | false | false | 1 | 8 | 11 | 32 | 16 | 16 | null | null |
antonlogvinenko/javelin | src/Javelin/Lib/ByteCode/ConstantPool.hs | mit | getConstants 1 = return [] | 26 | getConstants 1 = return [] | 26 | getConstants 1 = return [] | 26 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
Soostone/aws | Aws/DynamoDb/Core.hs | bsd-3-clause | ddbUsWest1 :: Region
ddbUsWest1 = Region "dynamodb.us-west-1.amazonaws.com" "us-west-1" | 87 | ddbUsWest1 :: Region
ddbUsWest1 = Region "dynamodb.us-west-1.amazonaws.com" "us-west-1" | 87 | ddbUsWest1 = Region "dynamodb.us-west-1.amazonaws.com" "us-west-1" | 66 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
sinelaw/lamdu | bottlelib/Data/Store/Transaction.hs | gpl-3.0 | insert :: (MonadA m, Binary a) => Guid -> a -> Transaction m ()
insert key = insertBS key . encodeS | 99 | insert :: (MonadA m, Binary a) => Guid -> a -> Transaction m ()
insert key = insertBS key . encodeS | 99 | insert key = insertBS key . encodeS | 35 | false | true | 0 | 9 | 20 | 51 | 25 | 26 | null | null |
gridaphobe/target | bench/MapBench.hs | mit | prop_delete_sc :: Monad m => Int -> K -> M -> SC.Property m
prop_delete_sc d x y = hasDepth d y && valid y SC.==> valid z && keys z == (keys y L.\\ [x])
where z = delete x y | 175 | prop_delete_sc :: Monad m => Int -> K -> M -> SC.Property m
prop_delete_sc d x y = hasDepth d y && valid y SC.==> valid z && keys z == (keys y L.\\ [x])
where z = delete x y | 175 | prop_delete_sc d x y = hasDepth d y && valid y SC.==> valid z && keys z == (keys y L.\\ [x])
where z = delete x y | 115 | false | true | 0 | 10 | 42 | 102 | 48 | 54 | null | null |
fmthoma/ghc | compiler/types/TypeRep.hs | bsd-3-clause | pprTyThingCategory (AnId _) = ptext (sLit "Identifier") | 59 | pprTyThingCategory (AnId _) = ptext (sLit "Identifier") | 59 | pprTyThingCategory (AnId _) = ptext (sLit "Identifier") | 59 | false | false | 0 | 7 | 10 | 24 | 11 | 13 | null | null |
sinelaw/beatbox | src/Main.hs | bsd-3-clause | innerProduct :: (Fractional a, Num a, Storable a) => V.Vector a -> V.Vector a -> a
innerProduct x y = vSum $ vMul2 x y | 118 | innerProduct :: (Fractional a, Num a, Storable a) => V.Vector a -> V.Vector a -> a
innerProduct x y = vSum $ vMul2 x y | 118 | innerProduct x y = vSum $ vMul2 x y | 35 | false | true | 0 | 9 | 24 | 64 | 31 | 33 | null | null |
mainland/nikola | src/Data/Array/Nikola/Exp.hs | bsd-3-clause | (||*) :: Exp t Bool -> Exp t Bool -> Exp t Bool
e1 ||* e2 = binop (BinopE OrL) e1 e2 | 84 | (||*) :: Exp t Bool -> Exp t Bool -> Exp t Bool
e1 ||* e2 = binop (BinopE OrL) e1 e2 | 84 | e1 ||* e2 = binop (BinopE OrL) e1 e2 | 36 | false | true | 0 | 9 | 21 | 55 | 26 | 29 | null | null |
snoyberg/ghc | compiler/codeGen/StgCmmClosure.hs | bsd-3-clause | isKnownFun LFLetNoEscape = True | 31 | isKnownFun LFLetNoEscape = True | 31 | isKnownFun LFLetNoEscape = True | 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ku-fpg/blank-canvas | wiki-suite/Tic_Tac_Toe.hs | bsd-3-clause | boardColor = "#000080" | 22 | boardColor = "#000080" | 22 | boardColor = "#000080" | 22 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
YoEight/hk-coolc | src/Compiler/Semantic.hs | bsd-3-clause | validateClassFeatures ∷ MonadError CompilerError m
⇒ Class String
→ m ()
validateClassFeatures (Class _ _ attrs meths) = do
foldrM onAttr emptyUFM attrs
foldrM onMeth emptyUFM meths
return ()
where
onAttr (Attr name _ _) env = do
checkIdDecl name... | 625 | validateClassFeatures ∷ MonadError CompilerError m
⇒ Class String
→ m ()
validateClassFeatures (Class _ _ attrs meths) = do
foldrM onAttr emptyUFM attrs
foldrM onMeth emptyUFM meths
return ()
where
onAttr (Attr name _ _) env = do
checkIdDecl name... | 625 | validateClassFeatures (Class _ _ attrs meths) = do
foldrM onAttr emptyUFM attrs
foldrM onMeth emptyUFM meths
return ()
where
onAttr (Attr name _ _) env = do
checkIdDecl name
when (memberUFM name env) (throwError $ DuplicateAttrDeclaration name)
return (insertUFM name () env)
... | 502 | false | true | 0 | 12 | 196 | 220 | 99 | 121 | null | null |
adnelson/nixfromnpm | src/NixFromNpm/Npm/Resolve.hs | mit | silentShell :: Sh Text -> NpmFetcher Text
silentShell = shell . silently | 72 | silentShell :: Sh Text -> NpmFetcher Text
silentShell = shell . silently | 72 | silentShell = shell . silently | 30 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
zenhack/whenview | src/WhenView/I18n.hs | mit | monthsFor' :: String -> [String]
monthsFor' "POSIX" = englishMonths | 67 | monthsFor' :: String -> [String]
monthsFor' "POSIX" = englishMonths | 67 | monthsFor' "POSIX" = englishMonths | 34 | false | true | 0 | 8 | 8 | 27 | 12 | 15 | null | null |
colah/ImplicitCAD | Graphics/Implicit/ExtOpenScad/Parser/Lexer.hs | agpl-3.0 | -- | match something between two ends.
surroundedBy :: Char -> GenParser Char st a -> Char -> GenParser Char st a
surroundedBy leftTok middle rightTok = between (matchTok leftTok) (matchTok rightTok) middle | 206 | surroundedBy :: Char -> GenParser Char st a -> Char -> GenParser Char st a
surroundedBy leftTok middle rightTok = between (matchTok leftTok) (matchTok rightTok) middle | 167 | surroundedBy leftTok middle rightTok = between (matchTok leftTok) (matchTok rightTok) middle | 92 | true | true | 0 | 9 | 32 | 68 | 32 | 36 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/Id.hs | bsd-3-clause | zapFragileIdInfo :: Id -> Id
zapFragileIdInfo = zapInfo zapFragileInfo | 70 | zapFragileIdInfo :: Id -> Id
zapFragileIdInfo = zapInfo zapFragileInfo | 70 | zapFragileIdInfo = zapInfo zapFragileInfo | 41 | false | true | 0 | 7 | 8 | 25 | 10 | 15 | null | null |
SimSaladin/rnfssp | Settings.hs | bsd-3-clause | -- Static setting below. Changing these requires a recompile
-- | The location of static files on your system. This is a file system
-- path. The default value works properly with your scaffolded site.
staticDir :: FilePath
staticDir = "static" | 245 | staticDir :: FilePath
staticDir = "static" | 42 | staticDir = "static" | 20 | true | true | 0 | 4 | 41 | 14 | 9 | 5 | null | null |
ambiata/mismi | mismi-s3/src/Mismi/S3/Data.hs | bsd-3-clause | renderSyncError :: SyncError -> Text
renderSyncError (SyncError r) =
renderRunError r renderSyncWorkerError | 109 | renderSyncError :: SyncError -> Text
renderSyncError (SyncError r) =
renderRunError r renderSyncWorkerError | 109 | renderSyncError (SyncError r) =
renderRunError r renderSyncWorkerError | 72 | false | true | 0 | 7 | 13 | 29 | 14 | 15 | null | null |
tdfirth/lambda | src/Lambda/Primitives.hs | mit | unpackNum notNum = throwError $ TypeMismatch "number" notNum | 64 | unpackNum notNum = throwError $ TypeMismatch "number" notNum | 64 | unpackNum notNum = throwError $ TypeMismatch "number" notNum | 64 | false | false | 0 | 6 | 11 | 18 | 8 | 10 | null | null |
AlexanderPankiv/ghc | libraries/base/GHC/Natural.hs | bsd-3-clause | naturalToWordMaybe (NatS# w#) = Just (W# w#) | 44 | naturalToWordMaybe (NatS# w#) = Just (W# w#) | 44 | naturalToWordMaybe (NatS# w#) = Just (W# w#) | 44 | false | false | 0 | 7 | 6 | 24 | 11 | 13 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | readDollarVariable = do
id <- getNextId
pos <- getPosition
let singleCharred p = do
n <- p
value <- wrap [n]
return (T_DollarBraced id value)
let positional = do
value <- singleCharred digit
return value `attempting` do
lookAhead digit
pa... | 968 | readDollarVariable = do
id <- getNextId
pos <- getPosition
let singleCharred p = do
n <- p
value <- wrap [n]
return (T_DollarBraced id value)
let positional = do
value <- singleCharred digit
return value `attempting` do
lookAhead digit
pa... | 968 | readDollarVariable = do
id <- getNextId
pos <- getPosition
let singleCharred p = do
n <- p
value <- wrap [n]
return (T_DollarBraced id value)
let positional = do
value <- singleCharred digit
return value `attempting` do
lookAhead digit
pa... | 968 | false | false | 2 | 20 | 302 | 298 | 129 | 169 | null | null |
mightymoose/liquidhaskell | benchmarks/base-4.5.1.0/Control/Concurrent.hs | bsd-3-clause | -- | Returns 'True' if the calling thread is /bound/, that is, if it is
-- safe to use foreign libraries that rely on thread-local state from the
-- calling thread.
isCurrentThreadBound :: IO Bool
isCurrentThreadBound = IO $ \ s# ->
case isCurrentThreadBound# s# of
(# s2#, flg #) -> (# s2#, not (flg ==# 0#)... | 722 | isCurrentThreadBound :: IO Bool
isCurrentThreadBound = IO $ \ s# ->
case isCurrentThreadBound# s# of
(# s2#, flg #) -> (# s2#, not (flg ==# 0#) #)
{- |
Run the 'IO' computation passed as the first argument. If the calling thread
is not /bound/, a bound thread is created temporarily. @runInBoundThread@
do... | 557 | isCurrentThreadBound = IO $ \ s# ->
case isCurrentThreadBound# s# of
(# s2#, flg #) -> (# s2#, not (flg ==# 0#) #)
{- |
Run the 'IO' computation passed as the first argument. If the calling thread
is not /bound/, a bound thread is created temporarily. @runInBoundThread@
doesn't finish until the 'IO' comp... | 525 | true | true | 3 | 13 | 136 | 65 | 33 | 32 | null | null |
sgraf812/feed-gipeda | src/FeedGipeda/TaskScheduler.hs | bsd-3-clause | {-| Spawn the task queue on the local node and start to discover slave nodes.
Tasks which don't finish within `timeout` return `Nothing`.
The consumer tries to keep the task list short and `await`s new task items
only when there are idle slaves. This way, upstream can react more timely
to changes in ta... | 5,457 | start
:: forall a r . Serializable a
=> IO (Task a)
-> Process ()
start awaitTask = do
idleSlaves <- liftIO (MSemN.new 0)
q <- spawnLocal (queue idleSlaves)
spawnLocal (slaveDiscovery q)
spawnLocal (dispatch idleSlaves q)
return ()
where
dispatch
:: MSemN Int
-> ProcessId
... | 5,030 | start awaitTask = do
idleSlaves <- liftIO (MSemN.new 0)
q <- spawnLocal (queue idleSlaves)
spawnLocal (slaveDiscovery q)
spawnLocal (dispatch idleSlaves q)
return ()
where
dispatch
:: MSemN Int
-> ProcessId
-> Process ()
dispatch idleSlaves queue = forever $ do
... | 4,958 | true | true | 0 | 25 | 1,944 | 1,425 | 697 | 728 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs | bsd-3-clause | -- | Helper function to collapse a list of version ranges with origins into
-- a single, simplified, version range.
collapse :: [VROrigin qpn] -> VR
collapse = simplifyVR . L.foldr ((.&&.) . fst) anyVR | 201 | collapse :: [VROrigin qpn] -> VR
collapse = simplifyVR . L.foldr ((.&&.) . fst) anyVR | 85 | collapse = simplifyVR . L.foldr ((.&&.) . fst) anyVR | 52 | true | true | 1 | 8 | 34 | 51 | 25 | 26 | null | null |
jlouis/combinatorrent | src/Digest.hs | bsd-2-clause | digest :: L.ByteString -> B.ByteString
digest bs = {-# SCC "sha1_digest" #-} SHA1.hashlazy bs | 93 | digest :: L.ByteString -> B.ByteString
digest bs = {-# SCC "sha1_digest" #-} SHA1.hashlazy bs | 93 | digest bs = {-# SCC "sha1_digest" #-} SHA1.hashlazy bs | 54 | false | true | 0 | 6 | 13 | 28 | 14 | 14 | null | null |
Javran/misc | leftist/Leftist.hs | mit | -- | /O(1)/ is the leftist tree empty?
null :: LTree a -> Bool
null Nil = True | 78 | null :: LTree a -> Bool
null Nil = True | 39 | null Nil = True | 15 | true | true | 0 | 6 | 17 | 22 | 11 | 11 | null | null |
markus1189/optparse-applicative | Options/Applicative/Extra.hs | bsd-3-clause | parserFailure :: ParserPrefs -> ParserInfo a
-> ParseError -> Context
-> ParserFailure ParserHelp
parserFailure pprefs pinfo msg ctx = ParserFailure $ \progn ->
let h = with_context ctx pinfo $ \names pinfo' -> mconcat
[ base_help pinfo'
, usage_help progn names pin... | 1,588 | parserFailure :: ParserPrefs -> ParserInfo a
-> ParseError -> Context
-> ParserFailure ParserHelp
parserFailure pprefs pinfo msg ctx = ParserFailure $ \progn ->
let h = with_context ctx pinfo $ \names pinfo' -> mconcat
[ base_help pinfo'
, usage_help progn names pin... | 1,588 | parserFailure pprefs pinfo msg ctx = ParserFailure $ \progn ->
let h = with_context ctx pinfo $ \names pinfo' -> mconcat
[ base_help pinfo'
, usage_help progn names pinfo'
, error_help ]
in (h, exit_code, prefColumns pprefs)
where
exit_code = case msg of
ErrorMsg _ ... | 1,462 | false | true | 0 | 17 | 539 | 501 | 245 | 256 | null | null |
Orvid/fbthrift | thrift/compiler/test/fixtures/includes/gen-hs/Module_Types.hs | apache-2.0 | write_MyStruct :: (Thrift.Protocol p, Thrift.Transport t) => p t -> MyStruct -> IO ()
write_MyStruct oprot record = Thrift.writeVal oprot $ from_MyStruct record | 160 | write_MyStruct :: (Thrift.Protocol p, Thrift.Transport t) => p t -> MyStruct -> IO ()
write_MyStruct oprot record = Thrift.writeVal oprot $ from_MyStruct record | 160 | write_MyStruct oprot record = Thrift.writeVal oprot $ from_MyStruct record | 74 | false | true | 0 | 9 | 22 | 63 | 30 | 33 | null | null |
greydot/persistent | persistent-template/Database/Persist/TH.hs | mit | uniqueTypeDec :: MkPersistSettings -> EntityDef -> Dec
uniqueTypeDec mps t =
DataInstD [] ''Unique
[genericDataType mps (entityHaskell t) backendT]
(map (mkUnique mps t) $ entityUniques t)
[] | 227 | uniqueTypeDec :: MkPersistSettings -> EntityDef -> Dec
uniqueTypeDec mps t =
DataInstD [] ''Unique
[genericDataType mps (entityHaskell t) backendT]
(map (mkUnique mps t) $ entityUniques t)
[] | 227 | uniqueTypeDec mps t =
DataInstD [] ''Unique
[genericDataType mps (entityHaskell t) backendT]
(map (mkUnique mps t) $ entityUniques t)
[] | 172 | false | true | 0 | 10 | 62 | 80 | 38 | 42 | null | null |
andreasabel/helf | src/PrettyM.hs | mit | comma = return P.comma | 27 | comma = return P.comma | 27 | comma = return P.comma | 27 | false | false | 1 | 6 | 8 | 15 | 5 | 10 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Protocol.hs | bsd-3-clause | packageCommand (AnalogWriteE p w) =
addCommand ALG_CMD_WRITE_PIN (packageExpr p ++ packageExpr w) | 101 | packageCommand (AnalogWriteE p w) =
addCommand ALG_CMD_WRITE_PIN (packageExpr p ++ packageExpr w) | 101 | packageCommand (AnalogWriteE p w) =
addCommand ALG_CMD_WRITE_PIN (packageExpr p ++ packageExpr w) | 101 | false | false | 0 | 8 | 15 | 35 | 16 | 19 | null | null |
taojang/haskell-programming-book-exercise | src/ch26/ChEx.hs | bsd-3-clause | sPrintIncAccum :: (Num a, Show a) => StateT a IO String
sPrintIncAccum = StateT $ \s -> print s >> pure (show s, s + 1) | 119 | sPrintIncAccum :: (Num a, Show a) => StateT a IO String
sPrintIncAccum = StateT $ \s -> print s >> pure (show s, s + 1) | 119 | sPrintIncAccum = StateT $ \s -> print s >> pure (show s, s + 1) | 63 | false | true | 0 | 10 | 25 | 65 | 33 | 32 | null | null |
a143753/AOJ | 2102.hs | apache-2.0 | f a@(h:t) = (r1 && (f (a \\ [h,h,h]))) || (r2 && (f (a \\ [h,h+1,h+2])))
where
nh = length $ filter (== h) a
r1 = nh >= 3
r2 = (elem (h+1) a) && (elem (h+2) a) | 173 | f a@(h:t) = (r1 && (f (a \\ [h,h,h]))) || (r2 && (f (a \\ [h,h+1,h+2])))
where
nh = length $ filter (== h) a
r1 = nh >= 3
r2 = (elem (h+1) a) && (elem (h+2) a) | 173 | f a@(h:t) = (r1 && (f (a \\ [h,h,h]))) || (r2 && (f (a \\ [h,h+1,h+2])))
where
nh = length $ filter (== h) a
r1 = nh >= 3
r2 = (elem (h+1) a) && (elem (h+2) a) | 173 | false | false | 1 | 13 | 52 | 164 | 87 | 77 | null | null |
f-me/snap-core | test/suite/Snap/Util/GZip/Tests.hs | bsd-3-clause | mkBadRq :: IO Request
mkBadRq = do
enum <- newIORef $ SomeEnumerator returnI
return $ Request "foo" 80 "foo" 999 "foo" 1000 "foo" False badHdrs
enum Nothing GET (1,1) [] "/" "/" "/" ""
Map.empty Map.empty Map.empty
----------------------------------------------------------... | 340 | mkBadRq :: IO Request
mkBadRq = do
enum <- newIORef $ SomeEnumerator returnI
return $ Request "foo" 80 "foo" 999 "foo" 1000 "foo" False badHdrs
enum Nothing GET (1,1) [] "/" "/" "/" ""
Map.empty Map.empty Map.empty
----------------------------------------------------------... | 340 | mkBadRq = do
enum <- newIORef $ SomeEnumerator returnI
return $ Request "foo" 80 "foo" 999 "foo" 1000 "foo" False badHdrs
enum Nothing GET (1,1) [] "/" "/" "/" ""
Map.empty Map.empty Map.empty
------------------------------------------------------------------------------ | 318 | false | true | 0 | 9 | 84 | 93 | 46 | 47 | null | null |
thinkpad20/rowling | src/Language/Rowling/Definitions/Types.hs | mit | -- | Creates an extensible record type from a list of fields.
tRecord' :: [(Name, Type)] -> Name -> Type
tRecord' fields name = TRecord (H.fromList fields) (Just name) | 167 | tRecord' :: [(Name, Type)] -> Name -> Type
tRecord' fields name = TRecord (H.fromList fields) (Just name) | 105 | tRecord' fields name = TRecord (H.fromList fields) (Just name) | 62 | true | true | 0 | 8 | 28 | 53 | 28 | 25 | null | null |
jacendfeng/OpenJDK-7U-Research | src/macosx/native/jobjc/src/core/PrimitiveCoder.hs | gpl-2.0 | popAddr _ Nschar = "rt.unsafe.getByte(addr)" | 45 | popAddr _ Nschar = "rt.unsafe.getByte(addr)" | 45 | popAddr _ Nschar = "rt.unsafe.getByte(addr)" | 45 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
spinda/liquidhaskell | src/Language/Haskell/Liquid/Spec/Expand.hs | bsd-3-clause | predEdges :: Pred -> [Symbol]
predEdges = nub . go
where
go (PAnd ps) = concatMap go ps
go (POr ps) = concatMap go ps
go (PImp p1 p2) = go p1 ++ go p2
go (PIff p1 p2) = go p1 ++ go p2
go (PAtom _ p1 p2) = exprEdges p1 ++ exprEdges p2
go (PAll _ p) = go p
go (PNot p)... | 399 | predEdges :: Pred -> [Symbol]
predEdges = nub . go
where
go (PAnd ps) = concatMap go ps
go (POr ps) = concatMap go ps
go (PImp p1 p2) = go p1 ++ go p2
go (PIff p1 p2) = go p1 ++ go p2
go (PAtom _ p1 p2) = exprEdges p1 ++ exprEdges p2
go (PAll _ p) = go p
go (PNot p)... | 399 | predEdges = nub . go
where
go (PAnd ps) = concatMap go ps
go (POr ps) = concatMap go ps
go (PImp p1 p2) = go p1 ++ go p2
go (PIff p1 p2) = go p1 ++ go p2
go (PAtom _ p1 p2) = exprEdges p1 ++ exprEdges p2
go (PAll _ p) = go p
go (PNot p) = go p
go (PBexp e... | 369 | false | true | 8 | 10 | 167 | 198 | 98 | 100 | null | null |
bgamari/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | hacek 'r' = "ř" | 15 | hacek 'r' = "ř" | 15 | hacek 'r' = "ř" | 15 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
sol/pandoc | src/Text/Pandoc/Writers/Man.hs | gpl-2.0 | inlineListToMan :: WriterOptions -> [Inline] -> State WriterState Doc
-- if list starts with ., insert a zero-width character \& so it
-- won't be interpreted as markup if it falls at the beginning of a line.
inlineListToMan opts lst@(Str "." : _) = mapM (inlineToMan opts) lst >>=
(return . (text "\\&" <>) . hcat) | 318 | inlineListToMan :: WriterOptions -> [Inline] -> State WriterState Doc
inlineListToMan opts lst@(Str "." : _) = mapM (inlineToMan opts) lst >>=
(return . (text "\\&" <>) . hcat) | 179 | inlineListToMan opts lst@(Str "." : _) = mapM (inlineToMan opts) lst >>=
(return . (text "\\&" <>) . hcat) | 109 | true | true | 0 | 10 | 58 | 80 | 42 | 38 | null | null |
evinstk/scheme-by-haskell | Eval.hs | mit | eval :: LispVal -> ThrowsError LispVal
eval val@(String _) = return val | 71 | eval :: LispVal -> ThrowsError LispVal
eval val@(String _) = return val | 71 | eval val@(String _) = return val | 32 | false | true | 3 | 7 | 11 | 36 | 17 | 19 | null | null |
plow-technologies/shakespeare-dynamic | ghcjs-shakespeare-dynamic/src/Shakespeare/Dynamic/Components.hs | mit | selectListWith :: (Ord k, Eq v) => ((k,v) -> String) -> Map.Map k v -> (v -> Message ()) -> [Property] -> Maybe v -> LiveVDom JSEvent
selectListWith buildDisplay kvMap = selectList displayMap
where displayMap = Map.fromList $ (\t@(_,v) -> (buildDisplay t, v) ) <$> Map.toList kvMap | 283 | selectListWith :: (Ord k, Eq v) => ((k,v) -> String) -> Map.Map k v -> (v -> Message ()) -> [Property] -> Maybe v -> LiveVDom JSEvent
selectListWith buildDisplay kvMap = selectList displayMap
where displayMap = Map.fromList $ (\t@(_,v) -> (buildDisplay t, v) ) <$> Map.toList kvMap | 283 | selectListWith buildDisplay kvMap = selectList displayMap
where displayMap = Map.fromList $ (\t@(_,v) -> (buildDisplay t, v) ) <$> Map.toList kvMap | 149 | false | true | 0 | 12 | 48 | 148 | 76 | 72 | null | null |
black0range/Smutt | src/Smutt/HTTP/Header.hs | mit | -- | Checks if there are a header k with value v
fieldIn :: Text -> Text -> Header -> Bool
fieldIn k v hdr = case lookup (T.toCaseFold k) hdr of
Just a -> a == v
_ -> False | 178 | fieldIn :: Text -> Text -> Header -> Bool
fieldIn k v hdr = case lookup (T.toCaseFold k) hdr of
Just a -> a == v
_ -> False | 129 | fieldIn k v hdr = case lookup (T.toCaseFold k) hdr of
Just a -> a == v
_ -> False | 87 | true | true | 0 | 9 | 46 | 67 | 33 | 34 | null | null |
sebfisch/haskell-barchart | src/Graphics/BarChart/Parser.hs | bsd-3-clause | readCSV :: FilePath -> IO CSV
readCSV file = either (fail . show) (return . clean) =<< parseCSVFromFile file
where clean = filter (not . all null) | 147 | readCSV :: FilePath -> IO CSV
readCSV file = either (fail . show) (return . clean) =<< parseCSVFromFile file
where clean = filter (not . all null) | 147 | readCSV file = either (fail . show) (return . clean) =<< parseCSVFromFile file
where clean = filter (not . all null) | 117 | false | true | 1 | 8 | 27 | 77 | 34 | 43 | null | null |
christiaanb/ghc | compiler/simplCore/SimplUtils.hs | bsd-3-clause | countValArgs :: SimplCont -> Int
-- Count value arguments excluding coercions
countValArgs (ApplyToVal { sc_arg = arg, sc_cont = cont })
| Coercion {} <- arg = countValArgs cont
| otherwise = 1 + countValArgs cont | 226 | countValArgs :: SimplCont -> Int
countValArgs (ApplyToVal { sc_arg = arg, sc_cont = cont })
| Coercion {} <- arg = countValArgs cont
| otherwise = 1 + countValArgs cont | 181 | countValArgs (ApplyToVal { sc_arg = arg, sc_cont = cont })
| Coercion {} <- arg = countValArgs cont
| otherwise = 1 + countValArgs cont | 148 | true | true | 1 | 9 | 48 | 68 | 35 | 33 | null | null |
rfranek/duckling | Duckling/Time/HR/Rules.hs | bsd-3-clause | ruleNextNCycle :: Rule
ruleNextNCycle = Rule
{ name = "next n <cycle>"
, pattern =
[ regex "(u )?(sljede(c|\x0107)(ih?|a|eg?))"
, Predicate $ isIntegerBetween 1 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
n <- getIntValue to... | 379 | ruleNextNCycle :: Rule
ruleNextNCycle = Rule
{ name = "next n <cycle>"
, pattern =
[ regex "(u )?(sljede(c|\x0107)(ih?|a|eg?))"
, Predicate $ isIntegerBetween 1 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
n <- getIntValue to... | 379 | ruleNextNCycle = Rule
{ name = "next n <cycle>"
, pattern =
[ regex "(u )?(sljede(c|\x0107)(ih?|a|eg?))"
, Predicate $ isIntegerBetween 1 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
n <- getIntValue token
tt $ cycleN... | 356 | false | true | 0 | 16 | 107 | 124 | 63 | 61 | null | null |
Baranowski/SourceGraph | Parsing/State.hs | gpl-3.0 | getModules :: PState ParsedModules
getModules = asks' moduleLookup | 66 | getModules :: PState ParsedModules
getModules = asks' moduleLookup | 66 | getModules = asks' moduleLookup | 31 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
lostbean/neo4j-conduit | src/Database/CouchDB/Conduit/View.hs | bsd-2-clause | conduitRows :: MonadResource m => Sink BS8.ByteString m (Source m A.Object)
conduitRows = do
raw <- CA.sinkParser (A.json <?> "json object")
rows <- case raw of
(A.Object raw') -> case M.lookup "rows" raw' of
(Just (A.Array r)) -> return r
_ -> return V.empty
_ ->... | 533 | conduitRows :: MonadResource m => Sink BS8.ByteString m (Source m A.Object)
conduitRows = do
raw <- CA.sinkParser (A.json <?> "json object")
rows <- case raw of
(A.Object raw') -> case M.lookup "rows" raw' of
(Just (A.Array r)) -> return r
_ -> return V.empty
_ -> ... | 532 | conduitRows = do
raw <- CA.sinkParser (A.json <?> "json object")
rows <- case raw of
(A.Object raw') -> case M.lookup "rows" raw' of
(Just (A.Array r)) -> return r
_ -> return V.empty
_ -> throw $ CouchInternalError "view entry is not an object"
return $ sourc... | 456 | false | true | 1 | 18 | 151 | 194 | 91 | 103 | null | null |
triplepointfive/datatypes | src/LambdaCalculus.hs | mit | pickfreshname :: Context -> String -> (Context, String)
pickfreshname ctx x | x `elem` ctx = pickfreshname ctx nx
| otherwise = (x:ctx, x)
where nx = x ++ "'" | 180 | pickfreshname :: Context -> String -> (Context, String)
pickfreshname ctx x | x `elem` ctx = pickfreshname ctx nx
| otherwise = (x:ctx, x)
where nx = x ++ "'" | 180 | pickfreshname ctx x | x `elem` ctx = pickfreshname ctx nx
| otherwise = (x:ctx, x)
where nx = x ++ "'" | 124 | false | true | 0 | 8 | 51 | 78 | 40 | 38 | null | null |
nevrenato/Hets_Fork | OMDoc/OMDocInterface.hs | gpl-2.0 | mkOMRE :: URI.URI -> OMElement
mkOMRE = toElement . mkOMR | 57 | mkOMRE :: URI.URI -> OMElement
mkOMRE = toElement . mkOMR | 57 | mkOMRE = toElement . mkOMR | 26 | false | true | 0 | 6 | 9 | 21 | 11 | 10 | null | null |
marcinmrotek/repa-linear-algebra | src/Numeric/LinearAlgebra/Repa.hs | bsd-3-clause | hess :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
-- ^Hessenberg factorization. (p,h) == hess m ==> p * h * p' where p is unitary and h is in upper Hessenberg form (zero entries below the first subdiagonal).
hess m = let (p,h) = H.hess $ repa2hm m in (hm2repa p, hm2repa h) | 306 | hess :: (Field t, Numeric t) => Array F DIM2 t -> (Array F DIM2 t, Array F DIM2 t)
hess m = let (p,h) = H.hess $ repa2hm m in (hm2repa p, hm2repa h) | 148 | hess m = let (p,h) = H.hess $ repa2hm m in (hm2repa p, hm2repa h) | 65 | true | true | 0 | 10 | 64 | 106 | 51 | 55 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-code/Language/Drasil/CodeExpr.hs | bsd-2-clause | newWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID a,
IsArgumentName a) => f -> [Expr] -> [(a, Expr)] -> Expr
newWithNamedArgs c ps ns = New (c ^. uid) ps (zip (map ((^. uid) . fst) ns)
(map snd ns)) | 216 | newWithNamedArgs :: (Callable f, HasUID f, CodeIdea f, HasUID a,
IsArgumentName a) => f -> [Expr] -> [(a, Expr)] -> Expr
newWithNamedArgs c ps ns = New (c ^. uid) ps (zip (map ((^. uid) . fst) ns)
(map snd ns)) | 216 | newWithNamedArgs c ps ns = New (c ^. uid) ps (zip (map ((^. uid) . fst) ns)
(map snd ns)) | 92 | false | true | 0 | 12 | 46 | 124 | 66 | 58 | null | null |
hferreiro/replay | compiler/nativeGen/RegAlloc/Linear/Main.hs | bsd-3-clause | -- it doesn't matter what order the fixup blocks are returned in.
linearRA block_live accInstr accFixups id (instr:instrs)
= do
(accInstr', new_fixups) <- raInsn block_live accInstr id instr
linearRA block_live accInstr' (new_fixups ++ accFixups) id instrs
-- | Do allocation for a single instructi... | 323 | linearRA block_live accInstr accFixups id (instr:instrs)
= do
(accInstr', new_fixups) <- raInsn block_live accInstr id instr
linearRA block_live accInstr' (new_fixups ++ accFixups) id instrs
-- | Do allocation for a single instruction. | 255 | linearRA block_live accInstr accFixups id (instr:instrs)
= do
(accInstr', new_fixups) <- raInsn block_live accInstr id instr
linearRA block_live accInstr' (new_fixups ++ accFixups) id instrs
-- | Do allocation for a single instruction. | 255 | true | false | 0 | 9 | 65 | 69 | 35 | 34 | null | null |
jbracker/supermonad-plugin | examples/monad/hmtc/supermonad/PPTAMCode.hs | bsd-3-clause | ppTAMInst GTR = ppOA "GTR" "" | 43 | ppTAMInst GTR = ppOA "GTR" "" | 43 | ppTAMInst GTR = ppOA "GTR" "" | 43 | false | false | 0 | 5 | 19 | 14 | 6 | 8 | null | null |
themoritz/cabal | cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs | bsd-3-clause | -- | Slightly more realistic version of db11 where base-3 depends on syb
-- This means that if a package depends on base-3 and on syb, then they MUST
-- share the version of syb
--
-- * Package A relies on base-3 (which relies on base-4)
-- * Package B relies on base-4
-- * Package C relies on both A and B
-- * Package... | 1,083 | db12 :: ExampleDb
db12 =
let base3 = exInst "base" 3 "base-3-inst" [base4, syb1]
base4 = exInst "base" 4 "base-4-inst" []
syb1 = exInst "syb" 1 "syb-1-inst" [base4]
in [
Left base3
, Left base4
, Left syb1
, Right $ exAv "syb" 2 [ExFix "base" 4]
, Right $ exAv "A" 1 [ExFix "base" ... | 558 | db12 =
let base3 = exInst "base" 3 "base-3-inst" [base4, syb1]
base4 = exInst "base" 4 "base-4-inst" []
syb1 = exInst "syb" 1 "syb-1-inst" [base4]
in [
Left base3
, Left base4
, Left syb1
, Right $ exAv "syb" 2 [ExFix "base" 4]
, Right $ exAv "A" 1 [ExFix "base" 3, ExAny "syb"]
... | 540 | true | true | 0 | 12 | 270 | 269 | 138 | 131 | null | null |
rueshyna/gogol | gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Services/List.hs | mpl-2.0 | -- | Maximum results to return per page.
aslPageSize :: Lens' AppsServicesList (Maybe Int32)
aslPageSize
= lens _aslPageSize (\ s a -> s{_aslPageSize = a}) .
mapping _Coerce | 181 | aslPageSize :: Lens' AppsServicesList (Maybe Int32)
aslPageSize
= lens _aslPageSize (\ s a -> s{_aslPageSize = a}) .
mapping _Coerce | 140 | aslPageSize
= lens _aslPageSize (\ s a -> s{_aslPageSize = a}) .
mapping _Coerce | 88 | true | true | 0 | 10 | 35 | 55 | 28 | 27 | null | null |
danr/hipspec | src/HipSpec/Lang/RichToSimple.hs | gpl-3.0 | rtsFun :: R.Function Id -> RTS (S.Function Id)
rtsFun (R.Function f ty e) = do
let (args,body) = collectBinders e
x <- fresh
local (mkLetFrom f x) $ S.Function f ty (map fst args) <$> rtsBody body | 208 | rtsFun :: R.Function Id -> RTS (S.Function Id)
rtsFun (R.Function f ty e) = do
let (args,body) = collectBinders e
x <- fresh
local (mkLetFrom f x) $ S.Function f ty (map fst args) <$> rtsBody body | 208 | rtsFun (R.Function f ty e) = do
let (args,body) = collectBinders e
x <- fresh
local (mkLetFrom f x) $ S.Function f ty (map fst args) <$> rtsBody body | 161 | false | true | 0 | 11 | 48 | 114 | 53 | 61 | null | null |
ucsd-cse131/01-adder | tests/Common.hs | mit | run :: FilePath -> Program -> IO Result
--------------------------------------------------------------------------------
run name pgm = do
_ <- generateSource name pgm -- generate source file
r <- executeShellCommand logF cmd timeLimit -- compile & run
readResult resF logF r
where
cmd = pr... | 461 | run :: FilePath -> Program -> IO Result
run name pgm = do
_ <- generateSource name pgm -- generate source file
r <- executeShellCommand logF cmd timeLimit -- compile & run
readResult resF logF r
where
cmd = printf "make %s" resF
resF = dirExt "output" name Res
logF = dirExt "ou... | 380 | run name pgm = do
_ <- generateSource name pgm -- generate source file
r <- executeShellCommand logF cmd timeLimit -- compile & run
readResult resF logF r
where
cmd = printf "make %s" resF
resF = dirExt "output" name Res
logF = dirExt "output" name Log
-- | `timeLimit` for eac... | 340 | true | true | 3 | 8 | 107 | 123 | 51 | 72 | null | null |
frantisekfarka/ghc-dsi | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | translateOp dflags SameSmallMutableArrayOp= Just (mo_wordEq dflags) | 67 | translateOp dflags SameSmallMutableArrayOp= Just (mo_wordEq dflags) | 67 | translateOp dflags SameSmallMutableArrayOp= Just (mo_wordEq dflags) | 67 | false | false | 0 | 7 | 5 | 22 | 9 | 13 | null | null |
ryanl/haskell-raytracer | src/RayTracer.hs | gpl-2.0 | flatten_intersections' surf [] = [] | 35 | flatten_intersections' surf [] = [] | 35 | flatten_intersections' surf [] = [] | 35 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
charlesrosenbauer/Bzo-Compiler | src/Builtins.hs | gpl-3.0 | isBuiltinFunc "#compileRegex" = 50004 | 37 | isBuiltinFunc "#compileRegex" = 50004 | 37 | isBuiltinFunc "#compileRegex" = 50004 | 37 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ulricha/dsh-aquery | Queries/AQuery/Packets.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Flow statistics
-- | Positional aligning via zip
deltasZip :: Q [Integer] -> Q [Integer]
deltasZip xs = cons 0 (map (\(view -> (a, b)) -> a - b) (zip (drop 1 xs) xs)) | 251 | deltasZip :: Q [Integer] -> Q [Integer]
deltasZip xs = cons 0 (map (\(view -> (a, b)) -> a - b) (zip (drop 1 xs) xs)) | 117 | deltasZip xs = cons 0 (map (\(view -> (a, b)) -> a - b) (zip (drop 1 xs) xs)) | 77 | true | true | 0 | 12 | 36 | 87 | 47 | 40 | null | null |
owainlewis/bmcs-haskell-sdk | src/Network/Oracle/OCI/Common/Credentials.hs | bsd-3-clause | readCredentialsFromFile :: FilePath
-> String
-> IO Credentials
readCredentialsFromFile filePath section = do
result <- flip parseCredentials (T.pack section) <$> TIO.readFile filePath
case result of
Left e -> E.throwIO (CredentialsException . show $ e)
Right credentials -> return cre... | 328 | readCredentialsFromFile :: FilePath
-> String
-> IO Credentials
readCredentialsFromFile filePath section = do
result <- flip parseCredentials (T.pack section) <$> TIO.readFile filePath
case result of
Left e -> E.throwIO (CredentialsException . show $ e)
Right credentials -> return cre... | 328 | readCredentialsFromFile filePath section = do
result <- flip parseCredentials (T.pack section) <$> TIO.readFile filePath
case result of
Left e -> E.throwIO (CredentialsException . show $ e)
Right credentials -> return credentials | 260 | false | true | 0 | 13 | 73 | 101 | 46 | 55 | null | null |
mainland/dph | dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Primitive/Gang.hs | bsd-3-clause | -- | Finaliser for worker threads.
-- We want to shutdown the corresponding thread when it's MVar becomes
-- unreachable. Without this the program can compilain about
-- "Blocked indefinitely on an MVar" because worker threads are still
-- blocked on the request MVars when the program ends. Whether this finali... | 1,056 | finaliseWorker :: MVar Req -> IO ()
finaliseWorker varReq
= do varDone <- newEmptyMVar
putMVar varReq (ReqShutdown varDone)
takeMVar varDone
return ()
-- | Fork a 'Gang' with the given number of threads (at least 1). | 246 | finaliseWorker varReq
= do varDone <- newEmptyMVar
putMVar varReq (ReqShutdown varDone)
takeMVar varDone
return ()
-- | Fork a 'Gang' with the given number of threads (at least 1). | 210 | true | true | 0 | 9 | 227 | 77 | 42 | 35 | null | null |
johnjcamilleri/fst | Main.hs | bsd-3-clause | -- | Error when there is no loaded input
noInput :: String
noInput = "No input has been loaded." | 96 | noInput :: String
noInput = "No input has been loaded." | 55 | noInput = "No input has been loaded." | 37 | true | true | 0 | 4 | 18 | 12 | 7 | 5 | null | null |
sebastiaanvisser/islay | src/Container/FingerTree/Functions.hs | bsd-3-clause | toList :: HFix (Tree a) c -> [a]
toList = unK . foldm (K . getValue) | 68 | toList :: HFix (Tree a) c -> [a]
toList = unK . foldm (K . getValue) | 68 | toList = unK . foldm (K . getValue) | 35 | false | true | 0 | 8 | 15 | 43 | 22 | 21 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.