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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3sformal/bacon-core | src/System/Expression.hs | mit | propagateNot (And as) = And $ map propagateNot as | 57 | propagateNot (And as) = And $ map propagateNot as | 57 | propagateNot (And as) = And $ map propagateNot as | 57 | false | false | 0 | 6 | 16 | 25 | 11 | 14 | null | null |
roman/testloop | examples/testloop-example/test/TestSuite.hs | mit | main :: IO ()
main = hspecWith defaultConfig specs >> return () | 63 | main :: IO ()
main = hspecWith defaultConfig specs >> return () | 63 | main = hspecWith defaultConfig specs >> return () | 49 | false | true | 1 | 7 | 11 | 33 | 14 | 19 | null | null |
sgillis/prestapi | src/Handler/Questionnaire.hs | gpl-3.0 | extractQuestion :: Entity Questions -> Questions
extractQuestion (Entity _ q) = q | 81 | extractQuestion :: Entity Questions -> Questions
extractQuestion (Entity _ q) = q | 81 | extractQuestion (Entity _ q) = q | 32 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
glguy/hpaste | src/Pages.hs | bsd-3-clause | show_ago :: UTCTime -> Paste -> String
show_ago now paste = helper (paste_timestamp paste)
where
helper Nothing = "new"
helper (Just earlier) =
let d = truncate $ diffUTCTime now earlier
in if d == 0 then "new" else
if d == 1 then "1 second" else
if d < 60 then show d ++ " seconds" else
if d < 120 then "1 minute" else
if d < 3600 then show (d `div` 60) ++ " minutes" else
if d < 7200 then "1 hour" else
if d < 86400 then show (d `div` 3600) ++ " hours" else
if d < 172800 then "1 day" else show (d `div` 86400) ++ " days" | 586 | show_ago :: UTCTime -> Paste -> String
show_ago now paste = helper (paste_timestamp paste)
where
helper Nothing = "new"
helper (Just earlier) =
let d = truncate $ diffUTCTime now earlier
in if d == 0 then "new" else
if d == 1 then "1 second" else
if d < 60 then show d ++ " seconds" else
if d < 120 then "1 minute" else
if d < 3600 then show (d `div` 60) ++ " minutes" else
if d < 7200 then "1 hour" else
if d < 86400 then show (d `div` 3600) ++ " hours" else
if d < 172800 then "1 day" else show (d `div` 86400) ++ " days" | 586 | show_ago now paste = helper (paste_timestamp paste)
where
helper Nothing = "new"
helper (Just earlier) =
let d = truncate $ diffUTCTime now earlier
in if d == 0 then "new" else
if d == 1 then "1 second" else
if d < 60 then show d ++ " seconds" else
if d < 120 then "1 minute" else
if d < 3600 then show (d `div` 60) ++ " minutes" else
if d < 7200 then "1 hour" else
if d < 86400 then show (d `div` 3600) ++ " hours" else
if d < 172800 then "1 day" else show (d `div` 86400) ++ " days" | 547 | false | true | 1 | 18 | 177 | 239 | 124 | 115 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Chapter5.hs | mit | -- Tuple types
-- ^^^^^^^^^^^
-- Minimum and maximum of two integers.
minAndMax :: Integer -> Integer -> (Integer,Integer)
minAndMax x y
| x>=y = (y,x)
| otherwise = (x,y) | 186 | minAndMax :: Integer -> Integer -> (Integer,Integer)
minAndMax x y
| x>=y = (y,x)
| otherwise = (x,y) | 114 | minAndMax x y
| x>=y = (y,x)
| otherwise = (x,y) | 61 | true | true | 1 | 8 | 44 | 63 | 35 | 28 | null | null |
banacorn/formal-language | haskell-legacy/test.hs | mit | acceptsF = [656] | 16 | acceptsF = [656] | 16 | acceptsF = [656] | 16 | false | false | 0 | 5 | 2 | 9 | 5 | 4 | null | null |
vaibhavsagar/duffer.hs | duffer/src/Duffer/Pack.hs | bsd-3-clause | getPackObjectRefs :: WithRepo (Set.Set Ref)
getPackObjectRefs = Set.fromList . concatMap parsedPackIndexRefs <$>
(asks getPackIndices >>= liftIO . (=<<) (traverse B.readFile)) | 179 | getPackObjectRefs :: WithRepo (Set.Set Ref)
getPackObjectRefs = Set.fromList . concatMap parsedPackIndexRefs <$>
(asks getPackIndices >>= liftIO . (=<<) (traverse B.readFile)) | 179 | getPackObjectRefs = Set.fromList . concatMap parsedPackIndexRefs <$>
(asks getPackIndices >>= liftIO . (=<<) (traverse B.readFile)) | 135 | false | true | 0 | 11 | 23 | 62 | 31 | 31 | null | null |
knuton/lox | Text/Lox/Writers/Latex.hs | gpl-3.0 | asLatex (Iff f1 f2) = parens (asLatex f1 ++ " \\leftrightarrow " ++ asLatex f2) | 79 | asLatex (Iff f1 f2) = parens (asLatex f1 ++ " \\leftrightarrow " ++ asLatex f2) | 79 | asLatex (Iff f1 f2) = parens (asLatex f1 ++ " \\leftrightarrow " ++ asLatex f2) | 79 | false | false | 0 | 9 | 14 | 38 | 17 | 21 | null | null |
ndmitchell/tagsoup | test/TagSoup/Generate/Type.hs | bsd-3-clause | getI (ELet i _ _) = i | 21 | getI (ELet i _ _) = i | 21 | getI (ELet i _ _) = i | 21 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
ajdunlap/cruzo | Handler/New.hs | gpl-3.0 | --newGrid :: Int -> Int -> Handler
newGrid rs cs t a u = runDB $ Import.insert (Puz u rs cs t a (GridV $ replicate (rs*cs) (Letter Nothing Plain)) Nothing) | 156 | newGrid rs cs t a u = runDB $ Import.insert (Puz u rs cs t a (GridV $ replicate (rs*cs) (Letter Nothing Plain)) Nothing) | 120 | newGrid rs cs t a u = runDB $ Import.insert (Puz u rs cs t a (GridV $ replicate (rs*cs) (Letter Nothing Plain)) Nothing) | 120 | true | false | 0 | 13 | 31 | 72 | 36 | 36 | null | null |
tidalcycles/Tidal | vis/Sound/Tidal/Vis.hs | gpl-3.0 | renderEvent (_, (s,e), (cs)) = do C.save
drawBlocks cs 0
C.restore
where height = 1/(fromIntegral $ length cs)
drawBlocks [] _ = return ()
drawBlocks (c:cs) n = do let (RGB r g b) = toSRGB c
C.setSourceRGBA r g b 1
C.rectangle x y w h
C.fill
C.stroke
drawBlocks cs (n+1)
where x = (fromRational s)
y = (fromIntegral n) * height
w = (fromRational (e-s))
h = height | 684 | renderEvent (_, (s,e), (cs)) = do C.save
drawBlocks cs 0
C.restore
where height = 1/(fromIntegral $ length cs)
drawBlocks [] _ = return ()
drawBlocks (c:cs) n = do let (RGB r g b) = toSRGB c
C.setSourceRGBA r g b 1
C.rectangle x y w h
C.fill
C.stroke
drawBlocks cs (n+1)
where x = (fromRational s)
y = (fromIntegral n) * height
w = (fromRational (e-s))
h = height | 684 | renderEvent (_, (s,e), (cs)) = do C.save
drawBlocks cs 0
C.restore
where height = 1/(fromIntegral $ length cs)
drawBlocks [] _ = return ()
drawBlocks (c:cs) n = do let (RGB r g b) = toSRGB c
C.setSourceRGBA r g b 1
C.rectangle x y w h
C.fill
C.stroke
drawBlocks cs (n+1)
where x = (fromRational s)
y = (fromIntegral n) * height
w = (fromRational (e-s))
h = height | 684 | false | false | 0 | 13 | 390 | 227 | 112 | 115 | null | null |
lukexi/ghc-7.8-arm64 | compiler/nativeGen/RegAlloc/Liveness.hs | bsd-3-clause | --
-- Compute the liveness graph of the set of basic blocks. Important:
-- we also discard any unreachable code here, starting from the entry
-- points (the first block in the list, and any blocks with info
-- tables). Unreachable code arises when code blocks are orphaned in
-- earlier optimisation passes, and may confuse the register allocator
-- by referring to registers that are not initialised. It's easy to
-- discard the unreachable code as part of the SCC pass, so that's
-- exactly what we do. (#7574)
--
sccBlocks
:: Instruction instr
=> [NatBasicBlock instr]
-> [BlockId]
-> [SCC (NatBasicBlock instr)]
sccBlocks blocks entries = map (fmap get_node) sccs
where
-- nodes :: [(NatBasicBlock instr, Unique, [Unique])]
nodes = [ (block, id, getOutEdges instrs)
| block@(BasicBlock id instrs) <- blocks ]
g1 = graphFromEdgedVertices nodes
reachable :: BlockSet
reachable = setFromList [ id | (_,id,_) <- reachablesG g1 roots ]
g2 = graphFromEdgedVertices [ node | node@(_,id,_) <- nodes
, id `setMember` reachable ]
sccs = stronglyConnCompG g2
get_node (n, _, _) = n
getOutEdges :: Instruction instr => [instr] -> [BlockId]
getOutEdges instrs = concat $ map jumpDestsOfInstr instrs
-- This is truly ugly, but I don't see a good alternative.
-- Digraph just has the wrong API. We want to identify nodes
-- by their keys (BlockId), but Digraph requires the whole
-- node: (NatBasicBlock, BlockId, [BlockId]). This takes
-- advantage of the fact that Digraph only looks at the key,
-- even though it asks for the whole triple.
roots = [(panic "sccBlocks",b,panic "sccBlocks") | b <- entries ]
--------------------------------------------------------------------------------
-- Annotate code with register liveness information
-- | 1,978 | sccBlocks
:: Instruction instr
=> [NatBasicBlock instr]
-> [BlockId]
-> [SCC (NatBasicBlock instr)]
sccBlocks blocks entries = map (fmap get_node) sccs
where
-- nodes :: [(NatBasicBlock instr, Unique, [Unique])]
nodes = [ (block, id, getOutEdges instrs)
| block@(BasicBlock id instrs) <- blocks ]
g1 = graphFromEdgedVertices nodes
reachable :: BlockSet
reachable = setFromList [ id | (_,id,_) <- reachablesG g1 roots ]
g2 = graphFromEdgedVertices [ node | node@(_,id,_) <- nodes
, id `setMember` reachable ]
sccs = stronglyConnCompG g2
get_node (n, _, _) = n
getOutEdges :: Instruction instr => [instr] -> [BlockId]
getOutEdges instrs = concat $ map jumpDestsOfInstr instrs
-- This is truly ugly, but I don't see a good alternative.
-- Digraph just has the wrong API. We want to identify nodes
-- by their keys (BlockId), but Digraph requires the whole
-- node: (NatBasicBlock, BlockId, [BlockId]). This takes
-- advantage of the fact that Digraph only looks at the key,
-- even though it asks for the whole triple.
roots = [(panic "sccBlocks",b,panic "sccBlocks") | b <- entries ]
--------------------------------------------------------------------------------
-- Annotate code with register liveness information
-- | 1,458 | sccBlocks blocks entries = map (fmap get_node) sccs
where
-- nodes :: [(NatBasicBlock instr, Unique, [Unique])]
nodes = [ (block, id, getOutEdges instrs)
| block@(BasicBlock id instrs) <- blocks ]
g1 = graphFromEdgedVertices nodes
reachable :: BlockSet
reachable = setFromList [ id | (_,id,_) <- reachablesG g1 roots ]
g2 = graphFromEdgedVertices [ node | node@(_,id,_) <- nodes
, id `setMember` reachable ]
sccs = stronglyConnCompG g2
get_node (n, _, _) = n
getOutEdges :: Instruction instr => [instr] -> [BlockId]
getOutEdges instrs = concat $ map jumpDestsOfInstr instrs
-- This is truly ugly, but I don't see a good alternative.
-- Digraph just has the wrong API. We want to identify nodes
-- by their keys (BlockId), but Digraph requires the whole
-- node: (NatBasicBlock, BlockId, [BlockId]). This takes
-- advantage of the fact that Digraph only looks at the key,
-- even though it asks for the whole triple.
roots = [(panic "sccBlocks",b,panic "sccBlocks") | b <- entries ]
--------------------------------------------------------------------------------
-- Annotate code with register liveness information
-- | 1,326 | true | true | 0 | 13 | 518 | 313 | 175 | 138 | null | null |
psibi/yesod | yesod-core/Yesod/Core/Handler.hs | mit | getExpires :: MonadIO m
=> Int -- ^ minutes
-> m UTCTime
getExpires m = do
now <- liftIO getCurrentTime
return $ fromIntegral (m * 60) `addUTCTime` now
-- | Unset the cookie on the client.
--
-- Note: although the value used for key and path is 'Text', you should only
-- use ASCII values to be HTTP compliant. | 342 | getExpires :: MonadIO m
=> Int -- ^ minutes
-> m UTCTime
getExpires m = do
now <- liftIO getCurrentTime
return $ fromIntegral (m * 60) `addUTCTime` now
-- | Unset the cookie on the client.
--
-- Note: although the value used for key and path is 'Text', you should only
-- use ASCII values to be HTTP compliant. | 342 | getExpires m = do
now <- liftIO getCurrentTime
return $ fromIntegral (m * 60) `addUTCTime` now
-- | Unset the cookie on the client.
--
-- Note: although the value used for key and path is 'Text', you should only
-- use ASCII values to be HTTP compliant. | 263 | false | true | 0 | 11 | 91 | 66 | 34 | 32 | null | null |
kadena-io/pact | tests/RoundTripSpec.hs | bsd-3-clause | testJSONPersist :: Spec
testJSONPersist = do
rt "integer" (PLiteral (LInteger 123))
rt "decimal" (PLiteral (LDecimal 123.34857))
rt "bool" (PLiteral (LBool False))
rt "string" (PLiteral (LString "hello"))
rt "time" (PLiteral (LTime (read "2016-09-17 22:47:31.904733 UTC")))
rt "keyset" (PGuard (GKeySet $ mkKeySet [PublicKey "askjh",PublicKey "dfgh"] "predfun"))
rt "modref" (PModRef (ModRef "foo.bar" (Just ["baz", "bof.quux"]) def))
rt "list" (PList (V.fromList [PLiteral (LInteger 123), PLiteral (LBool False), PLiteral (LTime (read "2016-09-17 22:47:31.904733 UTC"))]))
rt "object" (PObject (ObjectMap (fromList [("A",PLiteral (LInteger 123)), ("B",PLiteral (LBool False))]))) | 698 | testJSONPersist :: Spec
testJSONPersist = do
rt "integer" (PLiteral (LInteger 123))
rt "decimal" (PLiteral (LDecimal 123.34857))
rt "bool" (PLiteral (LBool False))
rt "string" (PLiteral (LString "hello"))
rt "time" (PLiteral (LTime (read "2016-09-17 22:47:31.904733 UTC")))
rt "keyset" (PGuard (GKeySet $ mkKeySet [PublicKey "askjh",PublicKey "dfgh"] "predfun"))
rt "modref" (PModRef (ModRef "foo.bar" (Just ["baz", "bof.quux"]) def))
rt "list" (PList (V.fromList [PLiteral (LInteger 123), PLiteral (LBool False), PLiteral (LTime (read "2016-09-17 22:47:31.904733 UTC"))]))
rt "object" (PObject (ObjectMap (fromList [("A",PLiteral (LInteger 123)), ("B",PLiteral (LBool False))]))) | 698 | testJSONPersist = do
rt "integer" (PLiteral (LInteger 123))
rt "decimal" (PLiteral (LDecimal 123.34857))
rt "bool" (PLiteral (LBool False))
rt "string" (PLiteral (LString "hello"))
rt "time" (PLiteral (LTime (read "2016-09-17 22:47:31.904733 UTC")))
rt "keyset" (PGuard (GKeySet $ mkKeySet [PublicKey "askjh",PublicKey "dfgh"] "predfun"))
rt "modref" (PModRef (ModRef "foo.bar" (Just ["baz", "bof.quux"]) def))
rt "list" (PList (V.fromList [PLiteral (LInteger 123), PLiteral (LBool False), PLiteral (LTime (read "2016-09-17 22:47:31.904733 UTC"))]))
rt "object" (PObject (ObjectMap (fromList [("A",PLiteral (LInteger 123)), ("B",PLiteral (LBool False))]))) | 674 | false | true | 0 | 18 | 97 | 317 | 153 | 164 | null | null |
meiersi-11ce/stack | src/Stack/Build/Coverage.hs | bsd-3-clause | generateHpcReport :: (MonadIO m,MonadReader env m,HasConfig env,MonadLogger m,MonadBaseControl IO m,MonadCatch m,HasEnvConfig env)
=> Package -> [Text] -> (PackageName -> m (Maybe Text)) -> m ()
generateHpcReport package tests getGhcPkgKey = do
-- If we're using > GHC 7.10, the hpc 'include' parameter must specify a
-- ghc package key. See
-- https://github.com/commercialhaskell/stack/issues/785
let pkgName = packageNameText (packageName package)
pkgId = packageIdentifierString (packageIdentifier package)
compilerVersion <- asks (envConfigCompilerVersion . getEnvConfig)
includeName <-
if getGhcVersion compilerVersion < $(mkVersion "7.10")
then return pkgId
else do
mghcPkgKey <- getGhcPkgKey (packageName package)
case mghcPkgKey of
Nothing -> fail $ "Before computing test coverage report, failed to find GHC package key for " ++ T.unpack pkgName
Just ghcPkgKey -> return $ T.unpack ghcPkgKey
forM_ tests $ \testName -> do
tixSrc <- tixFilePath pkgId (T.unpack testName)
subdir <- parseRelDir (T.unpack testName)
let report = "coverage report for " <> pkgName <> "'s test-suite \"" <> testName <> "\""
-- Restrict to just the current library code (see #634 -
-- this will likely be customizable in the future)
extraArgs = ["--include", includeName ++ ":"]
generateHpcReportInternal tixSrc subdir report extraArgs extraArgs | 1,557 | generateHpcReport :: (MonadIO m,MonadReader env m,HasConfig env,MonadLogger m,MonadBaseControl IO m,MonadCatch m,HasEnvConfig env)
=> Package -> [Text] -> (PackageName -> m (Maybe Text)) -> m ()
generateHpcReport package tests getGhcPkgKey = do
-- If we're using > GHC 7.10, the hpc 'include' parameter must specify a
-- ghc package key. See
-- https://github.com/commercialhaskell/stack/issues/785
let pkgName = packageNameText (packageName package)
pkgId = packageIdentifierString (packageIdentifier package)
compilerVersion <- asks (envConfigCompilerVersion . getEnvConfig)
includeName <-
if getGhcVersion compilerVersion < $(mkVersion "7.10")
then return pkgId
else do
mghcPkgKey <- getGhcPkgKey (packageName package)
case mghcPkgKey of
Nothing -> fail $ "Before computing test coverage report, failed to find GHC package key for " ++ T.unpack pkgName
Just ghcPkgKey -> return $ T.unpack ghcPkgKey
forM_ tests $ \testName -> do
tixSrc <- tixFilePath pkgId (T.unpack testName)
subdir <- parseRelDir (T.unpack testName)
let report = "coverage report for " <> pkgName <> "'s test-suite \"" <> testName <> "\""
-- Restrict to just the current library code (see #634 -
-- this will likely be customizable in the future)
extraArgs = ["--include", includeName ++ ":"]
generateHpcReportInternal tixSrc subdir report extraArgs extraArgs | 1,557 | generateHpcReport package tests getGhcPkgKey = do
-- If we're using > GHC 7.10, the hpc 'include' parameter must specify a
-- ghc package key. See
-- https://github.com/commercialhaskell/stack/issues/785
let pkgName = packageNameText (packageName package)
pkgId = packageIdentifierString (packageIdentifier package)
compilerVersion <- asks (envConfigCompilerVersion . getEnvConfig)
includeName <-
if getGhcVersion compilerVersion < $(mkVersion "7.10")
then return pkgId
else do
mghcPkgKey <- getGhcPkgKey (packageName package)
case mghcPkgKey of
Nothing -> fail $ "Before computing test coverage report, failed to find GHC package key for " ++ T.unpack pkgName
Just ghcPkgKey -> return $ T.unpack ghcPkgKey
forM_ tests $ \testName -> do
tixSrc <- tixFilePath pkgId (T.unpack testName)
subdir <- parseRelDir (T.unpack testName)
let report = "coverage report for " <> pkgName <> "'s test-suite \"" <> testName <> "\""
-- Restrict to just the current library code (see #634 -
-- this will likely be customizable in the future)
extraArgs = ["--include", includeName ++ ":"]
generateHpcReportInternal tixSrc subdir report extraArgs extraArgs | 1,344 | false | true | 0 | 17 | 408 | 356 | 173 | 183 | null | null |
bttr/psqueues | src/Data/OrdPSQ/Internal.hs | bsd-3-clause | singleSequ :: a -> Sequ a
singleSequ a = Sequ (\as -> a : as) | 61 | singleSequ :: a -> Sequ a
singleSequ a = Sequ (\as -> a : as) | 61 | singleSequ a = Sequ (\as -> a : as) | 35 | false | true | 0 | 8 | 14 | 36 | 18 | 18 | null | null |
GaloisInc/saw-script | saw-core/src/Verifier/SAW/Term/Pretty.hs | bsd-3-clause | -- | Pretty-print records (if the flag is 'False') or record types (if the flag
-- is 'True'), where the latter are preceded by the string @#@, either as:
--
-- * @(val1, val2, .., valn)@, if the record represents a tuple; OR
--
-- * @{ fld1 op val1, ..., fldn op valn }@ otherwise, where @op@ is @::@ for
-- types and @=@ for values.
ppRecord :: Bool -> [(FieldName, SawDoc)] -> SawDoc
ppRecord type_p alist =
(if type_p then (pretty '#' <>) else id) $
encloseSep lbrace rbrace comma $ map ppField alist
where
ppField (fld, rhs) = group (nest 2 (vsep [pretty fld <+> op_str, rhs]))
op_str = if type_p then ":" else "="
-- | Pretty-print a projection / selector "x.f" | 684 | ppRecord :: Bool -> [(FieldName, SawDoc)] -> SawDoc
ppRecord type_p alist =
(if type_p then (pretty '#' <>) else id) $
encloseSep lbrace rbrace comma $ map ppField alist
where
ppField (fld, rhs) = group (nest 2 (vsep [pretty fld <+> op_str, rhs]))
op_str = if type_p then ":" else "="
-- | Pretty-print a projection / selector "x.f" | 347 | ppRecord type_p alist =
(if type_p then (pretty '#' <>) else id) $
encloseSep lbrace rbrace comma $ map ppField alist
where
ppField (fld, rhs) = group (nest 2 (vsep [pretty fld <+> op_str, rhs]))
op_str = if type_p then ":" else "="
-- | Pretty-print a projection / selector "x.f" | 295 | true | true | 0 | 12 | 142 | 139 | 78 | 61 | null | null |
input-output-hk/pos-haskell-prototype | lib/src/Pos/AllSecrets.hs | mit | -- | Make 'InvSecretsMap' from a list of secret keys.
mkInvSecretsMap :: [SecretKey] -> InvSecretsMap
mkInvSecretsMap =
let toSecretPair sk = (addressHash (toPublic sk), sk)
in InvSecretsMap . HM.fromList . map toSecretPair | 231 | mkInvSecretsMap :: [SecretKey] -> InvSecretsMap
mkInvSecretsMap =
let toSecretPair sk = (addressHash (toPublic sk), sk)
in InvSecretsMap . HM.fromList . map toSecretPair | 177 | mkInvSecretsMap =
let toSecretPair sk = (addressHash (toPublic sk), sk)
in InvSecretsMap . HM.fromList . map toSecretPair | 129 | true | true | 0 | 12 | 39 | 61 | 31 | 30 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Query/Unit.hs | mit | maxEnergy ProtossInterceptor = 0 | 32 | maxEnergy ProtossInterceptor = 0 | 32 | maxEnergy ProtossInterceptor = 0 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_PATH_GEN_COMPONENTS_NV :: GLenum
gl_PATH_GEN_COMPONENTS_NV = 0x90B3 | 70 | gl_PATH_GEN_COMPONENTS_NV :: GLenum
gl_PATH_GEN_COMPONENTS_NV = 0x90B3 | 70 | gl_PATH_GEN_COMPONENTS_NV = 0x90B3 | 34 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
v0lkan/learning-haskell | recursion.hs | mit | maximum' [x] = x | 16 | maximum' [x] = x | 16 | maximum' [x] = x | 16 | false | false | 0 | 6 | 3 | 12 | 6 | 6 | null | null |
8l/barrelfish | hake/HakeTypes.hs | mit | isOutput (Target _ _) = True | 28 | isOutput (Target _ _) = True | 28 | isOutput (Target _ _) = True | 28 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/FileList.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/FileList.item Mozilla FileList.item documentation>
item_ :: (MonadDOM m) => FileList -> Word -> m ()
item_ self index
= liftDOM (void (self ^. jsf "item" [toJSVal index])) | 229 | item_ :: (MonadDOM m) => FileList -> Word -> m ()
item_ self index
= liftDOM (void (self ^. jsf "item" [toJSVal index])) | 122 | item_ self index
= liftDOM (void (self ^. jsf "item" [toJSVal index])) | 72 | true | true | 0 | 12 | 31 | 66 | 33 | 33 | null | null |
haasn/colour | Data/Colour/RGBSpace/HSL.hs | mit | lightness :: (Fractional a, Ord a) => RGB a -> a
lightness rgb = l
where
(_,_,l,_,_) = hslsv rgb
-- |Convert HSL (hue-saturation-lightness) coordinates to an 'RGB' value.
-- Hue is expected to be measured in degrees. | 220 | lightness :: (Fractional a, Ord a) => RGB a -> a
lightness rgb = l
where
(_,_,l,_,_) = hslsv rgb
-- |Convert HSL (hue-saturation-lightness) coordinates to an 'RGB' value.
-- Hue is expected to be measured in degrees. | 220 | lightness rgb = l
where
(_,_,l,_,_) = hslsv rgb
-- |Convert HSL (hue-saturation-lightness) coordinates to an 'RGB' value.
-- Hue is expected to be measured in degrees. | 171 | false | true | 0 | 8 | 41 | 70 | 36 | 34 | null | null |
badp/ganeti | src/Ganeti/Config.hs | gpl-2.0 | getGroup :: ConfigData -> String -> ErrorResult NodeGroup
getGroup cfg name =
let groups = fromContainer (configNodegroups cfg)
in case getItem "NodeGroup" name groups of
-- if not found by uuid, we need to look it up by name, slow
Ok grp -> Ok grp
Bad _ -> let by_name = M.mapKeys
(groupName . (M.!) groups) groups
in getItem "NodeGroup" name by_name
-- | Computes a node group's node params. | 465 | getGroup :: ConfigData -> String -> ErrorResult NodeGroup
getGroup cfg name =
let groups = fromContainer (configNodegroups cfg)
in case getItem "NodeGroup" name groups of
-- if not found by uuid, we need to look it up by name, slow
Ok grp -> Ok grp
Bad _ -> let by_name = M.mapKeys
(groupName . (M.!) groups) groups
in getItem "NodeGroup" name by_name
-- | Computes a node group's node params. | 465 | getGroup cfg name =
let groups = fromContainer (configNodegroups cfg)
in case getItem "NodeGroup" name groups of
-- if not found by uuid, we need to look it up by name, slow
Ok grp -> Ok grp
Bad _ -> let by_name = M.mapKeys
(groupName . (M.!) groups) groups
in getItem "NodeGroup" name by_name
-- | Computes a node group's node params. | 407 | false | true | 0 | 18 | 141 | 120 | 57 | 63 | null | null |
michalkonecny/aern2 | aern2-fnreps/main/fnreps-bounds.hs | bsd-3-clause | -- x_LP :: LPoly.LocalPoly MPBall
-- x_LP = LPoly.variable
functions ::
Map.Map String (String, DyadicInterval, RF -> RF)
functions =
Map.fromList
[
("sine-T",
(sine_name "T (total error)",
sine_dom, sine_totalerr_x))
,
("sine-M",
(sine_name "M (model error)",
sine_dom, sine_modelerr_x))
,
("sine-R",
(sine_name "R (rounding error)",
sine_dom, sine_rounderr_x))
,
-- ("heron-init-T",
-- (heron_init_name "T (total error)",
-- heron_x_dom, heron_init_totalerr_x))
-- ,
-- ("heron-init-M",
-- (heron_init_name "M (model error)",
-- heron_x_dom, heron_init_modelerr_x))
-- ,
("heron-init-R",
(heron_init_name "R (rounding error)",
heron_x_dom, heron_init_rounderr_x))
] | 862 | functions ::
Map.Map String (String, DyadicInterval, RF -> RF)
functions =
Map.fromList
[
("sine-T",
(sine_name "T (total error)",
sine_dom, sine_totalerr_x))
,
("sine-M",
(sine_name "M (model error)",
sine_dom, sine_modelerr_x))
,
("sine-R",
(sine_name "R (rounding error)",
sine_dom, sine_rounderr_x))
,
-- ("heron-init-T",
-- (heron_init_name "T (total error)",
-- heron_x_dom, heron_init_totalerr_x))
-- ,
-- ("heron-init-M",
-- (heron_init_name "M (model error)",
-- heron_x_dom, heron_init_modelerr_x))
-- ,
("heron-init-R",
(heron_init_name "R (rounding error)",
heron_x_dom, heron_init_rounderr_x))
] | 802 | functions =
Map.fromList
[
("sine-T",
(sine_name "T (total error)",
sine_dom, sine_totalerr_x))
,
("sine-M",
(sine_name "M (model error)",
sine_dom, sine_modelerr_x))
,
("sine-R",
(sine_name "R (rounding error)",
sine_dom, sine_rounderr_x))
,
-- ("heron-init-T",
-- (heron_init_name "T (total error)",
-- heron_x_dom, heron_init_totalerr_x))
-- ,
-- ("heron-init-M",
-- (heron_init_name "M (model error)",
-- heron_x_dom, heron_init_modelerr_x))
-- ,
("heron-init-R",
(heron_init_name "R (rounding error)",
heron_x_dom, heron_init_rounderr_x))
] | 737 | true | true | 0 | 8 | 272 | 130 | 81 | 49 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/src/C2HS/Gen/Bind.hs | mit | accessPath :: CHSAPath -> GB (CDecl, [BitSize])
accessPath (CHSRoot _ ide) = -- t
do
decl <- findAndChaseDecl ide False True
return (ide `simplifyDecl` decl, [BitSize 0 0]) | 209 | accessPath :: CHSAPath -> GB (CDecl, [BitSize])
accessPath (CHSRoot _ ide) = -- t
do
decl <- findAndChaseDecl ide False True
return (ide `simplifyDecl` decl, [BitSize 0 0]) | 209 | accessPath (CHSRoot _ ide) = -- t
do
decl <- findAndChaseDecl ide False True
return (ide `simplifyDecl` decl, [BitSize 0 0]) | 161 | false | true | 0 | 10 | 64 | 79 | 41 | 38 | null | null |
proger/haskell-dstm | Bomberman/Bomberman.hs | bsd-3-clause | ctrlKeys :: [Char]; ctrlKeys = (esc:spaceKey:qKeys)++dKeys | 68 | ctrlKeys :: [Char]
ctrlKeys = (esc:spaceKey:qKeys)++dKeys | 67 | ctrlKeys = (esc:spaceKey:qKeys)++dKeys | 43 | false | true | 0 | 8 | 15 | 30 | 17 | 13 | null | null |
Rizary/hackage-matrix-builder | src-lib/Log.hs | gpl-3.0 | mutex :: MVar ()
mutex = unsafePerformIO $ newMVar () | 53 | mutex :: MVar ()
mutex = unsafePerformIO $ newMVar () | 53 | mutex = unsafePerformIO $ newMVar () | 36 | false | true | 2 | 7 | 9 | 32 | 13 | 19 | null | null |
vito/atomo | src/Atomo/Parser/Base.hs | bsd-3-clause | integer :: Parser Integer
integer = withToken $ \t ->
case t of
TokPrimitive (Integer i) -> Just i
_ -> Nothing | 131 | integer :: Parser Integer
integer = withToken $ \t ->
case t of
TokPrimitive (Integer i) -> Just i
_ -> Nothing | 131 | integer = withToken $ \t ->
case t of
TokPrimitive (Integer i) -> Just i
_ -> Nothing | 105 | false | true | 0 | 12 | 41 | 51 | 25 | 26 | null | null |
houshuang/frame | src/Data/Frame/HFrame.hs | mit | blen (BBlock xs) = VU.length xs | 31 | blen (BBlock xs) = VU.length xs | 31 | blen (BBlock xs) = VU.length xs | 31 | false | false | 0 | 7 | 5 | 20 | 9 | 11 | null | null |
brendanhay/gogol | gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs | mpl-2.0 | -- | The color of the border.
eoboColor :: Lens' EmbeddedObjectBOrder (Maybe Color)
eoboColor
= lens _eoboColor (\ s a -> s{_eoboColor = a}) | 142 | eoboColor :: Lens' EmbeddedObjectBOrder (Maybe Color)
eoboColor
= lens _eoboColor (\ s a -> s{_eoboColor = a}) | 112 | eoboColor
= lens _eoboColor (\ s a -> s{_eoboColor = a}) | 58 | true | true | 1 | 9 | 25 | 52 | 25 | 27 | null | null |
sonyandy/fd | src/Control/Monad/FD/Internal/IntMap/Strict.hs | bsd-3-clause | sunion :: (IsInt k, Semigroup v) => IntMap k v -> IntMap k v -> IntMap k v
sunion xs ys = IntMap $ IntMap.unionWith (<>) (unIntMap xs) (unIntMap ys) | 148 | sunion :: (IsInt k, Semigroup v) => IntMap k v -> IntMap k v -> IntMap k v
sunion xs ys = IntMap $ IntMap.unionWith (<>) (unIntMap xs) (unIntMap ys) | 148 | sunion xs ys = IntMap $ IntMap.unionWith (<>) (unIntMap xs) (unIntMap ys) | 73 | false | true | 0 | 8 | 29 | 81 | 40 | 41 | null | null |
mitchellwrosen/Sloch | src/sloch/Sloch/Dirent.hs | bsd-3-clause | slochDirents :: [Dirent] -> IO [SlochDirent]
slochDirents = fmap catMaybes . mapM slochDirent | 93 | slochDirents :: [Dirent] -> IO [SlochDirent]
slochDirents = fmap catMaybes . mapM slochDirent | 93 | slochDirents = fmap catMaybes . mapM slochDirent | 48 | false | true | 0 | 7 | 12 | 34 | 17 | 17 | null | null |
snoyberg/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprTransStmt by using GroupForm
= sep [ text "then group", nest 2 (pprBy by), nest 2 (ptext (sLit "using") <+> ppr using)] | 124 | pprTransStmt by using GroupForm
= sep [ text "then group", nest 2 (pprBy by), nest 2 (ptext (sLit "using") <+> ppr using)] | 124 | pprTransStmt by using GroupForm
= sep [ text "then group", nest 2 (pprBy by), nest 2 (ptext (sLit "using") <+> ppr using)] | 124 | false | false | 0 | 11 | 23 | 63 | 30 | 33 | null | null |
masaedw/Yiki | Samples/AttoparsecSample.hs | bsd-2-clause | eol = choice [try (string "\n\r"),
try (string "\r\n"),
string "\n",
string "\r"] | 123 | eol = choice [try (string "\n\r"),
try (string "\r\n"),
string "\n",
string "\r"] | 123 | eol = choice [try (string "\n\r"),
try (string "\r\n"),
string "\n",
string "\r"] | 123 | false | false | 1 | 9 | 54 | 49 | 22 | 27 | null | null |
ekmett/ghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | baseRegOffset dflags (LongReg 1) = oFFSET_StgRegTable_rL1 dflags | 67 | baseRegOffset dflags (LongReg 1) = oFFSET_StgRegTable_rL1 dflags | 67 | baseRegOffset dflags (LongReg 1) = oFFSET_StgRegTable_rL1 dflags | 67 | false | false | 0 | 7 | 9 | 20 | 9 | 11 | null | null |
mrwonko/wonkococo | wcc/Regex.hs | mit | -- either remove c from the left side, or use the empty word left and remove c from the right side
deriveCharacter c (l `Concat` r) = (deriveCharacter c l `concat` r) `union` (matchesEmptyWord1 l `concat` deriveCharacter c r) | 231 | deriveCharacter c (l `Concat` r) = (deriveCharacter c l `concat` r) `union` (matchesEmptyWord1 l `concat` deriveCharacter c r) | 132 | deriveCharacter c (l `Concat` r) = (deriveCharacter c l `concat` r) `union` (matchesEmptyWord1 l `concat` deriveCharacter c r) | 132 | true | false | 0 | 8 | 44 | 58 | 33 | 25 | null | null |
frasertweedale/hs-jose | src/Crypto/JOSE/Types.hs | apache-2.0 | parseOctets :: B.ByteString -> Parser Integer
parseOctets s
| B.null s = fail "empty octet sequence"
| s == "\NUL" = pure 0
| B.head s == 0 = fail "leading null byte"
| otherwise = pure (bsToInteger s) | 220 | parseOctets :: B.ByteString -> Parser Integer
parseOctets s
| B.null s = fail "empty octet sequence"
| s == "\NUL" = pure 0
| B.head s == 0 = fail "leading null byte"
| otherwise = pure (bsToInteger s) | 220 | parseOctets s
| B.null s = fail "empty octet sequence"
| s == "\NUL" = pure 0
| B.head s == 0 = fail "leading null byte"
| otherwise = pure (bsToInteger s) | 174 | false | true | 2 | 10 | 57 | 92 | 41 | 51 | null | null |
shayan-najd/HsParser | U/Pretty.hs | gpl-3.0 | hPutLitString :: Handle -> Ptr a -> Int -> IO ()
hPutLitString handle a l = if l == 0
then return ()
else hPutBuf handle a l | 180 | hPutLitString :: Handle -> Ptr a -> Int -> IO ()
hPutLitString handle a l = if l == 0
then return ()
else hPutBuf handle a l | 180 | hPutLitString handle a l = if l == 0
then return ()
else hPutBuf handle a l | 131 | false | true | 0 | 9 | 83 | 62 | 30 | 32 | null | null |
dysinger/amazonka | amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/UpdateIdentityPool.hs | mpl-2.0 | -- | An identity pool ID in the format REGION:GUID.
uipIdentityPoolId :: Lens' UpdateIdentityPool Text
uipIdentityPoolId =
lens _uipIdentityPoolId (\s a -> s { _uipIdentityPoolId = a }) | 189 | uipIdentityPoolId :: Lens' UpdateIdentityPool Text
uipIdentityPoolId =
lens _uipIdentityPoolId (\s a -> s { _uipIdentityPoolId = a }) | 137 | uipIdentityPoolId =
lens _uipIdentityPoolId (\s a -> s { _uipIdentityPoolId = a }) | 86 | true | true | 0 | 9 | 31 | 40 | 22 | 18 | null | null |
elliottt/dang | src/Dang/Message.hs | bsd-3-clause | isError _ = False | 45 | isError _ = False | 45 | isError _ = False | 45 | false | false | 0 | 4 | 31 | 10 | 4 | 6 | null | null |
tonymorris/story-board | src/Graphics/Storyboard/Prelude.hs | bsd-3-clause | keyPress :: Prelude ()
keyPress = do
liftIO $ putStrLn "waiting"
Prelude $ \ ch -> liftIO $ atomically $ do
event <- readTChan (eventQueue $ preludeContext ch)
if eType event == "keypress"
then return ()
else retry
liftIO $ putStrLn "waited"
------------------------------------------------------------------------
-- | This function should be memoize; it will return
-- the same answer for *every* call. | 417 | keyPress :: Prelude ()
keyPress = do
liftIO $ putStrLn "waiting"
Prelude $ \ ch -> liftIO $ atomically $ do
event <- readTChan (eventQueue $ preludeContext ch)
if eType event == "keypress"
then return ()
else retry
liftIO $ putStrLn "waited"
------------------------------------------------------------------------
-- | This function should be memoize; it will return
-- the same answer for *every* call. | 417 | keyPress = do
liftIO $ putStrLn "waiting"
Prelude $ \ ch -> liftIO $ atomically $ do
event <- readTChan (eventQueue $ preludeContext ch)
if eType event == "keypress"
then return ()
else retry
liftIO $ putStrLn "waited"
------------------------------------------------------------------------
-- | This function should be memoize; it will return
-- the same answer for *every* call. | 394 | false | true | 0 | 17 | 72 | 108 | 50 | 58 | null | null |
fhaust/aer-utils | src/Data/AER/MotionFlow.hs | mit | vecIdx i = i `quotRem` 128 | 26 | vecIdx i = i `quotRem` 128 | 26 | vecIdx i = i `quotRem` 128 | 26 | false | false | 0 | 5 | 5 | 15 | 8 | 7 | null | null |
mrakgr/futhark | src/Futhark/Compiler.hs | bsd-3-clause | runCompilerOnProgram :: FutharkConfig
-> Pipeline I.SOACS lore
-> Action lore
-> FilePath
-> IO ()
runCompilerOnProgram config pipeline action file = do
res <- runFutharkM compile $ isJust $ futharkVerbose config
case res of
Left err -> liftIO $ do
dumpError config err
exitWith $ ExitFailure 2
Right () ->
return ()
where compile = do
source <- liftIO $ T.readFile file
prog <- runPipelineOnSource config pipeline file source
when (isJust $ futharkVerbose config) $
liftIO $ hPutStrLn stderr $ "Running action " ++ actionName action
actionProcedure action prog | 729 | runCompilerOnProgram :: FutharkConfig
-> Pipeline I.SOACS lore
-> Action lore
-> FilePath
-> IO ()
runCompilerOnProgram config pipeline action file = do
res <- runFutharkM compile $ isJust $ futharkVerbose config
case res of
Left err -> liftIO $ do
dumpError config err
exitWith $ ExitFailure 2
Right () ->
return ()
where compile = do
source <- liftIO $ T.readFile file
prog <- runPipelineOnSource config pipeline file source
when (isJust $ futharkVerbose config) $
liftIO $ hPutStrLn stderr $ "Running action " ++ actionName action
actionProcedure action prog | 729 | runCompilerOnProgram config pipeline action file = do
res <- runFutharkM compile $ isJust $ futharkVerbose config
case res of
Left err -> liftIO $ do
dumpError config err
exitWith $ ExitFailure 2
Right () ->
return ()
where compile = do
source <- liftIO $ T.readFile file
prog <- runPipelineOnSource config pipeline file source
when (isJust $ futharkVerbose config) $
liftIO $ hPutStrLn stderr $ "Running action " ++ actionName action
actionProcedure action prog | 546 | false | true | 1 | 15 | 256 | 216 | 94 | 122 | null | null |
garetxe/cabal | cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs | bsd-3-clause | varPI (S (SN (PI qpn i) _)) = (qpn, Just i) | 43 | varPI (S (SN (PI qpn i) _)) = (qpn, Just i) | 43 | varPI (S (SN (PI qpn i) _)) = (qpn, Just i) | 43 | false | false | 0 | 10 | 10 | 41 | 20 | 21 | null | null |
evanrinehart/mikmod | Sound/MikMod.hs | lgpl-3.0 | samplePlayCritical :: SampleHandle -> Int -> IO (Maybe Voice)
samplePlayCritical samp start = do
v <- c_Sample_Play samp (fromIntegral start) sfxCritical
if v >= 0
then (return . Just . Voice) v
else return Nothing
-- | Free a sample. Do not sampleFree samples aquired via 'getModuleSamples'.
-- Those are freed with 'playerFree'. Discard the SampleHandle after using
-- this operation. | 399 | samplePlayCritical :: SampleHandle -> Int -> IO (Maybe Voice)
samplePlayCritical samp start = do
v <- c_Sample_Play samp (fromIntegral start) sfxCritical
if v >= 0
then (return . Just . Voice) v
else return Nothing
-- | Free a sample. Do not sampleFree samples aquired via 'getModuleSamples'.
-- Those are freed with 'playerFree'. Discard the SampleHandle after using
-- this operation. | 399 | samplePlayCritical samp start = do
v <- c_Sample_Play samp (fromIntegral start) sfxCritical
if v >= 0
then (return . Just . Voice) v
else return Nothing
-- | Free a sample. Do not sampleFree samples aquired via 'getModuleSamples'.
-- Those are freed with 'playerFree'. Discard the SampleHandle after using
-- this operation. | 337 | false | true | 0 | 11 | 73 | 88 | 44 | 44 | null | null |
seereason/haskell-unixutils | System/Unix/Misc.hs | bsd-3-clause | md5sum :: FilePath -> IO String
md5sum path = Data.ByteString.Lazy.Char8.readFile path >>= return . show . md5 | 110 | md5sum :: FilePath -> IO String
md5sum path = Data.ByteString.Lazy.Char8.readFile path >>= return . show . md5 | 110 | md5sum path = Data.ByteString.Lazy.Char8.readFile path >>= return . show . md5 | 78 | false | true | 0 | 9 | 16 | 46 | 22 | 24 | null | null |
Vetii/Komposition | Transformations/Complex.hs | gpl-2.0 | mkCayley :: (RealFloat a) => CayleyMap a
mkCayley = CayleyMap $ mkMobius 1 (0 :+ (-1)) 1 (0 :+ 1) | 97 | mkCayley :: (RealFloat a) => CayleyMap a
mkCayley = CayleyMap $ mkMobius 1 (0 :+ (-1)) 1 (0 :+ 1) | 97 | mkCayley = CayleyMap $ mkMobius 1 (0 :+ (-1)) 1 (0 :+ 1) | 56 | false | true | 0 | 10 | 19 | 55 | 29 | 26 | null | null |
Jubobs/CommonMark-WIP | src/CommonMark.hs | bsd-3-clause | -- | Temporary function for testing elementary parsers.
commonmarkTest :: Show a => Parser a -> Text -> IO ()
commonmarkTest p s = do
case A.parseOnly p s of
Left e -> putStrLn $ "No parse: " ++ e
Right x -> putStrLn $ "Parsed: " ++ show x
-- $example
--
-- Parsers for CommonMark syntactic elements can be
-- tested at the command line:
--
-- > λ> commonmarkTest hRule "---rule?---"
-- > No parse: horizontal rule: endOfInput
--
-- > λ> commonmarkTest hRule " ------"
-- > Parsed: Rule
--
-- > λ> commonmarkTest hRule " ------"
-- > No parse: horizontal rule: Failed reading: empty | 605 | commonmarkTest :: Show a => Parser a -> Text -> IO ()
commonmarkTest p s = do
case A.parseOnly p s of
Left e -> putStrLn $ "No parse: " ++ e
Right x -> putStrLn $ "Parsed: " ++ show x
-- $example
--
-- Parsers for CommonMark syntactic elements can be
-- tested at the command line:
--
-- > λ> commonmarkTest hRule "---rule?---"
-- > No parse: horizontal rule: endOfInput
--
-- > λ> commonmarkTest hRule " ------"
-- > Parsed: Rule
--
-- > λ> commonmarkTest hRule " ------"
-- > No parse: horizontal rule: Failed reading: empty | 549 | commonmarkTest p s = do
case A.parseOnly p s of
Left e -> putStrLn $ "No parse: " ++ e
Right x -> putStrLn $ "Parsed: " ++ show x
-- $example
--
-- Parsers for CommonMark syntactic elements can be
-- tested at the command line:
--
-- > λ> commonmarkTest hRule "---rule?---"
-- > No parse: horizontal rule: endOfInput
--
-- > λ> commonmarkTest hRule " ------"
-- > Parsed: Rule
--
-- > λ> commonmarkTest hRule " ------"
-- > No parse: horizontal rule: Failed reading: empty | 495 | true | true | 0 | 12 | 132 | 109 | 56 | 53 | null | null |
nikki-and-the-robots/nikki | src/Graphics/Qt/CPPWrapper.hs | lgpl-3.0 | -- | Blocking operation, that gets the gui thread to perform a given action and
-- returns its result.
postGUIBlocking :: IO a -> IO a
postGUIBlocking a = do
ref <- newEmptyMVar
postGUI (a >>= putMVar ref)
takeMVar ref | 230 | postGUIBlocking :: IO a -> IO a
postGUIBlocking a = do
ref <- newEmptyMVar
postGUI (a >>= putMVar ref)
takeMVar ref | 127 | postGUIBlocking a = do
ref <- newEmptyMVar
postGUI (a >>= putMVar ref)
takeMVar ref | 95 | true | true | 0 | 10 | 51 | 55 | 25 | 30 | null | null |
brendanhay/gogol | gogol-cloudidentity/gen/Network/Google/CloudIdentity/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'DynamicGroupStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dgsStatus'
--
-- * 'dgsStatusTime'
dynamicGroupStatus
:: DynamicGroupStatus
dynamicGroupStatus =
DynamicGroupStatus' {_dgsStatus = Nothing, _dgsStatusTime = Nothing} | 350 | dynamicGroupStatus
:: DynamicGroupStatus
dynamicGroupStatus =
DynamicGroupStatus' {_dgsStatus = Nothing, _dgsStatusTime = Nothing} | 136 | dynamicGroupStatus =
DynamicGroupStatus' {_dgsStatus = Nothing, _dgsStatusTime = Nothing} | 91 | true | true | 1 | 7 | 55 | 36 | 22 | 14 | null | null |
pxqr/utp | src/Network/UTP/Packet.hs | bsd-3-clause | getPayload _ = Nothing | 33 | getPayload _ = Nothing | 33 | getPayload _ = Nothing | 33 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
frantisekfarka/ghc-dsi | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | genJump tree
= do
(target,code) <- getSomeReg tree
return (code `snocOL` MTCTR target `snocOL` BCTR [] Nothing)
-- -----------------------------------------------------------------------------
-- Unconditional branches | 239 | genJump tree
= do
(target,code) <- getSomeReg tree
return (code `snocOL` MTCTR target `snocOL` BCTR [] Nothing)
-- -----------------------------------------------------------------------------
-- Unconditional branches | 239 | genJump tree
= do
(target,code) <- getSomeReg tree
return (code `snocOL` MTCTR target `snocOL` BCTR [] Nothing)
-- -----------------------------------------------------------------------------
-- Unconditional branches | 239 | false | false | 0 | 11 | 42 | 58 | 30 | 28 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | List of optimization activities associated with this configuration.
cocOptimizationActivitys :: Lens' CreativeOptimizationConfiguration [OptimizationActivity]
cocOptimizationActivitys
= lens _cocOptimizationActivitys
(\ s a -> s{_cocOptimizationActivitys = a})
. _Default
. _Coerce | 306 | cocOptimizationActivitys :: Lens' CreativeOptimizationConfiguration [OptimizationActivity]
cocOptimizationActivitys
= lens _cocOptimizationActivitys
(\ s a -> s{_cocOptimizationActivitys = a})
. _Default
. _Coerce | 233 | cocOptimizationActivitys
= lens _cocOptimizationActivitys
(\ s a -> s{_cocOptimizationActivitys = a})
. _Default
. _Coerce | 142 | true | true | 2 | 8 | 49 | 57 | 28 | 29 | null | null |
pparkkin/eta | compiler/ETA/Interactive/ByteCodeItbls.hs | bsd-3-clause | funPtrToInt :: FunPtr a -> Int
funPtrToInt (FunPtr a#) = I# (addr2Int# a#) | 74 | funPtrToInt :: FunPtr a -> Int
funPtrToInt (FunPtr a#) = I# (addr2Int# a#) | 74 | funPtrToInt (FunPtr a#) = I# (addr2Int# a#) | 43 | false | true | 0 | 7 | 12 | 36 | 17 | 19 | null | null |
supermitch/learn-haskell | real-world-haskell/ch03/AltCustomer.hs | mit | customerName :: Customer -> String
customerName (Customer _ name _) = name | 74 | customerName :: Customer -> String
customerName (Customer _ name _) = name | 74 | customerName (Customer _ name _) = name | 39 | false | true | 0 | 9 | 11 | 34 | 15 | 19 | null | null |
silky/ImplicitCAD | Graphics/Implicit/ExtOpenScad/Primitives.hs | gpl-2.0 | objMap _ _ [] = [] | 18 | objMap _ _ [] = [] | 18 | objMap _ _ [] = [] | 18 | false | false | 0 | 6 | 5 | 17 | 8 | 9 | null | null |
nomeata/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | isInt _ = False | 23 | isInt _ = False | 23 | isInt _ = False | 23 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/parsing/bnfc-meta-examples/test/ParseAndPrintSpec.hs | unlicense | ------------------------------------------------------------------------------
spec :: Spec
spec = do
parseST
printST
deBruijnST | 136 | spec :: Spec
spec = do
parseST
printST
deBruijnST | 56 | spec = do
parseST
printST
deBruijnST | 43 | true | true | 0 | 7 | 17 | 28 | 11 | 17 | null | null |
christiaanb/ghc | utils/genprimopcode/Main.hs | bsd-3-clause | gen_primop_vector_uniques :: Info -> String
gen_primop_vector_uniques (Info _ entries)
= unlines $
concatMap mkVecUnique (specs `zip` [mIN_VECTOR_UNIQUE..])
where
specs = concatMap desugarVectorSpec (filter is_vector (filter is_primtype entries))
mkVecUnique :: (Entry, Int) -> [String]
mkVecUnique (i, unique) =
[ key_id ++ " :: Unique"
, key_id ++ " = mkPreludeTyConUnique " ++ show unique
]
where
key_id = prefix i ++ "PrimTyConKey" | 496 | gen_primop_vector_uniques :: Info -> String
gen_primop_vector_uniques (Info _ entries)
= unlines $
concatMap mkVecUnique (specs `zip` [mIN_VECTOR_UNIQUE..])
where
specs = concatMap desugarVectorSpec (filter is_vector (filter is_primtype entries))
mkVecUnique :: (Entry, Int) -> [String]
mkVecUnique (i, unique) =
[ key_id ++ " :: Unique"
, key_id ++ " = mkPreludeTyConUnique " ++ show unique
]
where
key_id = prefix i ++ "PrimTyConKey" | 496 | gen_primop_vector_uniques (Info _ entries)
= unlines $
concatMap mkVecUnique (specs `zip` [mIN_VECTOR_UNIQUE..])
where
specs = concatMap desugarVectorSpec (filter is_vector (filter is_primtype entries))
mkVecUnique :: (Entry, Int) -> [String]
mkVecUnique (i, unique) =
[ key_id ++ " :: Unique"
, key_id ++ " = mkPreludeTyConUnique " ++ show unique
]
where
key_id = prefix i ++ "PrimTyConKey" | 452 | false | true | 0 | 9 | 121 | 144 | 76 | 68 | null | null |
sergv/tags-server | src/Haskell/Language/Lexer/RulePredicate.hs | bsd-3-clause | isInLatexCodeEnv :: RulePredM AlexState Bool
isInLatexCodeEnv = do
style <- asks asLiterateStyle
pure $ case style of
Nothing -> False
Just Latex -> True
Just Bird -> False
-- | Check whether given name is a cpp define. | 240 | isInLatexCodeEnv :: RulePredM AlexState Bool
isInLatexCodeEnv = do
style <- asks asLiterateStyle
pure $ case style of
Nothing -> False
Just Latex -> True
Just Bird -> False
-- | Check whether given name is a cpp define. | 240 | isInLatexCodeEnv = do
style <- asks asLiterateStyle
pure $ case style of
Nothing -> False
Just Latex -> True
Just Bird -> False
-- | Check whether given name is a cpp define. | 195 | false | true | 1 | 12 | 58 | 67 | 29 | 38 | null | null |
DavidAlphaFox/ghc | libraries/bytestring/Data/ByteString/Lazy/Char8.hs | bsd-3-clause | takeWhile :: (Char -> Bool) -> ByteString -> ByteString
takeWhile f = L.takeWhile (f . w2c) | 91 | takeWhile :: (Char -> Bool) -> ByteString -> ByteString
takeWhile f = L.takeWhile (f . w2c) | 91 | takeWhile f = L.takeWhile (f . w2c) | 35 | false | true | 0 | 8 | 15 | 47 | 22 | 25 | null | null |
flocc-net/flocc | v0.1/Compiler/Planner/SearchCache.hs | apache-2.0 | emptyCacheSt = SCacheSt {
scSolCtx = Nothing,
scCosts = DM.empty,
scMetaInfo = DM.empty,
scCurrentSol = Nothing,
scPath = Nothing
} | 153 | emptyCacheSt = SCacheSt {
scSolCtx = Nothing,
scCosts = DM.empty,
scMetaInfo = DM.empty,
scCurrentSol = Nothing,
scPath = Nothing
} | 153 | emptyCacheSt = SCacheSt {
scSolCtx = Nothing,
scCosts = DM.empty,
scMetaInfo = DM.empty,
scCurrentSol = Nothing,
scPath = Nothing
} | 153 | false | false | 0 | 7 | 41 | 42 | 26 | 16 | null | null |
neothemachine/monadiccp | src/Data/Expr/Util.hs | bsd-3-clause | propCol :: (b -> Bool) -> ColExpr a b c -> Maybe Bool
propCol ft t = case t of
ColTerm x -> Just $ ft x
_ -> Nothing | 120 | propCol :: (b -> Bool) -> ColExpr a b c -> Maybe Bool
propCol ft t = case t of
ColTerm x -> Just $ ft x
_ -> Nothing | 120 | propCol ft t = case t of
ColTerm x -> Just $ ft x
_ -> Nothing | 66 | false | true | 3 | 7 | 33 | 66 | 31 | 35 | null | null |
tsoding/boids | src/Boids.hs | mit | boidsProduct :: [Boid] -> (Boid -> [Boid] -> Boid) -> [Boid]
boidsProduct boids f = [ f boid $ excludedBoids i | (i, boid) <- indexedBoids ]
where indexedBoids = zip [1..] boids
excludedBoids i = map snd $ filter (\(j, _) -> i /= j) indexedBoids | 259 | boidsProduct :: [Boid] -> (Boid -> [Boid] -> Boid) -> [Boid]
boidsProduct boids f = [ f boid $ excludedBoids i | (i, boid) <- indexedBoids ]
where indexedBoids = zip [1..] boids
excludedBoids i = map snd $ filter (\(j, _) -> i /= j) indexedBoids | 259 | boidsProduct boids f = [ f boid $ excludedBoids i | (i, boid) <- indexedBoids ]
where indexedBoids = zip [1..] boids
excludedBoids i = map snd $ filter (\(j, _) -> i /= j) indexedBoids | 198 | false | true | 0 | 10 | 60 | 129 | 67 | 62 | null | null |
adityashah30/haskellchess | chessEngine/OpenBookModule.hs | gpl-2.0 | --Extract the white move from a node.
getWhiteMove::(Int, Int, String, String) -> String
getWhiteMove (_, _, white, _) = white | 126 | getWhiteMove::(Int, Int, String, String) -> String
getWhiteMove (_, _, white, _) = white | 88 | getWhiteMove (_, _, white, _) = white | 37 | true | true | 0 | 6 | 19 | 43 | 26 | 17 | null | null |
danr/hipspec | tfp1/tests/SomePrelude.hs | gpl-3.0 | dropWhile p xs@(x:xs')
| p x = dropWhile p xs'
| True = xs | 95 | dropWhile p xs@(x:xs')
| p x = dropWhile p xs'
| True = xs | 95 | dropWhile p xs@(x:xs')
| p x = dropWhile p xs'
| True = xs | 95 | false | false | 0 | 8 | 50 | 44 | 20 | 24 | null | null |
ndmitchell/shake | src/Development/Shake/Command.hs | bsd-3-clause | isFSAOptions FSAOptions{} = True | 32 | isFSAOptions FSAOptions{} = True | 32 | isFSAOptions FSAOptions{} = True | 32 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
trbauer/ebnf | Language/EBNF/Types.hs | mit | -- Computes the unbound variables (non-terminals) in the grammar
gVarsRefed :: Grammar -> [String]
gVarsRefed = nubOrd . concatMap vVarsRefed . gVars | 149 | gVarsRefed :: Grammar -> [String]
gVarsRefed = nubOrd . concatMap vVarsRefed . gVars | 84 | gVarsRefed = nubOrd . concatMap vVarsRefed . gVars | 50 | true | true | 0 | 7 | 21 | 30 | 16 | 14 | null | null |
nurpax/aeson | Data/Aeson.hs | bsd-3-clause | -- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'.
-- If this fails due to incomplete or invalid input, 'Nothing' is
-- returned.
--
-- The input must consist solely of a JSON document, with no trailing
-- data except for whitespace.
--
-- This function parses and performs conversion immediately. See
-- 'json'' for details.
decodeStrict' :: (FromJSON a) => B.ByteString -> Maybe a
decodeStrict' = decodeStrictWith jsonEOF' fromJSON | 453 | decodeStrict' :: (FromJSON a) => B.ByteString -> Maybe a
decodeStrict' = decodeStrictWith jsonEOF' fromJSON | 107 | decodeStrict' = decodeStrictWith jsonEOF' fromJSON | 50 | true | true | 0 | 7 | 72 | 43 | 26 | 17 | null | null |
dQuixote/hearch | src/lib/Database.hs | mit | -- default: databaseFile
-- | Store a word/page-frequency-views map to the table.
storeFreqMap :: String -> Map String (String, Int, Int) -> IO ()
storeFreqMap file freqMap = withConnection file $ \con -> do
-- Map Word (Page, Freq, Views) -> (Word, Page, Freq, Views)
let rows = map joinAssosc $ Map.assocs freqMap
-- store all the rows in the table
forM_ rows $ execute con storeQueryFormat
-- Helper function for storeFreqMap. Joins a (word, (page, freq, views))
-- map into one quadruple which can then be stored in the table. | 547 | storeFreqMap :: String -> Map String (String, Int, Int) -> IO ()
storeFreqMap file freqMap = withConnection file $ \con -> do
-- Map Word (Page, Freq, Views) -> (Word, Page, Freq, Views)
let rows = map joinAssosc $ Map.assocs freqMap
-- store all the rows in the table
forM_ rows $ execute con storeQueryFormat
-- Helper function for storeFreqMap. Joins a (word, (page, freq, views))
-- map into one quadruple which can then be stored in the table. | 465 | storeFreqMap file freqMap = withConnection file $ \con -> do
-- Map Word (Page, Freq, Views) -> (Word, Page, Freq, Views)
let rows = map joinAssosc $ Map.assocs freqMap
-- store all the rows in the table
forM_ rows $ execute con storeQueryFormat
-- Helper function for storeFreqMap. Joins a (word, (page, freq, views))
-- map into one quadruple which can then be stored in the table. | 400 | true | true | 0 | 14 | 107 | 97 | 49 | 48 | null | null |
spechub/Hets | CommonLogic/Print_KIF.hs | gpl-2.0 | printTermSeq :: Set.Set String -> AS.TERM_SEQ -> Doc
printTermSeq bv s = case s of
AS.Term_seq t -> printTerm bv t
AS.Seq_marks m -> printRowVar m | 150 | printTermSeq :: Set.Set String -> AS.TERM_SEQ -> Doc
printTermSeq bv s = case s of
AS.Term_seq t -> printTerm bv t
AS.Seq_marks m -> printRowVar m | 150 | printTermSeq bv s = case s of
AS.Term_seq t -> printTerm bv t
AS.Seq_marks m -> printRowVar m | 97 | false | true | 0 | 9 | 29 | 65 | 30 | 35 | null | null |
brendanhay/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | Solid color fill.
ofSolidFill :: Lens' OutlineFill (Maybe SolidFill)
ofSolidFill
= lens _ofSolidFill (\ s a -> s{_ofSolidFill = a}) | 138 | ofSolidFill :: Lens' OutlineFill (Maybe SolidFill)
ofSolidFill
= lens _ofSolidFill (\ s a -> s{_ofSolidFill = a}) | 115 | ofSolidFill
= lens _ofSolidFill (\ s a -> s{_ofSolidFill = a}) | 64 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
shouya/projz | emulator/Processor.hs | bsd-2-clause | inst_rpo, inst_rpe, inst_rp, inst_rm :: State -> State
inst_rz = cond_ret_inst cond_z | 86 | inst_rpo, inst_rpe, inst_rp, inst_rm :: State -> State
inst_rz = cond_ret_inst cond_z | 86 | inst_rz = cond_ret_inst cond_z | 31 | false | true | 5 | 5 | 12 | 36 | 15 | 21 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Hooks/DebugEvents.hs | bsd-2-clause | -- verify a decoder parameter, else call error reporter
-- once again, it's more general than I originally wrote
guardR :: (MonadReader r m, Eq v)
=> (r -> v) -- value selector
-> v -- expected value
-> (v -> v -> m a) -- error reporter
-> m a -- continuation (hush)
-> m a
guardR sel val err good = do
v <- asks sel
if v == val then good else err v val
-- this is kinda dumb | 583 | guardR :: (MonadReader r m, Eq v)
=> (r -> v) -- value selector
-> v -- expected value
-> (v -> v -> m a) -- error reporter
-> m a -- continuation (hush)
-> m a
guardR sel val err good = do
v <- asks sel
if v == val then good else err v val
-- this is kinda dumb | 470 | guardR sel val err good = do
v <- asks sel
if v == val then good else err v val
-- this is kinda dumb | 107 | true | true | 0 | 12 | 290 | 117 | 61 | 56 | null | null |
DataStewardshipPortal/ds-wizard | DSServer/app/App.hs | apache-2.0 | deleteSession :: PGPool -> Cookies -> Action
deleteSession pool cookies =
case getSession cookies of
Nothing -> return ()
Just sessionId -> do
_ <- runQuery pool $ deleteSessionById sessionId
deleteCookie sessionCookie
--tl2t :: TL.Text -> Data.Text.Internal.Lazy.Text
--t2t t = Data.Text.Lazy.pack $ tifName tif
--tif2t :: TransactionInputField -> Data.Text.Text
--tif2t tif = Data.Text.pack $ tifName tif | 429 | deleteSession :: PGPool -> Cookies -> Action
deleteSession pool cookies =
case getSession cookies of
Nothing -> return ()
Just sessionId -> do
_ <- runQuery pool $ deleteSessionById sessionId
deleteCookie sessionCookie
--tl2t :: TL.Text -> Data.Text.Internal.Lazy.Text
--t2t t = Data.Text.Lazy.pack $ tifName tif
--tif2t :: TransactionInputField -> Data.Text.Text
--tif2t tif = Data.Text.pack $ tifName tif | 429 | deleteSession pool cookies =
case getSession cookies of
Nothing -> return ()
Just sessionId -> do
_ <- runQuery pool $ deleteSessionById sessionId
deleteCookie sessionCookie
--tl2t :: TL.Text -> Data.Text.Internal.Lazy.Text
--t2t t = Data.Text.Lazy.pack $ tifName tif
--tif2t :: TransactionInputField -> Data.Text.Text
--tif2t tif = Data.Text.pack $ tifName tif | 384 | false | true | 0 | 13 | 78 | 83 | 38 | 45 | null | null |
DavidAlphaFox/darcs | src/Darcs/Patch/Match.hs | gpl-2.0 | secondMatcher (UpToHash h:_) = strictJust $ hashmatch' h | 56 | secondMatcher (UpToHash h:_) = strictJust $ hashmatch' h | 56 | secondMatcher (UpToHash h:_) = strictJust $ hashmatch' h | 56 | false | false | 0 | 8 | 7 | 26 | 12 | 14 | null | null |
drippdropp/99-problems | haskell/problem5.hs | apache-2.0 | myReverse :: [a] -> [a]
myReverse [] = [] | 41 | myReverse :: [a] -> [a]
myReverse [] = [] | 41 | myReverse [] = [] | 17 | false | true | 0 | 6 | 8 | 28 | 15 | 13 | null | null |
mariefarrell/Hets | Comorphisms/HasCASL2Haskell.hs | gpl-2.0 | toProgPos :: Range -> SrcLoc
toProgPos p = if isNullRange p then loc0
else let Range (SourcePos n l c : _) = p
in SrcLoc n (1000 + (l - 1) * 80 + c) l c | 188 | toProgPos :: Range -> SrcLoc
toProgPos p = if isNullRange p then loc0
else let Range (SourcePos n l c : _) = p
in SrcLoc n (1000 + (l - 1) * 80 + c) l c | 188 | toProgPos p = if isNullRange p then loc0
else let Range (SourcePos n l c : _) = p
in SrcLoc n (1000 + (l - 1) * 80 + c) l c | 159 | false | true | 0 | 14 | 73 | 89 | 44 | 45 | null | null |
smurphy8/wavelets | src/Data/Wavelets/Reconstruction.hs | bsd-3-clause | -- hiding (map)
-- import Linear
-- |explicitly name a Fractional and Ord instance on the idwt function
fidwt :: Int -> WaveletFilter Double -> WaveletPacker Double c -> c -> [Double]
fidwt = idwt | 198 | fidwt :: Int -> WaveletFilter Double -> WaveletPacker Double c -> c -> [Double]
fidwt = idwt | 93 | fidwt = idwt | 12 | true | true | 0 | 11 | 36 | 48 | 23 | 25 | null | null |
flazz/tooHS | src/Game.hs | bsd-3-clause | -- | fire one shot
fireShot :: IORef Game -> IO ()
fireShot gameRef = do
modifyIORef gameRef addShot
where addShot g = g { shots = s:(shots g) }
where Vector3 x y z = pos . ship $ g
s = Shot $ Vector3 x (y + 0.1) z | 244 | fireShot :: IORef Game -> IO ()
fireShot gameRef = do
modifyIORef gameRef addShot
where addShot g = g { shots = s:(shots g) }
where Vector3 x y z = pos . ship $ g
s = Shot $ Vector3 x (y + 0.1) z | 225 | fireShot gameRef = do
modifyIORef gameRef addShot
where addShot g = g { shots = s:(shots g) }
where Vector3 x y z = pos . ship $ g
s = Shot $ Vector3 x (y + 0.1) z | 193 | true | true | 8 | 9 | 80 | 133 | 56 | 77 | null | null |
rueshyna/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | Version number for persistent state.
tcPersistentStateVersion :: Lens' TopologyConfig (Maybe Int32)
tcPersistentStateVersion
= lens _tcPersistentStateVersion
(\ s a -> s{_tcPersistentStateVersion = a})
. mapping _Coerce | 238 | tcPersistentStateVersion :: Lens' TopologyConfig (Maybe Int32)
tcPersistentStateVersion
= lens _tcPersistentStateVersion
(\ s a -> s{_tcPersistentStateVersion = a})
. mapping _Coerce | 196 | tcPersistentStateVersion
= lens _tcPersistentStateVersion
(\ s a -> s{_tcPersistentStateVersion = a})
. mapping _Coerce | 133 | true | true | 2 | 8 | 40 | 60 | 28 | 32 | null | null |
brendanhay/gogol | gogol-vision/gen/Network/Google/Vision/Types/Product.hs | mpl-2.0 | -- | The value of the label attached to the product. Cannot be empty and
-- cannot exceed 128 bytes.
gcvvpkvValue :: Lens' GoogleCloudVisionV1p3beta1ProductKeyValue (Maybe Text)
gcvvpkvValue
= lens _gcvvpkvValue (\ s a -> s{_gcvvpkvValue = a}) | 245 | gcvvpkvValue :: Lens' GoogleCloudVisionV1p3beta1ProductKeyValue (Maybe Text)
gcvvpkvValue
= lens _gcvvpkvValue (\ s a -> s{_gcvvpkvValue = a}) | 144 | gcvvpkvValue
= lens _gcvvpkvValue (\ s a -> s{_gcvvpkvValue = a}) | 67 | true | true | 1 | 9 | 38 | 51 | 26 | 25 | null | null |
Gabriel439/Haskell-Errors-Library | Control/Error/Util.hs | bsd-3-clause | -- | Write a string to standard error
err :: Text -> IO ()
err = Data.Text.IO.hPutStr stderr | 92 | err :: Text -> IO ()
err = Data.Text.IO.hPutStr stderr | 54 | err = Data.Text.IO.hPutStr stderr | 33 | true | true | 0 | 7 | 17 | 28 | 15 | 13 | null | null |
opentower/carnap | Carnap/src/Carnap/Calculi/NaturalDeduction/Syntax.hs | gpl-3.0 | dependencies _ = Nothing | 24 | dependencies _ = Nothing | 24 | dependencies _ = Nothing | 24 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
aristidb/datastorage | src/TypedBinary.hs | bsd-3-clause | addSize (Constant a) (Range x y) = Range (a + x) (fmap (+a) y) | 62 | addSize (Constant a) (Range x y) = Range (a + x) (fmap (+a) y) | 62 | addSize (Constant a) (Range x y) = Range (a + x) (fmap (+a) y) | 62 | false | false | 0 | 8 | 13 | 49 | 25 | 24 | null | null |
chrisdone/haskell-docs | src/main/Main.hs | bsd-3-clause | -- | Main entry point.
main :: IO ()
main =
do args <- getArgs
app args
-- | Do the printing. | 101 | main :: IO ()
main =
do args <- getArgs
app args
-- | Do the printing. | 78 | main =
do args <- getArgs
app args
-- | Do the printing. | 64 | true | true | 0 | 8 | 29 | 37 | 16 | 21 | null | null |
mrshannon/trees | src/Input/Keyboard/GLUT.hs | gpl-2.0 | changeAsciiKeyState 'R' ns k = k { rKey = ns } | 46 | changeAsciiKeyState 'R' ns k = k { rKey = ns } | 46 | changeAsciiKeyState 'R' ns k = k { rKey = ns } | 46 | false | false | 0 | 6 | 10 | 21 | 11 | 10 | null | null |
atodorov/bdcs | src/BDCS/Export/Types.hs | lgpl-2.1 | exportTypeText ExportQcow2 = "qcow2" | 40 | exportTypeText ExportQcow2 = "qcow2" | 40 | exportTypeText ExportQcow2 = "qcow2" | 40 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
mrmonday/Idris-dev | src/Idris/ElabQuasiquote.hs | bsd-3-clause | extractUnquotes n (PCase fc expr cases)
= do (expr', ex1) <- extractUnquotes n expr
let (pats, rhss) = unzip cases
(pats', exs1) <- fmap unzip $ mapM (extractUnquotes n) pats
(rhss', exs2) <- fmap unzip $ mapM (extractUnquotes n) rhss
return (PCase fc expr' (zip pats' rhss'), ex1 ++ concat exs1 ++ concat exs2) | 341 | extractUnquotes n (PCase fc expr cases)
= do (expr', ex1) <- extractUnquotes n expr
let (pats, rhss) = unzip cases
(pats', exs1) <- fmap unzip $ mapM (extractUnquotes n) pats
(rhss', exs2) <- fmap unzip $ mapM (extractUnquotes n) rhss
return (PCase fc expr' (zip pats' rhss'), ex1 ++ concat exs1 ++ concat exs2) | 341 | extractUnquotes n (PCase fc expr cases)
= do (expr', ex1) <- extractUnquotes n expr
let (pats, rhss) = unzip cases
(pats', exs1) <- fmap unzip $ mapM (extractUnquotes n) pats
(rhss', exs2) <- fmap unzip $ mapM (extractUnquotes n) rhss
return (PCase fc expr' (zip pats' rhss'), ex1 ++ concat exs1 ++ concat exs2) | 341 | false | false | 0 | 11 | 83 | 161 | 77 | 84 | null | null |
meiersi/bytestring | Data/ByteString/Lazy/Char8.hs | bsd-3-clause | -- | /O(n)/ @'replicate' n x@ is a ByteString of length @n@ with @x@
-- the value of every element.
--
replicate :: Int64 -> Char -> ByteString
replicate w c = L.replicate w (c2w c) | 181 | replicate :: Int64 -> Char -> ByteString
replicate w c = L.replicate w (c2w c) | 78 | replicate w c = L.replicate w (c2w c) | 37 | true | true | 0 | 7 | 35 | 40 | 21 | 19 | null | null |
juhp/stack | src/Stack/Dot.hs | bsd-3-clause | localPackageToPackage :: LocalPackage -> Package
localPackageToPackage lp =
fromMaybe (lpPackage lp) (lpTestBench lp) | 119 | localPackageToPackage :: LocalPackage -> Package
localPackageToPackage lp =
fromMaybe (lpPackage lp) (lpTestBench lp) | 119 | localPackageToPackage lp =
fromMaybe (lpPackage lp) (lpTestBench lp) | 70 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
Soostone/cassy | src/Database/Cassandra/Pool.hs | bsd-3-clause | openThrift host port = do
h <- hOpen (host, PortNumber (fromIntegral port))
ft <- openFramedTransport h
let p = BinaryProtocol ft
return (h, ft, p)
------------------------------------------------------------------------------ | 244 | openThrift host port = do
h <- hOpen (host, PortNumber (fromIntegral port))
ft <- openFramedTransport h
let p = BinaryProtocol ft
return (h, ft, p)
------------------------------------------------------------------------------ | 244 | openThrift host port = do
h <- hOpen (host, PortNumber (fromIntegral port))
ft <- openFramedTransport h
let p = BinaryProtocol ft
return (h, ft, p)
------------------------------------------------------------------------------ | 244 | false | false | 0 | 12 | 43 | 74 | 35 | 39 | null | null |
adarqui/lambda-calculus | NumBool.hs | gpl-3.0 | nFalse = 0 | 10 | nFalse = 0 | 10 | nFalse = 0 | 10 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
aburnett88/HSat | tests-src/Test/Make/Instances/Common/Literal.hs | mit | generateSet :: (Ord a) => Set a -> Word -> Gen (Set a)
generateSet set remove =
if set == S.empty || remove == 0 then
return set else do
index <- choose (0, S.size set - 1)
let set' = S.delete (S.elemAt index set) set
generateSet set' (remove - 1) | 285 | generateSet :: (Ord a) => Set a -> Word -> Gen (Set a)
generateSet set remove =
if set == S.empty || remove == 0 then
return set else do
index <- choose (0, S.size set - 1)
let set' = S.delete (S.elemAt index set) set
generateSet set' (remove - 1) | 285 | generateSet set remove =
if set == S.empty || remove == 0 then
return set else do
index <- choose (0, S.size set - 1)
let set' = S.delete (S.elemAt index set) set
generateSet set' (remove - 1) | 219 | false | true | 0 | 14 | 88 | 136 | 66 | 70 | null | null |
rgrempel/frelm.org | vendor/elm-format/parser/src/Parse/Pattern.hs | mit | record :: IParser P.Pattern
record =
addLocation $
do
v <- brackets ((\f a b _ -> f a b) <$> commaSep1 ((\x pre post -> Commented pre x post) <$> lowVar))
return $ P.Record v | 190 | record :: IParser P.Pattern
record =
addLocation $
do
v <- brackets ((\f a b _ -> f a b) <$> commaSep1 ((\x pre post -> Commented pre x post) <$> lowVar))
return $ P.Record v | 190 | record =
addLocation $
do
v <- brackets ((\f a b _ -> f a b) <$> commaSep1 ((\x pre post -> Commented pre x post) <$> lowVar))
return $ P.Record v | 162 | false | true | 0 | 17 | 51 | 97 | 48 | 49 | null | null |
parsonsmatt/hash-rekt | src/Data/HashRecord/Internal.hs | bsd-3-clause | -- | Looks up the given key in a 'HashRecord''. Intended to be used with
-- TypeApplications.
--
-- >>> Rec.lookup @"foo" (Rec.insert @"foo" 'a' Rec.empty)
-- 'a'
lookup
:: forall key val keys.
( MapEntry key val
, Lookup key keys ~ val
)
=> HashRecord keys
-> val
lookup = runIdentity . lookup' @key | 324 | lookup
:: forall key val keys.
( MapEntry key val
, Lookup key keys ~ val
)
=> HashRecord keys
-> val
lookup = runIdentity . lookup' @key | 161 | lookup = runIdentity . lookup' @key | 35 | true | true | 1 | 10 | 79 | 71 | 36 | 35 | null | null |
yliu120/K3 | src/Language/K3/Analysis/Properties.hs | apache-2.0 | pienv0 :: PIEnv
pienv0 = PIEnv {penv=penv0, paenv=paenv0} | 57 | pienv0 :: PIEnv
pienv0 = PIEnv {penv=penv0, paenv=paenv0} | 57 | pienv0 = PIEnv {penv=penv0, paenv=paenv0} | 41 | false | true | 0 | 6 | 7 | 25 | 15 | 10 | null | null |
vikraman/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isCFunEqCan_maybe :: Ct -> Maybe (TyCon, [Type])
isCFunEqCan_maybe (CFunEqCan { cc_fun = tc, cc_tyargs = xis }) = Just (tc, xis) | 128 | isCFunEqCan_maybe :: Ct -> Maybe (TyCon, [Type])
isCFunEqCan_maybe (CFunEqCan { cc_fun = tc, cc_tyargs = xis }) = Just (tc, xis) | 128 | isCFunEqCan_maybe (CFunEqCan { cc_fun = tc, cc_tyargs = xis }) = Just (tc, xis) | 79 | false | true | 6 | 9 | 20 | 64 | 33 | 31 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.