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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
christiaanb/ghc | compiler/types/TypeRep.hs | bsd-3-clause | tidyType env (ForAllTy tv ty) = ForAllTy tvp $! (tidyType envp ty)
where
(envp, tvp) = tidyTyVarBndr env tv
---------------
-- | Grabs the free type variables, tidies them
-- and then uses 'tidyType' to work over the type itself | 303 | tidyType env (ForAllTy tv ty) = ForAllTy tvp $! (tidyType envp ty)
where
(envp, tvp) = tidyTyVarBndr env tv
---------------
-- | Grabs the free type variables, tidies them
-- and then uses 'tidyType' to work over the type itself | 303 | tidyType env (ForAllTy tv ty) = ForAllTy tvp $! (tidyType envp ty)
where
(envp, tvp) = tidyTyVarBndr env tv
---------------
-- | Grabs the free type variables, tidies them
-- and then uses 'tidyType' to work over the type itself | 303 | false | false | 0 | 7 | 114 | 58 | 29 | 29 | null | null |
genos/online_problems | advent_of_code_2018/day09/src/Main.hs | mit | make :: Int -> Int -> Game
make np = G $ V.replicate np 0 | 57 | make :: Int -> Int -> Game
make np = G $ V.replicate np 0 | 57 | make np = G $ V.replicate np 0 | 30 | false | true | 0 | 7 | 14 | 33 | 16 | 17 | null | null |
olsner/ghc | compiler/types/TyCoRep.hs | bsd-3-clause | isRuntimeRepTy _ = False | 24 | isRuntimeRepTy _ = False | 24 | isRuntimeRepTy _ = False | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bgwines/avalon-meta-comparison | Metas.hs | bsd-3-clause | isDoubleFailMission 10 _ = False | 32 | isDoubleFailMission 10 _ = False | 32 | isDoubleFailMission 10 _ = False | 32 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
dsabel/stmshf | Control/Concurrent/SHFSTM/Internal.hs | bsd-3-clause | writeTVnWithLog :: TLOG -- ^ the transaction log
-> IO ()
writeTVnWithLog (TLOG tlog) =
do
lg <- readIORef tlog -- access the Log-File
mid <- myThreadId
let ((la,ln,lw):xs) = tripelStack lg
let t = readTVars lg
let k = lockingSet lg
let toBeWritten = Set.elems ln
writeNew ... | 390 | writeTVnWithLog :: TLOG -- ^ the transaction log
-> IO ()
writeTVnWithLog (TLOG tlog) =
do
lg <- readIORef tlog -- access the Log-File
mid <- myThreadId
let ((la,ln,lw):xs) = tripelStack lg
let t = readTVars lg
let k = lockingSet lg
let toBeWritten = Set.elems ln
writeNew t... | 389 | writeTVnWithLog (TLOG tlog) =
do
lg <- readIORef tlog -- access the Log-File
mid <- myThreadId
let ((la,ln,lw):xs) = tripelStack lg
let t = readTVars lg
let k = lockingSet lg
let toBeWritten = Set.elems ln
writeNew toBeWritten
writeIORef tlog lg{tripelStack=((la,Set.empty,lw):xs)} | 316 | false | true | 0 | 13 | 102 | 155 | 75 | 80 | null | null |
sgraf812/GLFW-b | Test.hs | bsd-2-clause | test_pollEvents :: IO ()
test_pollEvents =
GLFW.pollEvents | 62 | test_pollEvents :: IO ()
test_pollEvents =
GLFW.pollEvents | 62 | test_pollEvents =
GLFW.pollEvents | 37 | false | true | 0 | 7 | 10 | 24 | 10 | 14 | null | null |
johntyree/traduisons-hs | executables/UI/QML.hs | bsd-3-clause | hangingIndent :: Style
hangingIndent = Style "margin-left: 8px; text-indent: -8px" | 82 | hangingIndent :: Style
hangingIndent = Style "margin-left: 8px; text-indent: -8px" | 82 | hangingIndent = Style "margin-left: 8px; text-indent: -8px" | 59 | false | true | 0 | 6 | 9 | 20 | 8 | 12 | null | null |
Garygunn94/DFS | CommonResources/.stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/autogen/Paths_CommonResources.hs | bsd-3-clause | datadir = "/home/ggunn/DFS/TransactionServer/.stack-work/install/x86_64-linux/lts-7.13/8.0.1/share/x86_64-linux-ghc-8.0.1/CommonResources-0.1.0.0" | 149 | datadir = "/home/ggunn/DFS/TransactionServer/.stack-work/install/x86_64-linux/lts-7.13/8.0.1/share/x86_64-linux-ghc-8.0.1/CommonResources-0.1.0.0" | 149 | datadir = "/home/ggunn/DFS/TransactionServer/.stack-work/install/x86_64-linux/lts-7.13/8.0.1/share/x86_64-linux-ghc-8.0.1/CommonResources-0.1.0.0" | 149 | false | false | 0 | 4 | 5 | 6 | 3 | 3 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_CMD_LINEENDRECTEXTEND :: Int
wxSTC_CMD_LINEENDRECTEXTEND = 2432 | 69 | wxSTC_CMD_LINEENDRECTEXTEND :: Int
wxSTC_CMD_LINEENDRECTEXTEND = 2432 | 69 | wxSTC_CMD_LINEENDRECTEXTEND = 2432 | 34 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
GaloisInc/halvm-ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | isStableSource :: UnfoldingSource -> Bool
-- Keep the unfolding template
isStableSource InlineCompulsory = True | 113 | isStableSource :: UnfoldingSource -> Bool
isStableSource InlineCompulsory = True | 82 | isStableSource InlineCompulsory = True | 40 | true | true | 0 | 5 | 15 | 23 | 11 | 12 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M12/D09/Exercise.hs | mit | friendFollowerRatio :: Tweep -> Rational
friendFollowerRatio = undefined | 72 | friendFollowerRatio :: Tweep -> Rational
friendFollowerRatio = undefined | 72 | friendFollowerRatio = undefined | 31 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
GaloisInc/halvm-ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | -- See Note [Wiring in RuntimeRep]
vecCountDataConNames :: [Name]
vecCountDataConNames = zipWith3Lazy mk_special_dc_name
[ fsLit "Vec2", fsLit "Vec4", fsLit "Vec8"
, fsLit "Vec16", fsLit "Vec32", fsLit "Vec64" ]
vecCountDataConKeys
... | 348 | vecCountDataConNames :: [Name]
vecCountDataConNames = zipWith3Lazy mk_special_dc_name
[ fsLit "Vec2", fsLit "Vec4", fsLit "Vec8"
, fsLit "Vec16", fsLit "Vec32", fsLit "Vec64" ]
vecCountDataConKeys
vecCountDataCons | 313 | vecCountDataConNames = zipWith3Lazy mk_special_dc_name
[ fsLit "Vec2", fsLit "Vec4", fsLit "Vec8"
, fsLit "Vec16", fsLit "Vec32", fsLit "Vec64" ]
vecCountDataConKeys
vecCountDataCons | 282 | true | true | 0 | 7 | 129 | 60 | 31 | 29 | null | null |
fmapfmapfmap/amazonka | amazonka-directconnect/gen/Network/AWS/DirectConnect/ConfirmConnection.hs | mpl-2.0 | -- | The response status code.
ccrsResponseStatus :: Lens' ConfirmConnectionResponse Int
ccrsResponseStatus = lens _ccrsResponseStatus (\ s a -> s{_ccrsResponseStatus = a}) | 172 | ccrsResponseStatus :: Lens' ConfirmConnectionResponse Int
ccrsResponseStatus = lens _ccrsResponseStatus (\ s a -> s{_ccrsResponseStatus = a}) | 141 | ccrsResponseStatus = lens _ccrsResponseStatus (\ s a -> s{_ccrsResponseStatus = a}) | 83 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
daniel-beard/projecteulerhaskell | Problems/p20.hs | mit | main :: IO ()
main = print calc | 31 | main :: IO ()
main = print calc | 31 | main = print calc | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
psibi/cabal2nix | src/Internal/PrettyPrinting.hs | bsd-3-clause | listattr :: String -> Doc -> [String] -> Doc
listattr n prefix vs = onlyIf (not (null vs)) $
sep [ text n <+> equals <+> prefix <+> lbrack,
nest 2 $ fsep $ map text vs,
rbrack <> semi
] | 265 | listattr :: String -> Doc -> [String] -> Doc
listattr n prefix vs = onlyIf (not (null vs)) $
sep [ text n <+> equals <+> prefix <+> lbrack,
nest 2 $ fsep $ map text vs,
rbrack <> semi
] | 265 | listattr n prefix vs = onlyIf (not (null vs)) $
sep [ text n <+> equals <+> prefix <+> lbrack,
nest 2 $ fsep $ map text vs,
rbrack <> semi
] | 220 | false | true | 0 | 11 | 120 | 99 | 49 | 50 | null | null |
alanz/haxl-play | src/EventsThreads.hs | unlicense | -- sys_yield -- Switch to another thread
sys_yield = M (\c -> SYS_YIELD (c () ) ) | 83 | sys_yield = M (\c -> SYS_YIELD (c () ) ) | 40 | sys_yield = M (\c -> SYS_YIELD (c () ) ) | 40 | true | false | 1 | 11 | 18 | 32 | 15 | 17 | null | null |
mightymoose/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Generic/Mutable.hs | bsd-3-clause | clone v = do
v' <- unsafeNew (length v)
unsafeCopy v' v
return v'
-- Growing
-- -------
-- | Grow a vector by the given number of elements. The number must be
-- positive.
{-@ grow :: (PrimMonad m, MVector v a)
=> x:(PVec v m a) -> by:Nat -> m (PVecN v m a {(mvLen x... | 332 | clone v = do
v' <- unsafeNew (length v)
unsafeCopy v' v
return v'
-- Growing
-- -------
-- | Grow a vector by the given number of elements. The number must be
-- positive.
{-@ grow :: (PrimMonad m, MVector v a)
=> x:(PVec v m a) -> by:Nat -> m (PVecN v m a {(mvLen x... | 332 | clone v = do
v' <- unsafeNew (length v)
unsafeCopy v' v
return v'
-- Growing
-- -------
-- | Grow a vector by the given number of elements. The number must be
-- positive.
{-@ grow :: (PrimMonad m, MVector v a)
=> x:(PVec v m a) -> by:Nat -> m (PVecN v m a {(mvLen x... | 332 | false | false | 1 | 11 | 114 | 48 | 21 | 27 | null | null |
alekar/hugs | packages/base/Data/Generics/Instances.hs | bsd-3-clause | listDataType = mkDataType "Prelude.[]" [nilConstr,consConstr] | 61 | listDataType = mkDataType "Prelude.[]" [nilConstr,consConstr] | 61 | listDataType = mkDataType "Prelude.[]" [nilConstr,consConstr] | 61 | false | false | 0 | 6 | 4 | 17 | 9 | 8 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/vectorise/Vectorise/Builtins/Base.hs | bsd-3-clause | lookupEnvBuiltin :: String -- Function name for error messages
-> NameEnv a -- Name environment
-> Name -- Index into the name environment
-> a
lookupEnvBuiltin fn env n
| Just r <- lookupNameEnv env n = r
| o... | 859 | lookupEnvBuiltin :: String -- Function name for error messages
-> NameEnv a -- Name environment
-> Name -- Index into the name environment
-> a
lookupEnvBuiltin fn env n
| Just r <- lookupNameEnv env n = r
| o... | 859 | lookupEnvBuiltin fn env n
| Just r <- lookupNameEnv env n = r
| otherwise
= pprSorry "Vectorise.Builtins.lookupEnvBuiltin"
(vcat [ text ""
, text "DPH builtin function '" <> text fn <> text "_" <> ppr n <>
text "' is not yet implemented."
, text "This function does not appear in your source p... | 608 | false | true | 0 | 13 | 276 | 147 | 67 | 80 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Builder.hs | bsd-3-clause | floatLE :: Float -> Builder
floatLE = P.primFixed P.floatLE | 59 | floatLE :: Float -> Builder
floatLE = P.primFixed P.floatLE | 59 | floatLE = P.primFixed P.floatLE | 31 | false | true | 0 | 6 | 8 | 22 | 11 | 11 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\xFA42' = "\x65E2" | 33 | decomposeChar '\xFA42' = "\x65E2" | 33 | decomposeChar '\xFA42' = "\x65E2" | 33 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
pmiddend/jumpie | lib/Jumpie/Game.hs | gpl-3.0 | processParticle :: (Functor m,Monad m,MonadGame m,MonadState GameState m) => ObjectProcessor m Particle
processParticle _ b = do
currentTicks' <- gcurrentTicks
currentDelta <- gcurrentTimeDelta
deadline <- particleDeadline b
if deadline < currentTicks'
then return (Nothing,[])
else
return (Just (b... | 474 | processParticle :: (Functor m,Monad m,MonadGame m,MonadState GameState m) => ObjectProcessor m Particle
processParticle _ b = do
currentTicks' <- gcurrentTicks
currentDelta <- gcurrentTimeDelta
deadline <- particleDeadline b
if deadline < currentTicks'
then return (Nothing,[])
else
return (Just (b... | 474 | processParticle _ b = do
currentTicks' <- gcurrentTicks
currentDelta <- gcurrentTimeDelta
deadline <- particleDeadline b
if deadline < currentTicks'
then return (Nothing,[])
else
return (Just (b & particlePosition +~ (toSeconds currentDelta) *^ (b ^. particleVelocity) & particleVelocity +~ (toSeco... | 370 | false | true | 0 | 19 | 76 | 168 | 82 | 86 | null | null |
danieldk/lbfgs-hs | Numeric/LBFGS.hs | apache-2.0 | vectorToList_ :: Ptr CDouble -> Ptr CDouble -> [Double] -> IO ([Double])
vectorToList_ pStart pCur l
| pCur >= pStart = do
cval <- peek pCur
let val = realToFrac cval
vectorToList_ pStart (cDoublePlusPtr pCur (-1)) (val:l)
| otherwise = return l | 259 | vectorToList_ :: Ptr CDouble -> Ptr CDouble -> [Double] -> IO ([Double])
vectorToList_ pStart pCur l
| pCur >= pStart = do
cval <- peek pCur
let val = realToFrac cval
vectorToList_ pStart (cDoublePlusPtr pCur (-1)) (val:l)
| otherwise = return l | 259 | vectorToList_ pStart pCur l
| pCur >= pStart = do
cval <- peek pCur
let val = realToFrac cval
vectorToList_ pStart (cDoublePlusPtr pCur (-1)) (val:l)
| otherwise = return l | 186 | false | true | 1 | 13 | 55 | 121 | 57 | 64 | null | null |
jthornber/language-c-ejt | test-framework/Language/C/Test/ParseTests.hs | bsd-3-clause | getContextInfo :: Position -> IO String
getContextInfo pos = do
cnt <- readFile (posFile pos)
return $
case splitAt (posRow pos - 1) (lines cnt) of
([],[]) -> "/* No Input */"
([],ctxLine : post) -> showContext [] ctxLine (take 1 post)
(pre,[]) -> showContext [last pre] "/* End Of File */" []... | 521 | getContextInfo :: Position -> IO String
getContextInfo pos = do
cnt <- readFile (posFile pos)
return $
case splitAt (posRow pos - 1) (lines cnt) of
([],[]) -> "/* No Input */"
([],ctxLine : post) -> showContext [] ctxLine (take 1 post)
(pre,[]) -> showContext [last pre] "/* End Of File */" []... | 521 | getContextInfo pos = do
cnt <- readFile (posFile pos)
return $
case splitAt (posRow pos - 1) (lines cnt) of
([],[]) -> "/* No Input */"
([],ctxLine : post) -> showContext [] ctxLine (take 1 post)
(pre,[]) -> showContext [last pre] "/* End Of File */" []
(pre,ctxLine : post) -> showConte... | 481 | false | true | 0 | 13 | 124 | 238 | 119 | 119 | null | null |
romanb/amazonka | amazonka-iam/gen/Network/AWS/IAM/Types.hs | mpl-2.0 | -- | The status of the access key. 'Active' means the key is valid for API calls; 'Inactive' means it is not.
akmStatus :: Lens' AccessKeyMetadata (Maybe StatusType)
akmStatus = lens _akmStatus (\s a -> s { _akmStatus = a }) | 224 | akmStatus :: Lens' AccessKeyMetadata (Maybe StatusType)
akmStatus = lens _akmStatus (\s a -> s { _akmStatus = a }) | 114 | akmStatus = lens _akmStatus (\s a -> s { _akmStatus = a }) | 58 | true | true | 2 | 9 | 40 | 55 | 25 | 30 | null | null |
kawu/crf-chain2-tiers | src/Data/CRF/Chain2/Tiers/Model.hs | bsd-2-clause | unFeatMap :: FeatMap -> [(Feat, FeatIx)]
unFeatMap fm = concat
[ unLayerMap i layer
| (i, layer) <- zip [0..] (V.toList fm) ] | 133 | unFeatMap :: FeatMap -> [(Feat, FeatIx)]
unFeatMap fm = concat
[ unLayerMap i layer
| (i, layer) <- zip [0..] (V.toList fm) ] | 133 | unFeatMap fm = concat
[ unLayerMap i layer
| (i, layer) <- zip [0..] (V.toList fm) ] | 92 | false | true | 0 | 12 | 30 | 74 | 37 | 37 | null | null |
conal/hermit | examples/Haskell2012/Reverse.hs | bsd-2-clause | rev (x:xs) = rev xs ++ [x] | 26 | rev (x:xs) = rev xs ++ [x] | 26 | rev (x:xs) = rev xs ++ [x] | 26 | false | false | 2 | 6 | 6 | 28 | 13 | 15 | null | null |
spinda/liquidhaskell | tests/gsoc15/unknown/pos/RBTree-col-height.hs | bsd-3-clause | rbal x a (Node R y b (Node R z c d)) = Node R y (Node B x a b) (Node B z c d) | 78 | rbal x a (Node R y b (Node R z c d)) = Node R y (Node B x a b) (Node B z c d) | 78 | rbal x a (Node R y b (Node R z c d)) = Node R y (Node B x a b) (Node B z c d) | 78 | false | false | 0 | 9 | 26 | 70 | 34 | 36 | null | null |
svenssonjoel/ArrowObsidian | Obsidian/ArrowObsidian/API.hs | bsd-3-clause | --------------------------------------------------------------------------------
logInt n | n <= 1 = 0 | 103 | logInt n | n <= 1 = 0 | 21 | logInt n | n <= 1 = 0 | 21 | true | false | 0 | 8 | 9 | 20 | 9 | 11 | null | null |
mariefarrell/Hets | Syntax/ToXml.hs | gpl-2.0 | libItem :: LogicGraph -> GlobalAnnos -> LIB_ITEM -> Element
libItem lg ga li = case li of
Spec_defn n g as rg ->
add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg)
$ unode "SpecDefn" $ genericity lg ga g ++ [annoted spec lg ga as]
View_defn n g (View_type from to _) mapping rg ->
add_attrs (mkNameAttr (... | 811 | libItem :: LogicGraph -> GlobalAnnos -> LIB_ITEM -> Element
libItem lg ga li = case li of
Spec_defn n g as rg ->
add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg)
$ unode "SpecDefn" $ genericity lg ga g ++ [annoted spec lg ga as]
View_defn n g (View_type from to _) mapping rg ->
add_attrs (mkNameAttr (... | 811 | libItem lg ga li = case li of
Spec_defn n g as rg ->
add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg)
$ unode "SpecDefn" $ genericity lg ga g ++ [annoted spec lg ga as]
View_defn n g (View_type from to _) mapping rg ->
add_attrs (mkNameAttr (iriToStr n) : rgAttrs rg)
$ unode "ViewDefn" $ generic... | 751 | false | true | 0 | 17 | 212 | 341 | 159 | 182 | null | null |
onponomarev/ganeti | src/Ganeti/Types.hs | bsd-2-clause | showSecretJSObject :: (JSON.JSON a) =>
[(String, a)] -> JSON.JSObject (Secret JSON.JSValue)
showSecretJSObject value = JSON.toJSObject $ map f value
where f (k, _) = (k, Secret $ JSON.showJSON redacted) | 227 | showSecretJSObject :: (JSON.JSON a) =>
[(String, a)] -> JSON.JSObject (Secret JSON.JSValue)
showSecretJSObject value = JSON.toJSObject $ map f value
where f (k, _) = (k, Secret $ JSON.showJSON redacted) | 227 | showSecretJSObject value = JSON.toJSObject $ map f value
where f (k, _) = (k, Secret $ JSON.showJSON redacted) | 112 | false | true | 0 | 10 | 53 | 93 | 49 | 44 | null | null |
sandrolovnicki/lambda-calculus-interpreter | src/Reducer.hs | mit | --------------------------------------------------------------------------------
-- computes the beta normal form of a lambda term and count steps
---- do one step beta reduction if there are any redexes left
betaNF :: EvaluateOption -> Int -> Expression -> (Expression, Int)
betaNF CallByValue n ex =
if hasBetaRedex ... | 431 | betaNF :: EvaluateOption -> Int -> Expression -> (Expression, Int)
betaNF CallByValue n ex =
if hasBetaRedex ex
then
let (f, s) = betaReduction CallByValue n ex
in betaNF CallByValue s f
else (ex, n) | 222 | betaNF CallByValue n ex =
if hasBetaRedex ex
then
let (f, s) = betaReduction CallByValue n ex
in betaNF CallByValue s f
else (ex, n) | 155 | true | true | 0 | 10 | 83 | 88 | 47 | 41 | null | null |
knalbant/wrangell | ArgParsing.hs | bsd-3-clause | getInputFile :: ParsedArgs -> IOThrowsError String
getInputFile p = return $ inputFile p | 88 | getInputFile :: ParsedArgs -> IOThrowsError String
getInputFile p = return $ inputFile p | 88 | getInputFile p = return $ inputFile p | 37 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | jshortPrimTyConKey = mkPreludeTyConUnique 80 | 45 | jshortPrimTyConKey = mkPreludeTyConUnique 80 | 45 | jshortPrimTyConKey = mkPreludeTyConUnique 80 | 45 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
spechub/Hets | QBF/AS_BASIC_QBF.der.hs | gpl-2.0 | printSymbMapItems :: SYMBMAPITEMS -> Doc
printSymbMapItems (SymbMapItems xs _) = fsep $ map pretty xs | 101 | printSymbMapItems :: SYMBMAPITEMS -> Doc
printSymbMapItems (SymbMapItems xs _) = fsep $ map pretty xs | 101 | printSymbMapItems (SymbMapItems xs _) = fsep $ map pretty xs | 60 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
konn/pandoc-japanese-docx | src/Text/Pandoc/Readers/Docx/Japanese.hs | gpl-2.0 | trimLineBreaks ils = ils | 24 | trimLineBreaks ils = ils | 24 | trimLineBreaks ils = ils | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
neobrain/aeson | Data/Aeson/Encode/Builder.hs | bsd-3-clause | escapeAscii :: BP.BoundedPrim Word8
escapeAscii =
BP.condB (== c2w '\\' ) (ascii2 ('\\','\\')) $
BP.condB (== c2w '\"' ) (ascii2 ('\\','"' )) $
BP.condB (>= c2w '\x20') (BP.liftFixedToBounded BP.word8) $
BP.condB (== c2w '\n' ) (ascii2 ('\\','n' )) $
BP.condB (== c2w '\r' ) (ascii2 ('\\','r' )) ... | 598 | escapeAscii :: BP.BoundedPrim Word8
escapeAscii =
BP.condB (== c2w '\\' ) (ascii2 ('\\','\\')) $
BP.condB (== c2w '\"' ) (ascii2 ('\\','"' )) $
BP.condB (>= c2w '\x20') (BP.liftFixedToBounded BP.word8) $
BP.condB (== c2w '\n' ) (ascii2 ('\\','n' )) $
BP.condB (== c2w '\r' ) (ascii2 ('\\','r' )) ... | 598 | escapeAscii =
BP.condB (== c2w '\\' ) (ascii2 ('\\','\\')) $
BP.condB (== c2w '\"' ) (ascii2 ('\\','"' )) $
BP.condB (>= c2w '\x20') (BP.liftFixedToBounded BP.word8) $
BP.condB (== c2w '\n' ) (ascii2 ('\\','n' )) $
BP.condB (== c2w '\r' ) (ascii2 ('\\','r' )) $
BP.condB (== c2w '\t' ) (asci... | 562 | false | true | 0 | 14 | 135 | 249 | 130 | 119 | null | null |
tjakway/ghcjvm | compiler/main/GhcMake.hs | bsd-3-clause | summaryNodeSummary :: SummaryNode -> ModSummary
summaryNodeSummary (s, _, _) = s | 80 | summaryNodeSummary :: SummaryNode -> ModSummary
summaryNodeSummary (s, _, _) = s | 80 | summaryNodeSummary (s, _, _) = s | 32 | false | true | 0 | 6 | 10 | 27 | 15 | 12 | null | null |
sopvop/cabal | cabal-install/Distribution/Client/Config.hs | bsd-3-clause | getConfigFilePathAndSource :: Flag FilePath -> IO (ConfigFileSource, FilePath)
getConfigFilePathAndSource configFileFlag =
getSource sources
where
sources =
[ (CommandlineOption, return . flagToMaybe $ configFileFlag)
, (EnvironmentVariable, lookup "CABAL_CONFIG" `liftM` getEnvironment)
, ... | 554 | getConfigFilePathAndSource :: Flag FilePath -> IO (ConfigFileSource, FilePath)
getConfigFilePathAndSource configFileFlag =
getSource sources
where
sources =
[ (CommandlineOption, return . flagToMaybe $ configFileFlag)
, (EnvironmentVariable, lookup "CABAL_CONFIG" `liftM` getEnvironment)
, ... | 554 | getConfigFilePathAndSource configFileFlag =
getSource sources
where
sources =
[ (CommandlineOption, return . flagToMaybe $ configFileFlag)
, (EnvironmentVariable, lookup "CABAL_CONFIG" `liftM` getEnvironment)
, (Default, Just `liftM` defaultConfigFile) ]
getSource [] = err... | 475 | false | true | 0 | 10 | 130 | 153 | 83 | 70 | null | null |
craigbilner/advent-of-code-2016 | day-1.hs | apache-2.0 | updateDir North 'L' = West | 26 | updateDir North 'L' = West | 26 | updateDir North 'L' = West | 26 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
konn/konnfav | production.hs | bsd-2-clause | main :: IO ()
main = withKonnFav $ run 3000 | 43 | main :: IO ()
main = withKonnFav $ run 3000 | 43 | main = withKonnFav $ run 3000 | 29 | false | true | 0 | 6 | 9 | 23 | 11 | 12 | null | null |
spacekitteh/smcghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | emitMultiAssign :: [LocalReg] -> [CmmExpr] -> FCode ()
-- Emit code to perform the assignments in the
-- input simultaneously, using temporary variables when necessary.
type Key = Int | 185 | emitMultiAssign :: [LocalReg] -> [CmmExpr] -> FCode ()
-- Emit code to perform the assignments in the
-- input simultaneously, using temporary variables when necessary.
type Key = Int | 185 | emitMultiAssign :: [LocalReg] -> [CmmExpr] -> FCode ()
-- Emit code to perform the assignments in the
-- input simultaneously, using temporary variables when necessary.
type Key = Int | 185 | false | false | 0 | 9 | 30 | 39 | 20 | 19 | null | null |
beni55/wai | warp/Network/Wai/Handler/Warp/Response.hs | mit | checkChunk :: Request -> Bool
checkChunk req = httpVersion req == H.http11 | 74 | checkChunk :: Request -> Bool
checkChunk req = httpVersion req == H.http11 | 74 | checkChunk req = httpVersion req == H.http11 | 44 | false | true | 0 | 6 | 11 | 27 | 13 | 14 | null | null |
prowdsponsor/mangopay | mangopay/src/Web/MangoPay/Payins.hs | bsd-3-clause | -- | helper function to create a new direct payin with the needed information
-- | the url is only used in secure mode but is REQUIRED by MangoPay
mkCardPayin :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> Text -> CardId -> CardPayin
mkCardPayin aid uid wid amount fees url cid= CardPayin Nothing Nothing N... | 463 | mkCardPayin :: AnyUserId -> AnyUserId -> WalletId -> Amount -> Amount -> Text -> CardId -> CardPayin
mkCardPayin aid uid wid amount fees url cid= CardPayin Nothing Nothing Nothing aid uid fees
wid Nothing amount Nothing (Just url) Nothing Nothing cid Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 316 | mkCardPayin aid uid wid amount fees url cid= CardPayin Nothing Nothing Nothing aid uid fees
wid Nothing amount Nothing (Just url) Nothing Nothing cid Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing | 215 | true | true | 0 | 11 | 79 | 109 | 54 | 55 | null | null |
vektordev/GP | src/GRPIndividual.hs | gpl-2.0 | setActive :: Individual -> (Individual, [FilePath], Maybe FilePath)
setActive (InactiveI i f path) = (ActiveI i f path, [], Just $ path ++ "hl.hs") | 147 | setActive :: Individual -> (Individual, [FilePath], Maybe FilePath)
setActive (InactiveI i f path) = (ActiveI i f path, [], Just $ path ++ "hl.hs") | 147 | setActive (InactiveI i f path) = (ActiveI i f path, [], Just $ path ++ "hl.hs") | 79 | false | true | 0 | 9 | 23 | 75 | 38 | 37 | null | null |
jrgdiz/tese | src/MBSUtils.hs | mit | -- *shrugs*
pickBestSnd f (a,b) = (a, head $ sortBy f b) | 56 | pickBestSnd f (a,b) = (a, head $ sortBy f b) | 44 | pickBestSnd f (a,b) = (a, head $ sortBy f b) | 44 | true | false | 0 | 7 | 11 | 35 | 18 | 17 | null | null |
nushio3/formura | exe-src/c-incubator.hs | mit | qbDefaultConfig = QBConfig
{ _qbHostName = "K"
, _qbWorkDir = ".qb/"
, _qbLabNotePath = "/home/nushio/hub/3d-mhd/individuals"
, _qbRemoteLabNotePath = "/volume81/data/ra000008/nushio/individuals"} | 204 | qbDefaultConfig = QBConfig
{ _qbHostName = "K"
, _qbWorkDir = ".qb/"
, _qbLabNotePath = "/home/nushio/hub/3d-mhd/individuals"
, _qbRemoteLabNotePath = "/volume81/data/ra000008/nushio/individuals"} | 204 | qbDefaultConfig = QBConfig
{ _qbHostName = "K"
, _qbWorkDir = ".qb/"
, _qbLabNotePath = "/home/nushio/hub/3d-mhd/individuals"
, _qbRemoteLabNotePath = "/volume81/data/ra000008/nushio/individuals"} | 204 | false | false | 0 | 7 | 26 | 36 | 21 | 15 | null | null |
tonyday567/maths-extended | src/Data/Histogram/Util.hs | mit | err :: Histogram BinD Double -> Pdf -> [Double] -> Double
err h pdf p =
do let pdfT = pdf (H.bins h) p
pdfE = H.histData (perc h)
errV =
zipWith (-)
(V.toList pdfE)
(V.toList pdfT)
err' = fold L.sum (fmap abs errV)
err' | 304 | err :: Histogram BinD Double -> Pdf -> [Double] -> Double
err h pdf p =
do let pdfT = pdf (H.bins h) p
pdfE = H.histData (perc h)
errV =
zipWith (-)
(V.toList pdfE)
(V.toList pdfT)
err' = fold L.sum (fmap abs errV)
err' | 304 | err h pdf p =
do let pdfT = pdf (H.bins h) p
pdfE = H.histData (perc h)
errV =
zipWith (-)
(V.toList pdfE)
(V.toList pdfT)
err' = fold L.sum (fmap abs errV)
err' | 246 | false | true | 0 | 13 | 129 | 135 | 65 | 70 | null | null |
Ferdinand-vW/Wlp-verification-engine | src/Examples.hs | gpl-3.0 | simArray :: Stmt
simArray = var [array "a",array "b"]
[
assume ((ref "a" .== ref "b")),
ref "b" .= i 6,
(sim [ref "a" `repby` i 0,ref "b"] [ref "b" `minus` i 1,i 5]),
(sim [ref "a" `repby` i 0,ref "b"] [ref "a" `repby` i 0 `minus` i 1,i 4]),
... | 393 | simArray :: Stmt
simArray = var [array "a",array "b"]
[
assume ((ref "a" .== ref "b")),
ref "b" .= i 6,
(sim [ref "a" `repby` i 0,ref "b"] [ref "b" `minus` i 1,i 5]),
(sim [ref "a" `repby` i 0,ref "b"] [ref "a" `repby` i 0 `minus` i 1,i 4]),
... | 393 | simArray = var [array "a",array "b"]
[
assume ((ref "a" .== ref "b")),
ref "b" .= i 6,
(sim [ref "a" `repby` i 0,ref "b"] [ref "b" `minus` i 1,i 5]),
(sim [ref "a" `repby` i 0,ref "b"] [ref "a" `repby` i 0 `minus` i 1,i 4]),
assert ((ref... | 376 | false | true | 0 | 12 | 166 | 209 | 108 | 101 | null | null |
Mahdi89/eTeak | src/Misc.hs | bsd-3-clause | -- maybeMergeByWith : merge two sorted lists using `by' to compare elements,
-- `with' to combine equal elements and fail (return Nothing) if any equal elements compared
-- fail the test `test'
maybeMergeByWith :: (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> a) -> [a] -> [a] -> Maybe [a]
... | 813 | maybeMergeByWith :: (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> a) -> [a] -> [a] -> Maybe [a]
maybeMergeByWith by test with lefts rights = body lefts rights []
where
body [] rs ret = Just $ (reverse ret) ++ rs
body ls [] ret = Just $ (reverse ret) ++ ls
body (l:ls)... | 597 | maybeMergeByWith by test with lefts rights = body lefts rights []
where
body [] rs ret = Just $ (reverse ret) ++ rs
body ls [] ret = Just $ (reverse ret) ++ ls
body (l:ls) (r:rs) ret = case by l r of
LT -> body ls (r:rs) (l:ret)
GT -> body (l:l... | 492 | true | true | 2 | 14 | 275 | 292 | 148 | 144 | null | null |
brendanhay/gogol | gogol-servicemanagement/gen/Network/Google/ServiceManagement/Types/Product.hs | mpl-2.0 | -- | Useful description for why this advice was applied and what actions
-- should be taken to mitigate any implied risks.
aDescription :: Lens' Advice (Maybe Text)
aDescription
= lens _aDescription (\ s a -> s{_aDescription = a}) | 232 | aDescription :: Lens' Advice (Maybe Text)
aDescription
= lens _aDescription (\ s a -> s{_aDescription = a}) | 109 | aDescription
= lens _aDescription (\ s a -> s{_aDescription = a}) | 67 | true | true | 0 | 9 | 40 | 49 | 26 | 23 | null | null |
owainlewis/slack | src/Network/Slack/Api.hs | mit | groupsInvite :: Token -> RequestParams -> IO SlackResponse
groupsInvite token params = request token "groups.invite" params | 123 | groupsInvite :: Token -> RequestParams -> IO SlackResponse
groupsInvite token params = request token "groups.invite" params | 123 | groupsInvite token params = request token "groups.invite" params | 64 | false | true | 0 | 7 | 15 | 34 | 16 | 18 | null | null |
sdiehl/ghc | compiler/main/DynFlags.hs | bsd-3-clause | --------------------------
setDumpFlag' :: DumpFlag -> DynP ()
setDumpFlag' dump_flag
= do upd (\dfs -> dopt_set dfs dump_flag)
when want_recomp forceRecompile
where -- Certain dumpy-things are really interested in what's going
-- on during recompilation checking, so in those cases we
-... | 548 | setDumpFlag' :: DumpFlag -> DynP ()
setDumpFlag' dump_flag
= do upd (\dfs -> dopt_set dfs dump_flag)
when want_recomp forceRecompile
where -- Certain dumpy-things are really interested in what's going
-- on during recompilation checking, so in those cases we
-- don't want to turn it off... | 521 | setDumpFlag' dump_flag
= do upd (\dfs -> dopt_set dfs dump_flag)
when want_recomp forceRecompile
where -- Certain dumpy-things are really interested in what's going
-- on during recompilation checking, so in those cases we
-- don't want to turn it off.
want_recomp = dump_flag ... | 485 | true | true | 0 | 10 | 186 | 77 | 41 | 36 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | lcmIntegerIdKey = mkPreludeMiscIdUnique 90 | 56 | lcmIntegerIdKey = mkPreludeMiscIdUnique 90 | 56 | lcmIntegerIdKey = mkPreludeMiscIdUnique 90 | 56 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
rahulmutt/ghcvm | libraries/base/Control/Monad.hs | bsd-3-clause | unless p s = if p then pure () else s | 45 | unless p s = if p then pure () else s | 45 | unless p s = if p then pure () else s | 45 | false | false | 0 | 7 | 18 | 24 | 12 | 12 | null | null |
ducis/reactive-make | pipes-shell-0.1.0/src/Pipes/Shell.hs | gpl-3.0 | -- | Like 'pipeCmdEnv' but closes the input end immediately.
--
-- Useful for command line tools like @ ls @
producerCmdEnv :: MonadSafe m =>
Maybe [(String, String)] ->
String ->
Producer (Either BS.ByteString BS.ByteString) m ()
producerCmdEnv env' cmdStr = yield Nothing >-> ... | 342 | producerCmdEnv :: MonadSafe m =>
Maybe [(String, String)] ->
String ->
Producer (Either BS.ByteString BS.ByteString) m ()
producerCmdEnv env' cmdStr = yield Nothing >-> pipeCmdEnv env' cmdStr | 233 | producerCmdEnv env' cmdStr = yield Nothing >-> pipeCmdEnv env' cmdStr | 69 | true | true | 0 | 11 | 89 | 79 | 40 | 39 | null | null |
Hi-Angel/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | switchCaseChar :: Char -> Char
switchCaseChar c = if isUpper c then toLower c else toUpper c | 92 | switchCaseChar :: Char -> Char
switchCaseChar c = if isUpper c then toLower c else toUpper c | 92 | switchCaseChar c = if isUpper c then toLower c else toUpper c | 61 | false | true | 0 | 6 | 16 | 35 | 17 | 18 | null | null |
brendanhay/gogol | gogol-deploymentmanager/gen/Network/Google/DeploymentManager/Types/Product.hs | mpl-2.0 | -- | [Output Only] The URL of the zone where the operation resides. Only
-- applicable when performing per-zone operations.
oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a}) | 206 | oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a}) | 82 | oZone = lens _oZone (\ s a -> s{_oZone = a}) | 44 | true | true | 1 | 9 | 36 | 50 | 26 | 24 | null | null |
DougBurke/swish | tests/N3FormatterTest.hs | lgpl-2.1 | -- this 'round trips' into a triple-quoted string
simpleN3Graph_g1_06_rt :: B.Builder
simpleN3Graph_g1_06_rt =
commonPrefixes `mappend`
"base1:s1 base1:p1 \"\"\"l2-'\"line1\"'\n\nl2-'\"\"line2\"\"'\"\"\" .\n" | 216 | simpleN3Graph_g1_06_rt :: B.Builder
simpleN3Graph_g1_06_rt =
commonPrefixes `mappend`
"base1:s1 base1:p1 \"\"\"l2-'\"line1\"'\n\nl2-'\"\"line2\"\"'\"\"\" .\n" | 166 | simpleN3Graph_g1_06_rt =
commonPrefixes `mappend`
"base1:s1 base1:p1 \"\"\"l2-'\"line1\"'\n\nl2-'\"\"line2\"\"'\"\"\" .\n" | 130 | true | true | 0 | 5 | 26 | 20 | 12 | 8 | null | null |
Murano/language-javascript | src/Language/JavaScript/Pretty/Printer.hs | bsd-3-clause | rn (NN (JSBlock lb x rb)) foo = rJS (lb ++ x ++ rb) foo | 79 | rn (NN (JSBlock lb x rb)) foo = rJS (lb ++ x ++ rb) foo | 79 | rn (NN (JSBlock lb x rb)) foo = rJS (lb ++ x ++ rb) foo | 79 | false | false | 0 | 9 | 38 | 43 | 21 | 22 | null | null |
stevenremot/fronsduk | src/Machine.hs | gpl-3.0 | applyNumBinOperator :: (Int -> Int -> Int) -> Registers -> IO Registers
applyNumBinOperator op (Registers ((NumberValue a) : (NumberValue b) : s) e c d) =
return $ Registers (op a b § s) e c d | 195 | applyNumBinOperator :: (Int -> Int -> Int) -> Registers -> IO Registers
applyNumBinOperator op (Registers ((NumberValue a) : (NumberValue b) : s) e c d) =
return $ Registers (op a b § s) e c d | 195 | applyNumBinOperator op (Registers ((NumberValue a) : (NumberValue b) : s) e c d) =
return $ Registers (op a b § s) e c d | 123 | false | true | 0 | 12 | 39 | 98 | 49 | 49 | null | null |
lihlcnkr/codejam | backup/src/CodeWars/TinyTreePassCompiler.hs | apache-2.0 | getPriorityValue (TChar '/') = 8 | 32 | getPriorityValue (TChar '/') = 8 | 32 | getPriorityValue (TChar '/') = 8 | 32 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
dysinger/amazonka | amazonka-rds/gen/Network/AWS/RDS/Types.hs | mpl-2.0 | -- | The optional port for the option.
ocPort :: Lens' OptionConfiguration (Maybe Int)
ocPort = lens _ocPort (\s a -> s { _ocPort = a }) | 136 | ocPort :: Lens' OptionConfiguration (Maybe Int)
ocPort = lens _ocPort (\s a -> s { _ocPort = a }) | 97 | ocPort = lens _ocPort (\s a -> s { _ocPort = a }) | 49 | true | true | 1 | 9 | 26 | 49 | 25 | 24 | null | null |
simonmichael/shelltestrunner | src/Types.hs | gpl-3.0 | showMatcherTrimmed (NegativeRegex r) = "!/"++(trim r)++"/" | 60 | showMatcherTrimmed (NegativeRegex r) = "!/"++(trim r)++"/" | 60 | showMatcherTrimmed (NegativeRegex r) = "!/"++(trim r)++"/" | 60 | false | false | 0 | 8 | 7 | 30 | 14 | 16 | null | null |
sordina/scotty | Web/Scotty/Action.hs | bsd-3-clause | -- | Set the body of the response to the given 'T.Text' value. Also sets \"Content-Type\"
-- header to \"text/plain; charset=utf-8\" if it has not already been set.
text :: (ScottyError e, Monad m) => T.Text -> ActionT e m ()
text t = do
changeHeader addIfNotPresent "Content-Type" "text/plain; charset=utf-8"
ra... | 501 | text :: (ScottyError e, Monad m) => T.Text -> ActionT e m ()
text t = do
changeHeader addIfNotPresent "Content-Type" "text/plain; charset=utf-8"
raw $ encodeUtf8 t
-- | Set the body of the response to the given 'T.Text' value. Also sets \"Content-Type\"
-- header to \"text/html; charset=utf-8\" if it has not a... | 336 | text t = do
changeHeader addIfNotPresent "Content-Type" "text/plain; charset=utf-8"
raw $ encodeUtf8 t
-- | Set the body of the response to the given 'T.Text' value. Also sets \"Content-Type\"
-- header to \"text/html; charset=utf-8\" if it has not already been set. | 275 | true | true | 0 | 9 | 90 | 73 | 35 | 38 | null | null |
beni55/hermit | src/HERMIT/PrettyPrinter/Common.hs | bsd-2-clause | attr :: Attr -> DocH -> DocH
attr a p = mark (PushAttr a) <> p <> mark PopAttr | 78 | attr :: Attr -> DocH -> DocH
attr a p = mark (PushAttr a) <> p <> mark PopAttr | 78 | attr a p = mark (PushAttr a) <> p <> mark PopAttr | 49 | false | true | 0 | 9 | 18 | 44 | 21 | 23 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F15.hs | bsd-3-clause | -- glLightiv -------------------------------------------------------------------
-- | Manual page for <https://www.opengl.org/sdk/docs/man2/xhtml/glLight.xml OpenGL 2.x>.
glLightiv
:: MonadIO m
=> GLenum -- ^ @light@ of type [LightName](Graphics-GL-Groups.html#LightName).
-> GLenum -- ^ @pname@ of type [LightPar... | 530 | glLightiv
:: MonadIO m
=> GLenum -- ^ @light@ of type [LightName](Graphics-GL-Groups.html#LightName).
-> GLenum -- ^ @pname@ of type [LightParameter](Graphics-GL-Groups.html#LightParameter).
-> Ptr GLint -- ^ @params@ pointing to @COMPSIZE(pname)@ elements of type @CheckedInt32@.
-> m ()
glLightiv v1 v2 v3 = ... | 358 | glLightiv v1 v2 v3 = liftIO $ dyn140 ptr_glLightiv v1 v2 v3 | 59 | true | true | 2 | 11 | 69 | 68 | 33 | 35 | null | null |
mfilmer/kpModel | kpModel.hs | gpl-3.0 | jToEV joules = joules / q | 25 | jToEV joules = joules / q | 25 | jToEV joules = joules / q | 25 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
eklavya/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | freeNames :: Eq n => TT n -> [n]
freeNames t = nub $ freeNames' t
where
freeNames' (P _ n _) = [n]
freeNames' (Bind n (Let t v) sc) = freeNames' v ++ (freeNames' sc \\ [n])
++ freeNames' t
freeNames' (Bind n b sc) = freeNames' (binderTy b) ++ (freeNames' sc \\ [... | 490 | freeNames :: Eq n => TT n -> [n]
freeNames t = nub $ freeNames' t
where
freeNames' (P _ n _) = [n]
freeNames' (Bind n (Let t v) sc) = freeNames' v ++ (freeNames' sc \\ [n])
++ freeNames' t
freeNames' (Bind n b sc) = freeNames' (binderTy b) ++ (freeNames' sc \\ [... | 490 | freeNames t = nub $ freeNames' t
where
freeNames' (P _ n _) = [n]
freeNames' (Bind n (Let t v) sc) = freeNames' v ++ (freeNames' sc \\ [n])
++ freeNames' t
freeNames' (Bind n b sc) = freeNames' (binderTy b) ++ (freeNames' sc \\ [n])
freeNames' (App _ f a) = ... | 457 | false | true | 0 | 9 | 157 | 217 | 106 | 111 | null | null |
comonoidial/ALFIN | Alfin/CoreConvert.hs | mit | convertAp s (App a b) xs = convertAp s a (convertExp s b : xs) | 67 | convertAp s (App a b) xs = convertAp s a (convertExp s b : xs) | 67 | convertAp s (App a b) xs = convertAp s a (convertExp s b : xs) | 67 | false | false | 0 | 8 | 19 | 40 | 19 | 21 | null | null |
denisenkom/hspkcs11 | src/Bindings/Pkcs11/Attribs.hs | mit | _llAttrToAttr (LlAttribute EcPointType ptr len) = _peekByteString ptr len EcPoint | 81 | _llAttrToAttr (LlAttribute EcPointType ptr len) = _peekByteString ptr len EcPoint | 81 | _llAttrToAttr (LlAttribute EcPointType ptr len) = _peekByteString ptr len EcPoint | 81 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
mdsteele/fallback | src/Fallback/Scenario/Feats.hs | gpl-3.0 | featDescription SolarFlare =
"Deal massive fire damage to up to three enemies. Any undead targets, no\
\ matter how strong, are instantly destroyed." | 154 | featDescription SolarFlare =
"Deal massive fire damage to up to three enemies. Any undead targets, no\
\ matter how strong, are instantly destroyed." | 154 | featDescription SolarFlare =
"Deal massive fire damage to up to three enemies. Any undead targets, no\
\ matter how strong, are instantly destroyed." | 154 | false | false | 0 | 4 | 27 | 10 | 4 | 6 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/recursion/2018-04-wiegley-program-reduction-adi/ADIM.hs | unlicense | evalAdiM :: Expr -> State Count Int
evalAdiM = adiM phi psi
where
phi (Const (AInt n)) = do modify (over numConst (+1)); trace "\nInt" $ return n
phi (Const (ABool b)) = do modify (over numConst (+1)); trace "\nBool" $ return $ if b then 1 else 0
phi (Add l r) = ... | 843 | evalAdiM :: Expr -> State Count Int
evalAdiM = adiM phi psi
where
phi (Const (AInt n)) = do modify (over numConst (+1)); trace "\nInt" $ return n
phi (Const (ABool b)) = do modify (over numConst (+1)); trace "\nBool" $ return $ if b then 1 else 0
phi (Add l r) = ... | 843 | evalAdiM = adiM phi psi
where
phi (Const (AInt n)) = do modify (over numConst (+1)); trace "\nInt" $ return n
phi (Const (ABool b)) = do modify (over numConst (+1)); trace "\nBool" $ return $ if b then 1 else 0
phi (Add l r) = do modify (over numAdd (+1)); trac... | 807 | false | true | 0 | 14 | 326 | 446 | 218 | 228 | null | null |
antalsz/hs-to-coq | examples/containers/extraction/SetProperties.hs | mit | isLeft _ = False | 16 | isLeft _ = False | 16 | isLeft _ = False | 16 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Lazy.hs | bsd-3-clause | --TODO, we could coalese small blocks here
--FIXME: probably not strict enough, if we're doing this to avoid retaining
-- the parent blocks then we'd better copy strictly.
-- ---------------------------------------------------------------------
-- TODO defrag func that concatenates block together that are below a thr... | 1,497 | hGetContentsN :: Int -> Handle -> IO ByteString
hGetContentsN k h = lazyRead -- TODO close on exceptions
where
lazyRead = unsafeInterleaveIO loop
loop = do
c <- S.hGetSome h k -- only blocks if there is no data available
if S.null c
then do hClose h >> return Empty
else do... | 482 | hGetContentsN k h = lazyRead -- TODO close on exceptions
where
lazyRead = unsafeInterleaveIO loop
loop = do
c <- S.hGetSome h k -- only blocks if there is no data available
if S.null c
then do hClose h >> return Empty
else do cs <- lazyRead
return (Chunk ... | 434 | true | true | 2 | 13 | 305 | 146 | 78 | 68 | null | null |
ekmett/ghc | compiler/cmm/CmmBuildInfoTables.hs | bsd-3-clause | procpointSRT :: DynFlags -> CLabel -> Map CLabel Int -> [CLabel] ->
UniqSM (Maybe CmmDecl, C_SRT)
procpointSRT _ _ _ [] =
return (Nothing, NoC_SRT) | 164 | procpointSRT :: DynFlags -> CLabel -> Map CLabel Int -> [CLabel] ->
UniqSM (Maybe CmmDecl, C_SRT)
procpointSRT _ _ _ [] =
return (Nothing, NoC_SRT) | 164 | procpointSRT _ _ _ [] =
return (Nothing, NoC_SRT) | 50 | false | true | 0 | 11 | 41 | 67 | 34 | 33 | null | null |
np/ling | Ling/Compile/C.hs | bsd-3-clause | transLVal (C.LArw l f) = C.EArw (transLVal l) f | 47 | transLVal (C.LArw l f) = C.EArw (transLVal l) f | 47 | transLVal (C.LArw l f) = C.EArw (transLVal l) f | 47 | false | false | 0 | 8 | 8 | 32 | 15 | 17 | null | null |
cdepillabout/continuation-monad-test | src/Main.hs | gpl-2.0 | one, zero :: Binary
one = True | 30 | one, zero :: Binary
one = True | 30 | one = True | 10 | false | true | 2 | 6 | 6 | 24 | 9 | 15 | null | null |
JPMoresmau/leksah | src/IDE/Session.hs | gpl-2.0 | mkLayout :: IDEM PaneLayout
mkLayout = do
rawLayout <- getLayout
getLayout' rawLayout []
where
getLayout' (HorizontalP l r _) pp = do
l2 <- getLayout' l (pp ++ [SplitP TopP])
r2 <- getLayout' r (pp ++ [SplitP BottomP])
pane <- getPaned pp
pos ... | 1,666 | mkLayout :: IDEM PaneLayout
mkLayout = do
rawLayout <- getLayout
getLayout' rawLayout []
where
getLayout' (HorizontalP l r _) pp = do
l2 <- getLayout' l (pp ++ [SplitP TopP])
r2 <- getLayout' r (pp ++ [SplitP BottomP])
pane <- getPaned pp
pos ... | 1,666 | mkLayout = do
rawLayout <- getLayout
getLayout' rawLayout []
where
getLayout' (HorizontalP l r _) pp = do
l2 <- getLayout' l (pp ++ [SplitP TopP])
r2 <- getLayout' r (pp ++ [SplitP BottomP])
pane <- getPaned pp
pos <- fromIntegral <$> ... | 1,638 | false | true | 0 | 19 | 613 | 535 | 254 | 281 | null | null |
AlexanderPankiv/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprASCII :: [Word8] -> SDoc
pprASCII str
= vcat (map do1 str) $$ do1 0
where
do1 :: Word8 -> SDoc
do1 w = ptext (sLit "\t.byte\t") <> int (fromIntegral w) | 174 | pprASCII :: [Word8] -> SDoc
pprASCII str
= vcat (map do1 str) $$ do1 0
where
do1 :: Word8 -> SDoc
do1 w = ptext (sLit "\t.byte\t") <> int (fromIntegral w) | 174 | pprASCII str
= vcat (map do1 str) $$ do1 0
where
do1 :: Word8 -> SDoc
do1 w = ptext (sLit "\t.byte\t") <> int (fromIntegral w) | 146 | false | true | 2 | 8 | 50 | 81 | 39 | 42 | null | null |
wavewave/diagdrawer | exe/diagdrawer.hs | bsd-2-clause | main :: IO ()
main = do
putStrLn "diagdrawer"
param <- cmdArgs mode
commandLineProcess param | 101 | main :: IO ()
main = do
putStrLn "diagdrawer"
param <- cmdArgs mode
commandLineProcess param | 100 | main = do
putStrLn "diagdrawer"
param <- cmdArgs mode
commandLineProcess param | 86 | false | true | 0 | 8 | 23 | 38 | 16 | 22 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.hs | bsd-3-clause | foldl1' = G.foldl1' | 19 | foldl1' = G.foldl1' | 19 | foldl1' = G.foldl1' | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
mcschroeder/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | statePrimTyCon :: TyCon -- See Note [The State# TyCon]
statePrimTyCon = pcPrimTyCon statePrimTyConName [Nominal] VoidRep | 124 | statePrimTyCon :: TyCon
statePrimTyCon = pcPrimTyCon statePrimTyConName [Nominal] VoidRep | 91 | statePrimTyCon = pcPrimTyCon statePrimTyConName [Nominal] VoidRep | 67 | true | true | 0 | 6 | 18 | 22 | 12 | 10 | null | null |
fmapfmapfmap/amazonka | amazonka-elb/gen/Network/AWS/ELB/ModifyLoadBalancerAttributes.hs | mpl-2.0 | -- | The response status code.
mlbarsResponseStatus :: Lens' ModifyLoadBalancerAttributesResponse Int
mlbarsResponseStatus = lens _mlbarsResponseStatus (\ s a -> s{_mlbarsResponseStatus = a}) | 191 | mlbarsResponseStatus :: Lens' ModifyLoadBalancerAttributesResponse Int
mlbarsResponseStatus = lens _mlbarsResponseStatus (\ s a -> s{_mlbarsResponseStatus = a}) | 160 | mlbarsResponseStatus = lens _mlbarsResponseStatus (\ s a -> s{_mlbarsResponseStatus = a}) | 89 | true | true | 0 | 9 | 21 | 40 | 22 | 18 | null | null |
goldfirere/glambda | src/Language/Glambda/Eval.hs | bsd-3-clause | eval (App e1 e2) = eval (apply (eval e1) e2) | 49 | eval (App e1 e2) = eval (apply (eval e1) e2) | 49 | eval (App e1 e2) = eval (apply (eval e1) e2) | 49 | false | false | 0 | 9 | 14 | 34 | 16 | 18 | null | null |
scslab/iterIO | Data/IterIO/Http.hs | bsd-3-clause | mkHttpRequest_Line :: HttpReq s -> Bool -> S
mkHttpRequest_Line req absURI = S.concat [
reqMethod req
, sp
, mkReqURI req absURI
, sp
, let (major, minor) = reqVers req
in S8.pack $ "HTTP/" ++ show major ++ "." ++ show minor
, S8.pack "\r\n"
]
where sp = S8.singleton ' '
-- | Given a request, c... | 517 | mkHttpRequest_Line :: HttpReq s -> Bool -> S
mkHttpRequest_Line req absURI = S.concat [
reqMethod req
, sp
, mkReqURI req absURI
, sp
, let (major, minor) = reqVers req
in S8.pack $ "HTTP/" ++ show major ++ "." ++ show minor
, S8.pack "\r\n"
]
where sp = S8.singleton ' '
-- | Given a request, c... | 517 | mkHttpRequest_Line req absURI = S.concat [
reqMethod req
, sp
, mkReqURI req absURI
, sp
, let (major, minor) = reqVers req
in S8.pack $ "HTTP/" ++ show major ++ "." ++ show minor
, S8.pack "\r\n"
]
where sp = S8.singleton ' '
-- | Given a request, create the Request-URI.
-- If @absURI@ flag is... | 472 | false | true | 1 | 13 | 117 | 132 | 64 | 68 | null | null |
nomeata/ghc | compiler/codeGen/CgPrimOp.hs | bsd-3-clause | emitPrimOp res ReadOffAddrOp_StablePtr args _ = doIndexOffAddrOp Nothing bWord res args | 87 | emitPrimOp res ReadOffAddrOp_StablePtr args _ = doIndexOffAddrOp Nothing bWord res args | 87 | emitPrimOp res ReadOffAddrOp_StablePtr args _ = doIndexOffAddrOp Nothing bWord res args | 87 | false | false | 0 | 5 | 10 | 27 | 11 | 16 | null | null |
ksallberg/adventofcode | 2015/src/Day19_2.hs | bsd-2-clause | trans "SiRnFAr" = "P" | 21 | trans "SiRnFAr" = "P" | 21 | trans "SiRnFAr" = "P" | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
vladimir-ipatov/ganeti | test/hs/Test/Ganeti/HTools/Types.hs | gpl-2.0 | genBiggerISpec :: Types.ISpec -> Gen Types.ISpec
genBiggerISpec imin = do
mem_s <- choose (Types.iSpecMemorySize imin, maxBound)
dsk_c <- choose (Types.iSpecDiskCount imin, maxBound)
dsk_s <- choose (Types.iSpecDiskSize imin, maxBound)
cpu_c <- choose (Types.iSpecCpuCount imin, maxBound)
nic_c <- choose (Type... | 824 | genBiggerISpec :: Types.ISpec -> Gen Types.ISpec
genBiggerISpec imin = do
mem_s <- choose (Types.iSpecMemorySize imin, maxBound)
dsk_c <- choose (Types.iSpecDiskCount imin, maxBound)
dsk_s <- choose (Types.iSpecDiskSize imin, maxBound)
cpu_c <- choose (Types.iSpecCpuCount imin, maxBound)
nic_c <- choose (Type... | 824 | genBiggerISpec imin = do
mem_s <- choose (Types.iSpecMemorySize imin, maxBound)
dsk_c <- choose (Types.iSpecDiskCount imin, maxBound)
dsk_s <- choose (Types.iSpecDiskSize imin, maxBound)
cpu_c <- choose (Types.iSpecCpuCount imin, maxBound)
nic_c <- choose (Types.iSpecNicCount imin, maxBound)
su <- choose... | 775 | false | true | 0 | 12 | 228 | 232 | 113 | 119 | null | null |
OCExercise/haskellbook-solutions | chapters/chapter05/exercises/determine_the_type_p1.hs | bsd-2-clause | b = head [(0,"doge"),(1,"kitteh")] | 34 | b = head [(0,"doge"),(1,"kitteh")] | 34 | b = head [(0,"doge"),(1,"kitteh")] | 34 | false | false | 1 | 7 | 3 | 30 | 16 | 14 | null | null |
mbudde/jana | src/Jana/Error.hs | bsd-3-clause | newErrorMessage :: SourcePos -> Message -> JanaError
newErrorMessage pos msg
= JanaError pos [msg] | 100 | newErrorMessage :: SourcePos -> Message -> JanaError
newErrorMessage pos msg
= JanaError pos [msg] | 100 | newErrorMessage pos msg
= JanaError pos [msg] | 47 | false | true | 0 | 6 | 15 | 32 | 16 | 16 | null | null |
ivanperez-keera/Yampa | yampa/src/FRP/Yampa/InternalCore.hs | bsd-3-clause | secondPrim :: SF a b -> SF (c,a) (c,b)
secondPrim (SF {sfTF = tf10}) = SF {sfTF = tf0}
where
tf0 ~(c0, a0) = (spAux sf1, (c0, b0))
where
(sf1, b0) = tf10 a0
-- Also used in parSplitPrim | 227 | secondPrim :: SF a b -> SF (c,a) (c,b)
secondPrim (SF {sfTF = tf10}) = SF {sfTF = tf0}
where
tf0 ~(c0, a0) = (spAux sf1, (c0, b0))
where
(sf1, b0) = tf10 a0
-- Also used in parSplitPrim | 227 | secondPrim (SF {sfTF = tf10}) = SF {sfTF = tf0}
where
tf0 ~(c0, a0) = (spAux sf1, (c0, b0))
where
(sf1, b0) = tf10 a0
-- Also used in parSplitPrim | 188 | false | true | 0 | 9 | 80 | 110 | 61 | 49 | null | null |
ancientlanguage/haskell-analysis | grammar/src/Grammar/Common/Decompose.hs | mit | decomposeChar '\x2ADC' = "\x2ADD\x0338" | 39 | decomposeChar '\x2ADC' = "\x2ADD\x0338" | 39 | decomposeChar '\x2ADC' = "\x2ADD\x0338" | 39 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mb21/qua-kit | services/siren/app/Main.hs | mit | -- | entry point
main :: IO ()
main = withPostgres sets $ \conn ->
void $ runLuciClient (ServiceState 0 conn HashMap.empty) processMessages
where
sets = PSSettings
{ uName = "siren"
, uPass = "sirenpass"
, dbHost = "localhost"
, dbPort = 5432
, dbName = "sirendb"
} | 313 | main :: IO ()
main = withPostgres sets $ \conn ->
void $ runLuciClient (ServiceState 0 conn HashMap.empty) processMessages
where
sets = PSSettings
{ uName = "siren"
, uPass = "sirenpass"
, dbHost = "localhost"
, dbPort = 5432
, dbName = "sirendb"
} | 296 | main = withPostgres sets $ \conn ->
void $ runLuciClient (ServiceState 0 conn HashMap.empty) processMessages
where
sets = PSSettings
{ uName = "siren"
, uPass = "sirenpass"
, dbHost = "localhost"
, dbPort = 5432
, dbName = "sirendb"
} | 282 | true | true | 0 | 11 | 95 | 90 | 50 | 40 | null | null |
deepfire/mood | doc/eur/text-zipper.hs | agpl-3.0 | moveWordRightSpec :: Spec
moveWordRightSpec = describe "moveWordRight" $ do
it "does nothing at the end of the text" $
moveWordRight (zipLoc ["foo bar"] (0, 7)) `isAt` (0, 7)
it "moves from middle of the word to its end" $
moveWordRight (zipLoc ["barfoo foo"] (0, 2)) `isAt`(0, 6)
it "moves fro... | 1,015 | moveWordRightSpec :: Spec
moveWordRightSpec = describe "moveWordRight" $ do
it "does nothing at the end of the text" $
moveWordRight (zipLoc ["foo bar"] (0, 7)) `isAt` (0, 7)
it "moves from middle of the word to its end" $
moveWordRight (zipLoc ["barfoo foo"] (0, 2)) `isAt`(0, 6)
it "moves fro... | 1,015 | moveWordRightSpec = describe "moveWordRight" $ do
it "does nothing at the end of the text" $
moveWordRight (zipLoc ["foo bar"] (0, 7)) `isAt` (0, 7)
it "moves from middle of the word to its end" $
moveWordRight (zipLoc ["barfoo foo"] (0, 2)) `isAt`(0, 6)
it "moves from beginning to end" $
... | 989 | false | true | 0 | 15 | 247 | 376 | 201 | 175 | null | null |
DrexelSystemsImmunologyLab/diversity | src/src-lib/Math/Diversity/Print.hs | gpl-3.0 | printRarefaction :: Bool
-> Double
-> Label
-> Window
-> PositionMap
-> IO String
printRarefaction
bySample g label window positionMap = do
body <- fmap unlines . mapM mapLine . Map.toAscList $ positionMap
return (header ++... | 1,438 | printRarefaction :: Bool
-> Double
-> Label
-> Window
-> PositionMap
-> IO String
printRarefaction
bySample g label window positionMap = do
body <- fmap unlines . mapM mapLine . Map.toAscList $ positionMap
return (header ++... | 1,438 | printRarefaction
bySample g label window positionMap = do
body <- fmap unlines . mapM mapLine . Map.toAscList $ positionMap
return (header ++ body)
where
header = "label,window,position,weight,\
\additional_sampling,g_proportion,richness,\
\S_est... | 1,271 | false | true | 0 | 12 | 564 | 329 | 162 | 167 | null | null |
polarina/sdl2 | Graphics/UI/SDL/Event.hs | bsd-3-clause | recordGesture :: MonadIO m => TouchID -> m CInt
recordGesture v1 = liftIO $ recordGesture' v1 | 93 | recordGesture :: MonadIO m => TouchID -> m CInt
recordGesture v1 = liftIO $ recordGesture' v1 | 93 | recordGesture v1 = liftIO $ recordGesture' v1 | 45 | false | true | 0 | 7 | 15 | 35 | 16 | 19 | null | null |
bjpop/blip | blipcompiler/src/Blip/Compiler/Compile.hs | bsd-3-clause | isComparison (GreaterThan {}) = True | 36 | isComparison (GreaterThan {}) = True | 36 | isComparison (GreaterThan {}) = True | 36 | false | false | 0 | 7 | 4 | 16 | 8 | 8 | null | null |
hirokai/PaperServer | Parser/Publisher/NatureA.hs | bsd-2-clause | _journal _ cursor = Just $ head $ map (T.strip . head) $ filter (\x -> not $ null x) $ cursor $// element "p" &| attributeIs "class" "article-type" &.// content | 160 | _journal _ cursor = Just $ head $ map (T.strip . head) $ filter (\x -> not $ null x) $ cursor $// element "p" &| attributeIs "class" "article-type" &.// content | 160 | _journal _ cursor = Just $ head $ map (T.strip . head) $ filter (\x -> not $ null x) $ cursor $// element "p" &| attributeIs "class" "article-type" &.// content | 160 | false | false | 1 | 14 | 30 | 78 | 37 | 41 | null | null |
alfpark/bond | compiler/src/Language/Bond/Syntax/Util.hs | mit | foldMapType f x = f x | 21 | foldMapType f x = f x | 21 | foldMapType f x = f x | 21 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.