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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/czar | czar/Czar/Socket.hs | mpl-2.0 | connect :: (MonadCatchIO m, Exception e) => Address -> Context IO a -> m (Either e a)
connect addr ctx = runBouquet (BouquetConf [addr] acquire release 30)
$ retry 12
$ latencyAware
$ runReaderT (runCtx (logPeerTX "connected") >> runCtx ctx)
where
acquire (Address addr') = liftIO $ do
sock <- ... | 1,121 | connect :: (MonadCatchIO m, Exception e) => Address -> Context IO a -> m (Either e a)
connect addr ctx = runBouquet (BouquetConf [addr] acquire release 30)
$ retry 12
$ latencyAware
$ runReaderT (runCtx (logPeerTX "connected") >> runCtx ctx)
where
acquire (Address addr') = liftIO $ do
sock <- ... | 1,121 | connect addr ctx = runBouquet (BouquetConf [addr] acquire release 30)
$ retry 12
$ latencyAware
$ runReaderT (runCtx (logPeerTX "connected") >> runCtx ctx)
where
acquire (Address addr') = liftIO $ do
sock <- Sock.socket (family addr') Stream Sock.defaultProtocol
Sock.connect sock addr'... | 1,035 | false | true | 6 | 11 | 288 | 197 | 99 | 98 | null | null |
raymoo/NEET | src/Neet/Genome.hs | gpl-3.0 | crossConns :: MonadRandom m => MutParams -> IntMap ConnGene -> IntMap ConnGene ->
m (IntMap ConnGene)
crossConns params m1 m2 = T.sequence $ superLeft flipConn return m1 m2
where flipConn c1 c2 = do
if connEnabled c1 && connEnabled c2
then flipCoin c1 c2
else do
... | 577 | crossConns :: MonadRandom m => MutParams -> IntMap ConnGene -> IntMap ConnGene ->
m (IntMap ConnGene)
crossConns params m1 m2 = T.sequence $ superLeft flipConn return m1 m2
where flipConn c1 c2 = do
if connEnabled c1 && connEnabled c2
then flipCoin c1 c2
else do
... | 577 | crossConns params m1 m2 = T.sequence $ superLeft flipConn return m1 m2
where flipConn c1 c2 = do
if connEnabled c1 && connEnabled c2
then flipCoin c1 c2
else do
c <- flipCoin c1 c2
roll <- getRandomR (0,1)
let enabled
| roll <= di... | 461 | false | true | 0 | 17 | 216 | 179 | 83 | 96 | null | null |
galenhuntington/etr | Math/Base.hs | mit | combsTo k (h:t) = combsTo k t ++ map (h:) (combsTo (k-1) t) | 59 | combsTo k (h:t) = combsTo k t ++ map (h:) (combsTo (k-1) t) | 59 | combsTo k (h:t) = combsTo k t ++ map (h:) (combsTo (k-1) t) | 59 | false | false | 0 | 10 | 12 | 53 | 26 | 27 | null | null |
marcusbuffett/Clanki | src/Main.hs | mit | allActions :: [Action]
allActions = [Quiz ..] | 45 | allActions :: [Action]
allActions = [Quiz ..] | 45 | allActions = [Quiz ..] | 22 | false | true | 0 | 5 | 6 | 18 | 11 | 7 | null | null |
haskoin/haskoin | src/Haskoin/Address.hs | unlicense | base58put net (ScriptAddress h) = do
putWord8 (getScriptPrefix net)
serialize h | 95 | base58put net (ScriptAddress h) = do
putWord8 (getScriptPrefix net)
serialize h | 95 | base58put net (ScriptAddress h) = do
putWord8 (getScriptPrefix net)
serialize h | 95 | false | false | 0 | 9 | 26 | 37 | 15 | 22 | null | null |
glguy/hm | src/HM/Example.hs | mit | termType Add = Poly [] (intType --> intType --> intType) | 56 | termType Add = Poly [] (intType --> intType --> intType) | 56 | termType Add = Poly [] (intType --> intType --> intType) | 56 | false | false | 0 | 8 | 9 | 27 | 13 | 14 | null | null |
noughtmare/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs | gpl-2.0 | -- BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
switch 'V' 'H' = '\x254B' | 77 | switch 'V' 'H' = '\x254B' | 25 | switch 'V' 'H' = '\x254B' | 25 | true | false | 0 | 5 | 12 | 12 | 6 | 6 | null | null |
harendra-kumar/asyncly | src/Streamly/Internal/Data/Time/Units.hs | bsd-3-clause | tenPower3 :: Int64
tenPower3 = 1000 | 35 | tenPower3 :: Int64
tenPower3 = 1000 | 35 | tenPower3 = 1000 | 16 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
harrisi/on-being-better | list-expansion/Haskell/cis194/02/02-lists.hs | cc0-1.0 | f' :: Int -> (Int -> Int)
f' x y = 2 * x + y | 44 | f' :: Int -> (Int -> Int)
f' x y = 2 * x + y | 44 | f' x y = 2 * x + y | 18 | false | true | 0 | 7 | 15 | 40 | 19 | 21 | null | null |
Joss-Steward/Primality | main.hs | mit | main = do
args <- getArgs
--let (actions, nonOptions, errors) = getOpt RequireOrder options args
--opts <- foldl (>>=) (return startOptions) actions
opts <- parseOpts args
-- Bind the options to local names
let Options { optSlave = slave
, optMasterIP = serverIP
, optMas... | 533 | main = do
args <- getArgs
--let (actions, nonOptions, errors) = getOpt RequireOrder options args
--opts <- foldl (>>=) (return startOptions) actions
opts <- parseOpts args
-- Bind the options to local names
let Options { optSlave = slave
, optMasterIP = serverIP
, optMas... | 533 | main = do
args <- getArgs
--let (actions, nonOptions, errors) = getOpt RequireOrder options args
--opts <- foldl (>>=) (return startOptions) actions
opts <- parseOpts args
-- Bind the options to local names
let Options { optSlave = slave
, optMasterIP = serverIP
, optMas... | 533 | false | false | 1 | 13 | 158 | 114 | 55 | 59 | null | null |
jvilar/hrows | lib/Presenter/UpdateAuto.hs | gpl-2.0 | update model (DeleteFields fs, pos) =
completeRefresh pos $ deleteFields fs `inside` model | 94 | update model (DeleteFields fs, pos) =
completeRefresh pos $ deleteFields fs `inside` model | 94 | update model (DeleteFields fs, pos) =
completeRefresh pos $ deleteFields fs `inside` model | 94 | false | false | 2 | 6 | 16 | 40 | 18 | 22 | null | null |
Concelo/concelo | src/Data/Tree/RBTree.hs | bsd-3-clause | topMostZip :: (a -> a) -> RBZip a -> RBZip a
topMostZip updateVersion (RBZip s ((Step c v d s1):path)) = case d of
ToLeft -> topMostZip updateVersion (RBZip (Node c (updateVersion v) s s1) path)
ToRight -> topMostZip updateVersion (RBZip (Node c (updateVersion v) s1 s) path) | 291 | topMostZip :: (a -> a) -> RBZip a -> RBZip a
topMostZip updateVersion (RBZip s ((Step c v d s1):path)) = case d of
ToLeft -> topMostZip updateVersion (RBZip (Node c (updateVersion v) s s1) path)
ToRight -> topMostZip updateVersion (RBZip (Node c (updateVersion v) s1 s) path) | 291 | topMostZip updateVersion (RBZip s ((Step c v d s1):path)) = case d of
ToLeft -> topMostZip updateVersion (RBZip (Node c (updateVersion v) s s1) path)
ToRight -> topMostZip updateVersion (RBZip (Node c (updateVersion v) s1 s) path) | 246 | false | true | 0 | 14 | 63 | 142 | 70 | 72 | null | null |
databrary/databrary | src/JSON.hs | agpl-3.0 | (.=.) :: ToNestedObject o u => T.Text -> o -> o
k .=. v = nestObject k (\f -> f v) | 82 | (.=.) :: ToNestedObject o u => T.Text -> o -> o
k .=. v = nestObject k (\f -> f v) | 82 | k .=. v = nestObject k (\f -> f v) | 34 | false | true | 0 | 10 | 20 | 55 | 27 | 28 | null | null |
ondrasej/heavenly-bodies | src/HBodies/Game/Params.hs | apache-2.0 | health_bar_right = health_bar_left + health_bar_width | 53 | health_bar_right = health_bar_left + health_bar_width | 53 | health_bar_right = health_bar_left + health_bar_width | 53 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
ndmitchell/tagsoup | src/Text/HTML/TagSoup/Specification.hs | bsd-3-clause | commentEndSpace S{..} = pos $ case hd of
'>' -> CommentEnd & dat tl
'-' -> commentEndDash tl
_ | white hd -> hd & commentEndSpace tl
_ | eof -> errWant "-->" & CommentEnd & dat s
_ -> hd & comment tl
-- 8.2.4.38 CDATA section state | 253 | commentEndSpace S{..} = pos $ case hd of
'>' -> CommentEnd & dat tl
'-' -> commentEndDash tl
_ | white hd -> hd & commentEndSpace tl
_ | eof -> errWant "-->" & CommentEnd & dat s
_ -> hd & comment tl
-- 8.2.4.38 CDATA section state | 253 | commentEndSpace S{..} = pos $ case hd of
'>' -> CommentEnd & dat tl
'-' -> commentEndDash tl
_ | white hd -> hd & commentEndSpace tl
_ | eof -> errWant "-->" & CommentEnd & dat s
_ -> hd & comment tl
-- 8.2.4.38 CDATA section state | 253 | false | false | 0 | 12 | 70 | 107 | 48 | 59 | null | null |
input-output-hk/pos-haskell-prototype | generator/test/Test/Pos/Block/Logic/VarSpec.hs | mit | uniqueBlockApply :: BlockScenario -> Bool
uniqueBlockApply (BlockScenario bs) =
let ys = foldScenario [] bs in
ys == ordNub ys
where
foldScenario :: [HeaderHash] -> [BlockEvent' Blund] -> [HeaderHash]
foldScenario !acc [] = List.sort acc
foldScenario !acc (x:xs) =
case x of
Blk... | 981 | uniqueBlockApply :: BlockScenario -> Bool
uniqueBlockApply (BlockScenario bs) =
let ys = foldScenario [] bs in
ys == ordNub ys
where
foldScenario :: [HeaderHash] -> [BlockEvent' Blund] -> [HeaderHash]
foldScenario !acc [] = List.sort acc
foldScenario !acc (x:xs) =
case x of
Blk... | 981 | uniqueBlockApply (BlockScenario bs) =
let ys = foldScenario [] bs in
ys == ordNub ys
where
foldScenario :: [HeaderHash] -> [BlockEvent' Blund] -> [HeaderHash]
foldScenario !acc [] = List.sort acc
foldScenario !acc (x:xs) =
case x of
BlkEvApply ea ->
foldScenario... | 939 | false | true | 1 | 15 | 330 | 350 | 175 | 175 | null | null |
Fuuzetsu/haddock | haddock-api/src/Haddock/ModuleTree.hs | bsd-2-clause | mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree]
mkModuleTree dflags showPkgs mods =
foldr fn [] [ (mdl, splitModule mdl, modPkg mdl, modSrcPkg mdl, short) | (mdl, short) <- mods ]
where
modPkg mod_ | showPkgs = Just (unitIdString (moduleUnitId mod_))
| otherwise... | 580 | mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree]
mkModuleTree dflags showPkgs mods =
foldr fn [] [ (mdl, splitModule mdl, modPkg mdl, modSrcPkg mdl, short) | (mdl, short) <- mods ]
where
modPkg mod_ | showPkgs = Just (unitIdString (moduleUnitId mod_))
| otherwise... | 580 | mkModuleTree dflags showPkgs mods =
foldr fn [] [ (mdl, splitModule mdl, modPkg mdl, modSrcPkg mdl, short) | (mdl, short) <- mods ]
where
modPkg mod_ | showPkgs = Just (unitIdString (moduleUnitId mod_))
| otherwise = Nothing
modSrcPkg mod_ | showPkgs = fmap sourcePackageIdString
... | 498 | false | true | 3 | 13 | 160 | 224 | 112 | 112 | null | null |
silkapp/haskell-opaleye | src/Opaleye/PGTypes.hs | bsd-3-clause | -- Internal use only!
unsafePgFormatTime :: Time.FormatTime t => HPQ.Name -> String -> t -> Column c
unsafePgFormatTime typeName formatString = Column
. HPQ.CastExpr typeName
. HPQ.ConstExpr
. HPQ.OtherLit
... | 433 | unsafePgFormatTime :: Time.FormatTime t => HPQ.Name -> String -> t -> Column c
unsafePgFormatTime typeName formatString = Column
. HPQ.CastExpr typeName
. HPQ.ConstExpr
. HPQ.OtherLit
... | 411 | unsafePgFormatTime typeName formatString = Column
. HPQ.CastExpr typeName
. HPQ.ConstExpr
. HPQ.OtherLit
. format
where format = Time.formatTime Locale.defaultTimeLocale ... | 332 | true | true | 0 | 10 | 186 | 85 | 41 | 44 | null | null |
kosmoskatten/ghost-lang | ghost-conduit/test/Spec.hs | mit | testSuite :: [Test]
testSuite =
[ testGroup "GhostLang.ConduitProps"
[ testProperty "SourceAndSinkShallMatch" sourceAndSinkShallMatch
]
] | 157 | testSuite :: [Test]
testSuite =
[ testGroup "GhostLang.ConduitProps"
[ testProperty "SourceAndSinkShallMatch" sourceAndSinkShallMatch
]
] | 157 | testSuite =
[ testGroup "GhostLang.ConduitProps"
[ testProperty "SourceAndSinkShallMatch" sourceAndSinkShallMatch
]
] | 137 | false | true | 0 | 9 | 33 | 37 | 17 | 20 | null | null |
mydaum/cabal | Cabal/Distribution/Simple/BuildTarget.hs | bsd-3-clause | matchFile3 :: [ComponentInfo] -> String -> String -> String -> Bool
-> Match BuildTarget
matchFile3 cs str1 str2 str3 exists = do
ckind <- matchComponentKind str1
guardComponentName str2
c <- matchComponentKindAndName cs ckind str2
filepath <- matchComponentFile c str3 exists
return (Buil... | 355 | matchFile3 :: [ComponentInfo] -> String -> String -> String -> Bool
-> Match BuildTarget
matchFile3 cs str1 str2 str3 exists = do
ckind <- matchComponentKind str1
guardComponentName str2
c <- matchComponentKindAndName cs ckind str2
filepath <- matchComponentFile c str3 exists
return (Buil... | 355 | matchFile3 cs str1 str2 str3 exists = do
ckind <- matchComponentKind str1
guardComponentName str2
c <- matchComponentKindAndName cs ckind str2
filepath <- matchComponentFile c str3 exists
return (BuildTargetFile (cinfoName c) filepath) | 255 | false | true | 0 | 11 | 75 | 112 | 51 | 61 | null | null |
Gabriel439/Haskell-Aurora-Library | src/Aurora/Task.hs | bsd-3-clause | _Task :: Task
_Task = Task
{ name = empty
, constraints = empty
, max_failures = empty
, max_concurrency = empty
, finalization_wait = empty
} | 192 | _Task :: Task
_Task = Task
{ name = empty
, constraints = empty
, max_failures = empty
, max_concurrency = empty
, finalization_wait = empty
} | 192 | _Task = Task
{ name = empty
, constraints = empty
, max_failures = empty
, max_concurrency = empty
, finalization_wait = empty
} | 178 | false | true | 0 | 7 | 76 | 53 | 29 | 24 | null | null |
kazu-yamamoto/cab | Distribution/Cab/Sandbox.hs | bsd-3-clause | -- | Find a sandbox config file by tracing ancestor directories,
-- parse it and return the package db path
getSandbox :: IO (Maybe FilePath)
getSandbox = (Just <$> getPkgDb) `E.catch` handler
where
getPkgDb = getCurrentDirectory >>= getSandboxConfigFile >>= getPackageDbDir
handler :: SomeException -> IO (M... | 467 | getSandbox :: IO (Maybe FilePath)
getSandbox = (Just <$> getPkgDb) `E.catch` handler
where
getPkgDb = getCurrentDirectory >>= getSandboxConfigFile >>= getPackageDbDir
handler :: SomeException -> IO (Maybe String)
handler _ = return Nothing
-- | Find a sandbox config file by tracing ancestor directories.
... | 357 | getSandbox = (Just <$> getPkgDb) `E.catch` handler
where
getPkgDb = getCurrentDirectory >>= getSandboxConfigFile >>= getPackageDbDir
handler :: SomeException -> IO (Maybe String)
handler _ = return Nothing
-- | Find a sandbox config file by tracing ancestor directories.
-- Exception is thrown if not fo... | 323 | true | true | 2 | 7 | 88 | 83 | 45 | 38 | null | null |
tolysz/yesod | yesod-core/test/Hierarchy.hs | mit | postGetPostR :: Handler site Text
postGetPostR = pack "post" | 60 | postGetPostR :: Handler site Text
postGetPostR = pack "post" | 60 | postGetPostR = pack "post" | 26 | false | true | 0 | 6 | 8 | 25 | 10 | 15 | null | null |
elieux/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | gtWord_RDR = varQual_RDR gHC_PRIM (fsLit "gtWord#") | 56 | gtWord_RDR = varQual_RDR gHC_PRIM (fsLit "gtWord#") | 56 | gtWord_RDR = varQual_RDR gHC_PRIM (fsLit "gtWord#") | 56 | false | false | 0 | 7 | 10 | 17 | 8 | 9 | null | null |
copumpkin/macho | src/Data/Macho/Types.hs | bsd-3-clause | n_type 0x4e = N_ENSYM | 21 | n_type 0x4e = N_ENSYM | 21 | n_type 0x4e = N_ENSYM | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
peterokagey/haskellOEIS | src/Helpers/F3Matrix.hs | apache-2.0 | multiplyRow :: Int -> Int -> Matrix Int -> Matrix Int
multiplyRow scalar = mapRow (\_ i -> (scalar * i) `mod` 3) | 112 | multiplyRow :: Int -> Int -> Matrix Int -> Matrix Int
multiplyRow scalar = mapRow (\_ i -> (scalar * i) `mod` 3) | 112 | multiplyRow scalar = mapRow (\_ i -> (scalar * i) `mod` 3) | 58 | false | true | 0 | 10 | 22 | 58 | 30 | 28 | null | null |
adunning/pandoc-citeproc | src/Text/CSL/Pandoc.hs | bsd-3-clause | isNote _ = False | 32 | isNote _ = False | 32 | isNote _ = False | 32 | false | false | 0 | 5 | 19 | 9 | 4 | 5 | null | null |
snoyberg/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | getTyConImplicitBinds :: TyCon -> [CoreBind]
getTyConImplicitBinds tc = map get_defn (mapMaybe dataConWrapId_maybe (tyConDataCons tc)) | 134 | getTyConImplicitBinds :: TyCon -> [CoreBind]
getTyConImplicitBinds tc = map get_defn (mapMaybe dataConWrapId_maybe (tyConDataCons tc)) | 134 | getTyConImplicitBinds tc = map get_defn (mapMaybe dataConWrapId_maybe (tyConDataCons tc)) | 89 | false | true | 0 | 9 | 13 | 40 | 20 | 20 | null | null |
hermish/courseography | app/Response/Loading.hs | gpl-3.0 | loadingResponse :: T.Text -> ServerPart Response
loadingResponse size =
ok $ toResponse $
masterTemplate "Courseography - Loading..."
[]
(do
header "Loading..."
if size == "small"
then smallLoadingIcon
... | 387 | loadingResponse :: T.Text -> ServerPart Response
loadingResponse size =
ok $ toResponse $
masterTemplate "Courseography - Loading..."
[]
(do
header "Loading..."
if size == "small"
then smallLoadingIcon
... | 387 | loadingResponse size =
ok $ toResponse $
masterTemplate "Courseography - Loading..."
[]
(do
header "Loading..."
if size == "small"
then smallLoadingIcon
else largeLoadingIcon
)
... | 338 | false | true | 0 | 11 | 189 | 66 | 32 | 34 | null | null |
spechub/Hets | TPTP/Parser.hs | gpl-2.0 | -- <thf_union_type> ::= <thf_unitary_type> <plus> <thf_unitary_type> |
-- <thf_union_type> <plus> <thf_unitary_type>
thf_union_type :: CharParser st THF_union_type
thf_union_type = parserTrace "thf_union_type" (do
t <- try (thf_unitary_type << plusT)
ts <- thf_unitary_type `sepB... | 376 | thf_union_type :: CharParser st THF_union_type
thf_union_type = parserTrace "thf_union_type" (do
t <- try (thf_unitary_type << plusT)
ts <- thf_unitary_type `sepBy1` plusT
return $ t : ts
<?> "thf_union_type"
) | 226 | thf_union_type = parserTrace "thf_union_type" (do
t <- try (thf_unitary_type << plusT)
ts <- thf_unitary_type `sepBy1` plusT
return $ t : ts
<?> "thf_union_type"
) | 179 | true | true | 0 | 13 | 88 | 71 | 36 | 35 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/InspectorFrontendHost.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/InspectorFrontendHost.dispatchEventAsContextMenuEvent Mozilla InspectorFrontendHost.dispatchEventAsContextMenuEvent documentation>
dispatchEventAsContextMenuEvent ::
(MonadDOM m, IsEvent event) =>
I... | 504 | dispatchEventAsContextMenuEvent ::
(MonadDOM m, IsEvent event) =>
InspectorFrontendHost -> Maybe event -> m ()
dispatchEventAsContextMenuEvent self event
= liftDOM
(void
(self ^. jsf "dispatchEventAsContextMenuEvent" [toJSVal event])) | 317 | dispatchEventAsContextMenuEvent self event
= liftDOM
(void
(self ^. jsf "dispatchEventAsContextMenuEvent" [toJSVal event])) | 140 | true | true | 0 | 11 | 115 | 75 | 37 | 38 | null | null |
ezrakilty/narc | QCUtils.hs | bsd-2-clause | vecTor 0 gen = return [] | 24 | vecTor 0 gen = return [] | 24 | vecTor 0 gen = return [] | 24 | false | false | 1 | 6 | 5 | 20 | 7 | 13 | null | null |
christiaanb/clash-compiler | examples/Calculator.hs | bsd-2-clause | datamem mem (addr,Just val) = (replace mem addr val,mem !! addr) | 64 | datamem mem (addr,Just val) = (replace mem addr val,mem !! addr) | 64 | datamem mem (addr,Just val) = (replace mem addr val,mem !! addr) | 64 | false | false | 0 | 6 | 10 | 39 | 19 | 20 | null | null |
yangsiwei880813/CS644 | src/TypeDatabase.hs | gpl-2.0 | refineSymbolWithType db imps (FUNC mds ls ln params lt) = case (dropWhile isJust params', mlt') of
(_, Nothing) -> Nothing
([], Just lt') -> Just (FUNC mds ls ln (map fromJust params') lt')
... | 489 | refineSymbolWithType db imps (FUNC mds ls ln params lt) = case (dropWhile isJust params', mlt') of
(_, Nothing) -> Nothing
([], Just lt') -> Just (FUNC mds ls ln (map fromJust params') lt')
... | 489 | refineSymbolWithType db imps (FUNC mds ls ln params lt) = case (dropWhile isJust params', mlt') of
(_, Nothing) -> Nothing
([], Just lt') -> Just (FUNC mds ls ln (map fromJust params') lt')
... | 489 | false | false | 2 | 12 | 243 | 148 | 68 | 80 | null | null |
limdauto/learning-haskell | cis194/week4/HigherOrder.hs | mit | foldTree :: [a] -> Tree a
foldTree = foldr insert Leaf
where insert x Leaf = Node 0 Leaf x Leaf
insert x (Node 0 Leaf node Leaf) = Node 1 (Node 0 Leaf x Leaf) node Leaf
insert x (Node 1 left node Leaf) = Node 1 left node (Node 0 Leaf x Leaf)
insert x (Node height left@(Node leftHeight ... | 629 | foldTree :: [a] -> Tree a
foldTree = foldr insert Leaf
where insert x Leaf = Node 0 Leaf x Leaf
insert x (Node 0 Leaf node Leaf) = Node 1 (Node 0 Leaf x Leaf) node Leaf
insert x (Node 1 left node Leaf) = Node 1 left node (Node 0 Leaf x Leaf)
insert x (Node height left@(Node leftHeight ... | 629 | foldTree = foldr insert Leaf
where insert x Leaf = Node 0 Leaf x Leaf
insert x (Node 0 Leaf node Leaf) = Node 1 (Node 0 Leaf x Leaf) node Leaf
insert x (Node 1 left node Leaf) = Node 1 left node (Node 0 Leaf x Leaf)
insert x (Node height left@(Node leftHeight _ _ _) node right@(Node ri... | 603 | false | true | 0 | 12 | 212 | 272 | 135 | 137 | null | null |
yarbroughw/advent | src/Day5.hs | bsd-3-clause | isNice :: String -> Bool
isNice = applyRules [threeVowels, doubleLetter, noBadStrings] | 86 | isNice :: String -> Bool
isNice = applyRules [threeVowels, doubleLetter, noBadStrings] | 86 | isNice = applyRules [threeVowels, doubleLetter, noBadStrings] | 61 | false | true | 0 | 6 | 10 | 27 | 15 | 12 | null | null |
jfranklin9000/urbit | pkg/hs/proto/lib/Deppy/Core.hs | mit | cel_ :: Typ a -> Typ a -> Typ a
cel_ t u = Cel (Abs t (abstract (const Nothing) u)) | 83 | cel_ :: Typ a -> Typ a -> Typ a
cel_ t u = Cel (Abs t (abstract (const Nothing) u)) | 83 | cel_ t u = Cel (Abs t (abstract (const Nothing) u)) | 51 | false | true | 0 | 11 | 20 | 58 | 27 | 31 | null | null |
fmthoma/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | isTypeFamilyDecl _ = False | 26 | isTypeFamilyDecl _ = False | 26 | isTypeFamilyDecl _ = False | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
grwlf/vsim | src_r/VSim/Runtime/Waveform.hs | gpl-3.0 | event (Waveform (c@(Change t _):[])) = (t, error "event: passing the end-of-time") | 82 | event (Waveform (c@(Change t _):[])) = (t, error "event: passing the end-of-time") | 82 | event (Waveform (c@(Change t _):[])) = (t, error "event: passing the end-of-time") | 82 | false | false | 0 | 12 | 11 | 44 | 23 | 21 | null | null |
mzini/qlogic | Qlogic/Formula.hs | gpl-3.0 | isClause Bot = True | 27 | isClause Bot = True | 27 | isClause Bot = True | 27 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
y-kamiya/parallel-concurrent-haskell | src/Server/DistribChatNoSlave.hs | gpl-2.0 | runClient :: Server -> LocalClient -> IO ()
runClient server@Server{..} client@LocalClient{..} = do
race serverThread receiveThread
return ()
where
receiveThread = forever $ do
msg <- hGetLine clientHandle
atomically $ sendMessage server (ClientLocal client) $ Command msg
serverThread = join ... | 661 | runClient :: Server -> LocalClient -> IO ()
runClient server@Server{..} client@LocalClient{..} = do
race serverThread receiveThread
return ()
where
receiveThread = forever $ do
msg <- hGetLine clientHandle
atomically $ sendMessage server (ClientLocal client) $ Command msg
serverThread = join ... | 661 | runClient server@Server{..} client@LocalClient{..} = do
race serverThread receiveThread
return ()
where
receiveThread = forever $ do
msg <- hGetLine clientHandle
atomically $ sendMessage server (ClientLocal client) $ Command msg
serverThread = join $ atomically $ do
k <- readTVar client... | 617 | false | true | 0 | 17 | 184 | 211 | 96 | 115 | null | null |
keithodulaigh/Hets | FreeCAD/Translator.hs | gpl-2.0 | isBaseObject :: Element -> Bool
isBaseObject el = member (firstThree (getName el)) setBaseObjs | 94 | isBaseObject :: Element -> Bool
isBaseObject el = member (firstThree (getName el)) setBaseObjs | 94 | isBaseObject el = member (firstThree (getName el)) setBaseObjs | 62 | false | true | 0 | 9 | 12 | 35 | 17 | 18 | null | null |
brendanhay/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Reviews/Get.hs | mpl-2.0 | -- | Creates a value of 'ReviewsGet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rgXgafv'
--
-- * 'rgReviewId'
--
-- * 'rgUploadProtocol'
--
-- * 'rgPackageName'
--
-- * 'rgAccessToken'
--
-- * 'rgUploadType'
--
-- * 'rgTranslatio... | 764 | reviewsGet
:: Text -- ^ 'rgReviewId'
-> Text -- ^ 'rgPackageName'
-> ReviewsGet
reviewsGet pRgReviewId_ pRgPackageName_ =
ReviewsGet'
{ _rgXgafv = Nothing
, _rgReviewId = pRgReviewId_
, _rgUploadProtocol = Nothing
, _rgPackageName = pRgPackageName_
, _rgAccessToken = Nothing
, _rgU... | 412 | reviewsGet pRgReviewId_ pRgPackageName_ =
ReviewsGet'
{ _rgXgafv = Nothing
, _rgReviewId = pRgReviewId_
, _rgUploadProtocol = Nothing
, _rgPackageName = pRgPackageName_
, _rgAccessToken = Nothing
, _rgUploadType = Nothing
, _rgTranslationLanguage = Nothing
, _rgCallback = Nothing
} | 320 | true | true | 0 | 8 | 162 | 104 | 68 | 36 | null | null |
CarstenKoenig/Countdown | src/lib/Countdown/Completion.hs | mit | apply Mul = (*) | 15 | apply Mul = (*) | 15 | apply Mul = (*) | 15 | false | false | 0 | 5 | 3 | 11 | 6 | 5 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Readers/Docx/Parse.hs | gpl-2.0 | getHeaderLevel _ _ = Nothing | 28 | getHeaderLevel _ _ = Nothing | 28 | getHeaderLevel _ _ = Nothing | 28 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
samcal/rasa | rasa-ext-cursors/src/Rasa/Ext/Cursors/Internal/Base.hs | gpl-3.0 | -- | 'rangeDo' with void return.
rangeDo_ :: (CrdRange -> BufAction a) -> BufAction ()
rangeDo_ = void . rangeDo | 112 | rangeDo_ :: (CrdRange -> BufAction a) -> BufAction ()
rangeDo_ = void . rangeDo | 79 | rangeDo_ = void . rangeDo | 25 | true | true | 0 | 8 | 19 | 35 | 18 | 17 | null | null |
izgzhen/hadrian | src/Expression.hs | mit | -- | Is a certain package /not/ built right now?
notPackage :: Package -> Predicate
notPackage = notM . package | 111 | notPackage :: Package -> Predicate
notPackage = notM . package | 62 | notPackage = notM . package | 27 | true | true | 0 | 5 | 19 | 20 | 11 | 9 | null | null |
runeksvendsen/rbpcp-handler | src/RBPCP/Handler/Internal/Funding/Test.hs | bsd-3-clause | -- round (1000e8 :: Ratio Word64)
-- | Deterministally derive a mock 'Addr.AddressFundingInfo' so server and client
-- can agree on a set of "fake" test funding parameters, in order to be able to
-- ignore the Bitcoin network for testing purposes.
deriveMockFunding
:: PC.ChanParams
-> IO (AddressFundingI... | 663 | deriveMockFunding
:: PC.ChanParams
-> IO (AddressFundingInfo, HT.Tx)
deriveMockFunding cp =
return $ detGen qcGen intSeed
where
intSeed :: Int
intSeed = fromIntegral $ rndSeed `mod` 2^10
rndSeed :: Integer
rndSeed = Cryp.bs2i . Bin.encode . HC.hash256 . Bin.encode $ cp
qcGen = QC.v... | 408 | deriveMockFunding cp =
return $ detGen qcGen intSeed
where
intSeed :: Int
intSeed = fromIntegral $ rndSeed `mod` 2^10
rndSeed :: Integer
rndSeed = Cryp.bs2i . Bin.encode . HC.hash256 . Bin.encode $ cp
qcGen = QC.variantQCGen rndSeed (QC.mkQCGen intSeed)
(QC.MkGen detGen) = deriveMockFu... | 331 | true | true | 0 | 9 | 141 | 146 | 76 | 70 | null | null |
esengie/fpl-exploration-tool | src/langGenerator/Lang.hs | bsd-3-clause | infer ctx al@(Sigma v1 v2 v3 v4)
= do stable ctx al [Bool]
checkT ctx TyDef Bool
v5 <- infer (consCtx Bool ctx) (rt add1 v2)
v6 <- pure (nf v5)
checkEq v6 (fromScope v3)
checkT ctx TyDef Bool
v7 <- infer (consCtx Bool ctx) (rt add1 v1)
checkEq
(Pi (fromScope v... | 951 | infer ctx al@(Sigma v1 v2 v3 v4)
= do stable ctx al [Bool]
checkT ctx TyDef Bool
v5 <- infer (consCtx Bool ctx) (rt add1 v2)
v6 <- pure (nf v5)
checkEq v6 (fromScope v3)
checkT ctx TyDef Bool
v7 <- infer (consCtx Bool ctx) (rt add1 v1)
checkEq
(Pi (fromScope v... | 951 | infer ctx al@(Sigma v1 v2 v3 v4)
= do stable ctx al [Bool]
checkT ctx TyDef Bool
v5 <- infer (consCtx Bool ctx) (rt add1 v2)
v6 <- pure (nf v5)
checkEq v6 (fromScope v3)
checkT ctx TyDef Bool
v7 <- infer (consCtx Bool ctx) (rt add1 v1)
checkEq
(Pi (fromScope v... | 951 | false | false | 0 | 19 | 335 | 429 | 200 | 229 | null | null |
atzedijkstra/blog-server | src/Application/User.hs | bsd-3-clause | -- | Delete a user
userDelete :: (Monad m, MonadState Users m) => User -> m ()
userDelete = kviDelete | 101 | userDelete :: (Monad m, MonadState Users m) => User -> m ()
userDelete = kviDelete | 82 | userDelete = kviDelete | 22 | true | true | 0 | 8 | 19 | 38 | 20 | 18 | null | null |
pparkkin/eta | compiler/ETA/CodeGen/Monad.hs | bsd-3-clause | newLocal :: FieldType -> CodeGen Int
newLocal ft = do
next <- peekNextLocal
modify $ \s@CgState { cgNextLocal } ->
s { cgNextLocal = cgNextLocal + fieldSz}
return next
where fieldSz = fieldSize ft | 217 | newLocal :: FieldType -> CodeGen Int
newLocal ft = do
next <- peekNextLocal
modify $ \s@CgState { cgNextLocal } ->
s { cgNextLocal = cgNextLocal + fieldSz}
return next
where fieldSz = fieldSize ft | 217 | newLocal ft = do
next <- peekNextLocal
modify $ \s@CgState { cgNextLocal } ->
s { cgNextLocal = cgNextLocal + fieldSz}
return next
where fieldSz = fieldSize ft | 180 | false | true | 0 | 11 | 54 | 78 | 38 | 40 | null | null |
kadena-io/pact | src-tool/Pact/Analyze/Types/Shared.hs | bsd-3-clause | showTm :: (SingI ty, IsTerm tm) => tm ty -> String
showTm tm = showsTm 0 tm "" | 78 | showTm :: (SingI ty, IsTerm tm) => tm ty -> String
showTm tm = showsTm 0 tm "" | 78 | showTm tm = showsTm 0 tm "" | 27 | false | true | 0 | 8 | 17 | 48 | 22 | 26 | null | null |
badp/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | ldpDelayTarget :: String
ldpDelayTarget = "c-delay-target" | 58 | ldpDelayTarget :: String
ldpDelayTarget = "c-delay-target" | 58 | ldpDelayTarget = "c-delay-target" | 33 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
rsasse/tamarin-prover | lib/term/src/Term/Substitution/SubstVFresh.hs | gpl-3.0 | -- Smart constructors for substitutions
----------------------------------------------------------------------
-- | Convert a list of mappings to a fresh substitution.
substFromListVFresh :: IsVar v => [(v, VTerm c v)] -> SubstVFresh c v
substFromListVFresh xs = SubstVFresh (M.fromList xs) | 291 | substFromListVFresh :: IsVar v => [(v, VTerm c v)] -> SubstVFresh c v
substFromListVFresh xs = SubstVFresh (M.fromList xs) | 122 | substFromListVFresh xs = SubstVFresh (M.fromList xs) | 52 | true | true | 0 | 9 | 36 | 58 | 30 | 28 | null | null |
ggreif/clash-compiler | clash-lib/src/CLaSH/Rewrite/Combinators.hs | bsd-2-clause | allR _ trans c (App e1 e2) = do
e1' <- trans (AppFun:c) e1
e2' <- trans (AppArg:c) e2
return $ App e1' e2' | 112 | allR _ trans c (App e1 e2) = do
e1' <- trans (AppFun:c) e1
e2' <- trans (AppArg:c) e2
return $ App e1' e2' | 112 | allR _ trans c (App e1 e2) = do
e1' <- trans (AppFun:c) e1
e2' <- trans (AppArg:c) e2
return $ App e1' e2' | 112 | false | false | 1 | 11 | 29 | 76 | 34 | 42 | null | null |
da-x/hakyll-site | src/Site/Compilers.hs | bsd-3-clause | indexCompiler :: String -> Routes -> Pattern -> Rules ()
indexCompiler name path itemsPattern =
create [fromFilePath $ name ++ ".html"] $ do
route path
compile $ do
makeItem ""
>>= loadAndApplyTemplate "templates/index.html" (archiveCtx itemsPattern)
>>= loadAndApplyTemplate "templates/l... | 342 | indexCompiler :: String -> Routes -> Pattern -> Rules ()
indexCompiler name path itemsPattern =
create [fromFilePath $ name ++ ".html"] $ do
route path
compile $ do
makeItem ""
>>= loadAndApplyTemplate "templates/index.html" (archiveCtx itemsPattern)
>>= loadAndApplyTemplate "templates/l... | 342 | indexCompiler name path itemsPattern =
create [fromFilePath $ name ++ ".html"] $ do
route path
compile $ do
makeItem ""
>>= loadAndApplyTemplate "templates/index.html" (archiveCtx itemsPattern)
>>= loadAndApplyTemplate "templates/layout.html" defaultCtx | 285 | false | true | 0 | 15 | 70 | 96 | 44 | 52 | null | null |
elfeck/elfeckcom | src/Web/BetterMdParser.hs | mit | blockify :: [Line] -> Block
blockify ls
| arePlainLines ls = Norm $ map toRaw ls
| areListLines ls = List $ map (\e -> [e]) $ procListLines ls []
| areEnumLines ls =
Enum $ (minNum ls 10, map (\e -> [e]) $ procEnumLines ls []) | 238 | blockify :: [Line] -> Block
blockify ls
| arePlainLines ls = Norm $ map toRaw ls
| areListLines ls = List $ map (\e -> [e]) $ procListLines ls []
| areEnumLines ls =
Enum $ (minNum ls 10, map (\e -> [e]) $ procEnumLines ls []) | 238 | blockify ls
| arePlainLines ls = Norm $ map toRaw ls
| areListLines ls = List $ map (\e -> [e]) $ procListLines ls []
| areEnumLines ls =
Enum $ (minNum ls 10, map (\e -> [e]) $ procEnumLines ls []) | 210 | false | true | 2 | 12 | 58 | 129 | 64 | 65 | null | null |
meditans/preprocessor | test/Main.hs | mit | withStackInstalledPackage :: String -> (FilePath -> IO ()) -> IO ()
withStackInstalledPackage packageName action =
withSystemTempDirectory "preprocessorTest" $ \dir ->
withCurrentDirectory dir $ do
execCmd ("\nUnpacking " ++ packageName)
("stack unpack " ++ packageName)
setCurrentDirecto... | 738 | withStackInstalledPackage :: String -> (FilePath -> IO ()) -> IO ()
withStackInstalledPackage packageName action =
withSystemTempDirectory "preprocessorTest" $ \dir ->
withCurrentDirectory dir $ do
execCmd ("\nUnpacking " ++ packageName)
("stack unpack " ++ packageName)
setCurrentDirecto... | 738 | withStackInstalledPackage packageName action =
withSystemTempDirectory "preprocessorTest" $ \dir ->
withCurrentDirectory dir $ do
execCmd ("\nUnpacking " ++ packageName)
("stack unpack " ++ packageName)
setCurrentDirectory =<< uniqueOutputOf "ls"
execCmd ("Initializing " ++ package... | 670 | false | true | 0 | 11 | 166 | 145 | 69 | 76 | null | null |
sjakobi/brick | tests/Main.hs | bsd-3-clause | prop_applicativeInterchange :: IMap (O -> O) -> O -> Bool
prop_applicativeInterchange u y = (u <*> pure y) == (($ y) <$> u) | 123 | prop_applicativeInterchange :: IMap (O -> O) -> O -> Bool
prop_applicativeInterchange u y = (u <*> pure y) == (($ y) <$> u) | 123 | prop_applicativeInterchange u y = (u <*> pure y) == (($ y) <$> u) | 65 | false | true | 0 | 8 | 22 | 59 | 31 | 28 | null | null |
facebookincubator/duckling | Duckling/Time/RU/Rules.hs | bsd-3-clause | ruleAbsorptionOfAfterNamedDay :: Rule
ruleAbsorptionOfAfterNamedDay = Rule
{ name = "absorption of , after named day"
, pattern =
[ Predicate isADayOfWeek
, regex ","
]
, prod = \case
(x:_) -> Just x
_ -> Nothing
} | 246 | ruleAbsorptionOfAfterNamedDay :: Rule
ruleAbsorptionOfAfterNamedDay = Rule
{ name = "absorption of , after named day"
, pattern =
[ Predicate isADayOfWeek
, regex ","
]
, prod = \case
(x:_) -> Just x
_ -> Nothing
} | 246 | ruleAbsorptionOfAfterNamedDay = Rule
{ name = "absorption of , after named day"
, pattern =
[ Predicate isADayOfWeek
, regex ","
]
, prod = \case
(x:_) -> Just x
_ -> Nothing
} | 208 | false | true | 0 | 12 | 68 | 71 | 38 | 33 | null | null |
ssbl/bf-interpreter | BF2.hs | mit | runInterpreter :: Interpreter () -> IO ()
runInterpreter (Interpreter i) = evalStateT i (ArrayState 0 0 array) | 110 | runInterpreter :: Interpreter () -> IO ()
runInterpreter (Interpreter i) = evalStateT i (ArrayState 0 0 array) | 110 | runInterpreter (Interpreter i) = evalStateT i (ArrayState 0 0 array) | 68 | false | true | 0 | 7 | 16 | 49 | 23 | 26 | null | null |
sopvop/snap-core | test/Snap/Core/Tests.hs | bsd-3-clause | testMethod :: Test
testMethod = testCase "core/method" $ do
expect404 $ go (method POST $ return ())
expectNo404 $ go (method GET $ return ())
------------------------------------------------------------------------------ | 229 | testMethod :: Test
testMethod = testCase "core/method" $ do
expect404 $ go (method POST $ return ())
expectNo404 $ go (method GET $ return ())
------------------------------------------------------------------------------ | 229 | testMethod = testCase "core/method" $ do
expect404 $ go (method POST $ return ())
expectNo404 $ go (method GET $ return ())
------------------------------------------------------------------------------ | 210 | false | true | 0 | 13 | 33 | 69 | 32 | 37 | null | null |
sushantmahajan/programs | haskell/paper.hs | cc0-1.0 | ------------------------X----------------------
--lexical analyser
token k xs | k==take n xs = [(drop n xs),k]
| otherwise = []
where n=length k | 186 | token k xs | k==take n xs = [(drop n xs),k]
| otherwise = []
where n=length k | 119 | token k xs | k==take n xs = [(drop n xs),k]
| otherwise = []
where n=length k | 119 | true | false | 0 | 9 | 62 | 70 | 33 | 37 | null | null |
joelburget/daily-typecheckers | src/Day16.hs | bsd-3-clause | tyL :: Lens' Term (Maybe Term)
tyL f tm = case tm of
BVar i ty -> BVar i <$> f ty
FVar s ty -> FVar s <$> f ty
Abs subTm ty -> Abs subTm <$> f ty
App t1 t2 ty -> App t1 t2 <$> f ty
TyFun dom codom ty -> TyFun dom codom <$> f ty
Type -> const Type <$> f Nothing | 272 | tyL :: Lens' Term (Maybe Term)
tyL f tm = case tm of
BVar i ty -> BVar i <$> f ty
FVar s ty -> FVar s <$> f ty
Abs subTm ty -> Abs subTm <$> f ty
App t1 t2 ty -> App t1 t2 <$> f ty
TyFun dom codom ty -> TyFun dom codom <$> f ty
Type -> const Type <$> f Nothing | 272 | tyL f tm = case tm of
BVar i ty -> BVar i <$> f ty
FVar s ty -> FVar s <$> f ty
Abs subTm ty -> Abs subTm <$> f ty
App t1 t2 ty -> App t1 t2 <$> f ty
TyFun dom codom ty -> TyFun dom codom <$> f ty
Type -> const Type <$> f Nothing | 241 | false | true | 8 | 7 | 80 | 60 | 35 | 25 | null | null |
michalkonecny/aern2 | aern2-real/src/AERN2/Real/Tests.hs | bsd-3-clause | arbitrarySmall :: (Arbitrary a, HasOrderCertainly a Integer) => Integer -> Gen a
arbitrarySmall bound = aux
where
aux =
do
x <- arbitrary
if -bound !<=! x && x !<=! bound
then return x
else aux
{-|
A runtime representative of type @CReal@.
Used for specialising polymorphic tests to con... | 335 | arbitrarySmall :: (Arbitrary a, HasOrderCertainly a Integer) => Integer -> Gen a
arbitrarySmall bound = aux
where
aux =
do
x <- arbitrary
if -bound !<=! x && x !<=! bound
then return x
else aux
{-|
A runtime representative of type @CReal@.
Used for specialising polymorphic tests to con... | 335 | arbitrarySmall bound = aux
where
aux =
do
x <- arbitrary
if -bound !<=! x && x !<=! bound
then return x
else aux
{-|
A runtime representative of type @CReal@.
Used for specialising polymorphic tests to concrete types.
-} | 254 | false | true | 0 | 11 | 85 | 82 | 41 | 41 | null | null |
hvr/cryptohash-sha256 | src/Crypto/Hash/SHA256.hs | bsd-3-clause | sizeCtx :: Int
sizeCtx = 104 | 28 | sizeCtx :: Int
sizeCtx = 104 | 28 | sizeCtx = 104 | 13 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kylcarte/wangtiles | src/Tile/Neighborhood.hs | bsd-3-clause | tmMatches :: (CoordType c) => NeighborhoodTileSet
-> TileMap c -> Coord c -> NeighborhoodTileSet
tmMatches ts tm = matchingNeighborhoods ts . tmNeighborhood tm | 161 | tmMatches :: (CoordType c) => NeighborhoodTileSet
-> TileMap c -> Coord c -> NeighborhoodTileSet
tmMatches ts tm = matchingNeighborhoods ts . tmNeighborhood tm | 161 | tmMatches ts tm = matchingNeighborhoods ts . tmNeighborhood tm | 62 | false | true | 0 | 10 | 24 | 58 | 26 | 32 | null | null |
jcollard/elm-package | tests/SolverTests.hs | bsd-3-clause | n :: String -> N.Name
n = unsafeUnpackJust "name" . N.fromString . ("a/" ++) | 76 | n :: String -> N.Name
n = unsafeUnpackJust "name" . N.fromString . ("a/" ++) | 76 | n = unsafeUnpackJust "name" . N.fromString . ("a/" ++) | 54 | false | true | 0 | 8 | 13 | 41 | 19 | 22 | null | null |
greydot/dns | Network/DNS/Encode.hs | bsd-3-clause | composeQueryAD :: Word16 -> [Question] -> ByteString
composeQueryAD idt qs = encode qry
where
hdr = header defaultQuery
flg = flags hdr
qry = defaultQuery {
header = hdr {
identifier = idt,
flags = flg {
authenData = True
}
... | 452 | composeQueryAD :: Word16 -> [Question] -> ByteString
composeQueryAD idt qs = encode qry
where
hdr = header defaultQuery
flg = flags hdr
qry = defaultQuery {
header = hdr {
identifier = idt,
flags = flg {
authenData = True
}
... | 452 | composeQueryAD idt qs = encode qry
where
hdr = header defaultQuery
flg = flags hdr
qry = defaultQuery {
header = hdr {
identifier = idt,
flags = flg {
authenData = True
}
}
, question = qs
}
-----------... | 399 | false | true | 2 | 11 | 171 | 93 | 52 | 41 | null | null |
binesiyu/ifl | examples/ch27/WebApp.hs | mit | respStatus :: HttpResponse -> String
respStatus (RespSuccess _ _) = "200 OK" | 76 | respStatus :: HttpResponse -> String
respStatus (RespSuccess _ _) = "200 OK" | 76 | respStatus (RespSuccess _ _) = "200 OK" | 39 | false | true | 0 | 7 | 11 | 26 | 13 | 13 | null | null |
uduki/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | withQGraphicsRectItemResult :: IO (Ptr (TQGraphicsRectItem a)) -> IO (QGraphicsRectItem a)
withQGraphicsRectItemResult f
= withObjectResult qtc_QGraphicsRectItem_getFinalizer f | 178 | withQGraphicsRectItemResult :: IO (Ptr (TQGraphicsRectItem a)) -> IO (QGraphicsRectItem a)
withQGraphicsRectItemResult f
= withObjectResult qtc_QGraphicsRectItem_getFinalizer f | 178 | withQGraphicsRectItemResult f
= withObjectResult qtc_QGraphicsRectItem_getFinalizer f | 87 | false | true | 0 | 10 | 17 | 47 | 22 | 25 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT30.hs | gpl-3.0 | sorted :: [Nat] -> Bool
sorted (x:y:xs) = x <= y && sorted (y:xs) | 65 | sorted :: [Nat] -> Bool
sorted (x:y:xs) = x <= y && sorted (y:xs) | 65 | sorted (x:y:xs) = x <= y && sorted (y:xs) | 41 | false | true | 0 | 8 | 13 | 50 | 26 | 24 | null | null |
Philonous/pontarius-service | testclient/Main.hs | agpl-3.0 | credentialsB :: (Text, Text)
credentialsB = ("testuser2@test.pontarius.org", "pwd2") | 84 | credentialsB :: (Text, Text)
credentialsB = ("testuser2@test.pontarius.org", "pwd2") | 84 | credentialsB = ("testuser2@test.pontarius.org", "pwd2") | 55 | false | true | 0 | 5 | 7 | 23 | 14 | 9 | null | null |
christiaanb/Idris-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | ftyToTy FPtr = PointerType (IntegerType 8) (AddrSpace 0) | 56 | ftyToTy FPtr = PointerType (IntegerType 8) (AddrSpace 0) | 56 | ftyToTy FPtr = PointerType (IntegerType 8) (AddrSpace 0) | 56 | false | false | 0 | 7 | 7 | 26 | 12 | 14 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_PERFORMED_REDO :: Int
wxSTC_PERFORMED_REDO = 64 | 53 | wxSTC_PERFORMED_REDO :: Int
wxSTC_PERFORMED_REDO = 64 | 53 | wxSTC_PERFORMED_REDO = 64 | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
trskop/cabal | cabal-install/Distribution/Client/Sandbox.hs | bsd-3-clause | tryLoadSandboxConfig :: Verbosity -> GlobalFlags
-> IO (FilePath, PackageEnvironment)
tryLoadSandboxConfig verbosity globalFlags = do
path <- getSandboxConfigFilePath globalFlags
tryLoadSandboxPackageEnvironmentFile verbosity path
(globalConfigFile globalFlags)
-- | Return the name of t... | 371 | tryLoadSandboxConfig :: Verbosity -> GlobalFlags
-> IO (FilePath, PackageEnvironment)
tryLoadSandboxConfig verbosity globalFlags = do
path <- getSandboxConfigFilePath globalFlags
tryLoadSandboxPackageEnvironmentFile verbosity path
(globalConfigFile globalFlags)
-- | Return the name of t... | 371 | tryLoadSandboxConfig verbosity globalFlags = do
path <- getSandboxConfigFilePath globalFlags
tryLoadSandboxPackageEnvironmentFile verbosity path
(globalConfigFile globalFlags)
-- | Return the name of the package index file for this package environment. | 261 | false | true | 0 | 9 | 69 | 60 | 29 | 31 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Data.hs | bsd-3-clause | serialBegin :: Word8 -> Word32 -> Arduino ()
serialBegin p r = evalExprUnit <$> (Arduino $ primitive $ SerialBeginE (lit p) (lit r)) | 132 | serialBegin :: Word8 -> Word32 -> Arduino ()
serialBegin p r = evalExprUnit <$> (Arduino $ primitive $ SerialBeginE (lit p) (lit r)) | 132 | serialBegin p r = evalExprUnit <$> (Arduino $ primitive $ SerialBeginE (lit p) (lit r)) | 87 | false | true | 0 | 10 | 22 | 61 | 30 | 31 | null | null |
brendanhay/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/Zones/Update.hs | mpl-2.0 | -- | OAuth access token.
acwzuAccessToken :: Lens' AccountsContainersWorkspacesZonesUpdate (Maybe Text)
acwzuAccessToken
= lens _acwzuAccessToken
(\ s a -> s{_acwzuAccessToken = a}) | 189 | acwzuAccessToken :: Lens' AccountsContainersWorkspacesZonesUpdate (Maybe Text)
acwzuAccessToken
= lens _acwzuAccessToken
(\ s a -> s{_acwzuAccessToken = a}) | 164 | acwzuAccessToken
= lens _acwzuAccessToken
(\ s a -> s{_acwzuAccessToken = a}) | 85 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
olorin/amazonka | amazonka-ses/gen/Network/AWS/SES/GetIdentityNotificationAttributes.hs | mpl-2.0 | -- | The response status code.
ginarsResponseStatus :: Lens' GetIdentityNotificationAttributesResponse Int
ginarsResponseStatus = lens _ginarsResponseStatus (\ s a -> s{_ginarsResponseStatus = a}) | 196 | ginarsResponseStatus :: Lens' GetIdentityNotificationAttributesResponse Int
ginarsResponseStatus = lens _ginarsResponseStatus (\ s a -> s{_ginarsResponseStatus = a}) | 165 | ginarsResponseStatus = lens _ginarsResponseStatus (\ s a -> s{_ginarsResponseStatus = a}) | 89 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
kyren/hsgb | lib/Gameboy/Assembler.hs | unlicense | res :: Parsec String st Instruction
res = do
(b, t) <- instruction2Arg "RES" bitArg regularArg
encode b t
where
encode b (RegisterArg r) = return $ RES_B_R b r
encode b (AddressArg AtHL) = return $ RES_B_ATHL b
encode _ _ = fail "Invalid RES instruction" | 276 | res :: Parsec String st Instruction
res = do
(b, t) <- instruction2Arg "RES" bitArg regularArg
encode b t
where
encode b (RegisterArg r) = return $ RES_B_R b r
encode b (AddressArg AtHL) = return $ RES_B_ATHL b
encode _ _ = fail "Invalid RES instruction" | 276 | res = do
(b, t) <- instruction2Arg "RES" bitArg regularArg
encode b t
where
encode b (RegisterArg r) = return $ RES_B_R b r
encode b (AddressArg AtHL) = return $ RES_B_ATHL b
encode _ _ = fail "Invalid RES instruction" | 240 | false | true | 2 | 9 | 68 | 108 | 52 | 56 | null | null |
alphalambda/codeworld | codeworld-api/src/CodeWorld/Parameter.hs | apache-2.0 | pullMatch :: (a -> Bool) -> [a] -> (Maybe a, [a])
pullMatch _ [] = (Nothing, []) | 80 | pullMatch :: (a -> Bool) -> [a] -> (Maybe a, [a])
pullMatch _ [] = (Nothing, []) | 80 | pullMatch _ [] = (Nothing, []) | 30 | false | true | 0 | 8 | 16 | 56 | 31 | 25 | null | null |
harrisi/on-being-better | list-expansion/Haskell/cis194/01/01-intro.hs | cc0-1.0 | ex10 = 12 `div` 5 | 17 | ex10 = 12 `div` 5 | 17 | ex10 = 12 `div` 5 | 17 | false | false | 0 | 5 | 4 | 12 | 7 | 5 | null | null |
facebookincubator/duckling | Duckling/AmountOfMoney/EN/CA/Rules.hs | bsd-3-clause | ruleGrand :: Rule
ruleGrand = Rule
{ name = "<amount> grand"
, pattern =
[ Predicate isPositive
, regex "grand"
]
, prod = \case
(Token Numeral TNumeral.NumeralData{TNumeral.value = v}:_)
-> Just . Token AmountOfMoney . withValue (1000 * v) $ currencyOnly CAD
_ -> Nothing
} | 314 | ruleGrand :: Rule
ruleGrand = Rule
{ name = "<amount> grand"
, pattern =
[ Predicate isPositive
, regex "grand"
]
, prod = \case
(Token Numeral TNumeral.NumeralData{TNumeral.value = v}:_)
-> Just . Token AmountOfMoney . withValue (1000 * v) $ currencyOnly CAD
_ -> Nothing
} | 314 | ruleGrand = Rule
{ name = "<amount> grand"
, pattern =
[ Predicate isPositive
, regex "grand"
]
, prod = \case
(Token Numeral TNumeral.NumeralData{TNumeral.value = v}:_)
-> Just . Token AmountOfMoney . withValue (1000 * v) $ currencyOnly CAD
_ -> Nothing
} | 296 | false | true | 0 | 16 | 86 | 114 | 59 | 55 | null | null |
fujiy00/bertrand | src/Bertrand/Interpreter.hs | bsd-3-clause | eval :: Evaluator Expr [Expr]
eval e =
-- (\e' -> trace (unwords [show e, "=>" ,show e']) e') <$>
(
diveEnvM map $ \case
Id s -> do
-- envs <- filter ((>= -1) . depth) <$> envirs
-- envs <- envirs
bs <- concatMap (\env -> map (shieldWith env) .
concat . look... | 4,762 | eval :: Evaluator Expr [Expr]
eval e =
-- (\e' -> trace (unwords [show e, "=>" ,show e']) e') <$>
(
diveEnvM map $ \case
Id s -> do
-- envs <- filter ((>= -1) . depth) <$> envirs
-- envs <- envirs
bs <- concatMap (\env -> map (shieldWith env) .
concat . look... | 4,762 | eval e =
-- (\e' -> trace (unwords [show e, "=>" ,show e']) e') <$>
(
diveEnvM map $ \case
Id s -> do
-- envs <- filter ((>= -1) . depth) <$> envirs
-- envs <- envirs
bs <- concatMap (\env -> map (shieldWith env) .
concat . lookup s $ binds env) <$> envirs
... | 4,732 | false | true | 55 | 23 | 2,105 | 1,463 | 751 | 712 | null | null |
mcschroeder/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (FCTIDZ reg1 reg2) = pprUnary (sLit "fctidz") reg1 reg2 | 64 | pprInstr (FCTIDZ reg1 reg2) = pprUnary (sLit "fctidz") reg1 reg2 | 64 | pprInstr (FCTIDZ reg1 reg2) = pprUnary (sLit "fctidz") reg1 reg2 | 64 | false | false | 0 | 7 | 9 | 30 | 14 | 16 | null | null |
andorp/hs-bluesnap | src/Bluesnap/API/Response.hs | gpl-3.0 | elementToXMLSubscriptions :: Subscriptions -> [Content ()]
elementToXMLSubscriptions = schemaTypeToXML "subscriptions" | 118 | elementToXMLSubscriptions :: Subscriptions -> [Content ()]
elementToXMLSubscriptions = schemaTypeToXML "subscriptions" | 118 | elementToXMLSubscriptions = schemaTypeToXML "subscriptions" | 59 | false | true | 0 | 8 | 9 | 26 | 13 | 13 | null | null |
mortberg/cubicaltt | Connections.hs | mit | meetAssoc :: Face -> Face -> Face -> Property
meetAssoc xs ys zs = compatibles [xs,ys,zs] ==>
xs `meet` (ys `meet` zs) == (xs `meet` ys) `meet` zs | 167 | meetAssoc :: Face -> Face -> Face -> Property
meetAssoc xs ys zs = compatibles [xs,ys,zs] ==>
xs `meet` (ys `meet` zs) == (xs `meet` ys) `meet` zs | 167 | meetAssoc xs ys zs = compatibles [xs,ys,zs] ==>
xs `meet` (ys `meet` zs) == (xs `meet` ys) `meet` zs | 121 | false | true | 0 | 10 | 48 | 80 | 46 | 34 | null | null |
leshchevds/ganeti | src/Ganeti/OpCodes.hs | bsd-2-clause | opSummaryVal OpTagsSearch { opTagSearchPattern = s } = Just (fromNonEmpty s) | 76 | opSummaryVal OpTagsSearch { opTagSearchPattern = s } = Just (fromNonEmpty s) | 76 | opSummaryVal OpTagsSearch { opTagSearchPattern = s } = Just (fromNonEmpty s) | 76 | false | false | 0 | 8 | 10 | 27 | 13 | 14 | null | null |
anton-dessiatov/ghc | compiler/deSugar/Check.hs | bsd-3-clause | tidy_pat (SigPatOut p _) = tidy_pat (unLoc p) | 46 | tidy_pat (SigPatOut p _) = tidy_pat (unLoc p) | 46 | tidy_pat (SigPatOut p _) = tidy_pat (unLoc p) | 46 | false | false | 0 | 7 | 8 | 26 | 12 | 14 | null | null |
haskell-distributed/distributed-process-client-server | src/Control/Distributed/Process/ManagedProcess/Internal/GenProcess.hs | bsd-3-clause | -- | Evaluate any matching /info handler/ with the supplied datum after waiting
-- for at least @TimeInterval@. The process state (for the resulting @Action s@)
-- is also given and the process loop will go on as per @Server.continue@.
--
-- Informally, evaluating this expression (such that the @Action@ is given as the... | 915 | evalAfter :: forall s m . (Serializable m) => TimeInterval -> m -> s -> Action s
evalAfter d m s = act $ runAfter d m >> setProcessState s | 138 | evalAfter d m s = act $ runAfter d m >> setProcessState s | 57 | true | true | 0 | 10 | 156 | 76 | 44 | 32 | null | null |
owainlewis/lambda-calculus | src/Language/Combinators.hs | mit | twice :: (a -> a) -> a -> a
twice f = f . f | 43 | twice :: (a -> a) -> a -> a
twice f = f . f | 43 | twice f = f . f | 15 | false | true | 1 | 8 | 14 | 40 | 18 | 22 | null | null |
roman/Haskell-Reactive-Extensions | rx-logger/src/Rx/Logger/Env.hs | mit | setupLogTracerWithPrefix
:: ToLogger logger => String -> logger -> IO Disposable
setupLogTracerWithPrefix prefix =
setupLogTracer (defaultSettings { envPrefix = prefix }) | 174 | setupLogTracerWithPrefix
:: ToLogger logger => String -> logger -> IO Disposable
setupLogTracerWithPrefix prefix =
setupLogTracer (defaultSettings { envPrefix = prefix }) | 174 | setupLogTracerWithPrefix prefix =
setupLogTracer (defaultSettings { envPrefix = prefix }) | 91 | false | true | 0 | 8 | 24 | 49 | 24 | 25 | null | null |
ruud-v-a/hakyll | src/Hakyll/Web/Template/Internal.hs | bsd-3-clause | --------------------------------------------------------------------------------
chunk :: P.Parser TemplateElement
chunk = Chunk <$> (P.many1 $ P.noneOf "$") | 157 | chunk :: P.Parser TemplateElement
chunk = Chunk <$> (P.many1 $ P.noneOf "$") | 76 | chunk = Chunk <$> (P.many1 $ P.noneOf "$") | 42 | true | true | 0 | 9 | 12 | 35 | 18 | 17 | null | null |
bch29/robo-monad | src/Game/Robo.hs | gpl-3.0 | -- | Get the direction in which the robot is facing as a normalised vector.
getHeadingVec :: Robo s Vec
getHeadingVec = angleAsVec getHeading | 141 | getHeadingVec :: Robo s Vec
getHeadingVec = angleAsVec getHeading | 65 | getHeadingVec = angleAsVec getHeading | 37 | true | true | 0 | 5 | 23 | 20 | 10 | 10 | null | null |
rvion/lamdu | Lamdu/GUI/DefinitionEdit.hs | gpl-3.0 | acceptableTypeIndicator ::
MonadA m =>
Widget.R -> T m a -> Draw.Color -> Widget.Id ->
ExprGuiM m (ExpressionGui m)
acceptableTypeIndicator width accept color myId =
do
config <- ExprGuiM.readConfig
let acceptKeyMap =
Widget.keysEventMapMovesCursor (Config.acceptDefinitio... | 654 | acceptableTypeIndicator ::
MonadA m =>
Widget.R -> T m a -> Draw.Color -> Widget.Id ->
ExprGuiM m (ExpressionGui m)
acceptableTypeIndicator width accept color myId =
do
config <- ExprGuiM.readConfig
let acceptKeyMap =
Widget.keysEventMapMovesCursor (Config.acceptDefinitio... | 654 | acceptableTypeIndicator width accept color myId =
do
config <- ExprGuiM.readConfig
let acceptKeyMap =
Widget.keysEventMapMovesCursor (Config.acceptDefinitionTypeKeys config)
(E.Doc ["Edit", "Accept inferred type"]) (accept >> return myId)
typeIndicator width c... | 526 | false | true | 0 | 13 | 190 | 170 | 81 | 89 | null | null |
Feeniks/valkyrie | src/Valkyrie/Math.hs | bsd-3-clause | rotationX :: Angle -> Matrix44
rotationX a = zero44 { m11 = 1, m22 = cos r, m23 = -(sin r), m32 = sin r, m33 = cos r, m44 = 1 } where r = toRadians a | 149 | rotationX :: Angle -> Matrix44
rotationX a = zero44 { m11 = 1, m22 = cos r, m23 = -(sin r), m32 = sin r, m33 = cos r, m44 = 1 } where r = toRadians a | 149 | rotationX a = zero44 { m11 = 1, m22 = cos r, m23 = -(sin r), m32 = sin r, m33 = cos r, m44 = 1 } where r = toRadians a | 118 | false | true | 0 | 9 | 37 | 83 | 46 | 37 | null | null |
HaskellCNOrg/snap-web | src/Data/Baeson/Types.hs | bsd-3-clause | (.:) :: (FromBSON a) => BSON.Document -> T.Text -> Parser a
obj .: key = case BSON.look key obj of
Nothing -> fail $ "key " ++ show key ++ " not present"
Just v -> fromBSON v
| 206 | (.:) :: (FromBSON a) => BSON.Document -> T.Text -> Parser a
obj .: key = case BSON.look key obj of
Nothing -> fail $ "key " ++ show key ++ " not present"
Just v -> fromBSON v
| 206 | obj .: key = case BSON.look key obj of
Nothing -> fail $ "key " ++ show key ++ " not present"
Just v -> fromBSON v
| 146 | false | true | 0 | 10 | 69 | 90 | 43 | 47 | null | null |
HairyDude/heal | EveApi/Methods.hs | bsd-2-clause | argToParam (ArgExtended extended) = ("extended", if extended then "1" else "0") | 86 | argToParam (ArgExtended extended) = ("extended", if extended then "1" else "0") | 86 | argToParam (ArgExtended extended) = ("extended", if extended then "1" else "0") | 86 | false | false | 0 | 7 | 17 | 29 | 16 | 13 | null | null |
coghex/abridgefaraway | src/GLUtil/Font.hs | bsd-3-clause | findLetter SMFONT 'L' = (43, 16) | 33 | findLetter SMFONT 'L' = (43, 16) | 33 | findLetter SMFONT 'L' = (43, 16) | 33 | false | false | 0 | 5 | 6 | 19 | 9 | 10 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/RandList.hs | mit | foldr' f e (C _ t xs) = foldTree t $! (foldr' f e xs)
where foldTree (L x) e = f x $! e
foldTree (T x s t) e = f x $! (foldTree s $! (foldTree t $! e)) | 161 | foldr' f e (C _ t xs) = foldTree t $! (foldr' f e xs)
where foldTree (L x) e = f x $! e
foldTree (T x s t) e = f x $! (foldTree s $! (foldTree t $! e)) | 161 | foldr' f e (C _ t xs) = foldTree t $! (foldr' f e xs)
where foldTree (L x) e = f x $! e
foldTree (T x s t) e = f x $! (foldTree s $! (foldTree t $! e)) | 161 | false | false | 1 | 11 | 51 | 113 | 54 | 59 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.