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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tjakway/ghcjvm | compiler/basicTypes/Id.hs | bsd-3-clause | idDemandInfo :: Id -> Demand
idDemandInfo id = demandInfo (idInfo id) | 81 | idDemandInfo :: Id -> Demand
idDemandInfo id = demandInfo (idInfo id) | 81 | idDemandInfo id = demandInfo (idInfo id) | 46 | false | true | 0 | 7 | 22 | 33 | 14 | 19 | null | null |
meiersi/blaze-builder | benchmarks/Throughput/BlazePut.hs | bsd-3-clause | writeWord16N2Big = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = return ()
loop s n = do
Put.putWrite (
writeWord16be (s+0) `mappend`
writeWord16be (s+1))
loop (s+2) (n-2) | 257 | writeWord16N2Big = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = return ()
loop s n = do
Put.putWrite (
writeWord16be (s+0) `mappend`
writeWord16be (s+1))
loop (s+2) (n-2) | 257 | writeWord16N2Big = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = return ()
loop s n = do
Put.putWrite (
writeWord16be (s+0) `mappend`
writeWord16be (s+1))
loop (s+2) (n-2) | 257 | false | false | 2 | 14 | 99 | 123 | 62 | 61 | null | null |
danr/stm-promise | Control/Concurrent/STM/Promise/Process.hs | lgpl-3.0 | processPromiseCallback
:: (ProcessResult -> IO ()) -- ^ Callback
-> FilePath -- ^ Program to run
-> [String] -- ^ Arguments
-> String -- ^ Input string (stdin)
-> IO (Promise ProcessResult) -- ^ Promise object
processPromiseCallback callback ... | 2,670 | processPromiseCallback
:: (ProcessResult -> IO ()) -- ^ Callback
-> FilePath -- ^ Program to run
-> [String] -- ^ Arguments
-> String -- ^ Input string (stdin)
-> IO (Promise ProcessResult)
processPromiseCallback callback cmd args input = do
... | 2,650 | processPromiseCallback callback cmd args input = do
pid_var <- newTVarIO Nothing
result_var <- newTVarIO Unfinished
spawn_ok <- newTVarIO True
let silent io = io `catchError` const (return ())
spawn = do
-- Check that the process hasn't been spawned before
spawn_... | 2,382 | true | true | 0 | 28 | 1,278 | 636 | 301 | 335 | null | null |
literate-unitb/literate-unitb | src/Documentation/SummaryGen.hs | mit | transient_sum :: Machine -> M ()
transient_sum m = do
let prop = m!.props
section kw $ put_all_expr_with' toString
(style .= Tagged)
"" (M.toAscList $ prop^.transient)
where
kw = "\\textbf{transient}"
toString (Tr _ p evts hint) =
[s... | 1,187 | transient_sum :: Machine -> M ()
transient_sum m = do
let prop = m!.props
section kw $ put_all_expr_with' toString
(style .= Tagged)
"" (M.toAscList $ prop^.transient)
where
kw = "\\textbf{transient}"
toString (Tr _ p evts hint) =
[s... | 1,187 | transient_sum m = do
let prop = m!.props
section kw $ put_all_expr_with' toString
(style .= Tagged)
"" (M.toAscList $ prop^.transient)
where
kw = "\\textbf{transient}"
toString (Tr _ p evts hint) =
[s|%s \\qquad \\text{(%s$%s$%s)}|] ... | 1,154 | false | true | 5 | 12 | 500 | 421 | 204 | 217 | null | null |
MasseR/xmonadcontrib | XMonad/Layout/ImageButtonDecoration.hs | bsd-3-clause | menuButton :: [[Bool]]
menuButton = convertToBool menuButton' | 61 | menuButton :: [[Bool]]
menuButton = convertToBool menuButton' | 61 | menuButton = convertToBool menuButton' | 38 | false | true | 0 | 8 | 6 | 26 | 12 | 14 | null | null |
adarqui/ToyBox | haskell/haskell-wiki/functions-not-data-structures/src/TB/Wiki/FunctionsNotDataStructures.hs | gpl-3.0 | lookup :: Eq k => k -> FiniteMap k v -> Maybe v
lookup k m = m k | 64 | lookup :: Eq k => k -> FiniteMap k v -> Maybe v
lookup k m = m k | 64 | lookup k m = m k | 16 | false | true | 0 | 9 | 18 | 47 | 20 | 27 | null | null |
anton-dessiatov/stack | src/Stack/Build/ConstructPlan.hs | bsd-3-clause | psDirty PSIndex{} = Nothing | 27 | psDirty PSIndex{} = Nothing | 27 | psDirty PSIndex{} = Nothing | 27 | false | false | 1 | 5 | 3 | 16 | 6 | 10 | null | null |
VictorCMiraldo/mmm | MMM/Core/FuncComb.hs | mit | -- (5) Natural isomorphisms ----------------------------------------------------
swap :: (a,b) -> (b,a)
swap = split snd fst | 125 | swap :: (a,b) -> (b,a)
swap = split snd fst | 43 | swap = split snd fst | 20 | true | true | 0 | 6 | 15 | 33 | 19 | 14 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/DE/Lib.hs | bsd-3-clause | stated12 ns i = MoC.stated12 ns (unit2 i) | 41 | stated12 ns i = MoC.stated12 ns (unit2 i) | 41 | stated12 ns i = MoC.stated12 ns (unit2 i) | 41 | false | false | 1 | 7 | 7 | 28 | 11 | 17 | null | null |
mettekou/ghc | compiler/simplCore/SetLevels.hs | bsd-3-clause | add_id :: IdEnv ([Var], LevelledExpr) -> (Var, Var) -> IdEnv ([Var], LevelledExpr)
add_id id_env (v, v1)
| isTyVar v = delVarEnv id_env v
| otherwise = extendVarEnv id_env v ([v1], ASSERT(not (isCoVar v1)) Var v1) | 220 | add_id :: IdEnv ([Var], LevelledExpr) -> (Var, Var) -> IdEnv ([Var], LevelledExpr)
add_id id_env (v, v1)
| isTyVar v = delVarEnv id_env v
| otherwise = extendVarEnv id_env v ([v1], ASSERT(not (isCoVar v1)) Var v1) | 220 | add_id id_env (v, v1)
| isTyVar v = delVarEnv id_env v
| otherwise = extendVarEnv id_env v ([v1], ASSERT(not (isCoVar v1)) Var v1) | 137 | false | true | 1 | 11 | 41 | 116 | 61 | 55 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |'BC.hGet'
bc_hGet = BC.hGet | 31 | bc_hGet = BC.hGet | 17 | bc_hGet = BC.hGet | 17 | true | false | 0 | 5 | 4 | 9 | 5 | 4 | null | null |
bagl/takusen-oracle | Database/Test/Enumerator.hs | bsd-3-clause | iterCursor :: (Monad m) => Int -> IterAct m [Int]
iterCursor i acc = result $ i:acc | 84 | iterCursor :: (Monad m) => Int -> IterAct m [Int]
iterCursor i acc = result $ i:acc | 83 | iterCursor i acc = result $ i:acc | 33 | false | true | 2 | 9 | 17 | 50 | 24 | 26 | null | null |
dcreager/cabal | Distribution/Version.hs | bsd-3-clause | -- | The empty version range, that is a version range containing no versions.
--
-- This can be constructed using any unsatisfiable version range expression,
-- for example @> 1 && < 1@.
--
-- > withinRange v anyVersion = False
--
noVersion :: VersionRange
noVersion = IntersectVersionRanges (LaterVersion v) (EarlierVer... | 437 | noVersion :: VersionRange
noVersion = IntersectVersionRanges (LaterVersion v) (EarlierVersion v)
where v = Version [1] []
-- | The version range @== v@
--
-- > withinRange v' (thisVersion v) = v' == v
-- | 206 | noVersion = IntersectVersionRanges (LaterVersion v) (EarlierVersion v)
where v = Version [1] []
-- | The version range @== v@
--
-- > withinRange v' (thisVersion v) = v' == v
-- | 180 | true | true | 0 | 7 | 80 | 57 | 34 | 23 | null | null |
acowley/ghc | compiler/utils/Pretty.hs | bsd-3-clause | quote p = char '\'' <> p | 31 | quote p = char '\'' <> p | 31 | quote p = char '\'' <> p | 31 | false | false | 0 | 6 | 13 | 16 | 7 | 9 | null | null |
Fuuzetsu/haddock | haddock-api/src/Haddock/Options.hs | bsd-2-clause | optTitle :: [Flag] -> Maybe String
optTitle flags =
case [str | Flag_Heading str <- flags] of
[] -> Nothing
(t:_) -> Just t | 133 | optTitle :: [Flag] -> Maybe String
optTitle flags =
case [str | Flag_Heading str <- flags] of
[] -> Nothing
(t:_) -> Just t | 133 | optTitle flags =
case [str | Flag_Heading str <- flags] of
[] -> Nothing
(t:_) -> Just t | 98 | false | true | 4 | 9 | 33 | 66 | 33 | 33 | null | null |
ucsd-progsys/nanomaly | src/NanoML/Gen.hs | bsd-3-clause | oneof xs = getRandomR (0, length xs - 1) >>= (xs !!) | 52 | oneof xs = getRandomR (0, length xs - 1) >>= (xs !!) | 52 | oneof xs = getRandomR (0, length xs - 1) >>= (xs !!) | 52 | false | false | 0 | 9 | 11 | 33 | 17 | 16 | null | null |
ezyang/ghc | testsuite/tests/typecheck/should_run/T10284.hs | bsd-3-clause | :: Int
a = 'a' | 14 | :: Int
a = 'a' | 14 | :: Int
a = 'a' | 14 | false | false | 0 | 6 | 4 | 15 | 6 | 9 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/Query/Common.hs | bsd-2-clause | -- | Helper to declare a result from 'ErrorResult Maybe'. This version
-- should be used if an error signals there was no data and at the same
-- time when we have optional fields that may not be setted (i.e. we
-- want to return a 'RSUnavail' in case of 'Nothing').
rsErrorMaybeUnavail :: (JSON a) => ErrorResult (Maybe... | 469 | rsErrorMaybeUnavail :: (JSON a) => ErrorResult (Maybe a) -> ResultEntry
rsErrorMaybeUnavail res =
case res of
Ok x -> rsMaybeUnavail x
Bad _ -> rsNoData
-- | Helper for unknown field result. | 202 | rsErrorMaybeUnavail res =
case res of
Ok x -> rsMaybeUnavail x
Bad _ -> rsNoData
-- | Helper for unknown field result. | 130 | true | true | 3 | 9 | 95 | 64 | 34 | 30 | null | null |
urbanslug/ghc | compiler/codeGen/StgCmmProf.hs | bsd-3-clause | zero :: DynFlags -> CmmLit
zero dflags = mkIntCLit dflags 0 | 59 | zero :: DynFlags -> CmmLit
zero dflags = mkIntCLit dflags 0 | 59 | zero dflags = mkIntCLit dflags 0 | 32 | false | true | 0 | 7 | 10 | 29 | 12 | 17 | null | null |
JamieBeverley/InnerEar | src/InnerEar/Types/User.hs | gpl-3.0 | canSeeUserList (Just Manager) = True | 36 | canSeeUserList (Just Manager) = True | 36 | canSeeUserList (Just Manager) = True | 36 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
anton-k/sharc-timbre | src/Sharc/Instruments/Clarinet.hs | bsd-3-clause | note13 :: Note
note13 = Note
(Pitch 311.127 51 "d#4")
14
(Range
(NoteRange
(NoteRangeAmplitude 9956.06 32 0.64)
(NoteRangeHarmonicFreq 1 311.12))
(NoteRange
(NoteRangeAmplitude 1555.63 5 1477.0)
(NoteRangeHarmonicFreq 32 9956.06)))
[Harmoni... | 1,277 | note13 :: Note
note13 = Note
(Pitch 311.127 51 "d#4")
14
(Range
(NoteRange
(NoteRangeAmplitude 9956.06 32 0.64)
(NoteRangeHarmonicFreq 1 311.12))
(NoteRange
(NoteRangeAmplitude 1555.63 5 1477.0)
(NoteRangeHarmonicFreq 32 9956.06)))
[Harmoni... | 1,277 | note13 = Note
(Pitch 311.127 51 "d#4")
14
(Range
(NoteRange
(NoteRangeAmplitude 9956.06 32 0.64)
(NoteRangeHarmonicFreq 1 311.12))
(NoteRange
(NoteRangeAmplitude 1555.63 5 1477.0)
(NoteRangeHarmonicFreq 32 9956.06)))
[Harmonic 1 0.693 1260.... | 1,262 | false | true | 0 | 11 | 359 | 490 | 253 | 237 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/DynFlags.hs | bsd-3-clause | checkTemplateHaskellOk :: TurnOnFlag -> DynP ()
-- TODO: #ifdef GHCI
checkTemplateHaskellOk _
= getCurLoc >>= \l -> upd (\d -> d { thOnLoc = l }) | 147 | checkTemplateHaskellOk :: TurnOnFlag -> DynP ()
checkTemplateHaskellOk _
= getCurLoc >>= \l -> upd (\d -> d { thOnLoc = l }) | 126 | checkTemplateHaskellOk _
= getCurLoc >>= \l -> upd (\d -> d { thOnLoc = l }) | 78 | true | true | 2 | 10 | 27 | 58 | 30 | 28 | null | null |
ghcjs/ghcjs | src/Compiler/GhcjsPlatform.hs | mit | -- | configure the GHC API for building 32 bit JavaScript code
setGhcjsPlatform :: GhcjsSettings
-> GhcjsEnv
-> [FilePath] -- ^ JS objects for linking against
-> FilePath
-- ^ GHCJS base dir, usually "~/.ghcjs/platform-version/ghcjs"
... | 1,632 | setGhcjsPlatform :: GhcjsSettings
-> GhcjsEnv
-> [FilePath] -- ^ JS objects for linking against
-> FilePath
-- ^ GHCJS base dir, usually "~/.ghcjs/platform-version/ghcjs"
-> DynFlags -> DynFlags
setGhcjsPlatform set js_env js_objs bas... | 1,569 | setGhcjsPlatform set js_env js_objs basePath df
= addPlatformDefines basePath
$ setDfOpts
$ installGhcjsHooks js_env set js_objs
$ installDriverHooks set js_env
$ df { targetPlatform = ghcjsPlatform
, platformConstants = ghcjsPlatformConstants
, ghcNameVersion = Ghc... | 1,288 | true | true | 8 | 9 | 584 | 214 | 120 | 94 | null | null |
ktvoelker/helium | src/He/Error.hs | gpl-3.0 | vSepBy :: Doc -> Doc -> Doc -> Doc
vSepBy sep above below = above $+$ sep $+$ below | 83 | vSepBy :: Doc -> Doc -> Doc -> Doc
vSepBy sep above below = above $+$ sep $+$ below | 83 | vSepBy sep above below = above $+$ sep $+$ below | 48 | false | true | 0 | 7 | 18 | 38 | 19 | 19 | null | null |
matusfi/euler | haskell/4.hs | unlicense | -- Set.toDescList converts the Set to a list in descending order
-- This is faster than sorting the list afterwards
main :: IO ()
main = print . find isPalindrome . Set.toDescList $ products 999 999 | 198 | main :: IO ()
main = print . find isPalindrome . Set.toDescList $ products 999 999 | 82 | main = print . find isPalindrome . Set.toDescList $ products 999 999 | 68 | true | true | 1 | 7 | 35 | 46 | 21 | 25 | null | null |
awagner83/powermap | src/Data/Wikipedia/Request.hs | bsd-3-clause | prop x = simpleRequest ("prop", x) | 41 | prop x = simpleRequest ("prop", x) | 41 | prop x = simpleRequest ("prop", x) | 41 | false | false | 1 | 6 | 12 | 21 | 9 | 12 | null | null |
chpatrick/language-glsl | Language/GLSL/Parser.hs | bsd-3-clause | assignmentTable :: [[Operator Char S Expr]]
assignmentTable =
[ [infixRight "=" Equal]
, [infixRight "+=" AddAssign]
, [infixRight "-=" SubAssign]
, [infixRight "*=" MulAssign]
, [infixRight "/=" DivAssign]
, [infixRight "%=" ModAssign]
, [infixRight "<<=" LeftAssign]
, [infixRight ">>=" RightAssign]
... | 416 | assignmentTable :: [[Operator Char S Expr]]
assignmentTable =
[ [infixRight "=" Equal]
, [infixRight "+=" AddAssign]
, [infixRight "-=" SubAssign]
, [infixRight "*=" MulAssign]
, [infixRight "/=" DivAssign]
, [infixRight "%=" ModAssign]
, [infixRight "<<=" LeftAssign]
, [infixRight ">>=" RightAssign]
... | 416 | assignmentTable =
[ [infixRight "=" Equal]
, [infixRight "+=" AddAssign]
, [infixRight "-=" SubAssign]
, [infixRight "*=" MulAssign]
, [infixRight "/=" DivAssign]
, [infixRight "%=" ModAssign]
, [infixRight "<<=" LeftAssign]
, [infixRight ">>=" RightAssign]
, [infixRight "&=" AndAssign]
, [infixRigh... | 372 | false | true | 0 | 7 | 76 | 145 | 79 | 66 | null | null |
haskell-lisp/historic-lisk | src/Language/Lisk/Parser.hs | bsd-3-clause | liskPApp = fmap PParen $ parens $ do
op <- liskQName -- TODO: Restrict to constructor
args <- many1 $ spaces1 *> liskPat
return $ PApp op $ args | 150 | liskPApp = fmap PParen $ parens $ do
op <- liskQName -- TODO: Restrict to constructor
args <- many1 $ spaces1 *> liskPat
return $ PApp op $ args | 150 | liskPApp = fmap PParen $ parens $ do
op <- liskQName -- TODO: Restrict to constructor
args <- many1 $ spaces1 *> liskPat
return $ PApp op $ args | 150 | false | false | 0 | 10 | 34 | 54 | 25 | 29 | null | null |
joehillen/aura | src/Bash/Simplify.hs | gpl-3.0 | replaceStr (NoQuote s) = NoQuote `fmap` replaceStr' s | 55 | replaceStr (NoQuote s) = NoQuote `fmap` replaceStr' s | 55 | replaceStr (NoQuote s) = NoQuote `fmap` replaceStr' s | 55 | false | false | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
jgoerzen/photoset | Data/PhotoSet/Gallery.hs | gpl-2.0 | createGR :: String -> GalleryRemote
createGR = GalleryRemote | 60 | createGR :: String -> GalleryRemote
createGR = GalleryRemote | 60 | createGR = GalleryRemote | 24 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
kRITZCREEK/dickminer | src/Dickmine/Parse.hs | bsd-3-clause | parseLogEntry' x = case parseOldLogEntry x of
Just l -> Just l
Nothing -> parseLogEntry x | 93 | parseLogEntry' x = case parseOldLogEntry x of
Just l -> Just l
Nothing -> parseLogEntry x | 93 | parseLogEntry' x = case parseOldLogEntry x of
Just l -> Just l
Nothing -> parseLogEntry x | 93 | false | false | 1 | 8 | 19 | 40 | 16 | 24 | null | null |
bergmark/wl-pprint | Text/PrettyPrint/Leijen.hs | bsd-2-clause | -- | The document @dot@ contains a single dot, \".\".
dot :: Doc
dot = char '.' | 91 | dot :: Doc
dot = char '.' | 37 | dot = char '.' | 26 | true | true | 0 | 6 | 28 | 21 | 9 | 12 | null | null |
filib/gh-delta | src/Lib.hs | bsd-3-clause | -- | Setter for owner.
setDeltaParamsOwner :: String -> DeltaParams -> DeltaParams
setDeltaParamsOwner x params = params { deltaParamsOwner = fromString x } | 156 | setDeltaParamsOwner :: String -> DeltaParams -> DeltaParams
setDeltaParamsOwner x params = params { deltaParamsOwner = fromString x } | 133 | setDeltaParamsOwner x params = params { deltaParamsOwner = fromString x } | 73 | true | true | 0 | 7 | 22 | 36 | 19 | 17 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Expression.hs | gpl-3.0 | expressionType _ _ _ _ _ _ (Const v) = return $ valueType v | 59 | expressionType _ _ _ _ _ _ (Const v) = return $ valueType v | 59 | expressionType _ _ _ _ _ _ (Const v) = return $ valueType v | 59 | false | false | 1 | 6 | 13 | 30 | 15 | 15 | null | null |
uuhan/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | -- | Get the largest span containing the two FCs
spanFC :: FC -> FC -> FC
spanFC (FC f start end) (FC f' start' end')
| f == f' = FC f (minLocation start start') (maxLocation end end')
| otherwise = NoFC
where minLocation (l, c) (l', c') =
case compare l l' of
LT -> (l, c)
EQ... | 517 | spanFC :: FC -> FC -> FC
spanFC (FC f start end) (FC f' start' end')
| f == f' = FC f (minLocation start start') (maxLocation end end')
| otherwise = NoFC
where minLocation (l, c) (l', c') =
case compare l l' of
LT -> (l, c)
EQ -> (l, min c c')
GT -> (l', c')
... | 468 | spanFC (FC f start end) (FC f' start' end')
| f == f' = FC f (minLocation start start') (maxLocation end end')
| otherwise = NoFC
where minLocation (l, c) (l', c') =
case compare l l' of
LT -> (l, c)
EQ -> (l, min c c')
GT -> (l', c')
maxLocation (l, c) (l... | 443 | true | true | 1 | 11 | 203 | 237 | 124 | 113 | null | null |
Skyfold/postgrest | test/Main.hs | mit | main :: IO ()
main = do
testDbConn <- getEnvVarWithDefault "POSTGREST_TEST_CONNECTION" "postgres://postgrest_test@localhost/postgrest_test"
setupDb testDbConn
pool <- P.acquire (3, 10, toS testDbConn)
-- ask for the OS time at most once per second
getTime <- mkAutoUpdate
defaultUpdateSettings { updateAct... | 2,635 | main :: IO ()
main = do
testDbConn <- getEnvVarWithDefault "POSTGREST_TEST_CONNECTION" "postgres://postgrest_test@localhost/postgrest_test"
setupDb testDbConn
pool <- P.acquire (3, 10, toS testDbConn)
-- ask for the OS time at most once per second
getTime <- mkAutoUpdate
defaultUpdateSettings { updateAct... | 2,635 | main = do
testDbConn <- getEnvVarWithDefault "POSTGREST_TEST_CONNECTION" "postgres://postgrest_test@localhost/postgrest_test"
setupDb testDbConn
pool <- P.acquire (3, 10, toS testDbConn)
-- ask for the OS time at most once per second
getTime <- mkAutoUpdate
defaultUpdateSettings { updateAction = getPOSIX... | 2,621 | false | true | 0 | 14 | 565 | 634 | 321 | 313 | null | null |
ezyang/ghc | compiler/codeGen/CgUtils.hs | bsd-3-clause | baseRegOffset dflags (FloatReg 1) = oFFSET_StgRegTable_rF1 dflags | 72 | baseRegOffset dflags (FloatReg 1) = oFFSET_StgRegTable_rF1 dflags | 72 | baseRegOffset dflags (FloatReg 1) = oFFSET_StgRegTable_rF1 dflags | 72 | false | false | 0 | 7 | 13 | 20 | 9 | 11 | null | null |
ezyang/ghc | compiler/nativeGen/Dwarf/Types.hs | bsd-3-clause | -- | Assembly for a two-byte constant integer
pprHalf :: Word16 -> SDoc
pprHalf x = text "\t.short" <+> ppr (fromIntegral x :: Word) | 132 | pprHalf :: Word16 -> SDoc
pprHalf x = text "\t.short" <+> ppr (fromIntegral x :: Word) | 86 | pprHalf x = text "\t.short" <+> ppr (fromIntegral x :: Word) | 60 | true | true | 0 | 8 | 23 | 38 | 19 | 19 | null | null |
urbanslug/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | kindedTV :: Name -> Kind -> TyVarBndr
kindedTV = KindedTV | 57 | kindedTV :: Name -> Kind -> TyVarBndr
kindedTV = KindedTV | 57 | kindedTV = KindedTV | 19 | false | true | 0 | 6 | 9 | 19 | 10 | 9 | null | null |
pepincho/Functional-Programming | exercise-2.hs | mit | countOccurences x [] = 0 | 24 | countOccurences x [] = 0 | 24 | countOccurences x [] = 0 | 24 | false | false | 1 | 5 | 4 | 18 | 6 | 12 | null | null |
rueshyna/gogol | gogol-analytics/gen/Network/Google/Resource/Analytics/Data/Mcf/Get.hs | mpl-2.0 | -- | A comma-separated list of Multi-Channel Funnels metrics. E.g.,
-- \'mcf:totalConversions,mcf:totalConversionValue\'. At least one metric
-- must be specified.
dmgMetrics :: Lens' DataMcfGet Text
dmgMetrics
= lens _dmgMetrics (\ s a -> s{_dmgMetrics = a}) | 261 | dmgMetrics :: Lens' DataMcfGet Text
dmgMetrics
= lens _dmgMetrics (\ s a -> s{_dmgMetrics = a}) | 97 | dmgMetrics
= lens _dmgMetrics (\ s a -> s{_dmgMetrics = a}) | 61 | true | true | 0 | 9 | 37 | 44 | 24 | 20 | null | null |
brendanhay/gogol | gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs | mpl-2.0 | -- | Deletes a protected range.
reqDeleteProtectedRange :: Lens' Request' (Maybe DeleteProtectedRangeRequest)
reqDeleteProtectedRange
= lens _reqDeleteProtectedRange
(\ s a -> s{_reqDeleteProtectedRange = a}) | 216 | reqDeleteProtectedRange :: Lens' Request' (Maybe DeleteProtectedRangeRequest)
reqDeleteProtectedRange
= lens _reqDeleteProtectedRange
(\ s a -> s{_reqDeleteProtectedRange = a}) | 184 | reqDeleteProtectedRange
= lens _reqDeleteProtectedRange
(\ s a -> s{_reqDeleteProtectedRange = a}) | 106 | true | true | 1 | 9 | 30 | 51 | 25 | 26 | null | null |
sonyandy/tnt | Control/Monad/Code/Opcode.hs | bsd-3-clause | d2i :: Word8
d2i = 0x8e | 23 | d2i :: Word8
d2i = 0x8e | 23 | d2i = 0x8e | 10 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
haskellbr/hackage-downloads | bin/HackageDownloadsApi.hs | mit | scraperWorkerHandler :: WorkHandler () () (TVar [PackageDownloads]) ()
scraperWorkerHandler = const $ do
liftIO $ putStrLn "Scrapping Hackage..."
mpkgDs <- liftIO scrapePackageDownloads
case mpkgDs of
Just pkgDs -> do
st <- getState
liftIO $ atomically (writeTVar st pkgDs)
... | 385 | scraperWorkerHandler :: WorkHandler () () (TVar [PackageDownloads]) ()
scraperWorkerHandler = const $ do
liftIO $ putStrLn "Scrapping Hackage..."
mpkgDs <- liftIO scrapePackageDownloads
case mpkgDs of
Just pkgDs -> do
st <- getState
liftIO $ atomically (writeTVar st pkgDs)
... | 385 | scraperWorkerHandler = const $ do
liftIO $ putStrLn "Scrapping Hackage..."
mpkgDs <- liftIO scrapePackageDownloads
case mpkgDs of
Just pkgDs -> do
st <- getState
liftIO $ atomically (writeTVar st pkgDs)
return WorkComplete
Nothing -> return WorkError | 314 | false | true | 0 | 16 | 107 | 115 | 52 | 63 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/monads/m/src/UseWriter.hs | unlicense | useLInt = do a <- lInt 1; b <- lInt 2; c <- lInt 3; _ <- lInt 0; tell [1] ; return (a+b+c) | 92 | useLInt = do a <- lInt 1; b <- lInt 2; c <- lInt 3; _ <- lInt 0; tell [1] ; return (a+b+c) | 92 | useLInt = do a <- lInt 1; b <- lInt 2; c <- lInt 3; _ <- lInt 0; tell [1] ; return (a+b+c) | 92 | false | false | 1 | 11 | 25 | 81 | 36 | 45 | null | null |
matonix/pfds | src/PFDS/Sec9/Ex13.hs | bsd-3-clause | unconsTree :: RList a -> (Tree a, RList a)
unconsTree [] = error "Empty" | 72 | unconsTree :: RList a -> (Tree a, RList a)
unconsTree [] = error "Empty" | 72 | unconsTree [] = error "Empty" | 29 | false | true | 0 | 9 | 13 | 44 | 19 | 25 | null | null |
lostbean/sphermonics | tablegen/Main.hs | gpl-3.0 | run :: TableGen -> IO ()
run TableGen{..} = do
maybe (return ()) (genLegendre outdir) gen_legendre
maybe (return ()) (genHSHCoeff outdir) gen_hsh_coeff | 157 | run :: TableGen -> IO ()
run TableGen{..} = do
maybe (return ()) (genLegendre outdir) gen_legendre
maybe (return ()) (genHSHCoeff outdir) gen_hsh_coeff | 157 | run TableGen{..} = do
maybe (return ()) (genLegendre outdir) gen_legendre
maybe (return ()) (genHSHCoeff outdir) gen_hsh_coeff | 132 | false | true | 0 | 10 | 27 | 77 | 36 | 41 | null | null |
prasmussen/glot-www | Yesod/Auth/Simple.hs | mit | -- Re-encode to regular base64
decodeToken :: Text -> ByteString
decodeToken = B64.encode . B64Url.decodeLenient . encodeUtf8 | 125 | decodeToken :: Text -> ByteString
decodeToken = B64.encode . B64Url.decodeLenient . encodeUtf8 | 94 | decodeToken = B64.encode . B64Url.decodeLenient . encodeUtf8 | 60 | true | true | 0 | 7 | 16 | 28 | 15 | 13 | null | null |
copumpkin/picklers | src/Data/Pickler.hs | bsd-3-clause | -- Should I just use a two-element type?
either :: Integral i => Pickler ts l -> Pickler ts r -> Pickler (i ': ts) (Either l r)
either (Pickler gl pl) (Pickler gr pr) = Pickler g p
where
g (0 :> cs) = Left <$> gl cs
g (1 :> cs) = Right <$> gr cs
p (Left (pl -> (cs, b))) = (0 :> cs, b)
p (Right (pr -> (cs, b... | 338 | either :: Integral i => Pickler ts l -> Pickler ts r -> Pickler (i ': ts) (Either l r)
either (Pickler gl pl) (Pickler gr pr) = Pickler g p
where
g (0 :> cs) = Left <$> gl cs
g (1 :> cs) = Right <$> gr cs
p (Left (pl -> (cs, b))) = (0 :> cs, b)
p (Right (pr -> (cs, b))) = (1 :> cs, b) | 297 | either (Pickler gl pl) (Pickler gr pr) = Pickler g p
where
g (0 :> cs) = Left <$> gl cs
g (1 :> cs) = Right <$> gr cs
p (Left (pl -> (cs, b))) = (0 :> cs, b)
p (Right (pr -> (cs, b))) = (1 :> cs, b) | 210 | true | true | 0 | 10 | 91 | 206 | 106 | 100 | null | null |
frenetic-lang/netcore-1.0 | src/Frenetic/Slices/Sat.hs | bsd-3-clause | diagnose :: [IO (Maybe String)] -> IO ()
diagnose cases = mapM_ printResult cases | 81 | diagnose :: [IO (Maybe String)] -> IO ()
diagnose cases = mapM_ printResult cases | 81 | diagnose cases = mapM_ printResult cases | 40 | false | true | 0 | 9 | 13 | 40 | 19 | 21 | null | null |
shlevy/hnix-store | hnix-store-core/tests/NarFormat.hs | mit | -- * For each sample above, feed it into `nix-store --dump`,
-- and base64 encode the resulting NAR binary. This lets us
-- check our Haskell NAR generator against `nix-store`
-- "hi" file turned to a NAR with `nix-store --dump`, Base64 encoded
sampleRegularBaseline :: BSL.ByteString
sampleRegularBaseline = B64.decode... | 528 | sampleRegularBaseline :: BSL.ByteString
sampleRegularBaseline = B64.decodeLenient $ BSL.concat
["DQAAAAAAAABuaXgtYXJjaGl2ZS0xAAAAAQAAAAAAAAAoAAAAAAA"
,"AAAQAAAAAAAAAdHlwZQAAAAAHAAAAAAAAAHJlZ3VsYXIACAAAAA"
,"AAAABjb250ZW50cwMAAAAAAAAAaGkKAAAAAAABAAAAAAAAACkAA"
,"AAAAAAA"
] | 282 | sampleRegularBaseline = B64.decodeLenient $ BSL.concat
["DQAAAAAAAABuaXgtYXJjaGl2ZS0xAAAAAQAAAAAAAAAoAAAAAAA"
,"AAAQAAAAAAAAAdHlwZQAAAAAHAAAAAAAAAHJlZ3VsYXIACAAAAA"
,"AAAABjb250ZW50cwMAAAAAAAAAaGkKAAAAAAABAAAAAAAAACkAA"
,"AAAAAAA"
] | 242 | true | true | 2 | 7 | 65 | 47 | 25 | 22 | null | null |
rahulmutt/ghcvm | compiler/Eta/HsSyn/HsBinds.hs | bsd-3-clause | ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id)) | 69 | ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id)) | 69 | ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id)) | 69 | false | false | 0 | 9 | 23 | 35 | 17 | 18 | null | null |
quakehead/haskell-scheme | Types.hs | gpl-3.0 | showVal (String s) = "\"" ++ s ++ "\"" | 38 | showVal (String s) = "\"" ++ s ++ "\"" | 38 | showVal (String s) = "\"" ++ s ++ "\"" | 38 | false | false | 2 | 6 | 8 | 25 | 11 | 14 | null | null |
nightscape/platform | node/src/Unison/Runtime/Multiplex.hs | mit | subscribeTimed :: Serial a => Microseconds -> Channel a -> Multiplex (Multiplex (Maybe a), Multiplex ())
subscribeTimed micros chan = do
(fetch, cancel) <- subscribe chan
result <- liftIO . atomically $ newEmptyTMVar
activity <- liftIO . atomically . newTVar $ False
fetch' <- pure $ do
void . fork $ do
... | 1,173 | subscribeTimed :: Serial a => Microseconds -> Channel a -> Multiplex (Multiplex (Maybe a), Multiplex ())
subscribeTimed micros chan = do
(fetch, cancel) <- subscribe chan
result <- liftIO . atomically $ newEmptyTMVar
activity <- liftIO . atomically . newTVar $ False
fetch' <- pure $ do
void . fork $ do
... | 1,173 | subscribeTimed micros chan = do
(fetch, cancel) <- subscribe chan
result <- liftIO . atomically $ newEmptyTMVar
activity <- liftIO . atomically . newTVar $ False
fetch' <- pure $ do
void . fork $ do
r <- fetch
liftIO . atomically $ do
putTMVar result (Just r)
writeTVar activity T... | 1,068 | false | true | 0 | 19 | 311 | 433 | 195 | 238 | null | null |
goldfirere/singletons | singletons-base/src/Data/List/Singletons/Internal/Disambiguation.hs | bsd-3-clause | listtake :: Natural -> [a] -> [a]
listtake = undefined | 54 | listtake :: Natural -> [a] -> [a]
listtake = undefined | 54 | listtake = undefined | 20 | false | true | 0 | 7 | 9 | 25 | 14 | 11 | null | null |
kmilner/tamarin-prover | lib/theory/src/Theory/Model/Rule.hs | gpl-3.0 | prettyProtoRuleE :: HighlightDocument d => ProtoRuleE -> d
prettyProtoRuleE = prettyNamedRule (kwRuleModulo "E") (const emptyDoc) | 129 | prettyProtoRuleE :: HighlightDocument d => ProtoRuleE -> d
prettyProtoRuleE = prettyNamedRule (kwRuleModulo "E") (const emptyDoc) | 129 | prettyProtoRuleE = prettyNamedRule (kwRuleModulo "E") (const emptyDoc) | 70 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
rzil/honours | LeavittPathAlgebras/Matrix.hs | mit | rank :: (Num a, Eq a) => Matrix a -> Int
rank m = nrows m - nullity m | 69 | rank :: (Num a, Eq a) => Matrix a -> Int
rank m = nrows m - nullity m | 69 | rank m = nrows m - nullity m | 28 | false | true | 0 | 7 | 18 | 46 | 22 | 24 | null | null |
jaiyalas/haha | experiment/v0.hs | mit | cW = \f x -> f x x | 20 | cW = \f x -> f x x | 20 | cW = \f x -> f x x | 20 | false | false | 0 | 6 | 9 | 18 | 9 | 9 | null | null |
asr/apia | src/Apia/Options.hs | mit | ithtptp4XOpt name opts = Right opts { optWithtptp4X = name }
| 61 | withtptp4XOpt name opts = Right opts { optWithtptp4X = name } | 61 | withtptp4XOpt name opts = Right opts { optWithtptp4X = name } | 61 | false | false | 1 | 6 | 11 | 29 | 12 | 17 | null | null |
garrettoreilly/Hunt-The-Wumpus | Player.hs | mit | getAdjRooms :: Player -> Map -> [Int]
getAdjRooms p m = connections $ m !! (location p - 1) | 91 | getAdjRooms :: Player -> Map -> [Int]
getAdjRooms p m = connections $ m !! (location p - 1) | 91 | getAdjRooms p m = connections $ m !! (location p - 1) | 53 | false | true | 0 | 8 | 18 | 45 | 23 | 22 | null | null |
dancor/xiangqiboard | src/xiangqiboard.hs | gpl-2.0 | secondsDiff :: TimeDiff -> Double
secondsDiff timediff = fromIntegral (getSeco (timediff)) | 90 | secondsDiff :: TimeDiff -> Double
secondsDiff timediff = fromIntegral (getSeco (timediff)) | 90 | secondsDiff timediff = fromIntegral (getSeco (timediff)) | 56 | false | true | 0 | 8 | 10 | 30 | 15 | 15 | null | null |
Schpin/schpin-chassis | schpin_robot_lib/src/Data/Walker.hs | gpl-3.0 | getURDF :: Walker -> URDF.URDF
getURDF walker = URDF.URDF (walker_name walker) joints links
where
joints = concatMap getLegJoints ( legs walker )
links = getBodyLink ( body walker) : (concatMap getLegLinks $ legs walker) | 240 | getURDF :: Walker -> URDF.URDF
getURDF walker = URDF.URDF (walker_name walker) joints links
where
joints = concatMap getLegJoints ( legs walker )
links = getBodyLink ( body walker) : (concatMap getLegLinks $ legs walker) | 240 | getURDF walker = URDF.URDF (walker_name walker) joints links
where
joints = concatMap getLegJoints ( legs walker )
links = getBodyLink ( body walker) : (concatMap getLegLinks $ legs walker) | 209 | false | true | 0 | 10 | 53 | 84 | 41 | 43 | null | null |
frantisekfarka/ghc-dsi | testsuite/tests/th/T4135a.hs | bsd-3-clause | createInstance' :: Q Type -> Q Dec
createInstance' t = liftM head [d|
instance Foo $t where
type FooType $t = String |] | 129 | createInstance' :: Q Type -> Q Dec
createInstance' t = liftM head [d|
instance Foo $t where
type FooType $t = String |] | 129 | createInstance' t = liftM head [d|
instance Foo $t where
type FooType $t = String |] | 94 | false | true | 0 | 6 | 32 | 33 | 17 | 16 | null | null |
rcook/pansite | app/PansiteApp/PandocTool.hs | mit | mathJaxUrl :: String
mathJaxUrl = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full" | 111 | mathJaxUrl :: String
mathJaxUrl = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full" | 111 | mathJaxUrl = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full" | 90 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
parsonsmatt/servant-persistent | src/Config.hs | mit | -- | This returns a 'Middleware' based on the environment that we're in.
setLogger :: Environment -> Middleware
setLogger Test = id | 138 | setLogger :: Environment -> Middleware
setLogger Test = id | 65 | setLogger Test = id | 26 | true | true | 0 | 5 | 28 | 19 | 10 | 9 | null | null |
cmwilhelm/dusky | src/Dusky/Locality.hs | mit | lngToXCoord :: Float -> Int
lngToXCoord = round . getXCoord
where getXCoord = deriveLineFromPoints upperLeft lowerRight
upperLeft = (fromIntegral upperLeftLongitude, fromIntegral upperLeftXCoord)
lowerRight = (fromIntegral lowerRightLongitude, fromIntegral lowerRightXCoord) | 295 | lngToXCoord :: Float -> Int
lngToXCoord = round . getXCoord
where getXCoord = deriveLineFromPoints upperLeft lowerRight
upperLeft = (fromIntegral upperLeftLongitude, fromIntegral upperLeftXCoord)
lowerRight = (fromIntegral lowerRightLongitude, fromIntegral lowerRightXCoord) | 295 | lngToXCoord = round . getXCoord
where getXCoord = deriveLineFromPoints upperLeft lowerRight
upperLeft = (fromIntegral upperLeftLongitude, fromIntegral upperLeftXCoord)
lowerRight = (fromIntegral lowerRightLongitude, fromIntegral lowerRightXCoord) | 267 | false | true | 2 | 7 | 48 | 68 | 34 | 34 | null | null |
alanz/Blobs | lib/DData/IntMap.hs | lgpl-2.1 | intersection Nil t = Nil | 24 | intersection Nil t = Nil | 24 | intersection Nil t = Nil | 24 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 19220 = 2829 | 32 | getValueFromProduct 19220 = 2829 | 32 | getValueFromProduct 19220 = 2829 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
aninhumer/mantle | src/Mantle/Logic.hs | bsd-3-clause | (<), (>), (<=), (>=) :: Num a =>
Output a -> Output a -> Output Bool
(<) = binOp OpLT | 89 | (<), (>), (<=), (>=) :: Num a =>
Output a -> Output a -> Output Bool
(<) = binOp OpLT | 89 | (<) = binOp OpLT | 16 | false | true | 3 | 8 | 23 | 61 | 33 | 28 | null | null |
the-real-blackh/sodium-2d-game-engine | FRP/Sodium/GameEngine2D/Geometry.hs | bsd-3-clause | splitBottomP :: Float -> Rect -> (Rect, Rect)
splitBottomP p rect = splitBottom (p * h * 0.01) rect
where h = rectHeight rect
-- | Chop /chop/ off the top of the rectangle, returning the top and the remainder (bottom). | 221 | splitBottomP :: Float -> Rect -> (Rect, Rect)
splitBottomP p rect = splitBottom (p * h * 0.01) rect
where h = rectHeight rect
-- | Chop /chop/ off the top of the rectangle, returning the top and the remainder (bottom). | 221 | splitBottomP p rect = splitBottom (p * h * 0.01) rect
where h = rectHeight rect
-- | Chop /chop/ off the top of the rectangle, returning the top and the remainder (bottom). | 175 | false | true | 1 | 9 | 43 | 67 | 31 | 36 | null | null |
dsabel/stmshf | Control/Concurrent/SHFSTM/Internal/TransactionLog.hs | bsd-3-clause | -- | 'emptyTLOG' constructs an empty transaction log of type 'TLOG'
emptyTLOG :: IO (TLOG)
emptyTLOG =
do p <- newIORef (Log Set.empty [(Set.empty,Set.empty,Set.empty)] Set.empty)
return (TLOG p) | 204 | emptyTLOG :: IO (TLOG)
emptyTLOG =
do p <- newIORef (Log Set.empty [(Set.empty,Set.empty,Set.empty)] Set.empty)
return (TLOG p) | 135 | emptyTLOG =
do p <- newIORef (Log Set.empty [(Set.empty,Set.empty,Set.empty)] Set.empty)
return (TLOG p) | 112 | true | true | 0 | 14 | 36 | 78 | 38 | 40 | null | null |
ganeti/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | instanceCommunicationNetworkMode :: String
instanceCommunicationNetworkMode = nicModeRouted | 91 | instanceCommunicationNetworkMode :: String
instanceCommunicationNetworkMode = nicModeRouted | 91 | instanceCommunicationNetworkMode = nicModeRouted | 48 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Genesis/Config.hs | mit | configVssMaxTTL :: Integral i => Config -> i
configVssMaxTTL = vssMaxTTL . configProtocolConstants | 98 | configVssMaxTTL :: Integral i => Config -> i
configVssMaxTTL = vssMaxTTL . configProtocolConstants | 98 | configVssMaxTTL = vssMaxTTL . configProtocolConstants | 53 | false | true | 0 | 8 | 12 | 33 | 14 | 19 | null | null |
artems/FlashBit | src/Process/Console.hs | bsd-3-clause | writer :: TChan String -> IO Reason
writer outChan = do
_ <- forever $ do
message <- atomically . readTChan $ outChan
putStrLn message
return Normal | 172 | writer :: TChan String -> IO Reason
writer outChan = do
_ <- forever $ do
message <- atomically . readTChan $ outChan
putStrLn message
return Normal | 172 | writer outChan = do
_ <- forever $ do
message <- atomically . readTChan $ outChan
putStrLn message
return Normal | 136 | false | true | 0 | 13 | 50 | 62 | 27 | 35 | null | null |
alexander-at-github/eta | compiler/ETA/Utils/Util.hs | bsd-3-clause | zipWithEqual _ = zipWith | 25 | zipWithEqual _ = zipWith | 25 | zipWithEqual _ = zipWith | 25 | false | false | 0 | 4 | 4 | 10 | 4 | 6 | null | null |
meiersi/blaze-builder | benchmarks/Throughput/BinaryPut.hs | bsd-3-clause | putWord32N16Little = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = return ()
loop s n = do
putWord32le (s+0)
putWord32le (s+1)
putWord32le (s+2)
putWord32le (s+3)
putWord32le (s+4)
putWord32le (s+5)
putWord32l... | 688 | putWord32N16Little = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = return ()
loop s n = do
putWord32le (s+0)
putWord32le (s+1)
putWord32le (s+2)
putWord32le (s+3)
putWord32le (s+4)
putWord32le (s+5)
putWord32l... | 688 | putWord32N16Little = loop 0
where loop s n | s `seq` n `seq` False = undefined
loop _ 0 = return ()
loop s n = do
putWord32le (s+0)
putWord32le (s+1)
putWord32le (s+2)
putWord32le (s+3)
putWord32le (s+4)
putWord32le (s+5)
putWord32l... | 688 | false | false | 2 | 11 | 251 | 295 | 140 | 155 | null | null |
asr/apia | src/Apia/Options.hs | mit | ithEquinoxOpt ∷ String → OM
withEquinoxOpt [] _ = Left $
pretty "option " <> scquotes "--with-equinox"
<> pretty " requires an argument PATH"
| 146 | withEquinoxOpt ∷ String → OM
withEquinoxOpt [] _ = Left $
pretty "option " <> scquotes "--with-equinox"
<> pretty " requires an argument PATH" | 146 | withEquinoxOpt [] _ = Left $
pretty "option " <> scquotes "--with-equinox"
<> pretty " requires an argument PATH" | 117 | false | true | 6 | 8 | 28 | 51 | 21 | 30 | null | null |
olsner/ghc | compiler/codeGen/StgCmmClosure.hs | bsd-3-clause | -- For the non-updatable (single-entry case):
--
-- True if has fvs (in which case we need access to them, and we
-- should black-hole it)
-- or profiling (in which case we need to recover the cost centre
-- from inside it) ToDo: do w... | 584 | nodeMustPointToIt _ (LFThunk {}) -- Node must point to a standard-form thunk
= True | 92 | nodeMustPointToIt _ (LFThunk {}) -- Node must point to a standard-form thunk
= True | 92 | true | false | 1 | 6 | 258 | 30 | 18 | 12 | null | null |
juretta/course | test/src/L02/List/Tests.hs | bsd-3-clause | prop_flatMap_id_flattens ::
List (List Int)
-> Bool
prop_flatMap_id_flattens x =
flatMap id x == flatten x | 112 | prop_flatMap_id_flattens ::
List (List Int)
-> Bool
prop_flatMap_id_flattens x =
flatMap id x == flatten x | 112 | prop_flatMap_id_flattens x =
flatMap id x == flatten x | 56 | false | true | 1 | 9 | 21 | 43 | 18 | 25 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/HaXml/src/Text/ParserCombinators/PolyState.hs | bsd-3-clause | -- | @x `discard` y@ parses both x and y, but discards the result of y
discard :: Parser s t a -> Parser s t b -> Parser s t a
px `discard` py = do { x <- px; _ <- py; return x } | 178 | discard :: Parser s t a -> Parser s t b -> Parser s t a
px `discard` py = do { x <- px; _ <- py; return x } | 107 | px `discard` py = do { x <- px; _ <- py; return x } | 51 | true | true | 0 | 8 | 46 | 80 | 38 | 42 | null | null |
cshung/MiscLab | Haskell99/q24.hs | mit | diffSelectTest :: Int -> Int -> Either [Int] String
diffSelectTest numRandomElements numElements =
let
check :: Int -> Int -> Either [Int] String
check numRandomElements numElements
| numRandomElements < 1 = Right "Selecting less than one element is not supported"
| numRandomElements > n... | 680 | diffSelectTest :: Int -> Int -> Either [Int] String
diffSelectTest numRandomElements numElements =
let
check :: Int -> Int -> Either [Int] String
check numRandomElements numElements
| numRandomElements < 1 = Right "Selecting less than one element is not supported"
| numRandomElements > n... | 680 | diffSelectTest numRandomElements numElements =
let
check :: Int -> Int -> Either [Int] String
check numRandomElements numElements
| numRandomElements < 1 = Right "Selecting less than one element is not supported"
| numRandomElements > numElements = Right "Selecting more than one numEleme... | 628 | false | true | 0 | 12 | 156 | 168 | 78 | 90 | null | null |
fmthoma/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | failed Failed = True | 23 | failed Failed = True | 23 | failed Failed = True | 23 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
kolmodin/cabal | cabal-install/Distribution/Client/ProjectPlanning.hs | bsd-3-clause | defaultSetupDeps :: Compiler -> Platform
-> PD.PackageDescription
-> Maybe [Dependency]
defaultSetupDeps compiler platform pkg =
case packageSetupScriptStyle pkg of
-- For packages with build type custom that do not specify explicit
-- setup dependencies, we add a depe... | 3,046 | defaultSetupDeps :: Compiler -> Platform
-> PD.PackageDescription
-> Maybe [Dependency]
defaultSetupDeps compiler platform pkg =
case packageSetupScriptStyle pkg of
-- For packages with build type custom that do not specify explicit
-- setup dependencies, we add a depe... | 3,046 | defaultSetupDeps compiler platform pkg =
case packageSetupScriptStyle pkg of
-- For packages with build type custom that do not specify explicit
-- setup dependencies, we add a dependency on Cabal and a number
-- of other packages.
SetupCustomImplicitDeps ->
Just $
[ Depende... | 2,924 | false | true | 0 | 15 | 929 | 278 | 153 | 125 | null | null |
mettekou/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | -- treated just like a variable V
-- See Note [Empty case alternatives] in coreSyn/CoreSyn.hs
-- and Note [Bottoming expressions] in coreSyn/CoreUtils.hs:
-- The scrutinee of an empty case evaluates to bottom
pushAtom d p (AnnCase (_, a) _ _ []) -- trac #12128
= pushAtom d p a | 281 | pushAtom d p (AnnCase (_, a) _ _ []) -- trac #12128
= pushAtom d p a | 71 | pushAtom d p (AnnCase (_, a) _ _ []) -- trac #12128
= pushAtom d p a | 71 | true | false | 0 | 7 | 52 | 50 | 25 | 25 | null | null |
DavidAlphaFox/ghc | libraries/bytestring/Data/ByteString/Lazy.hs | bsd-3-clause | -- ---------------------------------------------------------------------
-- Low level constructors
-- | /O(n)/ Make a copy of the 'ByteString' with its own storage.
-- This is mainly useful to allow the rest of the data pointed
-- to by the 'ByteString' to be garbage collected, for example
-- if a large string h... | 488 | copy :: ByteString -> ByteString
copy cs = foldrChunks (Chunk . S.copy) Empty cs | 80 | copy cs = foldrChunks (Chunk . S.copy) Empty cs | 47 | true | true | 0 | 8 | 90 | 47 | 25 | 22 | null | null |
kadena-io/pact | tests/Analyze/Eval.hs | bsd-3-clause | mkEvalEnv :: GenState -> IO (EvalEnv LibState)
mkEvalEnv (GenState _ registryKSs txKSs txDecs txInts txStrs) = do
evalEnv <- liftIO $ initPureEvalEnv Nothing
let xformKsMap = HM.fromList
. fmap (\(k, (pks, _ks)) -> (T.pack k, toJSON pks))
. Map.toList
registryKSs' = xformKsMap registryKSs
... | 813 | mkEvalEnv :: GenState -> IO (EvalEnv LibState)
mkEvalEnv (GenState _ registryKSs txKSs txDecs txInts txStrs) = do
evalEnv <- liftIO $ initPureEvalEnv Nothing
let xformKsMap = HM.fromList
. fmap (\(k, (pks, _ks)) -> (T.pack k, toJSON pks))
. Map.toList
registryKSs' = xformKsMap registryKSs
... | 813 | mkEvalEnv (GenState _ registryKSs txKSs txDecs txInts txStrs) = do
evalEnv <- liftIO $ initPureEvalEnv Nothing
let xformKsMap = HM.fromList
. fmap (\(k, (pks, _ks)) -> (T.pack k, toJSON pks))
. Map.toList
registryKSs' = xformKsMap registryKSs
txKSs' = xformKsMap txKSs
txDecs' = HM... | 766 | false | true | 0 | 20 | 219 | 345 | 179 | 166 | null | null |
fmapfmapfmap/amazonka | amazonka-sdb/gen/Network/AWS/SDB/Types/Product.hs | mpl-2.0 | -- | A list of attributes.
iAttributes :: Lens' Item [Attribute]
iAttributes = lens _iAttributes (\ s a -> s{_iAttributes = a}) . _Coerce | 137 | iAttributes :: Lens' Item [Attribute]
iAttributes = lens _iAttributes (\ s a -> s{_iAttributes = a}) . _Coerce | 110 | iAttributes = lens _iAttributes (\ s a -> s{_iAttributes = a}) . _Coerce | 72 | true | true | 0 | 10 | 23 | 47 | 26 | 21 | null | null |
periodic/Simple-Yesod-ToDo | Settings.hs | bsd-2-clause | -- | The base URL for your static files. As you can see by the default
-- value, this can simply be "static" appended to your application root.
-- A powerful optimization can be serving static files from a separate
-- domain name. This allows you to use a web server optimized for static
-- files, more easily set expire... | 827 | staticRoot :: AppConfig DefaultEnv -> Text
staticRoot conf = [st|#{appRoot conf}/static|] | 90 | staticRoot conf = [st|#{appRoot conf}/static|] | 46 | true | true | 0 | 7 | 130 | 44 | 28 | 16 | null | null |
mengcz13/haskell_project | src/Lib.hs | bsd-3-clause | evalexpr (Geq expr1 expr2) = vgeq (evalexpr expr1) (evalexpr expr2) | 67 | evalexpr (Geq expr1 expr2) = vgeq (evalexpr expr1) (evalexpr expr2) | 67 | evalexpr (Geq expr1 expr2) = vgeq (evalexpr expr1) (evalexpr expr2) | 67 | false | false | 0 | 7 | 9 | 35 | 16 | 19 | null | null |
nevrenato/Hets_Fork | HasCASL/Subst.hs | gpl-2.0 | -- this function is a nice example where the usage of an abstract functor
-- makes the implementation cleaner
-- | reduce the topleft-most occurence of a let-expression if possible
-- , i.e, if the let doesn't contain function-definitions nor patterns
redLet :: Term -> ReductionResult Term
redLet t =
case t of
... | 969 | redLet :: Term -> ReductionResult Term
redLet t =
case t of
-- LetTerm LetBrand [ProgEq] Term Range
LetTerm _ eqs term _ -> substEqs term eqs
ApplTerm t1 t2 rg ->
(\ [r1,r2] -> ApplTerm r1 r2 rg) <$> redLetList [t1,t2]
TupleTerm l rg -> (\x -> TupleTerm x rg) <$> redLetList l
... | 716 | redLet t =
case t of
-- LetTerm LetBrand [ProgEq] Term Range
LetTerm _ eqs term _ -> substEqs term eqs
ApplTerm t1 t2 rg ->
(\ [r1,r2] -> ApplTerm r1 r2 rg) <$> redLetList [t1,t2]
TupleTerm l rg -> (\x -> TupleTerm x rg) <$> redLetList l
TypedTerm term tq typ rg -> (\x -> Ty... | 677 | true | true | 0 | 11 | 263 | 305 | 153 | 152 | null | null |
pkamenarsky/macos-statusbar | System/Statusbar.hs | apache-2.0 | setStatusItemTitle :: Ptr NSStatusItem -> String -> IO ()
setStatusItemTitle item title = withCString title (setStatusItemTitleC item) | 134 | setStatusItemTitle :: Ptr NSStatusItem -> String -> IO ()
setStatusItemTitle item title = withCString title (setStatusItemTitleC item) | 134 | setStatusItemTitle item title = withCString title (setStatusItemTitleC item) | 76 | false | true | 0 | 8 | 16 | 43 | 20 | 23 | null | null |
kyren/hsgb | lib/Gameboy/Instructions.hs | unlicense | encodeInstruction (ADD_A_R ARegister) = [0x87] | 46 | encodeInstruction (ADD_A_R ARegister) = [0x87] | 46 | encodeInstruction (ADD_A_R ARegister) = [0x87] | 46 | false | false | 0 | 6 | 4 | 19 | 9 | 10 | null | null |
antalsz/hs-to-coq | src/lib/HsToCoq/Coq/Gallina/Util.hs | mit | collectArgs (App t args) = do
(f, args1) <- collectArgs t
args2 <- mapM fromArg (toList args)
return $ (f, args1 ++ args2)
where
fromArg (PosArg t) = return t
fromArg _ = Left "non-positional argument" | 232 | collectArgs (App t args) = do
(f, args1) <- collectArgs t
args2 <- mapM fromArg (toList args)
return $ (f, args1 ++ args2)
where
fromArg (PosArg t) = return t
fromArg _ = Left "non-positional argument" | 232 | collectArgs (App t args) = do
(f, args1) <- collectArgs t
args2 <- mapM fromArg (toList args)
return $ (f, args1 ++ args2)
where
fromArg (PosArg t) = return t
fromArg _ = Left "non-positional argument" | 232 | false | false | 1 | 10 | 66 | 97 | 47 | 50 | null | null |
gnn/Hets | CMDL/Utils.hs | gpl-2.0 | {- | Giben a listof edgenamesand numbered edge names and
the list of all nodes and edges the function identifies
the edges that appearin the name list and are also goals -}
obtainGoalEdgeList :: [String] -> [String] -> [LNode DGNodeLab]
-> [LEdge DGLinkLab] -> ([String], [LEdge DGLinkLab])
obta... | 443 | obtainGoalEdgeList :: [String] -> [String] -> [LNode DGNodeLab]
-> [LEdge DGLinkLab] -> ([String], [LEdge DGLinkLab])
obtainGoalEdgeList ls1 ls2 ls3 ls4 =
let (l1, l2) = obtainEdgeList ls1 ls2 ls3 ls4
in (l1, filter edgeContainsGoals l2) | 264 | obtainGoalEdgeList ls1 ls2 ls3 ls4 =
let (l1, l2) = obtainEdgeList ls1 ls2 ls3 ls4
in (l1, filter edgeContainsGoals l2) | 127 | true | true | 0 | 11 | 99 | 108 | 57 | 51 | null | null |
headprogrammingczar/cabal | cabal-install/Distribution/Client/ProjectPlanning.hs | bsd-3-clause | planPackages :: Compiler
-> Platform
-> Solver -> SolverSettings
-> InstalledPackageIndex
-> SourcePackageDb
-> PkgConfigDb
-> [UnresolvedSourcePackage]
-> Map PackageName (Map OptionalStanza Bool)
-> Progress String... | 6,005 | planPackages :: Compiler
-> Platform
-> Solver -> SolverSettings
-> InstalledPackageIndex
-> SourcePackageDb
-> PkgConfigDb
-> [UnresolvedSourcePackage]
-> Map PackageName (Map OptionalStanza Bool)
-> Progress String... | 6,005 | planPackages comp platform solver SolverSettings{..}
installedPkgIndex sourcePkgDb pkgConfigDB
localPackages pkgStanzasEnable =
resolveDependencies
platform (compilerInfo comp)
pkgConfigDB solver
resolverParams
where
--TODO: [nice to have] disable multiple instan... | 5,659 | false | true | 0 | 20 | 1,668 | 633 | 333 | 300 | null | null |
AlexanderPankiv/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | mkIntExpr :: DynFlags -> Integer -> CoreExpr -- Result = I# i :: Int
mkIntExpr dflags i = mkConApp intDataCon [mkIntLit dflags i] | 137 | mkIntExpr :: DynFlags -> Integer -> CoreExpr
mkIntExpr dflags i = mkConApp intDataCon [mkIntLit dflags i] | 106 | mkIntExpr dflags i = mkConApp intDataCon [mkIntLit dflags i] | 61 | true | true | 0 | 7 | 30 | 38 | 19 | 19 | null | null |
mettekou/ghc | compiler/utils/Bag.hs | bsd-3-clause | partitionBagWith :: (a -> Either b c) -> Bag a
-> (Bag b {- Left -},
Bag c {- Right -})
partitionBagWith _ EmptyBag = (EmptyBag, EmptyBag) | 186 | partitionBagWith :: (a -> Either b c) -> Bag a
-> (Bag b {- Left -},
Bag c {- Right -})
partitionBagWith _ EmptyBag = (EmptyBag, EmptyBag) | 186 | partitionBagWith _ EmptyBag = (EmptyBag, EmptyBag) | 53 | false | true | 0 | 8 | 74 | 59 | 31 | 28 | null | null |
zeniuseducation/poly-euler | haskell/next/one.hs | epl-1.0 | count_divs :: Int -> Int
count_divs n
| 0 == rem n 2 = looper 2 1 2
| otherwise = looper 3 2 2
where looper :: Int -> Int -> Int -> Int
looper i j res
| i*i >= n = if i*i == n then 1+res else res
| 0 == rem n i = looper (j + i) j (res + 2)
| otherwise = looper (j + i) j res | 319 | count_divs :: Int -> Int
count_divs n
| 0 == rem n 2 = looper 2 1 2
| otherwise = looper 3 2 2
where looper :: Int -> Int -> Int -> Int
looper i j res
| i*i >= n = if i*i == n then 1+res else res
| 0 == rem n i = looper (j + i) j (res + 2)
| otherwise = looper (j + i) j res | 319 | count_divs n
| 0 == rem n 2 = looper 2 1 2
| otherwise = looper 3 2 2
where looper :: Int -> Int -> Int -> Int
looper i j res
| i*i >= n = if i*i == n then 1+res else res
| 0 == rem n i = looper (j + i) j (res + 2)
| otherwise = looper (j + i) j res | 294 | false | true | 5 | 9 | 120 | 182 | 88 | 94 | null | null |
frontrowed/stratosphere | gen/src/Gen/Render/Types.hs | mit | normalizeTypeName _ "AWS::EC2::SecurityGroup" "Ingress" = computeModuleName "AWS::EC2::SecurityGroup.IngressProperty" | 117 | normalizeTypeName _ "AWS::EC2::SecurityGroup" "Ingress" = computeModuleName "AWS::EC2::SecurityGroup.IngressProperty" | 117 | normalizeTypeName _ "AWS::EC2::SecurityGroup" "Ingress" = computeModuleName "AWS::EC2::SecurityGroup.IngressProperty" | 117 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
ocramz/petsc-hs | src/Numerical/PETSc/Internal/PutGet/TAO.hs | gpl-3.0 | taoLineSearchCreate :: Comm -> IO TaoLineSearch
taoLineSearchCreate cc = chk1 $ taoLineSearchCreate' cc | 103 | taoLineSearchCreate :: Comm -> IO TaoLineSearch
taoLineSearchCreate cc = chk1 $ taoLineSearchCreate' cc | 103 | taoLineSearchCreate cc = chk1 $ taoLineSearchCreate' cc | 55 | false | true | 2 | 7 | 12 | 33 | 14 | 19 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.