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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
olsner/ghc
|
compiler/basicTypes/DataCon.hs
|
bsd-3-clause
|
-- | The tag used for ordering 'DataCon's
dataConTag :: DataCon -> ConTag
dataConTag = dcTag
| 93
|
dataConTag :: DataCon -> ConTag
dataConTag = dcTag
| 51
|
dataConTag = dcTag
| 19
| true
| true
| 0
| 5
| 16
| 16
| 9
| 7
| null | null |
ml9951/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
patTyConName = thTc (fsLit "Pat") patTyConKey
| 61
|
patTyConName = thTc (fsLit "Pat") patTyConKey
| 61
|
patTyConName = thTc (fsLit "Pat") patTyConKey
| 61
| false
| false
| 0
| 7
| 21
| 17
| 8
| 9
| null | null |
spechub/Hets
|
Temporal/ModalCaslToNuSmvLtl.hs
|
gpl-2.0
|
convert' (Casl.WPast phi psi) = convert' ((phi `Casl.Pand` psi) `Casl.BPast`
(Casl.Pnot phi `Casl.Pand` psi))
| 155
|
convert' (Casl.WPast phi psi) = convert' ((phi `Casl.Pand` psi) `Casl.BPast`
(Casl.Pnot phi `Casl.Pand` psi))
| 155
|
convert' (Casl.WPast phi psi) = convert' ((phi `Casl.Pand` psi) `Casl.BPast`
(Casl.Pnot phi `Casl.Pand` psi))
| 155
| false
| false
| 0
| 11
| 59
| 60
| 33
| 27
| null | null |
buildsome/buildsome
|
src/Lib/Cmp.hs
|
gpl-2.0
|
eq :: Eq a => reason -> a -> a -> ComparisonResult reason
eq reason x y
| x == y = Equals
| otherwise = NotEquals reason
| 124
|
eq :: Eq a => reason -> a -> a -> ComparisonResult reason
eq reason x y
| x == y = Equals
| otherwise = NotEquals reason
| 124
|
eq reason x y
| x == y = Equals
| otherwise = NotEquals reason
| 66
| false
| true
| 1
| 9
| 31
| 64
| 29
| 35
| null | null |
phaazon/inject-function
|
Control/InjFun.hs
|
gpl-3.0
|
-- |Create an inject function.
inject :: (c -> i -> m o) -> InjFun c i m o
inject f = InjFun f
| 94
|
inject :: (c -> i -> m o) -> InjFun c i m o
inject f = InjFun f
| 63
|
inject f = InjFun f
| 19
| true
| true
| 0
| 9
| 23
| 45
| 22
| 23
| null | null |
rueshyna/gogol
|
gen/src/Gen/Types.hs
|
mpl-2.0
|
serviceImports :: HasService a b => a -> Imports
serviceImports s = Imports
{ tocImports = [preludeNS]
, typeImports = sort [preludeNS, prodNS s, sumNS s]
, prodImports = sort [preludeNS, sumNS s]
, sumImports = [preludeNS]
, actionImports = sort [preludeNS, typesNS s]
}
| 305
|
serviceImports :: HasService a b => a -> Imports
serviceImports s = Imports
{ tocImports = [preludeNS]
, typeImports = sort [preludeNS, prodNS s, sumNS s]
, prodImports = sort [preludeNS, sumNS s]
, sumImports = [preludeNS]
, actionImports = sort [preludeNS, typesNS s]
}
| 305
|
serviceImports s = Imports
{ tocImports = [preludeNS]
, typeImports = sort [preludeNS, prodNS s, sumNS s]
, prodImports = sort [preludeNS, sumNS s]
, sumImports = [preludeNS]
, actionImports = sort [preludeNS, typesNS s]
}
| 256
| false
| true
| 0
| 10
| 78
| 116
| 61
| 55
| null | null |
tbepler/haskell-syntax.vim
|
test.hs
|
mit
|
-- | Apply 'quotes' to 'Doc' if boolean is true.
maybeQuotes :: Bool -> Doc -> Doc
maybeQuotes False = id
| 105
|
maybeQuotes :: Bool -> Doc -> Doc
maybeQuotes False = id
| 56
|
maybeQuotes False = id
| 22
| true
| true
| 0
| 6
| 20
| 23
| 12
| 11
| null | null |
bgold-cosmos/Tidal
|
src/Sound/Tidal/Core.hs
|
gpl-3.0
|
cN0 :: String -> Pattern Note
cN0 = _cX (Note 0) getN
| 53
|
cN0 :: String -> Pattern Note
cN0 = _cX (Note 0) getN
| 53
|
cN0 = _cX (Note 0) getN
| 23
| false
| true
| 0
| 7
| 11
| 36
| 15
| 21
| null | null |
mightymoose/liquidhaskell
|
docs/slides/BOS14/hs/start/02_AbstractRefinements.hs
|
bsd-3-clause
|
-- Lets define a few different subsets of Int
{-@ type Even = {v:Int | v mod 2 == 0} @-}
{-@ type Odd = {v:Int | v mod 2 /= 0} @-}
{-@ type RGB = {v:Int | 0 <= v && v < 256} @-}
{-@ xE :: Even @-}
xE = listMax [0, 200, 4000, 60]
| 243
|
xE = listMax [0, 200, 4000, 60]
| 31
|
xE = listMax [0, 200, 4000, 60]
| 31
| true
| false
| 1
| 5
| 73
| 29
| 17
| 12
| null | null |
a143753/AOJ
|
1173.hs
|
apache-2.0
|
ans (s:sr) (')':as) = if s == '(' then (ans sr as) else "no"
| 60
|
ans (s:sr) (')':as) = if s == '(' then (ans sr as) else "no"
| 60
|
ans (s:sr) (')':as) = if s == '(' then (ans sr as) else "no"
| 60
| false
| false
| 1
| 8
| 13
| 48
| 24
| 24
| null | null |
egison/egison
|
hs-src/Language/Egison/Desugar.hs
|
mit
|
desugar (TensorExpr nsExpr xsExpr) =
ITensorExpr <$> desugar nsExpr <*> desugar xsExpr
| 88
|
desugar (TensorExpr nsExpr xsExpr) =
ITensorExpr <$> desugar nsExpr <*> desugar xsExpr
| 88
|
desugar (TensorExpr nsExpr xsExpr) =
ITensorExpr <$> desugar nsExpr <*> desugar xsExpr
| 88
| false
| false
| 0
| 7
| 13
| 31
| 14
| 17
| null | null |
gokhankici/symmetry
|
checker/src/Symmetry/SymbEx.hs
|
mit
|
err
= error "Spawning inside a loop prohibited! Use SpawnMany instead"
| 72
|
err
= error "Spawning inside a loop prohibited! Use SpawnMany instead"
| 72
|
err
= error "Spawning inside a loop prohibited! Use SpawnMany instead"
| 72
| false
| false
| 1
| 5
| 12
| 13
| 4
| 9
| null | null |
HIPERFIT/contracts
|
Haskell/QCHash.hs
|
mit
|
aR vs (Fst x) = Fst (aR vs x)
| 32
|
aR vs (Fst x) = Fst (aR vs x)
| 32
|
aR vs (Fst x) = Fst (aR vs x)
| 32
| false
| false
| 0
| 7
| 11
| 28
| 13
| 15
| null | null |
sgillespie/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
-- Overloaded labels
isLabelClassName :: Name
isLabelClassName
= clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey
| 127
|
isLabelClassName :: Name
isLabelClassName
= clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey
| 106
|
isLabelClassName
= clsQual gHC_OVER_LABELS (fsLit "IsLabel") isLabelClassNameKey
| 81
| true
| true
| 0
| 7
| 13
| 28
| 13
| 15
| null | null |
arianvp/binary-serialise-cbor
|
Data/Binary/Serialise/CBOR/Write.hs
|
bsd-3-clause
|
word64MP :: P.BoundedPrim Word64
word64MP =
condB (<= 0x17) (fromIntegral >$< header) $
condB (<= 0xff) (fromIntegral >$< withConstHeader 24 P.word8) $
condB (<= 0xffff) (fromIntegral >$< withConstHeader 25 P.word16BE) $
condB (<= 0xffffffff) (fromIntegral >$< withConstHeader 26 P.word32BE) $
(fromIntegral >$< withConstHeader 27 P.word64BE)
| 400
|
word64MP :: P.BoundedPrim Word64
word64MP =
condB (<= 0x17) (fromIntegral >$< header) $
condB (<= 0xff) (fromIntegral >$< withConstHeader 24 P.word8) $
condB (<= 0xffff) (fromIntegral >$< withConstHeader 25 P.word16BE) $
condB (<= 0xffffffff) (fromIntegral >$< withConstHeader 26 P.word32BE) $
(fromIntegral >$< withConstHeader 27 P.word64BE)
| 400
|
word64MP =
condB (<= 0x17) (fromIntegral >$< header) $
condB (<= 0xff) (fromIntegral >$< withConstHeader 24 P.word8) $
condB (<= 0xffff) (fromIntegral >$< withConstHeader 25 P.word16BE) $
condB (<= 0xffffffff) (fromIntegral >$< withConstHeader 26 P.word32BE) $
(fromIntegral >$< withConstHeader 27 P.word64BE)
| 367
| false
| true
| 0
| 13
| 102
| 131
| 68
| 63
| null | null |
TOSPIO/yi
|
src/library/Yi/Buffer/HighLevel.hs
|
gpl-2.0
|
readCurrentWordB :: BufferM YiString
readCurrentWordB = readUnitB unitWord
| 74
|
readCurrentWordB :: BufferM YiString
readCurrentWordB = readUnitB unitWord
| 74
|
readCurrentWordB = readUnitB unitWord
| 37
| false
| true
| 0
| 5
| 7
| 17
| 8
| 9
| null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\xFB44' = "\x05E4\x05BC"
| 39
|
decomposeChar '\xFB44' = "\x05E4\x05BC"
| 39
|
decomposeChar '\xFB44' = "\x05E4\x05BC"
| 39
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
apyrgio/ganeti
|
src/Ganeti/Query/Server.hs
|
bsd-2-clause
|
handleCall _ _ cfg (QueryNetworks names fields lock) =
handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNetwork)
(map Left names) fields lock
| 151
|
handleCall _ _ cfg (QueryNetworks names fields lock) =
handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNetwork)
(map Left names) fields lock
| 151
|
handleCall _ _ cfg (QueryNetworks names fields lock) =
handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNetwork)
(map Left names) fields lock
| 151
| false
| false
| 0
| 8
| 23
| 54
| 26
| 28
| null | null |
factisresearch/HStringTemplate
|
Text/StringTemplate/Group.hs
|
bsd-3-clause
|
-- | Adds a set of global options to a group
optInsertGroup :: [(String, String)] -> STGroup a -> STGroup a
optInsertGroup opts f = (inSGen (optInsertGroup opts) . optInsertTmpl opts) <$$> f
| 190
|
optInsertGroup :: [(String, String)] -> STGroup a -> STGroup a
optInsertGroup opts f = (inSGen (optInsertGroup opts) . optInsertTmpl opts) <$$> f
| 145
|
optInsertGroup opts f = (inSGen (optInsertGroup opts) . optInsertTmpl opts) <$$> f
| 82
| true
| true
| 0
| 10
| 32
| 68
| 33
| 35
| null | null |
DATx02-16-14/Hastings
|
src/ChineseCheckers/ChineseBitmaps.hs
|
bsd-3-clause
|
renderSquare can space size (Square Empty _ (x,y)) = do
bitmap <- loadBitmap $ filepath ++ "/empty.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
| 293
|
renderSquare can space size (Square Empty _ (x,y)) = do
bitmap <- loadBitmap $ filepath ++ "/empty.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
| 293
|
renderSquare can space size (Square Empty _ (x,y)) = do
bitmap <- loadBitmap $ filepath ++ "/empty.bmp"
renderOnTop can $ drawScaled bitmap (Rect (size*fromIntegral x + space*fromIntegral (x+xShift)) (size* fromIntegral y+space* fromIntegral (y+yShift)) widthPiece heightPiece)
| 293
| false
| false
| 0
| 15
| 50
| 129
| 63
| 66
| null | null |
knupfer/elisp-parse
|
src/Language/Elisp/Parse.hs
|
bsd-3-clause
|
symbol :: Parser T.Text
symbol = do
b <- A.option "" (string "'")
a <- A.takeWhile1 (`notElem` delimiter')
return $ b <> a
| 149
|
symbol :: Parser T.Text
symbol = do
b <- A.option "" (string "'")
a <- A.takeWhile1 (`notElem` delimiter')
return $ b <> a
| 149
|
symbol = do
b <- A.option "" (string "'")
a <- A.takeWhile1 (`notElem` delimiter')
return $ b <> a
| 125
| false
| true
| 1
| 10
| 49
| 69
| 32
| 37
| null | null |
spechub/Hets
|
HasCASL/MinType.hs
|
gpl-2.0
|
commonSubtype :: Rel.Rel Type -> Bool -> (Type, [Type]) -> Maybe (Int, Type)
commonSubtype trel b (ty, l) =
let tySet = foldl1 Set.intersection
$ map (if b then Rel.predecessors trel else Rel.succs trel) l
in case ty of
TypeName _ _ n | not (Set.null tySet) && n > 0
-> Just (n, Set.findMin tySet)
_ -> Nothing
| 337
|
commonSubtype :: Rel.Rel Type -> Bool -> (Type, [Type]) -> Maybe (Int, Type)
commonSubtype trel b (ty, l) =
let tySet = foldl1 Set.intersection
$ map (if b then Rel.predecessors trel else Rel.succs trel) l
in case ty of
TypeName _ _ n | not (Set.null tySet) && n > 0
-> Just (n, Set.findMin tySet)
_ -> Nothing
| 337
|
commonSubtype trel b (ty, l) =
let tySet = foldl1 Set.intersection
$ map (if b then Rel.predecessors trel else Rel.succs trel) l
in case ty of
TypeName _ _ n | not (Set.null tySet) && n > 0
-> Just (n, Set.findMin tySet)
_ -> Nothing
| 260
| false
| true
| 3
| 14
| 85
| 166
| 83
| 83
| null | null |
brendanhay/khan
|
khan/Khan/Internal/Options.hs
|
mpl-2.0
|
rKeysOption :: EnvMap -> Parser RKeysBucket
rKeysOption env = RKeysBucket <$> textOption "remote-keys"
( etext "KHAN_RKEYS" env
<> short 'K'
) "Bucket to retrieve/store certificates."
| 194
|
rKeysOption :: EnvMap -> Parser RKeysBucket
rKeysOption env = RKeysBucket <$> textOption "remote-keys"
( etext "KHAN_RKEYS" env
<> short 'K'
) "Bucket to retrieve/store certificates."
| 194
|
rKeysOption env = RKeysBucket <$> textOption "remote-keys"
( etext "KHAN_RKEYS" env
<> short 'K'
) "Bucket to retrieve/store certificates."
| 150
| false
| true
| 0
| 8
| 35
| 49
| 22
| 27
| null | null |
nishiuramakoto/logiku
|
Handler/LogicTTest.hs
|
gpl-3.0
|
bathroom_dry :: Logic Bool
bathroom_dry = do
(_klabel, BoolForm bool) <- inquireBool "bathroom dry?"
if bool
then return True
else mzero
| 148
|
bathroom_dry :: Logic Bool
bathroom_dry = do
(_klabel, BoolForm bool) <- inquireBool "bathroom dry?"
if bool
then return True
else mzero
| 148
|
bathroom_dry = do
(_klabel, BoolForm bool) <- inquireBool "bathroom dry?"
if bool
then return True
else mzero
| 121
| false
| true
| 0
| 9
| 32
| 47
| 23
| 24
| null | null |
robdockins/orlin
|
src/Orlin/PureTypeSys.hs
|
bsd-2-clause
|
displayExpr nms (Let (RecDecl xs) y) =
error "display reclet!"
| 68
|
displayExpr nms (Let (RecDecl xs) y) =
error "display reclet!"
| 68
|
displayExpr nms (Let (RecDecl xs) y) =
error "display reclet!"
| 68
| false
| false
| 0
| 9
| 15
| 28
| 13
| 15
| null | null |
matthewleon/libmpd-haskell
|
src/Network/MPD/Applicative/CurrentPlaylist.hs
|
mit
|
-- | Add tag to specified (remote) song.
addTagId :: Id -> Metadata -> Value -> Command ()
addTagId id' tag val = Command emptyResponse ["addtagid" <@> id' <++> tag <++> val]
| 174
|
addTagId :: Id -> Metadata -> Value -> Command ()
addTagId id' tag val = Command emptyResponse ["addtagid" <@> id' <++> tag <++> val]
| 133
|
addTagId id' tag val = Command emptyResponse ["addtagid" <@> id' <++> tag <++> val]
| 83
| true
| true
| 0
| 9
| 31
| 56
| 28
| 28
| null | null |
dzotokan/SourceGraph
|
Parsing/ParseModule.hs
|
gpl-3.0
|
getExp (ListComp e qss) = liftM2 MS.union (getExp e) $ getQStmts qss
| 68
|
getExp (ListComp e qss) = liftM2 MS.union (getExp e) $ getQStmts qss
| 68
|
getExp (ListComp e qss) = liftM2 MS.union (getExp e) $ getQStmts qss
| 68
| false
| false
| 0
| 8
| 11
| 39
| 17
| 22
| null | null |
Persi/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
getWordParts other = [other]
| 43
|
getWordParts other = [other]
| 43
|
getWordParts other = [other]
| 43
| false
| false
| 0
| 5
| 18
| 12
| 6
| 6
| null | null |
craynafinal/cs557_functional_languages
|
practice/week4/aug.hs
|
mit
|
myfriend = "my friend lives in Boston"
| 39
|
myfriend = "my friend lives in Boston"
| 39
|
myfriend = "my friend lives in Boston"
| 39
| false
| false
| 0
| 4
| 7
| 6
| 3
| 3
| null | null |
grandpascorpion/canon
|
Math/NumberTheory/Canon/Internals.hs
|
gpl-3.0
|
rootError :: CR_ -> Integer -> String
rootError c r = "crRoot: All exponents must be multiples of " ++ (show r) ++ ". Not so with " ++ (show c)
| 144
|
rootError :: CR_ -> Integer -> String
rootError c r = "crRoot: All exponents must be multiples of " ++ (show r) ++ ". Not so with " ++ (show c)
| 144
|
rootError c r = "crRoot: All exponents must be multiples of " ++ (show r) ++ ". Not so with " ++ (show c)
| 106
| false
| true
| 0
| 9
| 31
| 54
| 25
| 29
| null | null |
denibertovic/haskell
|
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
|
bsd-3-clause
|
-- | 'v1EndpointSubsetNotReadyAddresses' Lens
v1EndpointSubsetNotReadyAddressesL :: Lens_' V1EndpointSubset (Maybe [V1EndpointAddress])
v1EndpointSubsetNotReadyAddressesL f V1EndpointSubset{..} = (\v1EndpointSubsetNotReadyAddresses -> V1EndpointSubset { v1EndpointSubsetNotReadyAddresses, ..} ) <$> f v1EndpointSubsetNotReadyAddresses
| 334
|
v1EndpointSubsetNotReadyAddressesL :: Lens_' V1EndpointSubset (Maybe [V1EndpointAddress])
v1EndpointSubsetNotReadyAddressesL f V1EndpointSubset{..} = (\v1EndpointSubsetNotReadyAddresses -> V1EndpointSubset { v1EndpointSubsetNotReadyAddresses, ..} ) <$> f v1EndpointSubsetNotReadyAddresses
| 288
|
v1EndpointSubsetNotReadyAddressesL f V1EndpointSubset{..} = (\v1EndpointSubsetNotReadyAddresses -> V1EndpointSubset { v1EndpointSubsetNotReadyAddresses, ..} ) <$> f v1EndpointSubsetNotReadyAddresses
| 198
| true
| true
| 0
| 8
| 23
| 60
| 32
| 28
| null | null |
JPMoresmau/HJVM
|
src/Language/Java/JVM/API.hs
|
bsd-3-clause
|
setCharField :: (WithJava m) =>JObjectPtr -> Field -> Char -> m ()
setCharField = setField f_setCharField
| 108
|
setCharField :: (WithJava m) =>JObjectPtr -> Field -> Char -> m ()
setCharField = setField f_setCharField
| 105
|
setCharField = setField f_setCharField
| 38
| false
| true
| 0
| 10
| 18
| 40
| 20
| 20
| null | null |
ihc/futhark
|
src/Futhark/Pass/ExplicitAllocations.hs
|
isc
|
linearFuncallArg :: (Allocable fromlore tolore,
Allocator tolore (AllocM fromlore tolore)) =>
Type -> SubExp
-> WriterT [SubExp] (AllocM fromlore tolore) SubExp
linearFuncallArg Array{} (Var v) = do
(size, mem, arg') <- lift $ ensureDirectArray v
tell [size, Var mem]
return arg'
| 343
|
linearFuncallArg :: (Allocable fromlore tolore,
Allocator tolore (AllocM fromlore tolore)) =>
Type -> SubExp
-> WriterT [SubExp] (AllocM fromlore tolore) SubExp
linearFuncallArg Array{} (Var v) = do
(size, mem, arg') <- lift $ ensureDirectArray v
tell [size, Var mem]
return arg'
| 343
|
linearFuncallArg Array{} (Var v) = do
(size, mem, arg') <- lift $ ensureDirectArray v
tell [size, Var mem]
return arg'
| 124
| false
| true
| 6
| 7
| 104
| 116
| 62
| 54
| null | null |
snoyberg/keter
|
Keter/App.hs
|
mit
|
withActions :: AppStartConfig
-> BundleConfig
-> ([ WebAppConfig Port] -> [BackgroundConfig] -> Map Host (ProxyAction, TLS.Credentials) -> IO a)
-> IO a
withActions asc bconfig f =
loop (V.toList $ bconfigStanzas bconfig) [] [] Map.empty
where
-- todo: add loading from relative location
loadCert (SSL certFile chainCertFiles keyFile) =
either (const mempty) (TLS.Credentials . (:[]))
<$> TLS.credentialLoadX509Chain certFile (V.toList chainCertFiles) keyFile
loadCert _ = return mempty
loop [] wacs backs actions = f wacs backs actions
loop (Stanza (StanzaWebApp wac) rs:stanzas) wacs backs actions = bracketOnError
(getPort (ascLog asc) (ascPortPool asc) >>= either throwIO
(\p -> fmap (p,) <$> loadCert $ waconfigSsl wac)
)
(\(port, _) -> releasePort (ascPortPool asc) port)
(\(port, cert) -> loop
stanzas
(wac { waconfigPort = port } : wacs)
backs
(Map.unions $ actions : map (\host -> Map.singleton host ((PAPort port (waconfigTimeout wac), rs), cert)) hosts))
where
hosts = Set.toList $ Set.insert (waconfigApprootHost wac) (waconfigHosts wac)
loop (Stanza (StanzaStaticFiles sfc) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ sfconfigSsl sfc
loop stanzas wacs backs (actions cert)
where
actions cert = Map.unions
$ actions0
: map (\host -> Map.singleton host ((PAStatic sfc, rs), cert))
(Set.toList (sfconfigHosts sfc))
loop (Stanza (StanzaRedirect red) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ redirconfigSsl red
loop stanzas wacs backs (actions cert)
where
actions cert = Map.unions
$ actions0
: map (\host -> Map.singleton host ((PARedirect red, rs), cert))
(Set.toList (redirconfigHosts red))
loop (Stanza (StanzaReverseProxy rev mid to) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ reversingUseSSL rev
loop stanzas wacs backs (actions cert)
where
actions cert = Map.insert (CI.mk $ reversingHost rev) ((PAReverseProxy rev mid to, rs), cert) actions0
loop (Stanza (StanzaBackground back) _:stanzas) wacs backs actions =
loop stanzas wacs (back:backs) actions
| 2,413
|
withActions :: AppStartConfig
-> BundleConfig
-> ([ WebAppConfig Port] -> [BackgroundConfig] -> Map Host (ProxyAction, TLS.Credentials) -> IO a)
-> IO a
withActions asc bconfig f =
loop (V.toList $ bconfigStanzas bconfig) [] [] Map.empty
where
-- todo: add loading from relative location
loadCert (SSL certFile chainCertFiles keyFile) =
either (const mempty) (TLS.Credentials . (:[]))
<$> TLS.credentialLoadX509Chain certFile (V.toList chainCertFiles) keyFile
loadCert _ = return mempty
loop [] wacs backs actions = f wacs backs actions
loop (Stanza (StanzaWebApp wac) rs:stanzas) wacs backs actions = bracketOnError
(getPort (ascLog asc) (ascPortPool asc) >>= either throwIO
(\p -> fmap (p,) <$> loadCert $ waconfigSsl wac)
)
(\(port, _) -> releasePort (ascPortPool asc) port)
(\(port, cert) -> loop
stanzas
(wac { waconfigPort = port } : wacs)
backs
(Map.unions $ actions : map (\host -> Map.singleton host ((PAPort port (waconfigTimeout wac), rs), cert)) hosts))
where
hosts = Set.toList $ Set.insert (waconfigApprootHost wac) (waconfigHosts wac)
loop (Stanza (StanzaStaticFiles sfc) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ sfconfigSsl sfc
loop stanzas wacs backs (actions cert)
where
actions cert = Map.unions
$ actions0
: map (\host -> Map.singleton host ((PAStatic sfc, rs), cert))
(Set.toList (sfconfigHosts sfc))
loop (Stanza (StanzaRedirect red) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ redirconfigSsl red
loop stanzas wacs backs (actions cert)
where
actions cert = Map.unions
$ actions0
: map (\host -> Map.singleton host ((PARedirect red, rs), cert))
(Set.toList (redirconfigHosts red))
loop (Stanza (StanzaReverseProxy rev mid to) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ reversingUseSSL rev
loop stanzas wacs backs (actions cert)
where
actions cert = Map.insert (CI.mk $ reversingHost rev) ((PAReverseProxy rev mid to, rs), cert) actions0
loop (Stanza (StanzaBackground back) _:stanzas) wacs backs actions =
loop stanzas wacs (back:backs) actions
| 2,413
|
withActions asc bconfig f =
loop (V.toList $ bconfigStanzas bconfig) [] [] Map.empty
where
-- todo: add loading from relative location
loadCert (SSL certFile chainCertFiles keyFile) =
either (const mempty) (TLS.Credentials . (:[]))
<$> TLS.credentialLoadX509Chain certFile (V.toList chainCertFiles) keyFile
loadCert _ = return mempty
loop [] wacs backs actions = f wacs backs actions
loop (Stanza (StanzaWebApp wac) rs:stanzas) wacs backs actions = bracketOnError
(getPort (ascLog asc) (ascPortPool asc) >>= either throwIO
(\p -> fmap (p,) <$> loadCert $ waconfigSsl wac)
)
(\(port, _) -> releasePort (ascPortPool asc) port)
(\(port, cert) -> loop
stanzas
(wac { waconfigPort = port } : wacs)
backs
(Map.unions $ actions : map (\host -> Map.singleton host ((PAPort port (waconfigTimeout wac), rs), cert)) hosts))
where
hosts = Set.toList $ Set.insert (waconfigApprootHost wac) (waconfigHosts wac)
loop (Stanza (StanzaStaticFiles sfc) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ sfconfigSsl sfc
loop stanzas wacs backs (actions cert)
where
actions cert = Map.unions
$ actions0
: map (\host -> Map.singleton host ((PAStatic sfc, rs), cert))
(Set.toList (sfconfigHosts sfc))
loop (Stanza (StanzaRedirect red) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ redirconfigSsl red
loop stanzas wacs backs (actions cert)
where
actions cert = Map.unions
$ actions0
: map (\host -> Map.singleton host ((PARedirect red, rs), cert))
(Set.toList (redirconfigHosts red))
loop (Stanza (StanzaReverseProxy rev mid to) rs:stanzas) wacs backs actions0 = do
cert <- loadCert $ reversingUseSSL rev
loop stanzas wacs backs (actions cert)
where
actions cert = Map.insert (CI.mk $ reversingHost rev) ((PAReverseProxy rev mid to, rs), cert) actions0
loop (Stanza (StanzaBackground back) _:stanzas) wacs backs actions =
loop stanzas wacs (back:backs) actions
| 2,224
| false
| true
| 0
| 18
| 696
| 886
| 444
| 442
| null | null |
mlite/hLLVM
|
src/Llvm/Pass/RewriteDef.hs
|
bsd-3-clause
|
rwRhs _ (Call _ _) = Nothing
| 28
|
rwRhs _ (Call _ _) = Nothing
| 28
|
rwRhs _ (Call _ _) = Nothing
| 28
| false
| false
| 1
| 6
| 6
| 22
| 9
| 13
| null | null |
Dobiasd/HackerRank-solutions
|
Algorithms/Warmup/Sherlock_and_The_Beast/Main.hs
|
mit
|
maybeHead (x:_) = Just x
| 24
|
maybeHead (x:_) = Just x
| 24
|
maybeHead (x:_) = Just x
| 24
| false
| false
| 0
| 7
| 4
| 19
| 9
| 10
| null | null |
rleshchinskiy/vector
|
tests/Tests/Vector.hs
|
bsd-3-clause
|
testOrdFunctions :: forall a v. (COMMON_CONTEXT(a, v), Ord a, Ord (v a)) => v a -> [Test]
testOrdFunctions _ = $(testProperties
['prop_compare,
'prop_maximum, 'prop_minimum,
'prop_minIndex, 'prop_maxIndex ])
where
prop_compare :: P (v a -> v a -> Ordering) = compare `eq` compare
prop_maximum :: P (v a -> a) = not . V.null ===> V.maximum `eq` maximum
prop_minimum :: P (v a -> a) = not . V.null ===> V.minimum `eq` minimum
prop_minIndex :: P (v a -> Int) = not . V.null ===> V.minIndex `eq` minIndex
prop_maxIndex :: P (v a -> Int) = not . V.null ===> V.maxIndex `eq` maxIndex
| 607
|
testOrdFunctions :: forall a v. (COMMON_CONTEXT(a, v), Ord a, Ord (v a)) => v a -> [Test]
testOrdFunctions _ = $(testProperties
['prop_compare,
'prop_maximum, 'prop_minimum,
'prop_minIndex, 'prop_maxIndex ])
where
prop_compare :: P (v a -> v a -> Ordering) = compare `eq` compare
prop_maximum :: P (v a -> a) = not . V.null ===> V.maximum `eq` maximum
prop_minimum :: P (v a -> a) = not . V.null ===> V.minimum `eq` minimum
prop_minIndex :: P (v a -> Int) = not . V.null ===> V.minIndex `eq` minIndex
prop_maxIndex :: P (v a -> Int) = not . V.null ===> V.maxIndex `eq` maxIndex
| 607
|
testOrdFunctions _ = $(testProperties
['prop_compare,
'prop_maximum, 'prop_minimum,
'prop_minIndex, 'prop_maxIndex ])
where
prop_compare :: P (v a -> v a -> Ordering) = compare `eq` compare
prop_maximum :: P (v a -> a) = not . V.null ===> V.maximum `eq` maximum
prop_minimum :: P (v a -> a) = not . V.null ===> V.minimum `eq` minimum
prop_minIndex :: P (v a -> Int) = not . V.null ===> V.minIndex `eq` minIndex
prop_maxIndex :: P (v a -> Int) = not . V.null ===> V.maxIndex `eq` maxIndex
| 517
| false
| true
| 0
| 10
| 131
| 293
| 155
| 138
| null | null |
emmanueltouzery/cigale-timesheet
|
src/EventProviders/Redmine.hs
|
mit
|
getIssuesForDayNode :: RedmineConfigRecord -> Day -> TimeZone -> Cursor -> [TsEvent]
getIssuesForDayNode config day timezone dayNode = parseBugNodes config day timezone bugNodes
where
bugNodes = filter (isElement . node) (child dlNode)
dlNode = fromMaybe (error "can't find the DL node")
(find (isElement . node) (following dayNode))
| 369
|
getIssuesForDayNode :: RedmineConfigRecord -> Day -> TimeZone -> Cursor -> [TsEvent]
getIssuesForDayNode config day timezone dayNode = parseBugNodes config day timezone bugNodes
where
bugNodes = filter (isElement . node) (child dlNode)
dlNode = fromMaybe (error "can't find the DL node")
(find (isElement . node) (following dayNode))
| 369
|
getIssuesForDayNode config day timezone dayNode = parseBugNodes config day timezone bugNodes
where
bugNodes = filter (isElement . node) (child dlNode)
dlNode = fromMaybe (error "can't find the DL node")
(find (isElement . node) (following dayNode))
| 284
| false
| true
| 0
| 9
| 81
| 111
| 56
| 55
| null | null |
snowleopard/alga
|
src/Algebra/Graph/NonEmpty.hs
|
mit
|
-- | Structural equality on graph expressions.
-- Complexity: /O(s)/ time.
--
-- @
-- x === x == True
-- x + y === x + y == True
-- 1 + 2 === 2 + 1 == False
-- x + y === x * y == False
-- @
(===) :: Eq a => Graph a -> Graph a -> Bool
(Vertex x1 ) === (Vertex x2 ) = x1 == x2
| 289
|
(===) :: Eq a => Graph a -> Graph a -> Bool
(Vertex x1 ) === (Vertex x2 ) = x1 == x2
| 91
|
(Vertex x1 ) === (Vertex x2 ) = x1 == x2
| 47
| true
| true
| 0
| 8
| 89
| 65
| 36
| 29
| null | null |
haskelladdict/simgi
|
src/InputParser.hs
|
gpl-3.0
|
parse_number :: CharParser ModelState Double
parse_number = converter <$> naturalOrFloat
<?> "signed integer or double"
where
converter val = case val of
Left i -> (fromInteger i)
Right x -> x
-- | parse a positive number, can be used with 'many' and other
-- parser combinators; integers are automatically promoted to double
| 392
|
parse_number :: CharParser ModelState Double
parse_number = converter <$> naturalOrFloat
<?> "signed integer or double"
where
converter val = case val of
Left i -> (fromInteger i)
Right x -> x
-- | parse a positive number, can be used with 'many' and other
-- parser combinators; integers are automatically promoted to double
| 392
|
parse_number = converter <$> naturalOrFloat
<?> "signed integer or double"
where
converter val = case val of
Left i -> (fromInteger i)
Right x -> x
-- | parse a positive number, can be used with 'many' and other
-- parser combinators; integers are automatically promoted to double
| 347
| false
| true
| 0
| 9
| 119
| 65
| 32
| 33
| null | null |
eelco/luisterpaal.fm
|
Pages.hs
|
bsd-3-clause
|
stylesheet :: String -> Html
stylesheet uri = thelink noHtml ! [ rel "stylesheet", href uri ]
| 93
|
stylesheet :: String -> Html
stylesheet uri = thelink noHtml ! [ rel "stylesheet", href uri ]
| 93
|
stylesheet uri = thelink noHtml ! [ rel "stylesheet", href uri ]
| 64
| false
| true
| 0
| 7
| 16
| 37
| 18
| 19
| null | null |
duplode/threepenny-gui
|
samples/FadeInFadeOut.hs
|
bsd-3-clause
|
{-----------------------------------------------------------------------------
Main
------------------------------------------------------------------------------}
main :: IO ()
main = startGUI defaultConfig setup
| 217
|
main :: IO ()
main = startGUI defaultConfig setup
| 49
|
main = startGUI defaultConfig setup
| 35
| true
| true
| 0
| 6
| 15
| 22
| 11
| 11
| null | null |
SwiftsNamesake/Southpaw
|
lib/Southpaw/Picasso/Palette.hs
|
mit
|
darksalmon = (0.91372500, 0.58823500, 0.47843100, 1.0)
| 64
|
darksalmon = (0.91372500, 0.58823500, 0.47843100, 1.0)
| 64
|
darksalmon = (0.91372500, 0.58823500, 0.47843100, 1.0)
| 64
| false
| false
| 0
| 5
| 15
| 18
| 11
| 7
| null | null |
f1u77y/xmonad-contrib
|
XMonad/Layout/BinarySpacePartition.hs
|
bsd-3-clause
|
swapCrumb :: Crumb a -> Crumb a
swapCrumb (LeftCrumb s t) = RightCrumb s t
| 74
|
swapCrumb :: Crumb a -> Crumb a
swapCrumb (LeftCrumb s t) = RightCrumb s t
| 74
|
swapCrumb (LeftCrumb s t) = RightCrumb s t
| 42
| false
| true
| 0
| 6
| 14
| 41
| 18
| 23
| null | null |
eggzilla/Phylogeny
|
src/Bio/PhylogenyTools.hs
|
gpl-3.0
|
averagePathLengthperNode :: [(Double,(Node,Node))] -> Node -> (Node,Double)
averagePathLengthperNode indexedPathLengths nodeIndex = (nodeIndex,averagePathLength)
where pathLengthsperNode = filter (\(_,(a,b)) -> a == nodeIndex || b == nodeIndex) indexedPathLengths
sumPathLengths = sum (map (\(pathLength,(_,_)) -> pathLength) pathLengthsperNode)
averagePathLength = sumPathLengths / fromIntegral (length pathLengthsperNode)
| 441
|
averagePathLengthperNode :: [(Double,(Node,Node))] -> Node -> (Node,Double)
averagePathLengthperNode indexedPathLengths nodeIndex = (nodeIndex,averagePathLength)
where pathLengthsperNode = filter (\(_,(a,b)) -> a == nodeIndex || b == nodeIndex) indexedPathLengths
sumPathLengths = sum (map (\(pathLength,(_,_)) -> pathLength) pathLengthsperNode)
averagePathLength = sumPathLengths / fromIntegral (length pathLengthsperNode)
| 441
|
averagePathLengthperNode indexedPathLengths nodeIndex = (nodeIndex,averagePathLength)
where pathLengthsperNode = filter (\(_,(a,b)) -> a == nodeIndex || b == nodeIndex) indexedPathLengths
sumPathLengths = sum (map (\(pathLength,(_,_)) -> pathLength) pathLengthsperNode)
averagePathLength = sumPathLengths / fromIntegral (length pathLengthsperNode)
| 365
| false
| true
| 0
| 11
| 58
| 150
| 85
| 65
| null | null |
softwaremechanic/Miscellaneous
|
Haskell/fizzbuzz.hs
|
gpl-2.0
|
fives = cycle ["","","","","Buzz"]
| 34
|
fives = cycle ["","","","","Buzz"]
| 34
|
fives = cycle ["","","","","Buzz"]
| 34
| false
| false
| 0
| 6
| 3
| 24
| 14
| 10
| null | null |
dcreager/cabal
|
Distribution/Simple/Program.hs
|
bsd-3-clause
|
addKnownPrograms :: [Program] -> ProgramConfiguration -> ProgramConfiguration
addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
| 148
|
addKnownPrograms :: [Program] -> ProgramConfiguration -> ProgramConfiguration
addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
| 148
|
addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
| 70
| false
| true
| 0
| 7
| 15
| 44
| 21
| 23
| null | null |
li-zhirui/EoplLangs
|
src/LetRecLang/Evaluator.hs
|
bsd-3-clause
|
unaryOpConverter :: (ExpressedValue -> Try a)
-> (b -> ExpressedValue)
-> (a -> b)
-> (ExpressedValue -> EvaluateResult)
unaryOpConverter unpack trans func val = do
va <- unpack val
return . trans $ func va
| 261
|
unaryOpConverter :: (ExpressedValue -> Try a)
-> (b -> ExpressedValue)
-> (a -> b)
-> (ExpressedValue -> EvaluateResult)
unaryOpConverter unpack trans func val = do
va <- unpack val
return . trans $ func va
| 261
|
unaryOpConverter unpack trans func val = do
va <- unpack val
return . trans $ func va
| 89
| false
| true
| 0
| 9
| 89
| 87
| 43
| 44
| null | null |
mightymoose/liquidhaskell
|
benchmarks/text-0.11.2.3/Data/Text/Lazy/Encoding.hs
|
bsd-3-clause
|
-- | Decode text from big endian UTF-32 encoding.
decodeUtf32BEWith :: OnDecodeError -> B.ByteString -> Text
decodeUtf32BEWith onErr bs = F.unstream (E.streamUtf32BE onErr bs)
| 175
|
decodeUtf32BEWith :: OnDecodeError -> B.ByteString -> Text
decodeUtf32BEWith onErr bs = F.unstream (E.streamUtf32BE onErr bs)
| 125
|
decodeUtf32BEWith onErr bs = F.unstream (E.streamUtf32BE onErr bs)
| 66
| true
| true
| 0
| 8
| 23
| 42
| 21
| 21
| null | null |
Melvar/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
| 63
|
mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
| 63
|
mapPTermFC f g (PIdiom fc t) = PIdiom (f fc) (mapPTermFC f g t)
| 63
| false
| false
| 0
| 7
| 13
| 45
| 20
| 25
| null | null |
chjp2046/fbthrift
|
thrift/lib/hs/Thrift/Protocol/SimpleJSON.hs
|
apache-2.0
|
parseJSONValue (T_SET ty) =
TSet ty <$> between '[' ']' (parseJSONList ty)
| 76
|
parseJSONValue (T_SET ty) =
TSet ty <$> between '[' ']' (parseJSONList ty)
| 76
|
parseJSONValue (T_SET ty) =
TSet ty <$> between '[' ']' (parseJSONList ty)
| 76
| false
| false
| 0
| 8
| 13
| 35
| 16
| 19
| null | null |
brendanhay/gogol
|
gogol-bigtableadmin/gen/Network/Google/BigtableAdmin/Types/Product.hs
|
mpl-2.0
|
-- | The cluster to which read\/write requests should be routed.
scrClusterId :: Lens' SingleClusterRouting (Maybe Text)
scrClusterId
= lens _scrClusterId (\ s a -> s{_scrClusterId = a})
| 188
|
scrClusterId :: Lens' SingleClusterRouting (Maybe Text)
scrClusterId
= lens _scrClusterId (\ s a -> s{_scrClusterId = a})
| 123
|
scrClusterId
= lens _scrClusterId (\ s a -> s{_scrClusterId = a})
| 67
| true
| true
| 0
| 9
| 29
| 48
| 25
| 23
| null | null |
phischu/fragnix
|
tests/packages/scotty/Network.Socket.ByteString.hs
|
bsd-3-clause
|
sendManyTo sock@(MkSocket fd _ _ _ _) cs addr = do
sent <- liftM fromIntegral sendManyToInner
when (sent < totalLength cs) $ sendManyTo sock (remainingChunks sent cs) addr
where
sendManyToInner =
withSockAddr addr $ \addrPtr addrSize ->
withIOVec cs $ \(iovsPtr, iovsLen) -> do
let msgHdr = MsgHdr
addrPtr (fromIntegral addrSize)
iovsPtr (fromIntegral iovsLen)
with msgHdr $ \msgHdrPtr ->
throwSocketErrorWaitWrite sock "Network.Socket.ByteString.sendManyTo" $
c_sendmsg (fromIntegral fd) msgHdrPtr 0
| 608
|
sendManyTo sock@(MkSocket fd _ _ _ _) cs addr = do
sent <- liftM fromIntegral sendManyToInner
when (sent < totalLength cs) $ sendManyTo sock (remainingChunks sent cs) addr
where
sendManyToInner =
withSockAddr addr $ \addrPtr addrSize ->
withIOVec cs $ \(iovsPtr, iovsLen) -> do
let msgHdr = MsgHdr
addrPtr (fromIntegral addrSize)
iovsPtr (fromIntegral iovsLen)
with msgHdr $ \msgHdrPtr ->
throwSocketErrorWaitWrite sock "Network.Socket.ByteString.sendManyTo" $
c_sendmsg (fromIntegral fd) msgHdrPtr 0
| 608
|
sendManyTo sock@(MkSocket fd _ _ _ _) cs addr = do
sent <- liftM fromIntegral sendManyToInner
when (sent < totalLength cs) $ sendManyTo sock (remainingChunks sent cs) addr
where
sendManyToInner =
withSockAddr addr $ \addrPtr addrSize ->
withIOVec cs $ \(iovsPtr, iovsLen) -> do
let msgHdr = MsgHdr
addrPtr (fromIntegral addrSize)
iovsPtr (fromIntegral iovsLen)
with msgHdr $ \msgHdrPtr ->
throwSocketErrorWaitWrite sock "Network.Socket.ByteString.sendManyTo" $
c_sendmsg (fromIntegral fd) msgHdrPtr 0
| 608
| false
| false
| 0
| 16
| 175
| 184
| 88
| 96
| null | null |
apyrgio/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
adminstAll :: FrozenSet String
adminstAll = ConstantUtils.mkSet $ map Types.adminStateToRaw [minBound..]
| 104
|
adminstAll :: FrozenSet String
adminstAll = ConstantUtils.mkSet $ map Types.adminStateToRaw [minBound..]
| 104
|
adminstAll = ConstantUtils.mkSet $ map Types.adminStateToRaw [minBound..]
| 73
| false
| true
| 0
| 7
| 10
| 30
| 15
| 15
| null | null |
AlexeyRaga/eta
|
compiler/ETA/Prelude/PrelNames.hs
|
bsd-3-clause
|
quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
| 96
|
quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
| 96
|
quotRemIntegerName = varQual gHC_INTEGER_TYPE (fsLit "quotRemInteger") quotRemIntegerIdKey
| 96
| false
| false
| 0
| 7
| 12
| 19
| 9
| 10
| null | null |
uProxy/uproxy-idl-compiler
|
Parse/Parser.hs
|
apache-2.0
|
entityName = fmap toEntityName (sepBy1 identifier dot)
where
toEntityName [t] = EntityName Nothing t
toEntityName ts = EntityName (Just $ ModuleName $ init ts) (last ts)
| 175
|
entityName = fmap toEntityName (sepBy1 identifier dot)
where
toEntityName [t] = EntityName Nothing t
toEntityName ts = EntityName (Just $ ModuleName $ init ts) (last ts)
| 175
|
entityName = fmap toEntityName (sepBy1 identifier dot)
where
toEntityName [t] = EntityName Nothing t
toEntityName ts = EntityName (Just $ ModuleName $ init ts) (last ts)
| 175
| false
| false
| 2
| 8
| 31
| 79
| 34
| 45
| null | null |
FranklinChen/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
tldeclared (PTy _ _ _ _ _ n _ t) = [n]
| 55
|
tldeclared (PTy _ _ _ _ _ n _ t) = [n]
| 55
|
tldeclared (PTy _ _ _ _ _ n _ t) = [n]
| 55
| false
| false
| 0
| 7
| 28
| 32
| 16
| 16
| null | null |
thoferon/eventsafe
|
src/Database/EventSafe/DiscPool.hs
|
mit
|
-- ^ Half of the maximum of group files.
makePathAbsolute :: FilePath -> IO FilePath
makePathAbsolute path =
if isAbsolute path
then return path
else do
currentDir <- getCurrentDirectory
return $ currentDir </> path
-- | Helper function to create a 'DiscPool'.
-- It will create directories and the index file if they don't exist.
| 354
|
makePathAbsolute :: FilePath -> IO FilePath
makePathAbsolute path =
if isAbsolute path
then return path
else do
currentDir <- getCurrentDirectory
return $ currentDir </> path
-- | Helper function to create a 'DiscPool'.
-- It will create directories and the index file if they don't exist.
| 312
|
makePathAbsolute path =
if isAbsolute path
then return path
else do
currentDir <- getCurrentDirectory
return $ currentDir </> path
-- | Helper function to create a 'DiscPool'.
-- It will create directories and the index file if they don't exist.
| 268
| true
| true
| 0
| 9
| 78
| 56
| 28
| 28
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/Hs2Py/GenOpCodes.hs
|
gpl-2.0
|
-- | Generates all opcodes as Python classes.
showPyClasses :: String
showPyClasses = concatMap showPyClass pyClasses
| 117
|
showPyClasses :: String
showPyClasses = concatMap showPyClass pyClasses
| 71
|
showPyClasses = concatMap showPyClass pyClasses
| 47
| true
| true
| 0
| 6
| 15
| 24
| 10
| 14
| null | null |
elieux/ghc
|
compiler/basicTypes/MkId.hs
|
bsd-3-clause
|
proxyHashId :: Id
proxyHashId
= pcMiscPrelId proxyName ty
(noCafIdInfo `setUnfoldingInfo` evaldUnfolding) -- Note [evaldUnfoldings]
where
ty = mkForAllTys [kv, tv] (mkProxyPrimTy k t)
kv = kKiVar
k = mkTyVarTy kv
[tv] = mkTemplateTyVars [k]
t = mkTyVarTy tv
------------------------------------------------
-- unsafeCoerce# :: forall a b. a -> b
| 402
|
proxyHashId :: Id
proxyHashId
= pcMiscPrelId proxyName ty
(noCafIdInfo `setUnfoldingInfo` evaldUnfolding) -- Note [evaldUnfoldings]
where
ty = mkForAllTys [kv, tv] (mkProxyPrimTy k t)
kv = kKiVar
k = mkTyVarTy kv
[tv] = mkTemplateTyVars [k]
t = mkTyVarTy tv
------------------------------------------------
-- unsafeCoerce# :: forall a b. a -> b
| 402
|
proxyHashId
= pcMiscPrelId proxyName ty
(noCafIdInfo `setUnfoldingInfo` evaldUnfolding) -- Note [evaldUnfoldings]
where
ty = mkForAllTys [kv, tv] (mkProxyPrimTy k t)
kv = kKiVar
k = mkTyVarTy kv
[tv] = mkTemplateTyVars [k]
t = mkTyVarTy tv
------------------------------------------------
-- unsafeCoerce# :: forall a b. a -> b
| 384
| false
| true
| 0
| 7
| 104
| 96
| 51
| 45
| null | null |
kallisti-dev/hs-webdriver
|
src/Test/WebDriver/Commands.hs
|
bsd-3-clause
|
-- |Determine if the element is selected.
isSelected :: (HasCallStack, WebDriver wd) => Element -> wd Bool
isSelected e = doElemCommand methodGet e "/selected" Null
| 164
|
isSelected :: (HasCallStack, WebDriver wd) => Element -> wd Bool
isSelected e = doElemCommand methodGet e "/selected" Null
| 122
|
isSelected e = doElemCommand methodGet e "/selected" Null
| 57
| true
| true
| 0
| 7
| 24
| 44
| 22
| 22
| null | null |
unisonweb/platform
|
parser-typechecker/src/Unison/Typechecker/TypeError.hs
|
mit
|
or = booleanMismatch0 OrMismatch (Ex.inSynthesizeApp >> Ex.inOrApp)
| 67
|
or = booleanMismatch0 OrMismatch (Ex.inSynthesizeApp >> Ex.inOrApp)
| 67
|
or = booleanMismatch0 OrMismatch (Ex.inSynthesizeApp >> Ex.inOrApp)
| 67
| false
| false
| 0
| 8
| 6
| 22
| 11
| 11
| null | null |
vTurbine/ghc
|
compiler/ghci/ByteCodeGen.hs
|
bsd-3-clause
|
schemeER_wrk :: Word -> BCEnv -> AnnExpr' Id DVarSet -> BcM BCInstrList
schemeER_wrk d p rhs
| AnnTick (Breakpoint tick_no fvs) (_annot, newRhs) <- rhs
= do code <- schemeE (fromIntegral d) 0 p newRhs
cc_arr <- getCCArray
this_mod <- moduleName <$> getCurrentModule
let idOffSets = getVarOffSets d p fvs
let breakInfo = CgBreakInfo
{ cgb_vars = idOffSets
, cgb_resty = exprType (deAnnotate' newRhs)
}
newBreakInfo tick_no breakInfo
dflags <- getDynFlags
let cc | interpreterProfiled dflags = cc_arr ! tick_no
| otherwise = toRemotePtr nullPtr
let breakInstr = BRK_FUN (fromIntegral tick_no) (getUnique this_mod) cc
return $ breakInstr `consOL` code
| otherwise = schemeE (fromIntegral d) 0 p rhs
| 862
|
schemeER_wrk :: Word -> BCEnv -> AnnExpr' Id DVarSet -> BcM BCInstrList
schemeER_wrk d p rhs
| AnnTick (Breakpoint tick_no fvs) (_annot, newRhs) <- rhs
= do code <- schemeE (fromIntegral d) 0 p newRhs
cc_arr <- getCCArray
this_mod <- moduleName <$> getCurrentModule
let idOffSets = getVarOffSets d p fvs
let breakInfo = CgBreakInfo
{ cgb_vars = idOffSets
, cgb_resty = exprType (deAnnotate' newRhs)
}
newBreakInfo tick_no breakInfo
dflags <- getDynFlags
let cc | interpreterProfiled dflags = cc_arr ! tick_no
| otherwise = toRemotePtr nullPtr
let breakInstr = BRK_FUN (fromIntegral tick_no) (getUnique this_mod) cc
return $ breakInstr `consOL` code
| otherwise = schemeE (fromIntegral d) 0 p rhs
| 862
|
schemeER_wrk d p rhs
| AnnTick (Breakpoint tick_no fvs) (_annot, newRhs) <- rhs
= do code <- schemeE (fromIntegral d) 0 p newRhs
cc_arr <- getCCArray
this_mod <- moduleName <$> getCurrentModule
let idOffSets = getVarOffSets d p fvs
let breakInfo = CgBreakInfo
{ cgb_vars = idOffSets
, cgb_resty = exprType (deAnnotate' newRhs)
}
newBreakInfo tick_no breakInfo
dflags <- getDynFlags
let cc | interpreterProfiled dflags = cc_arr ! tick_no
| otherwise = toRemotePtr nullPtr
let breakInstr = BRK_FUN (fromIntegral tick_no) (getUnique this_mod) cc
return $ breakInstr `consOL` code
| otherwise = schemeE (fromIntegral d) 0 p rhs
| 790
| false
| true
| 2
| 16
| 274
| 263
| 123
| 140
| null | null |
johannesgerer/buchhaltung
|
src/Buchhaltung/ZipEdit2.hs
|
mit
|
doAction (Output f) = doOutput f >> continue
| 53
|
doAction (Output f) = doOutput f >> continue
| 53
|
doAction (Output f) = doOutput f >> continue
| 53
| false
| false
| 0
| 6
| 16
| 23
| 10
| 13
| null | null |
adamse/mmc2
|
src/Agent/Dijkstra.hs
|
mit
|
goValuable :: FromServer -> StateT DijkstraAgent IO Command
goValuable (FromServer {..}) = do
liftIO $ print "Valuable"
let (dm, pm) = dijkstra position pl (neighbours movv pl)
let target = getTarget dm pl goodness
let path = reverse $ constructPath pm position target
return (if length path < 2
then Idle
else getCommand path (fromMaybe False (fmap speedyp buffs)))
where
pl = positionedLayout layout
movv t = valuable t || carryable t || movable t || monkey t
| 515
|
goValuable :: FromServer -> StateT DijkstraAgent IO Command
goValuable (FromServer {..}) = do
liftIO $ print "Valuable"
let (dm, pm) = dijkstra position pl (neighbours movv pl)
let target = getTarget dm pl goodness
let path = reverse $ constructPath pm position target
return (if length path < 2
then Idle
else getCommand path (fromMaybe False (fmap speedyp buffs)))
where
pl = positionedLayout layout
movv t = valuable t || carryable t || movable t || monkey t
| 515
|
goValuable (FromServer {..}) = do
liftIO $ print "Valuable"
let (dm, pm) = dijkstra position pl (neighbours movv pl)
let target = getTarget dm pl goodness
let path = reverse $ constructPath pm position target
return (if length path < 2
then Idle
else getCommand path (fromMaybe False (fmap speedyp buffs)))
where
pl = positionedLayout layout
movv t = valuable t || carryable t || movable t || monkey t
| 455
| false
| true
| 0
| 14
| 131
| 199
| 93
| 106
| null | null |
anammari/pandoc
|
src/Text/Pandoc/Readers/RST.hs
|
gpl-2.0
|
titleTransform ((Header 1 head1):rest) |
not (any (isHeader 1) rest) = -- title, no subtitle
(promoteHeaders 1 rest, head1)
| 130
|
titleTransform ((Header 1 head1):rest) |
not (any (isHeader 1) rest) = -- title, no subtitle
(promoteHeaders 1 rest, head1)
| 130
|
titleTransform ((Header 1 head1):rest) |
not (any (isHeader 1) rest) = -- title, no subtitle
(promoteHeaders 1 rest, head1)
| 130
| false
| false
| 0
| 12
| 25
| 59
| 29
| 30
| null | null |
seckcoder/vector
|
Data/Vector.hs
|
bsd-3-clause
|
foldM'_ = G.foldM'_
| 19
|
foldM'_ = G.foldM'_
| 19
|
foldM'_ = G.foldM'_
| 19
| false
| false
| 1
| 6
| 2
| 12
| 4
| 8
| null | null |
philopon/apiary-benchmark
|
src/yesod.hs
|
mit
|
handleNum11R :: Handler TypedContent; handleNum11R = returnBS "deep"
| 68
|
handleNum11R :: Handler TypedContent
handleNum11R = returnBS "deep"
| 67
|
handleNum11R = returnBS "deep"
| 30
| false
| true
| 1
| 5
| 7
| 21
| 9
| 12
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-printers/Language/Drasil/HTML/Print.hs
|
bsd-2-clause
|
compCiteField _ (Edition _) = GT
| 35
|
compCiteField _ (Edition _) = GT
| 35
|
compCiteField _ (Edition _) = GT
| 35
| false
| false
| 1
| 6
| 8
| 20
| 8
| 12
| null | null |
robdockins/edison
|
test/src/Data/Edison/Test/Bag.hs
|
mit
|
prop_strict_fold :: BagTest Int bag => bag Int -> bag Int -> Bool
prop_strict_fold bag xs =
fold' (+) 0 xs == fold (+) 0 xs
&&
(null xs || fold1' (+) xs == fold1 (+) xs)
| 181
|
prop_strict_fold :: BagTest Int bag => bag Int -> bag Int -> Bool
prop_strict_fold bag xs =
fold' (+) 0 xs == fold (+) 0 xs
&&
(null xs || fold1' (+) xs == fold1 (+) xs)
| 181
|
prop_strict_fold bag xs =
fold' (+) 0 xs == fold (+) 0 xs
&&
(null xs || fold1' (+) xs == fold1 (+) xs)
| 115
| false
| true
| 0
| 9
| 48
| 93
| 47
| 46
| null | null |
isomorphism/hackage2
|
Distribution/Server/Packages/Downloads.hs
|
bsd-3-clause
|
lookupPackageDowns :: DownloadCounts -> PackageName -> Int
lookupPackageDowns dcs pkgname = maybe 0 packageDowns $ Map.lookup pkgname (downloadMap dcs)
| 151
|
lookupPackageDowns :: DownloadCounts -> PackageName -> Int
lookupPackageDowns dcs pkgname = maybe 0 packageDowns $ Map.lookup pkgname (downloadMap dcs)
| 151
|
lookupPackageDowns dcs pkgname = maybe 0 packageDowns $ Map.lookup pkgname (downloadMap dcs)
| 92
| false
| true
| 0
| 8
| 18
| 46
| 22
| 24
| null | null |
roberth/uu-helium
|
test/simple/benchmarks/Main.hs
|
gpl-3.0
|
eLex l n (')':cs)
= (l, n, Lrparen, ")") : leLex l (n+1) cs
| 63
|
leLex l n (')':cs)
= (l, n, Lrparen, ")") : leLex l (n+1) cs
| 63
|
leLex l n (')':cs)
= (l, n, Lrparen, ")") : leLex l (n+1) cs
| 63
| false
| false
| 0
| 8
| 17
| 50
| 27
| 23
| null | null |
scott-fleischman/greek-grammar
|
haskell/greek-grammar/src/Text/Greek/IO/Render.hs
|
mit
|
renderRhChar Consonant.Rh_ζ = "ζ"
| 33
|
renderRhChar Consonant.Rh_ζ = "ζ"
| 33
|
renderRhChar Consonant.Rh_ζ = "ζ"
| 33
| false
| false
| 0
| 6
| 3
| 13
| 6
| 7
| null | null |
nevrenato/HetsAlloy
|
HasCASL/ToItem.hs
|
gpl-2.0
|
cdToItem :: ClassDecl -> Item
cdToItem (ClassDecl cs k rg) =
mkItem "ClassDecl" rg $ map (emptyAnno . classToItem) cs
++ [emptyAnno $ kToItem k]
| 148
|
cdToItem :: ClassDecl -> Item
cdToItem (ClassDecl cs k rg) =
mkItem "ClassDecl" rg $ map (emptyAnno . classToItem) cs
++ [emptyAnno $ kToItem k]
| 148
|
cdToItem (ClassDecl cs k rg) =
mkItem "ClassDecl" rg $ map (emptyAnno . classToItem) cs
++ [emptyAnno $ kToItem k]
| 118
| false
| true
| 2
| 8
| 28
| 65
| 31
| 34
| null | null |
sdiehl/ghc
|
compiler/utils/UniqMap.hs
|
bsd-3-clause
|
plusUniqMap :: UniqMap k a -> UniqMap k a -> UniqMap k a
plusUniqMap (UniqMap m1) (UniqMap m2) = UniqMap $ plusUFM m1 m2
| 120
|
plusUniqMap :: UniqMap k a -> UniqMap k a -> UniqMap k a
plusUniqMap (UniqMap m1) (UniqMap m2) = UniqMap $ plusUFM m1 m2
| 120
|
plusUniqMap (UniqMap m1) (UniqMap m2) = UniqMap $ plusUFM m1 m2
| 63
| false
| true
| 0
| 7
| 23
| 60
| 28
| 32
| null | null |
josuf107/Adverb
|
Adverb/Common.hs
|
gpl-3.0
|
efficaciously = id
| 18
|
efficaciously = id
| 18
|
efficaciously = id
| 18
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
bitemyapp/hpp
|
src/Hpp/Expr.hs
|
bsd-3-clause
|
precedenceBin ShiftL = 7
| 24
|
precedenceBin ShiftL = 7
| 24
|
precedenceBin ShiftL = 7
| 24
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
romanofski/gtfsbrisbane
|
test/TestRealtime.hs
|
bsd-3-clause
|
makeFeedTest :: (TestName, FeedMessage, [ScheduleItem], [ScheduleItem])
-> TestTree
makeFeedTest (name,fm,schedule,expected) =
testCase name $ do updateSchedule fm schedule @?= expected
| 202
|
makeFeedTest :: (TestName, FeedMessage, [ScheduleItem], [ScheduleItem])
-> TestTree
makeFeedTest (name,fm,schedule,expected) =
testCase name $ do updateSchedule fm schedule @?= expected
| 202
|
makeFeedTest (name,fm,schedule,expected) =
testCase name $ do updateSchedule fm schedule @?= expected
| 105
| false
| true
| 0
| 9
| 36
| 67
| 37
| 30
| null | null |
kaoskorobase/mescaline
|
lib/mescaline/Data/Signal/SF/Event.hs
|
gpl-3.0
|
eventToMaybe :: Event a -> Maybe a
eventToMaybe = event Nothing Just
| 68
|
eventToMaybe :: Event a -> Maybe a
eventToMaybe = event Nothing Just
| 68
|
eventToMaybe = event Nothing Just
| 33
| false
| true
| 0
| 6
| 11
| 26
| 12
| 14
| null | null |
leftaroundabout/dynamic-plot
|
Graphics/Dynamic/Plot/Colour.hs
|
gpl-3.0
|
contrast= Contrast Neutral
| 26
|
contrast= Contrast Neutral
| 26
|
contrast= Contrast Neutral
| 26
| false
| false
| 1
| 5
| 2
| 14
| 4
| 10
| null | null |
kmate/HaRe
|
old/testing/liftToToplevel/D3_AstOut.hs
|
bsd-3-clause
|
sumSquares [] = 0
| 17
|
sumSquares [] = 0
| 17
|
sumSquares [] = 0
| 17
| false
| false
| 0
| 6
| 3
| 11
| 5
| 6
| null | null |
emk/haskell-probability-monads
|
examples/Probability.hs
|
bsd-3-clause
|
localizeRobot :: WPS Int
localizeRobot = do
-- Pick a random starting location
-- to use as a hypothesis.
pos1 <- uniform [0..299]
-- We know we're at a door. Hypotheses
-- which agree with this fact get a
-- weight of 1, others get 0.
if doorAtPosition pos1
then weight 1
else weight 0
-- Drive forward a bit.
let pos2 = pos1 + 28
-- We know we're not at a door.
if not (doorAtPosition pos2)
then weight 1
else weight 0
-- Drive forward some more.
let pos3 = pos2 + 28
if doorAtPosition pos3
then weight 1
else weight 0
-- Our final hypothesis.
return pos3
-- > runRand (runWPS localizeRobot 10)
-- [Perhaps 106 100.0%,
-- never,never,never,never,never,
-- Perhaps 93 100.0%,
-- never,never,never]
-- > runWPS' localizeRobot 10
-- [97,109,93]
-- ========================================================================
-- Random sampling
--
-- Heavily inspired by Sungwoo Park and colleagues' $\lambda_{\bigcirc}$
-- caculus <http://citeseer.ist.psu.edu/752237.html>.
--
-- See <http://www.randomhacks.net/articles/2007/02/21/randomly-sampled-distributions>.
| 1,125
|
localizeRobot :: WPS Int
localizeRobot = do
-- Pick a random starting location
-- to use as a hypothesis.
pos1 <- uniform [0..299]
-- We know we're at a door. Hypotheses
-- which agree with this fact get a
-- weight of 1, others get 0.
if doorAtPosition pos1
then weight 1
else weight 0
-- Drive forward a bit.
let pos2 = pos1 + 28
-- We know we're not at a door.
if not (doorAtPosition pos2)
then weight 1
else weight 0
-- Drive forward some more.
let pos3 = pos2 + 28
if doorAtPosition pos3
then weight 1
else weight 0
-- Our final hypothesis.
return pos3
-- > runRand (runWPS localizeRobot 10)
-- [Perhaps 106 100.0%,
-- never,never,never,never,never,
-- Perhaps 93 100.0%,
-- never,never,never]
-- > runWPS' localizeRobot 10
-- [97,109,93]
-- ========================================================================
-- Random sampling
--
-- Heavily inspired by Sungwoo Park and colleagues' $\lambda_{\bigcirc}$
-- caculus <http://citeseer.ist.psu.edu/752237.html>.
--
-- See <http://www.randomhacks.net/articles/2007/02/21/randomly-sampled-distributions>.
| 1,125
|
localizeRobot = do
-- Pick a random starting location
-- to use as a hypothesis.
pos1 <- uniform [0..299]
-- We know we're at a door. Hypotheses
-- which agree with this fact get a
-- weight of 1, others get 0.
if doorAtPosition pos1
then weight 1
else weight 0
-- Drive forward a bit.
let pos2 = pos1 + 28
-- We know we're not at a door.
if not (doorAtPosition pos2)
then weight 1
else weight 0
-- Drive forward some more.
let pos3 = pos2 + 28
if doorAtPosition pos3
then weight 1
else weight 0
-- Our final hypothesis.
return pos3
-- > runRand (runWPS localizeRobot 10)
-- [Perhaps 106 100.0%,
-- never,never,never,never,never,
-- Perhaps 93 100.0%,
-- never,never,never]
-- > runWPS' localizeRobot 10
-- [97,109,93]
-- ========================================================================
-- Random sampling
--
-- Heavily inspired by Sungwoo Park and colleagues' $\lambda_{\bigcirc}$
-- caculus <http://citeseer.ist.psu.edu/752237.html>.
--
-- See <http://www.randomhacks.net/articles/2007/02/21/randomly-sampled-distributions>.
| 1,100
| false
| true
| 0
| 10
| 222
| 150
| 81
| 69
| null | null |
conal/hermit
|
src/HERMIT/Plugin/Builder.hs
|
bsd-2-clause
|
-- | If HERMIT user specifies the -pN flag, get the N
-- TODO: as written will discard other flags that start with -p
getPassFlag :: [CommandLineOption] -> Maybe (Int, [CommandLineOption])
getPassFlag opts = case partition ("-p" `isPrefixOf`) opts of
([],_) -> Nothing
(ps,r) -> Just (read (drop 2 (last ps)), r)
| 360
|
getPassFlag :: [CommandLineOption] -> Maybe (Int, [CommandLineOption])
getPassFlag opts = case partition ("-p" `isPrefixOf`) opts of
([],_) -> Nothing
(ps,r) -> Just (read (drop 2 (last ps)), r)
| 242
|
getPassFlag opts = case partition ("-p" `isPrefixOf`) opts of
([],_) -> Nothing
(ps,r) -> Just (read (drop 2 (last ps)), r)
| 171
| true
| true
| 0
| 14
| 99
| 102
| 57
| 45
| null | null |
Teaspot-Studio/Urho3D-Haskell
|
src/Graphics/Urho3D/UI/Text3D.hs
|
mit
|
text3DSetTextAlignment :: (Parent Text3D a, Pointer ptr a, MonadIO m)
=> ptr -- ^ Pointer to text3D or ascentor
-> HorizontalAlignment
-> m ()
text3DSetTextAlignment p hAlign = liftIO $ do
let ptr = parentPointer p
hAlign' = fromIntegral . fromEnum $ hAlign
[C.exp| void {$(Text3D* ptr)->SetTextAlignment((HorizontalAlignment)$(int hAlign'))} |]
-- | Set row spacing, 1.0 for original font spacing.
-- void SetRowSpacing(float spacing);
| 454
|
text3DSetTextAlignment :: (Parent Text3D a, Pointer ptr a, MonadIO m)
=> ptr -- ^ Pointer to text3D or ascentor
-> HorizontalAlignment
-> m ()
text3DSetTextAlignment p hAlign = liftIO $ do
let ptr = parentPointer p
hAlign' = fromIntegral . fromEnum $ hAlign
[C.exp| void {$(Text3D* ptr)->SetTextAlignment((HorizontalAlignment)$(int hAlign'))} |]
-- | Set row spacing, 1.0 for original font spacing.
-- void SetRowSpacing(float spacing);
| 454
|
text3DSetTextAlignment p hAlign = liftIO $ do
let ptr = parentPointer p
hAlign' = fromIntegral . fromEnum $ hAlign
[C.exp| void {$(Text3D* ptr)->SetTextAlignment((HorizontalAlignment)$(int hAlign'))} |]
-- | Set row spacing, 1.0 for original font spacing.
-- void SetRowSpacing(float spacing);
| 305
| false
| true
| 0
| 12
| 80
| 96
| 50
| 46
| null | null |
apyrgio/snf-ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- | Default delay target measured in sectors
defaultDelayTarget :: Int
defaultDelayTarget = 1
| 94
|
defaultDelayTarget :: Int
defaultDelayTarget = 1
| 48
|
defaultDelayTarget = 1
| 22
| true
| true
| 0
| 4
| 13
| 12
| 7
| 5
| null | null |
daewon/til
|
exercism/haskell/space-age/src/SpaceAge.hs
|
mpl-2.0
|
periodOf Saturn = 29.447498
| 27
|
periodOf Saturn = 29.447498
| 27
|
periodOf Saturn = 29.447498
| 27
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
brow/noise
|
tests/Text/Noise/Parser/Test.hs
|
mit
|
test_trailing_comma = assertOutputElement
D.circle
"shape.circle(0,0,0,)"
| 77
|
test_trailing_comma = assertOutputElement
D.circle
"shape.circle(0,0,0,)"
| 77
|
test_trailing_comma = assertOutputElement
D.circle
"shape.circle(0,0,0,)"
| 77
| false
| false
| 0
| 5
| 8
| 14
| 6
| 8
| null | null |
brownsys/nettle-openflow
|
src/Examples/Flood.hs
|
bsd-3-clause
|
messageHandler :: SwitchHandle -> (TransactionID, SCMessage) -> IO ()
messageHandler switch (xid, scmsg) =
case scmsg of
PacketIn pktIn -> sendToSwitch switch (xid, PacketOut (receivedPacketOut pktIn flood))
_ -> return ()
| 255
|
messageHandler :: SwitchHandle -> (TransactionID, SCMessage) -> IO ()
messageHandler switch (xid, scmsg) =
case scmsg of
PacketIn pktIn -> sendToSwitch switch (xid, PacketOut (receivedPacketOut pktIn flood))
_ -> return ()
| 255
|
messageHandler switch (xid, scmsg) =
case scmsg of
PacketIn pktIn -> sendToSwitch switch (xid, PacketOut (receivedPacketOut pktIn flood))
_ -> return ()
| 185
| false
| true
| 0
| 12
| 63
| 92
| 45
| 47
| null | null |
lfairy/sylvia
|
Sylvia/Text/PrettyPrint.hs
|
gpl-3.0
|
pprintExp :: Exp Void -> String
pprintExp = ($ "") . pprint . vacuous
| 69
|
pprintExp :: Exp Void -> String
pprintExp = ($ "") . pprint . vacuous
| 69
|
pprintExp = ($ "") . pprint . vacuous
| 37
| false
| true
| 2
| 7
| 13
| 39
| 17
| 22
| null | null |
chreekat/snowdrift
|
tests/TestImport.hs
|
agpl-3.0
|
loginAs :: Login user => user -> YesodExample App ()
loginAs user = do
get200 $ urlPath $ testRoot `T.append` "/auth/login"
submitLogin (username user) (password user)
| 175
|
loginAs :: Login user => user -> YesodExample App ()
loginAs user = do
get200 $ urlPath $ testRoot `T.append` "/auth/login"
submitLogin (username user) (password user)
| 175
|
loginAs user = do
get200 $ urlPath $ testRoot `T.append` "/auth/login"
submitLogin (username user) (password user)
| 122
| false
| true
| 0
| 10
| 33
| 76
| 35
| 41
| null | null |
shlevy/ghc
|
compiler/utils/Util.hs
|
bsd-3-clause
|
zipWith4Equal _ = zipWith4
| 26
|
zipWith4Equal _ = zipWith4
| 26
|
zipWith4Equal _ = zipWith4
| 26
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
akaihola/palindromi-haskell
|
src/Tests.hs
|
mit
|
case_hasAlpha_lower_a = do True @=? hasAlpha "!#¤%&a()"
| 55
|
case_hasAlpha_lower_a = do True @=? hasAlpha "!#¤%&a()"
| 55
|
case_hasAlpha_lower_a = do True @=? hasAlpha "!#¤%&a()"
| 55
| false
| false
| 0
| 8
| 6
| 16
| 7
| 9
| null | null |
nwf/wl-pprint-extras
|
src/Text/PrettyPrint/Free/Internal.hs
|
bsd-2-clause
|
columns :: (Maybe Int -> Doc a e) -> Doc a e
columns = Columns
| 62
|
columns :: (Maybe Int -> Doc a e) -> Doc a e
columns = Columns
| 62
|
columns = Columns
| 17
| false
| true
| 0
| 9
| 14
| 41
| 18
| 23
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
happyReduction_218 _ = notHappyAtAll
| 37
|
happyReduction_218 _ = notHappyAtAll
| 37
|
happyReduction_218 _ = notHappyAtAll
| 37
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
sgillespie/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
primOrdOps :: String -- The class involved
-> TyCon -- The tycon involved
-> Type -- The type
-> (RdrName, RdrName, RdrName, RdrName, RdrName) -- (lt,le,eq,ge,gt)
-- See Note [Deriving and unboxed types] in TcDeriv
primOrdOps str tycon ty = assoc_ty_id str tycon ordOpTbl ty
| 320
|
primOrdOps :: String -- The class involved
-> TyCon -- The tycon involved
-> Type -- The type
-> (RdrName, RdrName, RdrName, RdrName, RdrName)
primOrdOps str tycon ty = assoc_ty_id str tycon ordOpTbl ty
| 247
|
primOrdOps str tycon ty = assoc_ty_id str tycon ordOpTbl ty
| 59
| true
| true
| 0
| 10
| 90
| 64
| 35
| 29
| null | null |
AntonXue/SSTG
|
src/SSTG/Core/Translation/Haskell.hs
|
bsd-3-clause
|
mkType (CastTy ty cor) = SL.CastTy (mkType ty) (mkCoercion cor)
| 63
|
mkType (CastTy ty cor) = SL.CastTy (mkType ty) (mkCoercion cor)
| 63
|
mkType (CastTy ty cor) = SL.CastTy (mkType ty) (mkCoercion cor)
| 63
| false
| false
| 0
| 7
| 9
| 36
| 17
| 19
| null | null |
serokell/importify
|
test/GGenerator.hs
|
mit
|
cleanGoldenExamples :: MonadIO m => m ()
cleanGoldenExamples = do
goldenExamples <- findGoldenFiles testDataPath
mapM_ removeFile goldenExamples
| 152
|
cleanGoldenExamples :: MonadIO m => m ()
cleanGoldenExamples = do
goldenExamples <- findGoldenFiles testDataPath
mapM_ removeFile goldenExamples
| 152
|
cleanGoldenExamples = do
goldenExamples <- findGoldenFiles testDataPath
mapM_ removeFile goldenExamples
| 111
| false
| true
| 0
| 9
| 24
| 47
| 19
| 28
| null | null |
Numberartificial/workflow
|
snipets/src/Craft/Chapter10.hs
|
mit
|
beside :: Picture -> Picture -> Picture
beside pic1 pic2 = zipWith (++) pic1 pic2
| 81
|
beside :: Picture -> Picture -> Picture
beside pic1 pic2 = zipWith (++) pic1 pic2
| 81
|
beside pic1 pic2 = zipWith (++) pic1 pic2
| 41
| false
| true
| 0
| 6
| 14
| 37
| 18
| 19
| null | null |
Cognimeta/cognimeta-utils
|
src/Cgm/Data/NEList.hs
|
apache-2.0
|
neSingleton = Single
| 20
|
neSingleton = Single
| 20
|
neSingleton = Single
| 20
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
geophf/1HaskellADay
|
exercises/HAD/Y2017/M01/D10/Solution.hs
|
mit
|
bookURL :: URL
bookURL = "http://www.gutenberg.org/cache/epub/46/pg46.txt"
| 74
|
bookURL :: URL
bookURL = "http://www.gutenberg.org/cache/epub/46/pg46.txt"
| 74
|
bookURL = "http://www.gutenberg.org/cache/epub/46/pg46.txt"
| 59
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.