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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
erikd/hs-tls | debug/src/Stunnel.hs | bsd-3-clause | listenAddressDescription (AddrFD _ _) = do
error "cannot listen on fd" | 74 | listenAddressDescription (AddrFD _ _) = do
error "cannot listen on fd" | 74 | listenAddressDescription (AddrFD _ _) = do
error "cannot listen on fd" | 74 | false | false | 0 | 7 | 14 | 23 | 10 | 13 | null | null |
thoughtpolice/binary-serialise-cbor | bench/Real/Load.hs | bsd-3-clause | -- Parser combinator for simple fields. Takes a field name, a pretty printer,
-- a parser function, an accessor, and a setter, returns a FieldDescr over the
-- compoid structure.
simpleField :: String -> (a -> Doc) -> ReadP a
-> (b -> a) -> (a -> b -> b) -> FieldDescr b
simpleField name showF readF get set... | 367 | simpleField :: String -> (a -> Doc) -> ReadP a
-> (b -> a) -> (a -> b -> b) -> FieldDescr b
simpleField name showF readF get set
= liftField get set $ field name showF readF | 187 | simpleField name showF readF get set
= liftField get set $ field name showF readF | 83 | true | true | 0 | 12 | 82 | 92 | 47 | 45 | null | null |
keera-studios/hsQt | Qtc/Gui/QWidget.hs | bsd-2-clause | qrepaint :: QWidget a -> ((QRect t1)) -> IO ()
qrepaint x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QWidget_repaint2 cobj_x0 cobj_x1 | 174 | qrepaint :: QWidget a -> ((QRect t1)) -> IO ()
qrepaint x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QWidget_repaint2 cobj_x0 cobj_x1 | 174 | qrepaint x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QWidget_repaint2 cobj_x0 cobj_x1 | 127 | false | true | 0 | 9 | 36 | 78 | 37 | 41 | null | null |
sordina/wai | wai-app-static/WaiAppStatic/CmdLine.hs | bsd-2-clause | args :: Parser Args
args = Args
<$> strOption
( long "docroot"
<> short 'd'
<> metavar "DOCROOT"
<> value "."
<> help "directory containing files to serve")
<*> (defIndex <$> many (strOption
( long "index"
<> short 'i'
<> ... | 1,332 | args :: Parser Args
args = Args
<$> strOption
( long "docroot"
<> short 'd'
<> metavar "DOCROOT"
<> value "."
<> help "directory containing files to serve")
<*> (defIndex <$> many (strOption
( long "index"
<> short 'i'
<> ... | 1,332 | args = Args
<$> strOption
( long "docroot"
<> short 'd'
<> metavar "DOCROOT"
<> value "."
<> help "directory containing files to serve")
<*> (defIndex <$> many (strOption
( long "index"
<> short 'i'
<> metavar "INDEX"
... | 1,312 | false | true | 26 | 14 | 549 | 373 | 172 | 201 | null | null |
meiersi/bytestring-builder | Data/ByteString/Lazy/Builder/BasicEncoding/Binary.hs | bsd-3-clause | word64Base128LE :: BoundedEncoding Word64
word64Base128LE = encodeBase128ViaWord64 | 82 | word64Base128LE :: BoundedEncoding Word64
word64Base128LE = encodeBase128ViaWord64 | 82 | word64Base128LE = encodeBase128ViaWord64 | 40 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
ghc-android/ghc | libraries/base/System/Posix/Internals.hs | bsd-3-clause | withFilePath :: FilePath -> (CWString -> IO a) -> IO a
withFilePath = withCWString | 82 | withFilePath :: FilePath -> (CWString -> IO a) -> IO a
withFilePath = withCWString | 82 | withFilePath = withCWString | 27 | false | true | 0 | 10 | 13 | 38 | 17 | 21 | null | null |
rueshyna/gogol | gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Snapshots/SetIAMPolicy.hs | mpl-2.0 | -- | OAuth access token.
pssiampAccessToken :: Lens' ProjectsSnapshotsSetIAMPolicy (Maybe Text)
pssiampAccessToken
= lens _pssiampAccessToken
(\ s a -> s{_pssiampAccessToken = a}) | 187 | pssiampAccessToken :: Lens' ProjectsSnapshotsSetIAMPolicy (Maybe Text)
pssiampAccessToken
= lens _pssiampAccessToken
(\ s a -> s{_pssiampAccessToken = a}) | 162 | pssiampAccessToken
= lens _pssiampAccessToken
(\ s a -> s{_pssiampAccessToken = a}) | 91 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
rahulmutt/ghcvm | libraries/eta-meta/Language/Eta/Meta/Lib.hs | bsd-3-clause | lam1E :: PatQ -> ExpQ -> ExpQ
lam1E p e = lamE [p] e | 52 | lam1E :: PatQ -> ExpQ -> ExpQ
lam1E p e = lamE [p] e | 52 | lam1E p e = lamE [p] e | 22 | false | true | 0 | 6 | 13 | 32 | 16 | 16 | null | null |
kim/amazonka | amazonka-elasticache/gen/Network/AWS/ElastiCache/Types.hs | mpl-2.0 | -- | The port number used by each cache nodes in the source cache cluster.
sPort :: Lens' Snapshot (Maybe Int)
sPort = lens _sPort (\s a -> s { _sPort = a }) | 157 | sPort :: Lens' Snapshot (Maybe Int)
sPort = lens _sPort (\s a -> s { _sPort = a }) | 82 | sPort = lens _sPort (\s a -> s { _sPort = a }) | 46 | true | true | 2 | 9 | 33 | 55 | 25 | 30 | null | null |
jsnajder/fer3-catalogue | src/WorkGroups.hs | bsd-3-clause | componentEditors :: Catalogue -> OverlapComponent -> [ItemEditor]
componentEditors cat (_,zs) =
nub . sort $ concatMap (\(x,_) -> let i = getItem cat x
in if isNothing i then error ("cannot find " ++ show x)
else itemEditors . fromJust $ getI... | 333 | componentEditors :: Catalogue -> OverlapComponent -> [ItemEditor]
componentEditors cat (_,zs) =
nub . sort $ concatMap (\(x,_) -> let i = getItem cat x
in if isNothing i then error ("cannot find " ++ show x)
else itemEditors . fromJust $ getI... | 333 | componentEditors cat (_,zs) =
nub . sort $ concatMap (\(x,_) -> let i = getItem cat x
in if isNothing i then error ("cannot find " ++ show x)
else itemEditors . fromJust $ getItem cat x) zs | 267 | false | true | 3 | 14 | 122 | 120 | 59 | 61 | null | null |
cabrera/elerea | FRP/Elerea/Param.hs | bsd-3-clause | transfer4 :: a -- ^ initial internal state
-> (p -> t1 -> t2 -> t3 -> t4 -> a -> a) -- ^ state updater function
-> Signal t1 -- ^ input signal 1
-> Signal t2 -- ^ input signal 2
-> Sig... | 859 | transfer4 :: a -- ^ initial internal state
-> (p -> t1 -> t2 -> t3 -> t4 -> a -> a) -- ^ state updater function
-> Signal t1 -- ^ input signal 1
-> Signal t2 -- ^ input signal 2
-> Sig... | 859 | transfer4 x0 f s1 s2 s3 s4 = mfix $ \sig -> do
inp <- input
sig' <- delay x0 sig
memo (liftM5 f inp s1 s2 s3 s4 `ap` sig')
{- $effectful
The following combinators are primarily aimed at library implementors
who wish build abstractions to effectful libraries on top of Elerea.
-}
-- | An IO action execute... | 375 | false | true | 0 | 13 | 363 | 163 | 83 | 80 | null | null |
dawedawe/kripkeweb | src/Util.hs | bsd-3-clause | -- |Drop the first and last p percent of the list elements.
dropFirstAndLastXPercent :: Int -> [a] -> [a]
dropFirstAndLastXPercent p xs = dropLastXPercent p (dropFirstXPercent p xs) | 181 | dropFirstAndLastXPercent :: Int -> [a] -> [a]
dropFirstAndLastXPercent p xs = dropLastXPercent p (dropFirstXPercent p xs) | 121 | dropFirstAndLastXPercent p xs = dropLastXPercent p (dropFirstXPercent p xs) | 75 | true | true | 0 | 7 | 27 | 44 | 23 | 21 | null | null |
yairchu/ad | src/Numeric/AD/Internal/Forward.hs | bsd-3-clause | apply :: Num a => (AD Forward a -> b) -> a -> b
apply f a = f (bundle a 1) | 74 | apply :: Num a => (AD Forward a -> b) -> a -> b
apply f a = f (bundle a 1) | 74 | apply f a = f (bundle a 1) | 26 | false | true | 0 | 10 | 21 | 60 | 27 | 33 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/Misc.hs | gpl-2.0 | -- | Return indices of next string in buffer matched by regex in the
-- given direction
regexB :: Direction -> SearchExp -> BufferM [Region]
regexB dir rx = do
p <- pointB
s <- sizeB
regexRegionB rx (mkRegion p (case dir of Forward -> s; Backward -> 0))
-----------------------------------------------------------... | 330 | regexB :: Direction -> SearchExp -> BufferM [Region]
regexB dir rx = do
p <- pointB
s <- sizeB
regexRegionB rx (mkRegion p (case dir of Forward -> s; Backward -> 0))
--------------------------------------------------------------------- | 242 | regexB dir rx = do
p <- pointB
s <- sizeB
regexRegionB rx (mkRegion p (case dir of Forward -> s; Backward -> 0))
--------------------------------------------------------------------- | 189 | true | true | 0 | 13 | 56 | 83 | 42 | 41 | null | null |
brendanhay/gogol | gogol-dlp/gen/Network/Google/DLP/Types/Product.hs | mpl-2.0 | -- | Estimate of the number of bytes to process.
gpdvrTotalEstimatedBytes :: Lens' GooglePrivacyDlpV2Result (Maybe Int64)
gpdvrTotalEstimatedBytes
= lens _gpdvrTotalEstimatedBytes
(\ s a -> s{_gpdvrTotalEstimatedBytes = a})
. mapping _Coerce | 255 | gpdvrTotalEstimatedBytes :: Lens' GooglePrivacyDlpV2Result (Maybe Int64)
gpdvrTotalEstimatedBytes
= lens _gpdvrTotalEstimatedBytes
(\ s a -> s{_gpdvrTotalEstimatedBytes = a})
. mapping _Coerce | 206 | gpdvrTotalEstimatedBytes
= lens _gpdvrTotalEstimatedBytes
(\ s a -> s{_gpdvrTotalEstimatedBytes = a})
. mapping _Coerce | 133 | true | true | 0 | 10 | 43 | 55 | 28 | 27 | null | null |
ekmett/ghc | compiler/basicTypes/Avail.hs | bsd-3-clause | availName (AvailTC n _) = n | 27 | availName (AvailTC n _) = n | 27 | availName (AvailTC n _) = n | 27 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
ThoughtWorksInc/DeepDarkFantasy | DDF/Double.hs | apache-2.0 | doubleDivide2 = app2 doubleDivide | 33 | doubleDivide2 = app2 doubleDivide | 33 | doubleDivide2 = app2 doubleDivide | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
intolerable/league-of-legends | src/League/Types/Constants.hs | bsd-3-clause | toMapID _ = undefined | 21 | toMapID _ = undefined | 21 | toMapID _ = undefined | 21 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
apoluektov/domino | src/Domino/Read.hs | mit | readFirst :: IO Player
readFirst = readUserInput (parser player) "Incorrect player id, try again:" | 98 | readFirst :: IO Player
readFirst = readUserInput (parser player) "Incorrect player id, try again:" | 98 | readFirst = readUserInput (parser player) "Incorrect player id, try again:" | 75 | false | true | 0 | 7 | 13 | 25 | 12 | 13 | null | null |
allanderek/ipclib | Language/Pepa/Compile/Model.hs | gpl-2.0 | modelToMotions (CompArray comp _size []) =
-- This does indeed look wrong, however see above that we multiple
-- the rate by the number of component in that state.
modelToMotions comp | 196 | modelToMotions (CompArray comp _size []) =
-- This does indeed look wrong, however see above that we multiple
-- the rate by the number of component in that state.
modelToMotions comp | 196 | modelToMotions (CompArray comp _size []) =
-- This does indeed look wrong, however see above that we multiple
-- the rate by the number of component in that state.
modelToMotions comp | 196 | false | false | 0 | 8 | 43 | 26 | 13 | 13 | null | null |
GaloisInc/delicious | Network/Delicious/User.hs | bsd-3-clause | getAllHashes :: DM [Post]
getAllHashes = getPosts' "getAll" "posts/all?hashes" nullFilter | 89 | getAllHashes :: DM [Post]
getAllHashes = getPosts' "getAll" "posts/all?hashes" nullFilter | 89 | getAllHashes = getPosts' "getAll" "posts/all?hashes" nullFilter | 63 | false | true | 0 | 6 | 9 | 24 | 12 | 12 | null | null |
flocc-net/flocc | v0.1/Compiler/Back/GraphBuilder.hs | apache-2.0 | mapGraphM :: Monad m => (Node -> m Node) -> Graph -> m Graph
mapGraphM f g = do
let nodes = IM.elems $ graphNodes g
nodes' <- mapM f nodes
let nodes'' = IM.fromList $ map (\n -> (nodeId n, n)) nodes'
return $ g { graphNodes=nodes'' }
-- |encapFun node ty. Encapsulates n in a FunNd subgraph, and adds types of ... | 353 | mapGraphM :: Monad m => (Node -> m Node) -> Graph -> m Graph
mapGraphM f g = do
let nodes = IM.elems $ graphNodes g
nodes' <- mapM f nodes
let nodes'' = IM.fromList $ map (\n -> (nodeId n, n)) nodes'
return $ g { graphNodes=nodes'' }
-- |encapFun node ty. Encapsulates n in a FunNd subgraph, and adds types of ... | 353 | mapGraphM f g = do
let nodes = IM.elems $ graphNodes g
nodes' <- mapM f nodes
let nodes'' = IM.fromList $ map (\n -> (nodeId n, n)) nodes'
return $ g { graphNodes=nodes'' }
-- |encapFun node ty. Encapsulates n in a FunNd subgraph, and adds types of new
-- |expressions to the state. | 292 | false | true | 0 | 15 | 78 | 128 | 63 | 65 | null | null |
sdiehl/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | int32PrimTyConName = mkPrimTc (fsLit "Int32#") int32PrimTyConKey int32PrimTyCon | 90 | int32PrimTyConName = mkPrimTc (fsLit "Int32#") int32PrimTyConKey int32PrimTyCon | 90 | int32PrimTyConName = mkPrimTc (fsLit "Int32#") int32PrimTyConKey int32PrimTyCon | 90 | false | false | 1 | 7 | 17 | 23 | 9 | 14 | null | null |
elkorn/d20 | test/Properties/Random.hs | mit | tests = $testGroupGenerator | 27 | tests = $testGroupGenerator | 27 | tests = $testGroupGenerator | 27 | false | false | 0 | 6 | 2 | 11 | 4 | 7 | null | null |
roberth/uu-helium | test/typeerrors/Examples/NoInstance.hs | gpl-3.0 | main = show A | 13 | main = show A | 13 | main = show A | 13 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
higgsd/euler | hs/Euler.hs | bsd-2-clause | primeFactorsP (p:ps) n
| p > intSqrt n = [n]
| m == 0 = p : primeFactorsP (p:ps) d
| otherwise = primeFactorsP ps n
where (d,m) = n `divMod` p | 158 | primeFactorsP (p:ps) n
| p > intSqrt n = [n]
| m == 0 = p : primeFactorsP (p:ps) d
| otherwise = primeFactorsP ps n
where (d,m) = n `divMod` p | 158 | primeFactorsP (p:ps) n
| p > intSqrt n = [n]
| m == 0 = p : primeFactorsP (p:ps) d
| otherwise = primeFactorsP ps n
where (d,m) = n `divMod` p | 158 | false | false | 2 | 9 | 47 | 96 | 48 | 48 | null | null |
5outh/textlunky | src/Types/Jewel.hs | mit | randJewel :: (MonadRandom m) => m Jewel
randJewel = fromUniverse | 64 | randJewel :: (MonadRandom m) => m Jewel
randJewel = fromUniverse | 64 | randJewel = fromUniverse | 24 | false | true | 0 | 7 | 9 | 29 | 13 | 16 | null | null |
phi16/Lambia | src/Lambia/Index.hs | gpl-3.0 | pass :: Status s -> (Save s, Save s)
pass (Status a b) = (a,b) | 62 | pass :: Status s -> (Save s, Save s)
pass (Status a b) = (a,b) | 62 | pass (Status a b) = (a,b) | 25 | false | true | 0 | 9 | 14 | 53 | 25 | 28 | null | null |
ankhers/haskell-ide-engine | hie-eg-plugin-async/Haskell/Ide/ExamplePluginAsync.hs | bsd-3-clause | longRunningCmdSync :: WorkerCmd -> CommandFunc T.Text
longRunningCmdSync cmd = CmdSync $ \_ctx _req -> do
SubProcess cin cout _tid <- ensureProcessRunning
liftIO $ atomically $ writeTChan cin cmd
res <- liftIO $ atomically $ readTChan cout
return (IdeResponseOk $ "res=" <> res)
-- -----------------------------... | 564 | longRunningCmdSync :: WorkerCmd -> CommandFunc T.Text
longRunningCmdSync cmd = CmdSync $ \_ctx _req -> do
SubProcess cin cout _tid <- ensureProcessRunning
liftIO $ atomically $ writeTChan cin cmd
res <- liftIO $ atomically $ readTChan cout
return (IdeResponseOk $ "res=" <> res)
-- -----------------------------... | 564 | longRunningCmdSync cmd = CmdSync $ \_ctx _req -> do
SubProcess cin cout _tid <- ensureProcessRunning
liftIO $ atomically $ writeTChan cin cmd
res <- liftIO $ atomically $ readTChan cout
return (IdeResponseOk $ "res=" <> res)
-- ---------------------------------------------------------------------
-- | If ther... | 510 | false | true | 0 | 12 | 92 | 103 | 50 | 53 | null | null |
janrain/heist | src/Text/Templating/Heist/Internal.hs | bsd-3-clause | toInternalTemplate :: Monad m => Template -> TemplateMonad m InternalTemplate
toInternalTemplate t = do
dts <- getsTS _doctypes
return $ InternalTemplate {
_itDoctype = listToMaybe dts,
_itNodes = t
}
------------------------------------------------------------------------------
-- | Rende... | 382 | toInternalTemplate :: Monad m => Template -> TemplateMonad m InternalTemplate
toInternalTemplate t = do
dts <- getsTS _doctypes
return $ InternalTemplate {
_itDoctype = listToMaybe dts,
_itNodes = t
}
------------------------------------------------------------------------------
-- | Rende... | 382 | toInternalTemplate t = do
dts <- getsTS _doctypes
return $ InternalTemplate {
_itDoctype = listToMaybe dts,
_itNodes = t
}
------------------------------------------------------------------------------
-- | Renders an internal template by prepending the appropriate doctype. | 304 | false | true | 0 | 11 | 71 | 71 | 34 | 37 | null | null |
pparkkin/eta | compiler/ETA/Main/SysTools.hs | bsd-3-clause | neededLinkArgs UnknownLD = [] | 33 | neededLinkArgs UnknownLD = [] | 33 | neededLinkArgs UnknownLD = [] | 33 | false | false | 0 | 5 | 7 | 11 | 5 | 6 | null | null |
siddhanathan/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | unpackCString_RDR = nameRdrName unpackCStringName | 55 | unpackCString_RDR = nameRdrName unpackCStringName | 55 | unpackCString_RDR = nameRdrName unpackCStringName | 55 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSQL_FLOAT :: Int
wxSQL_FLOAT = 6 | 34 | wxSQL_FLOAT :: Int
wxSQL_FLOAT = 6 | 34 | wxSQL_FLOAT = 6 | 15 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
raptros/chatless-hs | src/Api/Queries/Topic.hs | bsd-3-clause | topicMembersQuery :: (Functor m, Gh.PersistBackend m) => Tp.TopicRef -> m [Tm.MemberPartial]
topicMembersQuery tr = fmap (uncurry Tm.MemberPartial) <$> Gh.project (Tm.MemberUserField, Tm.MemberModeField) (Tm.MemberTopicField Gh.==. tr) | 235 | topicMembersQuery :: (Functor m, Gh.PersistBackend m) => Tp.TopicRef -> m [Tm.MemberPartial]
topicMembersQuery tr = fmap (uncurry Tm.MemberPartial) <$> Gh.project (Tm.MemberUserField, Tm.MemberModeField) (Tm.MemberTopicField Gh.==. tr) | 235 | topicMembersQuery tr = fmap (uncurry Tm.MemberPartial) <$> Gh.project (Tm.MemberUserField, Tm.MemberModeField) (Tm.MemberTopicField Gh.==. tr) | 142 | false | true | 0 | 9 | 23 | 88 | 45 | 43 | null | null |
kazu-yamamoto/wai | wai-extra/test/WaiExtraSpec.hs | mit | caseAutohead :: Assertion
caseAutohead = flip runSession autoheadApp $ do
sres1 <- request defaultRequest
{ requestMethod = "GET"
}
assertHeader "Foo" "Bar" sres1
assertBody "body" sres1
sres2 <- request defaultRequest
{ requestMethod = "HEAD"
... | 385 | caseAutohead :: Assertion
caseAutohead = flip runSession autoheadApp $ do
sres1 <- request defaultRequest
{ requestMethod = "GET"
}
assertHeader "Foo" "Bar" sres1
assertBody "body" sres1
sres2 <- request defaultRequest
{ requestMethod = "HEAD"
... | 385 | caseAutohead = flip runSession autoheadApp $ do
sres1 <- request defaultRequest
{ requestMethod = "GET"
}
assertHeader "Foo" "Bar" sres1
assertBody "body" sres1
sres2 <- request defaultRequest
{ requestMethod = "HEAD"
}
assertHeader "F... | 359 | false | true | 0 | 11 | 130 | 92 | 42 | 50 | null | null |
jeremyjh/free-agent | core/src/FreeAgent/Core/Protocol/Peer.hs | bsd-3-clause | -- | Returns the number of Peer Agent processes this node is connected to
queryPeerCount :: MonadAgent agent => agent (Either CallFail Int)
queryPeerCount = callServ QueryPeerCount | 180 | queryPeerCount :: MonadAgent agent => agent (Either CallFail Int)
queryPeerCount = callServ QueryPeerCount | 106 | queryPeerCount = callServ QueryPeerCount | 40 | true | true | 0 | 9 | 26 | 38 | 17 | 21 | null | null |
phischu/fragnix | tests/packages/scotty/Data.DList.hs | bsd-3-clause | -- | /O(n)/. Return the tail of the dlist
tail :: DList a -> DList a
tail = list (error "Data.DList.tail: empty dlist") (flip const) | 132 | tail :: DList a -> DList a
tail = list (error "Data.DList.tail: empty dlist") (flip const) | 90 | tail = list (error "Data.DList.tail: empty dlist") (flip const) | 63 | true | true | 0 | 7 | 24 | 45 | 20 | 25 | null | null |
chwthewke/hackup | src/Hackup/Config/Parser.hs | mit | parseConfig :: ByteString -> Either String Config
parseConfig = over _Failure (fold . intersperse "; ") . view isoAccValidationEither . configFromJSON <=< parseValue | 165 | parseConfig :: ByteString -> Either String Config
parseConfig = over _Failure (fold . intersperse "; ") . view isoAccValidationEither . configFromJSON <=< parseValue | 165 | parseConfig = over _Failure (fold . intersperse "; ") . view isoAccValidationEither . configFromJSON <=< parseValue | 115 | false | true | 0 | 11 | 22 | 50 | 24 | 26 | null | null |
FranklinChen/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | defined (PInterface _ _ _ _ n _ _ _ _ ms cn _) = n : (map fst (maybeToList cn) ++ concatMap defined ms) | 110 | defined (PInterface _ _ _ _ n _ _ _ _ ms cn _) = n : (map fst (maybeToList cn) ++ concatMap defined ms) | 110 | defined (PInterface _ _ _ _ n _ _ _ _ ms cn _) = n : (map fst (maybeToList cn) ++ concatMap defined ms) | 110 | false | false | 0 | 10 | 31 | 64 | 31 | 33 | null | null |
nkpart/score-writer | src/Score/Parser.hs | bsd-3-clause | braced :: TokenParsing f => String -> f b -> f b
braced n inner = symbol n *> (T.braces inner) | 94 | braced :: TokenParsing f => String -> f b -> f b
braced n inner = symbol n *> (T.braces inner) | 94 | braced n inner = symbol n *> (T.braces inner) | 45 | false | true | 0 | 9 | 20 | 57 | 25 | 32 | null | null |
rickerbh/GenerativeArtHaskell | GenerativeArt.hsproj/GenerativeArtC2.hs | mit | img2 = renderDrawing width height (PixelRGBA8 180 180 180 255) $
concentricCircles halfWidth halfHeight 10 | 115 | img2 = renderDrawing width height (PixelRGBA8 180 180 180 255) $
concentricCircles halfWidth halfHeight 10 | 115 | img2 = renderDrawing width height (PixelRGBA8 180 180 180 255) $
concentricCircles halfWidth halfHeight 10 | 115 | false | false | 1 | 7 | 23 | 43 | 17 | 26 | null | null |
jtojnar/haste-compiler | libraries/ghc-7.10/ghc-prim/GHC/PrimopWrappers.hs | bsd-3-clause | writeInt64OffAddr# :: Addr# -> Int# -> Int64# -> State# s -> State# s
writeInt64OffAddr# a1 a2 a3 a4 = (GHC.Prim.writeInt64OffAddr#) a1 a2 a3 a4 | 144 | writeInt64OffAddr# :: Addr# -> Int# -> Int64# -> State# s -> State# s
writeInt64OffAddr# a1 a2 a3 a4 = (GHC.Prim.writeInt64OffAddr#) a1 a2 a3 a4 | 144 | writeInt64OffAddr# a1 a2 a3 a4 = (GHC.Prim.writeInt64OffAddr#) a1 a2 a3 a4 | 74 | false | true | 0 | 9 | 23 | 57 | 28 | 29 | null | null |
spechub/Hets | CSL/Keywords.hs | gpl-2.0 | doS :: String
doS = "do" | 24 | doS :: String
doS = "do" | 24 | doS = "do" | 10 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
sdiehl/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcDeepSplitSigmaTy_maybe
:: TcSigmaType -> Maybe ([TcType], [TyVar], ThetaType, TcSigmaType)
-- Looks for a *non-trivial* quantified type, under zero or more function arrows
-- By "non-trivial" we mean either tyvars or constraints are non-empty
tcDeepSplitSigmaTy_maybe ty
| Just (arg_ty, res_ty) <- tcSpl... | 583 | tcDeepSplitSigmaTy_maybe
:: TcSigmaType -> Maybe ([TcType], [TyVar], ThetaType, TcSigmaType)
tcDeepSplitSigmaTy_maybe ty
| Just (arg_ty, res_ty) <- tcSplitFunTy_maybe ty
, Just (arg_tys, tvs, theta, rho) <- tcDeepSplitSigmaTy_maybe res_ty
= Just (arg_ty:arg_tys, tvs, theta, rho)
| (tvs, theta, rho)... | 430 | tcDeepSplitSigmaTy_maybe ty
| Just (arg_ty, res_ty) <- tcSplitFunTy_maybe ty
, Just (arg_tys, tvs, theta, rho) <- tcDeepSplitSigmaTy_maybe res_ty
= Just (arg_ty:arg_tys, tvs, theta, rho)
| (tvs, theta, rho) <- tcSplitSigmaTy ty
, not (null tvs && null theta)
= Just ([], tvs, theta, rho)
| othe... | 335 | true | true | 1 | 11 | 109 | 183 | 97 | 86 | null | null |
iljakuklic/eel-proto | src/Backend/CodeGen.hs | bsd-3-clause | -- | Modify the code generated so far
mapCode f = modify (\ste -> ste { cgOutput = f $ cgOutput ste}) | 101 | mapCode f = modify (\ste -> ste { cgOutput = f $ cgOutput ste}) | 63 | mapCode f = modify (\ste -> ste { cgOutput = f $ cgOutput ste}) | 63 | true | false | 0 | 11 | 21 | 36 | 19 | 17 | null | null |
abhin4v/hask-irc | hask-irc-handlers/Network/IRC/Handlers/NickTracker.hs | apache-2.0 | getByCanonicalNickQ :: CanonicalNick -> Query NickTracking [NickTrack]
getByCanonicalNickQ canonicalNick = do
NickTracking { .. } <- ask
return . IS.toList $ nickTracking @= canonicalNick | 191 | getByCanonicalNickQ :: CanonicalNick -> Query NickTracking [NickTrack]
getByCanonicalNickQ canonicalNick = do
NickTracking { .. } <- ask
return . IS.toList $ nickTracking @= canonicalNick | 191 | getByCanonicalNickQ canonicalNick = do
NickTracking { .. } <- ask
return . IS.toList $ nickTracking @= canonicalNick | 120 | false | true | 0 | 10 | 27 | 60 | 28 | 32 | null | null |
jaccokrijnen/leksah | src/IDE/Session.hs | gpl-2.0 | asPaneState s | isJust (cast s :: Maybe WorkspaceState) = WorkspaceSt (fromJust $ cast s) | 93 | asPaneState s | isJust (cast s :: Maybe WorkspaceState) = WorkspaceSt (fromJust $ cast s) | 93 | asPaneState s | isJust (cast s :: Maybe WorkspaceState) = WorkspaceSt (fromJust $ cast s) | 93 | false | false | 0 | 10 | 18 | 43 | 19 | 24 | null | null |
softwaremechanic/Miscellaneous | Haskell/19.hs | gpl-2.0 | withFile' :: FilePath -> IOMode -> (Handle -> IO a) -> IO a
withFile' path mode f = do
handle <- openFile path mode
result <- f handle
hClose handle
return result | 170 | withFile' :: FilePath -> IOMode -> (Handle -> IO a) -> IO a
withFile' path mode f = do
handle <- openFile path mode
result <- f handle
hClose handle
return result | 170 | withFile' path mode f = do
handle <- openFile path mode
result <- f handle
hClose handle
return result | 110 | false | true | 0 | 10 | 39 | 77 | 34 | 43 | null | null |
fosskers/nanq | lib/Data/Kanji.hs | gpl-3.0 | -- | How much of the Kanji found are learnt by the end of middle school?
--
-- > middleDen . levelDist :: [Kanji] -> Float
middleDen :: M.Map Level Float -> Float
middleDen m = M.foldl' (+) 0 . M.restrictKeys m $ S.fromList [ Three, Four .. ] | 242 | middleDen :: M.Map Level Float -> Float
middleDen m = M.foldl' (+) 0 . M.restrictKeys m $ S.fromList [ Three, Four .. ] | 119 | middleDen m = M.foldl' (+) 0 . M.restrictKeys m $ S.fromList [ Three, Four .. ] | 79 | true | true | 0 | 8 | 48 | 62 | 33 | 29 | null | null |
alexbiehl/postie | src/Network/Mail/Postie/Pipes.hs | bsd-3-clause | attoParser :: AT.Parser r -> Parser BS.ByteString IO (Maybe r)
attoParser p = do
result <- AT.parseWith draw' p ""
case result of
AT.Done t r -> do
unless (BS.null t) (unDraw t)
return (Just r)
_ -> return Nothing
where
draw' = fromMaybe "" <$> draw | 279 | attoParser :: AT.Parser r -> Parser BS.ByteString IO (Maybe r)
attoParser p = do
result <- AT.parseWith draw' p ""
case result of
AT.Done t r -> do
unless (BS.null t) (unDraw t)
return (Just r)
_ -> return Nothing
where
draw' = fromMaybe "" <$> draw | 279 | attoParser p = do
result <- AT.parseWith draw' p ""
case result of
AT.Done t r -> do
unless (BS.null t) (unDraw t)
return (Just r)
_ -> return Nothing
where
draw' = fromMaybe "" <$> draw | 216 | false | true | 3 | 15 | 76 | 141 | 61 | 80 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxHF_SEARCH :: Int
wxHF_SEARCH = 8 | 34 | wxHF_SEARCH :: Int
wxHF_SEARCH = 8 | 34 | wxHF_SEARCH = 8 | 15 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
dnaq/crypto-sodium | src/Crypto/Sodium/SecretBox/Xsalsa20Poly1305.hs | mit | boxZeroBytes :: Int
boxZeroBytes = fromIntegral c_crypto_secretbox_xsalsa20poly1305_boxzerobytes | 96 | boxZeroBytes :: Int
boxZeroBytes = fromIntegral c_crypto_secretbox_xsalsa20poly1305_boxzerobytes | 96 | boxZeroBytes = fromIntegral c_crypto_secretbox_xsalsa20poly1305_boxzerobytes | 76 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
mrehayden1/lji | src/LJI/Music/Notation.hs | bsd-3-clause | d = Natural D | 15 | d = Natural D | 15 | d = Natural D | 15 | false | false | 1 | 5 | 5 | 13 | 4 | 9 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/Module.hs | bsd-3-clause | elemModuleEnv :: Module -> ModuleEnv a -> Bool
elemModuleEnv m (ModuleEnv e) = Map.member (NDModule m) e | 104 | elemModuleEnv :: Module -> ModuleEnv a -> Bool
elemModuleEnv m (ModuleEnv e) = Map.member (NDModule m) e | 104 | elemModuleEnv m (ModuleEnv e) = Map.member (NDModule m) e | 57 | false | true | 0 | 7 | 16 | 46 | 22 | 24 | null | null |
PierreR/basic-prelude | test-is-a-prelude.hs | mit | readsPrec = P.readsPrec | 23 | readsPrec = P.readsPrec | 23 | readsPrec = P.readsPrec | 23 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
zmthy/snaplet-rest | src/Snap/Snaplet/Rest/Resource/Builder.hs | mit | ------------------------------------------------------------------------------
-- | Add a media representation for rendering and parsing.
addMedia :: Monad m => Media res m diff int -> ResourceBuilder res m id diff
addMedia media res = res
{ renderers = renderers res ++ renderers'
, parsers = parsers ... | 1,596 | addMedia :: Monad m => Media res m diff int -> ResourceBuilder res m id diff
addMedia media res = res
{ renderers = renderers res ++ renderers'
, parsers = parsers res ++ parsers'
, diffParsers = diffParsers res ++ diffParsers'
, listRenderers = listRenderers res ++ listRenderers'
, list... | 1,458 | addMedia media res = res
{ renderers = renderers res ++ renderers'
, parsers = parsers res ++ parsers'
, diffParsers = diffParsers res ++ diffParsers'
, listRenderers = listRenderers res ++ listRenderers'
, listParsers = listParsers res ++ listParsers'
}
where
renderers' = fr... | 1,381 | true | true | 4 | 18 | 384 | 456 | 222 | 234 | null | null |
fmapfmapfmap/amazonka | gen/src/Gen/AST/Data/Field.hs | mpl-2.0 | fieldMonoid :: Field -> Bool
fieldMonoid = elem DMonoid . derivingOf . view fieldAnn | 84 | fieldMonoid :: Field -> Bool
fieldMonoid = elem DMonoid . derivingOf . view fieldAnn | 84 | fieldMonoid = elem DMonoid . derivingOf . view fieldAnn | 55 | false | true | 0 | 7 | 13 | 35 | 15 | 20 | null | null |
flyrry/tictactoe | test/Test.hs | mit | -- do quick tests
quick :: Args
quick = Args {
replay = Nothing,
maxSuccess = 100,
maxDiscardRatio = 5,
maxSize = 100,
chatty = True
} | 192 | quick :: Args
quick = Args {
replay = Nothing,
maxSuccess = 100,
maxDiscardRatio = 5,
maxSize = 100,
chatty = True
} | 174 | quick = Args {
replay = Nothing,
maxSuccess = 100,
maxDiscardRatio = 5,
maxSize = 100,
chatty = True
} | 160 | true | true | 0 | 7 | 84 | 51 | 29 | 22 | null | null |
music-suite/music-score | src/Music/Score/Meta.hs | bsd-3-clause | -- JUNK
withSpan :: Score a -> Score (Span, a)
withSpan = mapTriples (\t d x -> (t >-> d,x)) | 93 | withSpan :: Score a -> Score (Span, a)
withSpan = mapTriples (\t d x -> (t >-> d,x)) | 84 | withSpan = mapTriples (\t d x -> (t >-> d,x)) | 45 | true | true | 0 | 9 | 20 | 53 | 29 | 24 | null | null |
mrordinaire/data-analysis | src/DataAnalysis02.hs | bsd-3-clause | convertCSVFileToSQL :: FilePath -> FilePath -> String -> [String] -> IO ()
convertCSVFileToSQL inFileName outFileName tableName fields = do
input <- readFile inFileName
let records = parseCSV inFileName input
either handleCSVError convertTool records
where handleCSVError csv = putStrLn "This does not appear to ... | 402 | convertCSVFileToSQL :: FilePath -> FilePath -> String -> [String] -> IO ()
convertCSVFileToSQL inFileName outFileName tableName fields = do
input <- readFile inFileName
let records = parseCSV inFileName input
either handleCSVError convertTool records
where handleCSVError csv = putStrLn "This does not appear to ... | 402 | convertCSVFileToSQL inFileName outFileName tableName fields = do
input <- readFile inFileName
let records = parseCSV inFileName input
either handleCSVError convertTool records
where handleCSVError csv = putStrLn "This does not appear to be a CSV file."
convertTool = convertCSVToSQL tableName outFileName... | 327 | false | true | 1 | 10 | 68 | 103 | 48 | 55 | null | null |
haskell/haddock | haddock-api/src/Haddock/Backends/Xhtml.hs | bsd-2-clause | processDecl False = Just . divTopDecl | 37 | processDecl False = Just . divTopDecl | 37 | processDecl False = Just . divTopDecl | 37 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
mcmaniac/ghc | compiler/cmm/PprC.hs | bsd-3-clause | machRepHintCType rep _other = machRepCType rep | 50 | machRepHintCType rep _other = machRepCType rep | 50 | machRepHintCType rep _other = machRepCType rep | 50 | false | false | 0 | 5 | 9 | 14 | 6 | 8 | null | null |
brodyberg/Notes | ProjectRosalind.hsproj/LearnHaskell/lib/HaskellBook/Arith4.hs | mit | roundTrip :: (Show a, Read a) => a -> a
roundTrip a = read (show a) | 67 | roundTrip :: (Show a, Read a) => a -> a
roundTrip a = read (show a) | 67 | roundTrip a = read (show a) | 27 | false | true | 0 | 7 | 15 | 42 | 21 | 21 | null | null |
burz/Feval | FVL/Eval.hs | mit | toCons :: [RVal] -> RVal
toCons [] = REmpty | 43 | toCons :: [RVal] -> RVal
toCons [] = REmpty | 43 | toCons [] = REmpty | 18 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
fmapfmapfmap/amazonka | amazonka-elasticache/gen/Network/AWS/ElastiCache/Types/Product.hs | mpl-2.0 | -- | Provides an identifier to allow retrieval of paginated results.
edMarker :: Lens' EngineDefaults (Maybe Text)
edMarker = lens _edMarker (\ s a -> s{_edMarker = a}) | 168 | edMarker :: Lens' EngineDefaults (Maybe Text)
edMarker = lens _edMarker (\ s a -> s{_edMarker = a}) | 99 | edMarker = lens _edMarker (\ s a -> s{_edMarker = a}) | 53 | true | true | 0 | 9 | 27 | 46 | 25 | 21 | null | null |
dalaing/type-systems | src/Fragment/If/Rules/Type/Infer/Offline.hs | bsd-3-clause | ifInferTypeRules :: IfInferTypeContext e w s r m ki ty pt tm a
=> InferTypeInput e w s r m (UnifyT ki ty a m) ki ty pt tm a
ifInferTypeRules =
let
ih = IfHelper expectType expectTypeEq
in
inferTypeInput ih | 230 | ifInferTypeRules :: IfInferTypeContext e w s r m ki ty pt tm a
=> InferTypeInput e w s r m (UnifyT ki ty a m) ki ty pt tm a
ifInferTypeRules =
let
ih = IfHelper expectType expectTypeEq
in
inferTypeInput ih | 230 | ifInferTypeRules =
let
ih = IfHelper expectType expectTypeEq
in
inferTypeInput ih | 93 | false | true | 0 | 9 | 65 | 90 | 43 | 47 | null | null |
MaxGabriel/YesodScreencast | Application.hs | cc0-1.0 | -- | This function allocates resources (such as a database connection pool),
-- performs initialization and return a foundation datatype value. This is also
-- the place to put your migrate statements to have automatic database
-- migrations handled by Yesod.
makeFoundation :: AppSettings -> IO App
makeFoundation appSe... | 1,737 | makeFoundation :: AppSettings -> IO App
makeFoundation appSettings = do
-- Some basic initializations: HTTP connection manager, logger, and static
-- subsite.
appHttpManager <- newManager
appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger
appStatic <-
(if appMutableStatic app... | 1,477 | makeFoundation appSettings = do
-- Some basic initializations: HTTP connection manager, logger, and static
-- subsite.
appHttpManager <- newManager
appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger
appStatic <-
(if appMutableStatic appSettings then staticDevel else static)
... | 1,437 | true | true | 0 | 13 | 349 | 205 | 103 | 102 | null | null |
meditans/hyper-relation | src/Data/HyperRelation/Internal/Proxy.hs | bsd-3-clause | tenth :: Proxy (S (S (S (S (S (S (S (S (S Z)))))))))
tenth = Proxy | 66 | tenth :: Proxy (S (S (S (S (S (S (S (S (S Z)))))))))
tenth = Proxy | 66 | tenth = Proxy | 13 | false | true | 0 | 23 | 15 | 68 | 34 | 34 | null | null |
sdiehl/ghc | compiler/utils/Outputable.hs | bsd-3-clause | larrowt = unicodeSyntax (char '⤙') (docToSDoc $ Pretty.text "-<") | 68 | larrowt = unicodeSyntax (char '⤙') (docToSDoc $ Pretty.text "-<") | 68 | larrowt = unicodeSyntax (char '⤙') (docToSDoc $ Pretty.text "-<") | 68 | false | false | 0 | 9 | 11 | 29 | 14 | 15 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | The static routes associated with the VPN connection.
vcRoutes :: Lens' VpnConnection [VpnStaticRoute]
vcRoutes = lens _vcRoutes (\s a -> s { _vcRoutes = a }) . _List | 171 | vcRoutes :: Lens' VpnConnection [VpnStaticRoute]
vcRoutes = lens _vcRoutes (\s a -> s { _vcRoutes = a }) . _List | 112 | vcRoutes = lens _vcRoutes (\s a -> s { _vcRoutes = a }) . _List | 63 | true | true | 1 | 9 | 29 | 53 | 26 | 27 | null | null |
agocorona/MFlow | pagemenu.hs | bsd-3-clause | leftWidget= "I'm the left widget" ++> noWidget | 47 | leftWidget= "I'm the left widget" ++> noWidget | 47 | leftWidget= "I'm the left widget" ++> noWidget | 47 | false | false | 0 | 5 | 7 | 10 | 5 | 5 | null | null |
alsonkemp/hdbc | Database/HDBC/Utils.hs | lgpl-2.1 | fetchAllRowsAL' :: Statement -> IO [[(String, SqlValue)]]
fetchAllRowsAL' sth =
do res <- fetchAllRowsAL sth
evalAll res
return res
{- | Like 'fetchAllRowsAL', but return a list of Maps instead of a list of
association lists. -} | 247 | fetchAllRowsAL' :: Statement -> IO [[(String, SqlValue)]]
fetchAllRowsAL' sth =
do res <- fetchAllRowsAL sth
evalAll res
return res
{- | Like 'fetchAllRowsAL', but return a list of Maps instead of a list of
association lists. -} | 247 | fetchAllRowsAL' sth =
do res <- fetchAllRowsAL sth
evalAll res
return res
{- | Like 'fetchAllRowsAL', but return a list of Maps instead of a list of
association lists. -} | 189 | false | true | 0 | 10 | 55 | 61 | 28 | 33 | null | null |
jfranklin9000/urbit | pkg/hs/urbit-atom/test/Main.hs | mit | -- Fast and Reference Implementations are the Same -----------------------------
prop_fast_words_atom_correct :: Vector Word -> Bool
prop_fast_words_atom_correct x = F.wordsAtom x == S.wordsAtom x | 197 | prop_fast_words_atom_correct :: Vector Word -> Bool
prop_fast_words_atom_correct x = F.wordsAtom x == S.wordsAtom x | 115 | prop_fast_words_atom_correct x = F.wordsAtom x == S.wordsAtom x | 63 | true | true | 0 | 7 | 23 | 36 | 17 | 19 | null | null |
christiaanb/ghc | compiler/main/GhcMake.hs | bsd-3-clause | label_self :: String -> IO ()
label_self thread_name = do
self_tid <- CC.myThreadId
CC.labelThread self_tid thread_name
-- -----------------------------------------------------------------------------
-- Loading the program
-- | Perform a dependency analysis starting from the current targets
-- and update the... | 801 | label_self :: String -> IO ()
label_self thread_name = do
self_tid <- CC.myThreadId
CC.labelThread self_tid thread_name
-- -----------------------------------------------------------------------------
-- Loading the program
-- | Perform a dependency analysis starting from the current targets
-- and update the... | 801 | label_self thread_name = do
self_tid <- CC.myThreadId
CC.labelThread self_tid thread_name
-- -----------------------------------------------------------------------------
-- Loading the program
-- | Perform a dependency analysis starting from the current targets
-- and update the session with the new module g... | 771 | false | true | 0 | 8 | 125 | 56 | 33 | 23 | null | null |
olsner/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | dataFamilyD :: Name -> [TyVarBndr] -> Maybe Kind -> DecQ
dataFamilyD tc tvs kind
= return $ DataFamilyD tc tvs kind | 119 | dataFamilyD :: Name -> [TyVarBndr] -> Maybe Kind -> DecQ
dataFamilyD tc tvs kind
= return $ DataFamilyD tc tvs kind | 119 | dataFamilyD tc tvs kind
= return $ DataFamilyD tc tvs kind | 62 | false | true | 0 | 8 | 24 | 47 | 23 | 24 | null | null |
harendra-kumar/asyncly | src/Streamly/Internal/Data/Fold.hs | bsd-3-clause | index :: Monad m => Int -> Fold m a (Maybe a)
index = genericIndex | 66 | index :: Monad m => Int -> Fold m a (Maybe a)
index = genericIndex | 66 | index = genericIndex | 20 | false | true | 0 | 10 | 14 | 41 | 18 | 23 | null | null |
aconbere/redis | Redis/Commands/Basic.hs | mit | -- PERSISTENCE
save :: Handle -> IO (Maybe RedisValue)
save h = command h $ inline h "SAVE" [] | 94 | save :: Handle -> IO (Maybe RedisValue)
save h = command h $ inline h "SAVE" [] | 79 | save h = command h $ inline h "SAVE" [] | 39 | true | true | 2 | 9 | 18 | 49 | 22 | 27 | null | null |
nobsun/hs-bcopl | src/Language/BCoPL/TypeLevel/MetaTheory/CompareNat.hs | bsd-3-clause | trans3 :: Nat' n1 -> Nat' n2 -> Nat' n3
-> LessThan3 n1 n2 -> LessThan3 n2 n3
-> LessThan3 n1 n3
trans3 = lemma3 | 126 | trans3 :: Nat' n1 -> Nat' n2 -> Nat' n3
-> LessThan3 n1 n2 -> LessThan3 n2 n3
-> LessThan3 n1 n3
trans3 = lemma3 | 126 | trans3 = lemma3 | 15 | false | true | 0 | 10 | 38 | 55 | 25 | 30 | null | null |
pparkkin/Hagl | Hagl/Examples/Beauty.hs | bsd-3-clause | guess23 :: Int -> Beauty
guess23 np = Beauty np 100 (2/3) | 57 | guess23 :: Int -> Beauty
guess23 np = Beauty np 100 (2/3) | 57 | guess23 np = Beauty np 100 (2/3) | 32 | false | true | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
isomorphism/csound-expression | src/Csound/Air/Misc.hs | bsd-3-clause | rndCps amt x = rndVal x (amt / 10) x | 36 | rndCps amt x = rndVal x (amt / 10) x | 36 | rndCps amt x = rndVal x (amt / 10) x | 36 | false | false | 0 | 7 | 9 | 25 | 12 | 13 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/UserRolePermissions/List.hs | mpl-2.0 | -- | Select only user role permissions with these IDs.
urplIds :: Lens' UserRolePermissionsList [Int64]
urplIds
= lens _urplIds (\ s a -> s{_urplIds = a}) . _Default
. _Coerce | 183 | urplIds :: Lens' UserRolePermissionsList [Int64]
urplIds
= lens _urplIds (\ s a -> s{_urplIds = a}) . _Default
. _Coerce | 128 | urplIds
= lens _urplIds (\ s a -> s{_urplIds = a}) . _Default
. _Coerce | 79 | true | true | 2 | 8 | 37 | 60 | 29 | 31 | null | null |
ekohl/ganeti | htools/Ganeti/HTools/Cluster.hs | gpl-2.0 | tieredSpecMap :: [Instance.Instance]
-> [String]
tieredSpecMap trl_ixes =
let fin_trl_ixes = reverse trl_ixes
ix_byspec = groupBy ((==) `on` Instance.specOf) fin_trl_ixes
spec_map = map (\ixs -> (Instance.specOf $ head ixs, length ixs))
ix_byspec
in map (\(spec,... | 440 | tieredSpecMap :: [Instance.Instance]
-> [String]
tieredSpecMap trl_ixes =
let fin_trl_ixes = reverse trl_ixes
ix_byspec = groupBy ((==) `on` Instance.specOf) fin_trl_ixes
spec_map = map (\ixs -> (Instance.specOf $ head ixs, length ixs))
ix_byspec
in map (\(spec,... | 440 | tieredSpecMap trl_ixes =
let fin_trl_ixes = reverse trl_ixes
ix_byspec = groupBy ((==) `on` Instance.specOf) fin_trl_ixes
spec_map = map (\ixs -> (Instance.specOf $ head ixs, length ixs))
ix_byspec
in map (\(spec, cnt) -> printf "%d,%d,%d=%d" (rspecMem spec)
... | 377 | false | true | 0 | 14 | 133 | 153 | 79 | 74 | null | null |
brendanhay/gogol | gogol-datastore/gen/Network/Google/Datastore/Types/Product.hs | mpl-2.0 | -- | Output only. The resource ID of the index.
gdaviIndexId :: Lens' GoogleDatastoreAdminV1Index (Maybe Text)
gdaviIndexId
= lens _gdaviIndexId (\ s a -> s{_gdaviIndexId = a}) | 178 | gdaviIndexId :: Lens' GoogleDatastoreAdminV1Index (Maybe Text)
gdaviIndexId
= lens _gdaviIndexId (\ s a -> s{_gdaviIndexId = a}) | 130 | gdaviIndexId
= lens _gdaviIndexId (\ s a -> s{_gdaviIndexId = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
jtapolczai/FileSync | System/IO/FileSync/CLI.hs | apache-2.0 | -- |Clears the conflicts and the last dirs fields of the app state.
clearConflicts :: StateT AppState IO ()
clearConflicts = modify (\s -> s{_appStateConflicts = [], _appStateLastDirs = Nothing}) | 195 | clearConflicts :: StateT AppState IO ()
clearConflicts = modify (\s -> s{_appStateConflicts = [], _appStateLastDirs = Nothing}) | 127 | clearConflicts = modify (\s -> s{_appStateConflicts = [], _appStateLastDirs = Nothing}) | 87 | true | true | 0 | 10 | 29 | 48 | 27 | 21 | null | null |
kongra/rete | AI/Rete/Print.hs | bsd-3-clause | stateToString :: Switch -> ReteState -> String
stateToString switch state = eval state $ toString boundless switch Rete | 119 | stateToString :: Switch -> ReteState -> String
stateToString switch state = eval state $ toString boundless switch Rete | 119 | stateToString switch state = eval state $ toString boundless switch Rete | 72 | false | true | 0 | 6 | 17 | 38 | 18 | 20 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxID_COPY :: Int
wxID_COPY = 5032 | 33 | wxID_COPY :: Int
wxID_COPY = 5032 | 33 | wxID_COPY = 5032 | 16 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
josefs/sbv | SBVTestSuite/TestSuite/Puzzles/DogCatMouse.hs | bsd-3-clause | -- Test suite
tests :: TestTree
tests =
testGroup "Puzzles.DogCatMouse"
[ goldenVsStringShow "dogCatMouse" (allSat p)
]
where p = do [dog, cat, mouse] <- sIntegers ["dog", "cat", "mouse"]
solve [ dog .>= 1 -- at least one dog
, cat .>= 1... | 722 | tests :: TestTree
tests =
testGroup "Puzzles.DogCatMouse"
[ goldenVsStringShow "dogCatMouse" (allSat p)
]
where p = do [dog, cat, mouse] <- sIntegers ["dog", "cat", "mouse"]
solve [ dog .>= 1 -- at least one dog
, cat .>= 1 ... | 708 | tests =
testGroup "Puzzles.DogCatMouse"
[ goldenVsStringShow "dogCatMouse" (allSat p)
]
where p = do [dog, cat, mouse] <- sIntegers ["dog", "cat", "mouse"]
solve [ dog .>= 1 -- at least one dog
, cat .>= 1 ... | 690 | true | true | 1 | 15 | 346 | 152 | 78 | 74 | null | null |
ariep/psqueues | src/Data/IntPSQ/Internal.hs | bsd-3-clause | -- TODO (jaspervdj): More efficient implementations possible
------------------------------------------------------------------------------
-- Views
------------------------------------------------------------------------------
-- | /O(min(n,W))/ Insert a new key, priority and value into the queue. If the key
-- is ... | 888 | insertView :: Ord p => Int -> p -> v -> IntPSQ p v -> (Maybe (p, v), IntPSQ p v)
insertView k p x t0 = case deleteView k t0 of
Nothing -> (Nothing, unsafeInsertNew k p x t0)
Just (p', v', t) -> (Just (p', v'), unsafeInsertNew k p x t)
-- | /O(min(n,W))/ Delete a key and its priority and value fr... | 445 | insertView k p x t0 = case deleteView k t0 of
Nothing -> (Nothing, unsafeInsertNew k p x t0)
Just (p', v', t) -> (Just (p', v'), unsafeInsertNew k p x t)
-- | /O(min(n,W))/ Delete a key and its priority and value from the queue. If
-- the key was present, the associated priority and value are re... | 364 | true | true | 0 | 12 | 165 | 156 | 83 | 73 | null | null |
khanage/mongoweb | test/Test.hs | apache-2.0 | prop_sort4 xs ys =
not (null xs) ==>
not (null ys) ==>
(head (sort (xs ++ ys)) == min (minimum xs) (minimum ys))
where types = (xs :: [Int], ys :: [Int]) | 179 | prop_sort4 xs ys =
not (null xs) ==>
not (null ys) ==>
(head (sort (xs ++ ys)) == min (minimum xs) (minimum ys))
where types = (xs :: [Int], ys :: [Int]) | 179 | prop_sort4 xs ys =
not (null xs) ==>
not (null ys) ==>
(head (sort (xs ++ ys)) == min (minimum xs) (minimum ys))
where types = (xs :: [Int], ys :: [Int]) | 179 | false | false | 0 | 12 | 57 | 103 | 53 | 50 | null | null |
sdeframond/haskell-tracer | src/Tracer/Shapes.hs | mit | mkRay :: Point -> Direction -> Ray
mkRay p d = Ray p (normalize d) | 66 | mkRay :: Point -> Direction -> Ray
mkRay p d = Ray p (normalize d) | 66 | mkRay p d = Ray p (normalize d) | 31 | false | true | 0 | 7 | 14 | 39 | 18 | 21 | null | null |
apyrgio/snf-ganeti | test/hs/Test/Ganeti/Objects.hs | bsd-2-clause | genNodeGroup :: Gen NodeGroup
genNodeGroup = do
name <- genFQDN
members <- pure []
ndparams <- arbitrary
alloc_policy <- arbitrary
ipolicy <- arbitrary
diskparams <- pure (GenericContainer Map.empty)
num_networks <- choose (0, 3)
net_uuid_list <- vectorOf num_networks (arbitrary::Gen String)
nic_param... | 779 | genNodeGroup :: Gen NodeGroup
genNodeGroup = do
name <- genFQDN
members <- pure []
ndparams <- arbitrary
alloc_policy <- arbitrary
ipolicy <- arbitrary
diskparams <- pure (GenericContainer Map.empty)
num_networks <- choose (0, 3)
net_uuid_list <- vectorOf num_networks (arbitrary::Gen String)
nic_param... | 779 | genNodeGroup = do
name <- genFQDN
members <- pure []
ndparams <- arbitrary
alloc_policy <- arbitrary
ipolicy <- arbitrary
diskparams <- pure (GenericContainer Map.empty)
num_networks <- choose (0, 3)
net_uuid_list <- vectorOf num_networks (arbitrary::Gen String)
nic_param_list <- vectorOf num_networks... | 749 | false | true | 0 | 12 | 149 | 250 | 117 | 133 | null | null |
hrushikesh/ircbot | demo.hs | bsd-3-clause | checkConf :: BotConf -> IO ()
checkConf BotConf{..}
| null host = exitHelp "must specify --irc-server"
| null nick = exitHelp "must specify --nick"
| null (username user) = exitHelp "must specify --username"
| null (hostname user) = exitHelp "must specify --hostname"
| null (re... | 408 | checkConf :: BotConf -> IO ()
checkConf BotConf{..}
| null host = exitHelp "must specify --irc-server"
| null nick = exitHelp "must specify --nick"
| null (username user) = exitHelp "must specify --username"
| null (hostname user) = exitHelp "must specify --hostname"
| null (re... | 408 | checkConf BotConf{..}
| null host = exitHelp "must specify --irc-server"
| null nick = exitHelp "must specify --nick"
| null (username user) = exitHelp "must specify --username"
| null (hostname user) = exitHelp "must specify --hostname"
| null (realname user) = exitHelp "must ... | 378 | false | true | 2 | 10 | 112 | 135 | 60 | 75 | null | null |
ganeti/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | sshsSshRootKey :: String
sshsSshRootKey = "ssh_root_key" | 56 | sshsSshRootKey :: String
sshsSshRootKey = "ssh_root_key" | 56 | sshsSshRootKey = "ssh_root_key" | 31 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
girving/games | Util.hs | bsd-3-clause | spanJust f l@(x:r) = maybe ([],l) (\y -> first (y:) $ spanJust f r) $ f x | 73 | spanJust f l@(x:r) = maybe ([],l) (\y -> first (y:) $ spanJust f r) $ f x | 73 | spanJust f l@(x:r) = maybe ([],l) (\y -> first (y:) $ spanJust f r) $ f x | 73 | false | false | 0 | 11 | 16 | 65 | 34 | 31 | null | null |
supki/libstackexchange | src/Network/StackExchange/API.hs | mit | -- $badgeRecipientsByIds
-- >>> checkLengthM $ askSE (badgeRecipientsByIds [20] <> s <> k <> q)
-- True
-- | <https://api.stackexchange.com/docs/badge-recipients-by-ids>
badgeRecipientsByIds ∷ [Int] → Request a "badgeRecipientsByIds" [SE Badge]
badgeRecipientsByIds (T.intercalate ";" . map (toLazyText . decimal) → is)... | 423 | badgeRecipientsByIds ∷ [Int] → Request a "badgeRecipientsByIds" [SE Badge]
badgeRecipientsByIds (T.intercalate ";" . map (toLazyText . decimal) → is) =
path ("badges/" <> is <> "/recipients") <>
parse (attoparsec items ".badges/{ids}/recipients: ") | 252 | badgeRecipientsByIds (T.intercalate ";" . map (toLazyText . decimal) → is) =
path ("badges/" <> is <> "/recipients") <>
parse (attoparsec items ".badges/{ids}/recipients: ") | 177 | true | true | 0 | 11 | 56 | 93 | 48 | 45 | null | null |
dylex/range-set | src/Data/RangeSet/Internal.hs | mit | -- |Remove @(,y]@
trimRangeList :: (Ord a, Enum a) => a -> [(a, a)] -> [(a, a)]
trimRangeList y set@((u,v) : xs)
| y < u = set
| otherwise = trimRangeList' y v xs | 166 | trimRangeList :: (Ord a, Enum a) => a -> [(a, a)] -> [(a, a)]
trimRangeList y set@((u,v) : xs)
| y < u = set
| otherwise = trimRangeList' y v xs | 148 | trimRangeList y set@((u,v) : xs)
| y < u = set
| otherwise = trimRangeList' y v xs | 86 | true | true | 0 | 9 | 38 | 107 | 56 | 51 | null | null |
Yoginski/blog.yogin.ski | site.hs | bsd-3-clause | postListCtx :: [Item String] -> Context String
postListCtx posts =
listField "posts" postCtx (return posts) `mappend`
defaultContext | 136 | postListCtx :: [Item String] -> Context String
postListCtx posts =
listField "posts" postCtx (return posts) `mappend`
defaultContext | 136 | postListCtx posts =
listField "posts" postCtx (return posts) `mappend`
defaultContext | 89 | false | true | 0 | 8 | 20 | 46 | 23 | 23 | null | null |
keithodulaigh/Hets | Common/Keywords.hs | gpl-2.0 | excludingS :: String
excludingS = "excluding" | 45 | excludingS :: String
excludingS = "excluding" | 45 | excludingS = "excluding" | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
NicolasDP/hs-packer | Data/Packer.hs | bsd-2-clause | -- | Run packing with a buffer created internally with a monadic action and return the bytestring
runPackingRes :: ByteArray bytes => Int -> Packing a -> (a, bytes)
runPackingRes sz action = unsafeDoIO $ runPackingIO sz action | 226 | runPackingRes :: ByteArray bytes => Int -> Packing a -> (a, bytes)
runPackingRes sz action = unsafeDoIO $ runPackingIO sz action | 128 | runPackingRes sz action = unsafeDoIO $ runPackingIO sz action | 61 | true | true | 0 | 8 | 37 | 50 | 25 | 25 | null | null |
ulricha/dsh | src/Database/DSH/CL/Opt/ProjectionPullup.hs | bsd-3-clause | inlineJoinPredLeftT :: Expr -> Ident -> JoinPredicate ScalarExpr -> TransformC CL (JoinPredicate ScalarExpr)
inlineJoinPredLeftT e x joinPred = do
-- Extract all left join expressions and turn them into regular expressions
predInputName <- freshNameT []
let leftPreds = fmap (fromScalarExpr predInputName . j... | 1,283 | inlineJoinPredLeftT :: Expr -> Ident -> JoinPredicate ScalarExpr -> TransformC CL (JoinPredicate ScalarExpr)
inlineJoinPredLeftT e x joinPred = do
-- Extract all left join expressions and turn them into regular expressions
predInputName <- freshNameT []
let leftPreds = fmap (fromScalarExpr predInputName . j... | 1,283 | inlineJoinPredLeftT e x joinPred = do
-- Extract all left join expressions and turn them into regular expressions
predInputName <- freshNameT []
let leftPreds = fmap (fromScalarExpr predInputName . jcLeft) $ jpConjuncts joinPred
-- Inline the head expression into the join predicate
scopeNames <- in... | 1,174 | false | true | 0 | 14 | 249 | 211 | 101 | 110 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.