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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uuhan/Idris-dev | src/Idris/Primitives.hs | bsd-3-clause | sBin :: (String -> String -> String) -> [Const] -> Maybe Const
sBin op [Str x, Str y] = Just $ Str (op x y) | 107 | sBin :: (String -> String -> String) -> [Const] -> Maybe Const
sBin op [Str x, Str y] = Just $ Str (op x y) | 107 | sBin op [Str x, Str y] = Just $ Str (op x y) | 44 | false | true | 0 | 8 | 24 | 68 | 34 | 34 | null | null |
takano-akio/ordrea | FRP/Ordrea/Base.hs | cc0-1.0 | test_mfix = do
r <- networkToList 3 net
r @?= [1, 6, 30]
where
net = fmap snd $ mfix $ \ ~(e', _) -> do
r <- scanD 1 $ (*) <$> e'
e <- eventFromList [[], [2,3], [5::Int]]
return (e, discreteToBehavior r) | 231 | test_mfix = do
r <- networkToList 3 net
r @?= [1, 6, 30]
where
net = fmap snd $ mfix $ \ ~(e', _) -> do
r <- scanD 1 $ (*) <$> e'
e <- eventFromList [[], [2,3], [5::Int]]
return (e, discreteToBehavior r) | 231 | test_mfix = do
r <- networkToList 3 net
r @?= [1, 6, 30]
where
net = fmap snd $ mfix $ \ ~(e', _) -> do
r <- scanD 1 $ (*) <$> e'
e <- eventFromList [[], [2,3], [5::Int]]
return (e, discreteToBehavior r) | 231 | false | false | 0 | 12 | 71 | 133 | 69 | 64 | null | null |
matthieubulte/sequent | src/Sequent/Proof.hs | bsd-3-clause | showProof (ForSomeAntecedent _) = "ForSomeAntecedent" | 59 | showProof (ForSomeAntecedent _) = "ForSomeAntecedent" | 59 | showProof (ForSomeAntecedent _) = "ForSomeAntecedent" | 59 | false | false | 0 | 6 | 10 | 16 | 7 | 9 | null | null |
brow/redis-iteratee | test/io/Database/Redis/Commands/Tests.hs | mit | connectedTest :: String -> (Connection -> H.Assertion) -> Test
connectedTest name f = testCase name $ do
redis <- connect localhost defaultPort
reply <- redis `select` testDB
if reply == "OK"
then do
flushdb redis
f redis
else
error "couldn't select test database" | 329 | connectedTest :: String -> (Connection -> H.Assertion) -> Test
connectedTest name f = testCase name $ do
redis <- connect localhost defaultPort
reply <- redis `select` testDB
if reply == "OK"
then do
flushdb redis
f redis
else
error "couldn't select test database" | 329 | connectedTest name f = testCase name $ do
redis <- connect localhost defaultPort
reply <- redis `select` testDB
if reply == "OK"
then do
flushdb redis
f redis
else
error "couldn't select test database" | 266 | false | true | 0 | 11 | 107 | 95 | 45 | 50 | null | null |
tylerjl/adventofcode | src/Y2015/D20.hs | mit | intsqrt :: Int -> Int
intsqrt i = floor ((sqrt $ fromIntegral i) :: Double) | 75 | intsqrt :: Int -> Int
intsqrt i = floor ((sqrt $ fromIntegral i) :: Double) | 75 | intsqrt i = floor ((sqrt $ fromIntegral i) :: Double) | 53 | false | true | 0 | 9 | 14 | 42 | 20 | 22 | null | null |
cblp/haskell-telegram-api | src/Web/Telegram/API/Bot/JsonExt.hs | bsd-3-clause | -- | Method used to drop prefix from field name during serialization
toJsonDrop :: forall a.(Generic a, GToJSON Zero (Rep a)) => Int -> a -> Value
toJsonDrop prefix = genericToJSON defaultOptions {
fieldLabelModifier = drop prefix
, omitNothingFields = True
} | 267 | toJsonDrop :: forall a.(Generic a, GToJSON Zero (Rep a)) => Int -> a -> Value
toJsonDrop prefix = genericToJSON defaultOptions {
fieldLabelModifier = drop prefix
, omitNothingFields = True
} | 198 | toJsonDrop prefix = genericToJSON defaultOptions {
fieldLabelModifier = drop prefix
, omitNothingFields = True
} | 120 | true | true | 0 | 9 | 49 | 71 | 38 | 33 | null | null |
sapek/pandoc | src/Text/Pandoc/Writers/Custom.hs | gpl-2.0 | docToCustom :: LuaState -> WriterOptions -> Pandoc -> IO ByteString
docToCustom lua opts (Pandoc (Meta metamap) blocks) = do
body <- blockListToCustom lua blocks
callfunc lua "Doc" body metamap (writerVariables opts)
-- | Convert Pandoc block element to Custom. | 266 | docToCustom :: LuaState -> WriterOptions -> Pandoc -> IO ByteString
docToCustom lua opts (Pandoc (Meta metamap) blocks) = do
body <- blockListToCustom lua blocks
callfunc lua "Doc" body metamap (writerVariables opts)
-- | Convert Pandoc block element to Custom. | 266 | docToCustom lua opts (Pandoc (Meta metamap) blocks) = do
body <- blockListToCustom lua blocks
callfunc lua "Doc" body metamap (writerVariables opts)
-- | Convert Pandoc block element to Custom. | 198 | false | true | 0 | 13 | 43 | 85 | 39 | 46 | null | null |
dudebout/cdc_2012_dudebout_shamma | simulations/simulation_empirical.hs | isc | comp :: Comp Environment State Order Price History0 History0 State Order Price History0 History0 ()
comp = logVar >> oneStep | 124 | comp :: Comp Environment State Order Price History0 History0 State Order Price History0 History0 ()
comp = logVar >> oneStep | 124 | comp = logVar >> oneStep | 24 | false | true | 3 | 6 | 19 | 51 | 21 | 30 | null | null |
kindohm/Tidal | Sound/Tidal/Pattern.hs | gpl-3.0 | tri1 = triwave1 | 15 | tri1 = triwave1 | 15 | tri1 = triwave1 | 15 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
rbonifacio/hephaestus-pl | src/funsat-0.6.2/src/Funsat/FastDom.hs | lgpl-3.0 | - for each node in iDom, find the intersection of all its predecessor's
-- dominating sets, and update iDom accordingly.
refineIDom :: Preds -> IDom -> IDom
refineIDom preds iDom = fmap (foldl1 (intersect iDom)) preds
| 218 | refineIDom :: Preds -> IDom -> IDom
refineIDom preds iDom = fmap (foldl1 (intersect iDom)) preds | 96 | refineIDom preds iDom = fmap (foldl1 (intersect iDom)) preds | 60 | true | true | 1 | 9 | 36 | 80 | 36 | 44 | null | null |
shockkolate/containers | Data/Map/Base.hs | bsd-3-clause | -- | /O(log n)/. Update the value at the minimal key.
--
-- > updateMinWithKey (\ k a -> Just ((show k) ++ ":" ++ a)) (fromList [(5,"a"), (3,"b")]) == fromList [(3,"3:b"), (5,"a")]
-- > updateMinWithKey (\ _ _ -> Nothing) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a
updateMinWithKey _ Tip = Tip | 398 | updateMinWithKey :: (k -> a -> Maybe a) -> Map k a -> Map k a
updateMinWithKey _ Tip = Tip | 106 | updateMinWithKey _ Tip = Tip | 44 | true | true | 0 | 9 | 105 | 52 | 27 | 25 | null | null |
olsner/ghc | compiler/types/Coercion.hs | bsd-3-clause | -- This could work harder to produce Refl coercions, but that would be
-- quite inefficient. Seems better not to try.
mkCoherenceCo :: Coercion -> Coercion -> Coercion
mkCoherenceCo co1 (Refl {}) = co1 | 201 | mkCoherenceCo :: Coercion -> Coercion -> Coercion
mkCoherenceCo co1 (Refl {}) = co1 | 83 | mkCoherenceCo co1 (Refl {}) = co1 | 33 | true | true | 0 | 7 | 33 | 38 | 19 | 19 | null | null |
martinra/hlinear | src/HLinear/Hook/EchelonTransformation/Basic.hs | gpl-3.0 | splitAt
:: AdditiveMonoid a
=> Int -> EchelonTransformation a
-> (EchelonTransformation a, EchelonTransformation a)
splitAt ix et@(EchelonTransformation nrs cs)
| ix <= nrs - V.length cs = (one (max 0 ix), et)
| ix >= nrs =
let czeros = V.generate (ix-nrs) $ ETC.one ix
cs' = fmap (ETC.adjustOffset (+(ix-nrs))) cs
in ( EchelonTransformation ix (czeros <> cs')
, one 0)
| otherwise =
let (csRight, csLeft) = V.splitAt (nrs-ix) cs
csLeft' = fmap (ETC.adjustOffset (+(ix-nrs))) csLeft
in ( EchelonTransformation ix csLeft'
, EchelonTransformation nrs csRight
) | 650 | splitAt
:: AdditiveMonoid a
=> Int -> EchelonTransformation a
-> (EchelonTransformation a, EchelonTransformation a)
splitAt ix et@(EchelonTransformation nrs cs)
| ix <= nrs - V.length cs = (one (max 0 ix), et)
| ix >= nrs =
let czeros = V.generate (ix-nrs) $ ETC.one ix
cs' = fmap (ETC.adjustOffset (+(ix-nrs))) cs
in ( EchelonTransformation ix (czeros <> cs')
, one 0)
| otherwise =
let (csRight, csLeft) = V.splitAt (nrs-ix) cs
csLeft' = fmap (ETC.adjustOffset (+(ix-nrs))) csLeft
in ( EchelonTransformation ix csLeft'
, EchelonTransformation nrs csRight
) | 650 | splitAt ix et@(EchelonTransformation nrs cs)
| ix <= nrs - V.length cs = (one (max 0 ix), et)
| ix >= nrs =
let czeros = V.generate (ix-nrs) $ ETC.one ix
cs' = fmap (ETC.adjustOffset (+(ix-nrs))) cs
in ( EchelonTransformation ix (czeros <> cs')
, one 0)
| otherwise =
let (csRight, csLeft) = V.splitAt (nrs-ix) cs
csLeft' = fmap (ETC.adjustOffset (+(ix-nrs))) csLeft
in ( EchelonTransformation ix csLeft'
, EchelonTransformation nrs csRight
) | 528 | false | true | 3 | 14 | 178 | 279 | 138 | 141 | null | null |
karshan/language-java | Language/Java/Pretty.hs | bsd-3-clause | escapeString c | c <= '\xFFFF' = escapeGeneral c
| otherwise = escapeGeneral lead ++ escapeGeneral trail
where c' = fromEnum c - 0x010000
lead = toEnum $ 0xD800 + c' `div` 0x0400
trail = toEnum $ 0xDC00 + c' `mod` 0x0400 | 304 | escapeString c | c <= '\xFFFF' = escapeGeneral c
| otherwise = escapeGeneral lead ++ escapeGeneral trail
where c' = fromEnum c - 0x010000
lead = toEnum $ 0xD800 + c' `div` 0x0400
trail = toEnum $ 0xDC00 + c' `mod` 0x0400 | 304 | escapeString c | c <= '\xFFFF' = escapeGeneral c
| otherwise = escapeGeneral lead ++ escapeGeneral trail
where c' = fromEnum c - 0x010000
lead = toEnum $ 0xD800 + c' `div` 0x0400
trail = toEnum $ 0xDC00 + c' `mod` 0x0400 | 304 | false | false | 0 | 9 | 125 | 93 | 46 | 47 | null | null |
adept/hledger | hledger-lib/Hledger/Read/JournalReader.hs | gpl-3.0 | -- | Parse a multi-line commodity directive, containing 0 or more format subdirectives.
--
-- >>> Right _ <- rjp commoditydirectivemultilinep "commodity $ ; blah \n format $1.00 ; blah"
commoditydirectivemultilinep :: JournalParser m ()
commoditydirectivemultilinep = do
string "commodity"
lift skipNonNewlineSpaces1
sym <- lift commoditysymbolp
_ <- lift followingcommentp
mformat <- lastMay <$> many (indented $ formatdirectivep sym)
let comm = Commodity{csymbol=sym, cformat=mformat}
modify' (\j -> j{jcommodities=M.insert sym comm $ jcommodities j})
where
indented = (lift skipNonNewlineSpaces1 >>)
-- | Parse a format (sub)directive, throwing a parse error if its
-- symbol does not match the one given. | 730 | commoditydirectivemultilinep :: JournalParser m ()
commoditydirectivemultilinep = do
string "commodity"
lift skipNonNewlineSpaces1
sym <- lift commoditysymbolp
_ <- lift followingcommentp
mformat <- lastMay <$> many (indented $ formatdirectivep sym)
let comm = Commodity{csymbol=sym, cformat=mformat}
modify' (\j -> j{jcommodities=M.insert sym comm $ jcommodities j})
where
indented = (lift skipNonNewlineSpaces1 >>)
-- | Parse a format (sub)directive, throwing a parse error if its
-- symbol does not match the one given. | 543 | commoditydirectivemultilinep = do
string "commodity"
lift skipNonNewlineSpaces1
sym <- lift commoditysymbolp
_ <- lift followingcommentp
mformat <- lastMay <$> many (indented $ formatdirectivep sym)
let comm = Commodity{csymbol=sym, cformat=mformat}
modify' (\j -> j{jcommodities=M.insert sym comm $ jcommodities j})
where
indented = (lift skipNonNewlineSpaces1 >>)
-- | Parse a format (sub)directive, throwing a parse error if its
-- symbol does not match the one given. | 492 | true | true | 1 | 14 | 120 | 157 | 76 | 81 | null | null |
snowleopard/shaking-up-ghc | src/Packages.hs | bsd-3-clause | programPath :: Context -> Action FilePath
programPath context@Context {..} = do
-- TODO: The @touchy@ utility lives in the @lib/bin@ directory instead of
-- @bin@, which is likely just a historical accident that should be fixed.
-- See: https://github.com/snowleopard/hadrian/issues/570
-- Likewise for 'unlit'.
name <- programName context
path <- if package `elem` [touchy, unlit] then stageLibPath stage <&> (-/- "bin")
else stageBinPath stage
return $ path -/- name <.> exe
-- TODO: Move @timeout@ to the @util@ directory and build in a more standard
-- location like other programs used only by the testsuite. | 688 | programPath :: Context -> Action FilePath
programPath context@Context {..} = do
-- TODO: The @touchy@ utility lives in the @lib/bin@ directory instead of
-- @bin@, which is likely just a historical accident that should be fixed.
-- See: https://github.com/snowleopard/hadrian/issues/570
-- Likewise for 'unlit'.
name <- programName context
path <- if package `elem` [touchy, unlit] then stageLibPath stage <&> (-/- "bin")
else stageBinPath stage
return $ path -/- name <.> exe
-- TODO: Move @timeout@ to the @util@ directory and build in a more standard
-- location like other programs used only by the testsuite. | 688 | programPath context@Context {..} = do
-- TODO: The @touchy@ utility lives in the @lib/bin@ directory instead of
-- @bin@, which is likely just a historical accident that should be fixed.
-- See: https://github.com/snowleopard/hadrian/issues/570
-- Likewise for 'unlit'.
name <- programName context
path <- if package `elem` [touchy, unlit] then stageLibPath stage <&> (-/- "bin")
else stageBinPath stage
return $ path -/- name <.> exe
-- TODO: Move @timeout@ to the @util@ directory and build in a more standard
-- location like other programs used only by the testsuite. | 646 | false | true | 2 | 10 | 168 | 102 | 56 | 46 | null | null |
gridaphobe/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | parenify :: LHsExpr RdrName -> LHsExpr RdrName
parenify e@(L _ (HsVar _)) = e | 77 | parenify :: LHsExpr RdrName -> LHsExpr RdrName
parenify e@(L _ (HsVar _)) = e | 77 | parenify e@(L _ (HsVar _)) = e | 30 | false | true | 1 | 10 | 13 | 49 | 21 | 28 | null | null |
dimara/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | stExt :: String
stExt = Types.storageTypeToRaw StorageExt | 57 | stExt :: String
stExt = Types.storageTypeToRaw StorageExt | 57 | stExt = Types.storageTypeToRaw StorageExt | 41 | false | true | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
y-kamiya/parallel-concurrent-haskell | src/Async/Main.hs | gpl-2.0 | geturl5 :: IO ()
geturl5 = do
m <- newEmptyMVar
let
download url = do
r <- getURL url
putMVar m (url, r)
mapM_ (forkIO . download) sites
(url, r) <- takeMVar m
printf "%s was first (%d bytes)\n" url (length r)
replicateM_ (length sites - 1) $ takeMVar m | 283 | geturl5 :: IO ()
geturl5 = do
m <- newEmptyMVar
let
download url = do
r <- getURL url
putMVar m (url, r)
mapM_ (forkIO . download) sites
(url, r) <- takeMVar m
printf "%s was first (%d bytes)\n" url (length r)
replicateM_ (length sites - 1) $ takeMVar m | 283 | geturl5 = do
m <- newEmptyMVar
let
download url = do
r <- getURL url
putMVar m (url, r)
mapM_ (forkIO . download) sites
(url, r) <- takeMVar m
printf "%s was first (%d bytes)\n" url (length r)
replicateM_ (length sites - 1) $ takeMVar m | 266 | false | true | 0 | 13 | 79 | 129 | 59 | 70 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLIFrameElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement.contentWindow Mozilla HTMLIFrameElement.contentWindow documentation>
getContentWindow :: (MonadDOM m) => HTMLIFrameElement -> m Window
getContentWindow self
= liftDOM ((self ^. js "contentWindow") >>= fromJSValUnchecked) | 296 | getContentWindow :: (MonadDOM m) => HTMLIFrameElement -> m Window
getContentWindow self
= liftDOM ((self ^. js "contentWindow") >>= fromJSValUnchecked) | 153 | getContentWindow self
= liftDOM ((self ^. js "contentWindow") >>= fromJSValUnchecked) | 87 | true | true | 0 | 10 | 27 | 51 | 26 | 25 | null | null |
feliposz/learning-stuff | haskell/euler1.hs | mit | c = sum (take (999 `div` 15) [15,30..]) | 39 | c = sum (take (999 `div` 15) [15,30..]) | 39 | c = sum (take (999 `div` 15) [15,30..]) | 39 | false | false | 1 | 9 | 7 | 36 | 18 | 18 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Mem.hs | isc | sliceInfo ::
(Monad m, HasScope rep m, Mem rep inner) =>
VName ->
Slice SubExp ->
m (MemInfo SubExp NoUniqueness MemBind)
sliceInfo v slice = do
(et, _, mem, ixfun) <- arrayVarReturns v
case sliceDims slice of
[] -> return $ MemPrim et
dims ->
return $
MemArray et (Shape dims) NoUniqueness . ArrayIn mem $
IxFun.slice ixfun (fmap pe64 slice) | 386 | sliceInfo ::
(Monad m, HasScope rep m, Mem rep inner) =>
VName ->
Slice SubExp ->
m (MemInfo SubExp NoUniqueness MemBind)
sliceInfo v slice = do
(et, _, mem, ixfun) <- arrayVarReturns v
case sliceDims slice of
[] -> return $ MemPrim et
dims ->
return $
MemArray et (Shape dims) NoUniqueness . ArrayIn mem $
IxFun.slice ixfun (fmap pe64 slice) | 386 | sliceInfo v slice = do
(et, _, mem, ixfun) <- arrayVarReturns v
case sliceDims slice of
[] -> return $ MemPrim et
dims ->
return $
MemArray et (Shape dims) NoUniqueness . ArrayIn mem $
IxFun.slice ixfun (fmap pe64 slice) | 256 | false | true | 0 | 15 | 104 | 161 | 78 | 83 | null | null |
patrikja/progolymp | open/towers/Main.hs | bsd-3-clause | eqPert :: (Integer, PowerTower) -> (Integer, PowerTower) -> Bool
eqPert (0, is) (fj, js) = 0 == fj | 103 | eqPert :: (Integer, PowerTower) -> (Integer, PowerTower) -> Bool
eqPert (0, is) (fj, js) = 0 == fj | 103 | eqPert (0, is) (fj, js) = 0 == fj | 38 | false | true | 0 | 7 | 22 | 52 | 30 | 22 | null | null |
hvr/lens | src/Data/List/Split/Lens.hs | bsd-3-clause | -- | Modify or retrieve the policy for whether a 'Splitter' should drop an initial blank.
keepInitialBlanks :: Lens' (Splitter a) Bool
keepInitialBlanks f s@Splitter { initBlankPolicy = p } = f (keeps p) <&> \p' -> s { initBlankPolicy = end p' } | 245 | keepInitialBlanks :: Lens' (Splitter a) Bool
keepInitialBlanks f s@Splitter { initBlankPolicy = p } = f (keeps p) <&> \p' -> s { initBlankPolicy = end p' } | 155 | keepInitialBlanks f s@Splitter { initBlankPolicy = p } = f (keeps p) <&> \p' -> s { initBlankPolicy = end p' } | 110 | true | true | 2 | 10 | 43 | 81 | 37 | 44 | null | null |
sectore/haskell-elm-todo-app | server/src/App.hs | mit | corsMiddleware :: Middleware
corsMiddleware = cors (const $ Just resourcePolicy)
where
resourcePolicy = simpleCorsResourcePolicy
{ corsMethods = "DELETE" : "PUT" : simpleMethods -- simpleMethods are GET,HEAD,POST
, corsRequestHeaders = ["Content-Type"]
} | 276 | corsMiddleware :: Middleware
corsMiddleware = cors (const $ Just resourcePolicy)
where
resourcePolicy = simpleCorsResourcePolicy
{ corsMethods = "DELETE" : "PUT" : simpleMethods -- simpleMethods are GET,HEAD,POST
, corsRequestHeaders = ["Content-Type"]
} | 276 | corsMiddleware = cors (const $ Just resourcePolicy)
where
resourcePolicy = simpleCorsResourcePolicy
{ corsMethods = "DELETE" : "PUT" : simpleMethods -- simpleMethods are GET,HEAD,POST
, corsRequestHeaders = ["Content-Type"]
} | 247 | false | true | 1 | 9 | 52 | 71 | 34 | 37 | null | null |
NikolayS/postgrest | src/PostgREST/QueryBuilder.hs | mit | pgFmtSelectItem :: QualifiedIdentifier -> SelectItem -> SqlFragment
pgFmtSelectItem table (f@(_, jp), Nothing) = pgFmtField table f <> pgFmtAsJsonPath jp | 153 | pgFmtSelectItem :: QualifiedIdentifier -> SelectItem -> SqlFragment
pgFmtSelectItem table (f@(_, jp), Nothing) = pgFmtField table f <> pgFmtAsJsonPath jp | 153 | pgFmtSelectItem table (f@(_, jp), Nothing) = pgFmtField table f <> pgFmtAsJsonPath jp | 85 | false | true | 0 | 7 | 18 | 56 | 28 | 28 | null | null |
abakst/liquidhaskell | tests/todo/NativeFixCrash.hs | bsd-3-clause | {-@ measure progDenote :: Stack -> Prog -> Maybe Stack @-}
progDenote :: Stack -> Prog -> Maybe Stack
progDenote s Nil = Just s | 127 | progDenote :: Stack -> Prog -> Maybe Stack
progDenote s Nil = Just s | 68 | progDenote s Nil = Just s | 25 | true | true | 0 | 7 | 24 | 31 | 15 | 16 | null | null |
Sgoettschkes/learning | haskell/ProjectEuler/Helpers/Numbers.hs | mit | collatz :: Int -> [Int]
collatz 1 = [1] | 39 | collatz :: Int -> [Int]
collatz 1 = [1] | 39 | collatz 1 = [1] | 15 | false | true | 0 | 8 | 8 | 30 | 14 | 16 | null | null |
higgsd/euler | hs/42.hs | bsd-2-clause | main = do
s <- readFile "../files/words.txt"
putStrLn $ show $ countTri $ readWords s | 93 | main = do
s <- readFile "../files/words.txt"
putStrLn $ show $ countTri $ readWords s | 93 | main = do
s <- readFile "../files/words.txt"
putStrLn $ show $ countTri $ readWords s | 93 | false | false | 0 | 9 | 22 | 34 | 15 | 19 | null | null |
jecisc/TP_PF_L3 | PF-TP1/.dist-buildwrapper/dist/build/autogen/Paths_TP1.hs | mit | minusFileName :: FilePath -> String -> FilePath
minusFileName dir "" = dir | 78 | minusFileName :: FilePath -> String -> FilePath
minusFileName dir "" = dir | 78 | minusFileName dir "" = dir | 30 | false | true | 0 | 6 | 15 | 24 | 12 | 12 | null | null |
pbevin/toycss | src/css/LocateCss.hs | gpl-2.0 | nodeMatch (s:ss) n = nodeMatch ss n && case s of
Elem e -> e == nodeName n
Class c -> c `elem` nodeClasses n
Id id -> Just id == nodeId n | 146 | nodeMatch (s:ss) n = nodeMatch ss n && case s of
Elem e -> e == nodeName n
Class c -> c `elem` nodeClasses n
Id id -> Just id == nodeId n | 146 | nodeMatch (s:ss) n = nodeMatch ss n && case s of
Elem e -> e == nodeName n
Class c -> c `elem` nodeClasses n
Id id -> Just id == nodeId n | 146 | false | false | 0 | 10 | 41 | 84 | 39 | 45 | null | null |
brendanhay/gogol | gogol-pubsub/gen/Network/Google/PubSub/Types/Product.hs | mpl-2.0 | -- | The encoding expected for messages
vmrEncoding :: Lens' ValidateMessageRequest (Maybe ValidateMessageRequestEncoding)
vmrEncoding
= lens _vmrEncoding (\ s a -> s{_vmrEncoding = a}) | 187 | vmrEncoding :: Lens' ValidateMessageRequest (Maybe ValidateMessageRequestEncoding)
vmrEncoding
= lens _vmrEncoding (\ s a -> s{_vmrEncoding = a}) | 147 | vmrEncoding
= lens _vmrEncoding (\ s a -> s{_vmrEncoding = a}) | 64 | true | true | 0 | 9 | 25 | 48 | 25 | 23 | null | null |
flavray/analytics | src/API.hs | bsd-3-clause | analytics _ _ Nothing = left $ err400 { errBody = "Missing page" } | 66 | analytics _ _ Nothing = left $ err400 { errBody = "Missing page" } | 66 | analytics _ _ Nothing = left $ err400 { errBody = "Missing page" } | 66 | false | false | 3 | 7 | 13 | 29 | 13 | 16 | null | null |
tsahyt/clingo-haskell | src/Clingo/Internal/AST.hs | mit | freeLiteral :: AstLiteral -> IO ()
freeLiteral (AstLiteralBool l _ _) = freeRawLocation l | 89 | freeLiteral :: AstLiteral -> IO ()
freeLiteral (AstLiteralBool l _ _) = freeRawLocation l | 89 | freeLiteral (AstLiteralBool l _ _) = freeRawLocation l | 54 | false | true | 0 | 7 | 13 | 36 | 17 | 19 | null | null |
kaashif/hinfo | src/Icon.hs | bsd-3-clause | rcfile :: IO String
rcfile = fmap (++"/.hinforc") getHomeDirectory | 66 | rcfile :: IO String
rcfile = fmap (++"/.hinforc") getHomeDirectory | 66 | rcfile = fmap (++"/.hinforc") getHomeDirectory | 46 | false | true | 0 | 6 | 8 | 29 | 13 | 16 | null | null |
bradseiler/haskell-smtp | Reply.hs | gpl-2.0 | dataComing state = (data_bad_order, state) | 42 | dataComing state = (data_bad_order, state) | 42 | dataComing state = (data_bad_order, state) | 42 | false | false | 0 | 5 | 4 | 15 | 8 | 7 | null | null |
peterbecich/haskell-programming-first-principles | subprojects/additionHspec/Main.hs | bsd-3-clause | sampleOneToThree = sample oneToThree | 36 | sampleOneToThree = sample oneToThree | 36 | sampleOneToThree = sample oneToThree | 36 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
cheeseywhiz/cheeseywhiz | hash.hs | mit | hash_init = 0xcbf29ce484222325 | 30 | hash_init = 0xcbf29ce484222325 | 30 | hash_init = 0xcbf29ce484222325 | 30 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
fmapfmapfmap/amazonka | amazonka-elasticache/gen/Network/AWS/ElastiCache/Types/Product.hs | mpl-2.0 | -- | The version number of the cache engine.
cevEngineVersion :: Lens' CacheEngineVersion (Maybe Text)
cevEngineVersion = lens _cevEngineVersion (\ s a -> s{_cevEngineVersion = a}) | 180 | cevEngineVersion :: Lens' CacheEngineVersion (Maybe Text)
cevEngineVersion = lens _cevEngineVersion (\ s a -> s{_cevEngineVersion = a}) | 135 | cevEngineVersion = lens _cevEngineVersion (\ s a -> s{_cevEngineVersion = a}) | 77 | true | true | 0 | 9 | 25 | 46 | 25 | 21 | null | null |
rahulmutt/ghcvm | tests/suite/templateHaskell/run/TH_repE2.hs | bsd-3-clause | an_string :: String
an_string = $( [| "A String" |] ) | 53 | an_string :: String
an_string = $( [| "A String" |] ) | 53 | an_string = $( [| "A String" |] ) | 33 | false | true | 0 | 6 | 10 | 18 | 11 | 7 | null | null |
sardonicpresence/glucose | src/Glucose/Namespace.hs | mit | lookupDefinition :: Identifier -> Namespace -> Maybe (FromSource Definition)
lookupDefinition n (Namespace ss) = go ss where
go [] = Nothing
go (Scope s : ss) = Map.lookup n s <|> go ss | 192 | lookupDefinition :: Identifier -> Namespace -> Maybe (FromSource Definition)
lookupDefinition n (Namespace ss) = go ss where
go [] = Nothing
go (Scope s : ss) = Map.lookup n s <|> go ss | 191 | lookupDefinition n (Namespace ss) = go ss where
go [] = Nothing
go (Scope s : ss) = Map.lookup n s <|> go ss | 114 | false | true | 0 | 10 | 39 | 91 | 42 | 49 | null | null |
timstclair/experimental | haskell/real_world_haskell/transpose.hs | unlicense | paddedTail s = tail s | 22 | paddedTail s = tail s | 22 | paddedTail s = tail s | 22 | false | false | 1 | 5 | 5 | 15 | 5 | 10 | null | null |
gafiatulin/codewars | src/7 kyu/Thirteen.hs | mit | thirt n | n == g n = n
| otherwise = thirt (g n)
where f x | (x `div` 10) == 0 = [x `mod` 10]
| otherwise = (x `mod` 10):f (x `div` 10)
g x = sum (zipWith (*) (cycle [1, 10, 9, 12, 3, 4]) (f x)) | 243 | thirt n | n == g n = n
| otherwise = thirt (g n)
where f x | (x `div` 10) == 0 = [x `mod` 10]
| otherwise = (x `mod` 10):f (x `div` 10)
g x = sum (zipWith (*) (cycle [1, 10, 9, 12, 3, 4]) (f x)) | 243 | thirt n | n == g n = n
| otherwise = thirt (g n)
where f x | (x `div` 10) == 0 = [x `mod` 10]
| otherwise = (x `mod` 10):f (x `div` 10)
g x = sum (zipWith (*) (cycle [1, 10, 9, 12, 3, 4]) (f x)) | 243 | false | false | 0 | 12 | 100 | 165 | 87 | 78 | null | null |
DavidAlphaFox/darcs | src/Darcs/Util/Printer/Color.hs | gpl-2.0 | -- | 'quoteChar' represents a special character as a string.
-- * @quoteChar '^c'@ (where @^c@ is a control character) is @"^c"@
-- * Otherwise, @quoteChar@ returns "\hex", where 'hex' is the
-- hexadecimal number of the character.
quoteChar :: Char -> String
quoteChar c
| isControl c && isPrintableAscii cHat = ['^', cHat]
| otherwise = sHex
where
cHat = chr $ (bit 6 `xor`) $ ord c
sHex = "<U+" ++ printf "%04X" c ++ ">"
-- make colors and highlightings
-- | @'markEscape' policy doc@ marks @doc@ with the appropriate
-- marking for escaped characters according to @policy@ | 594 | quoteChar :: Char -> String
quoteChar c
| isControl c && isPrintableAscii cHat = ['^', cHat]
| otherwise = sHex
where
cHat = chr $ (bit 6 `xor`) $ ord c
sHex = "<U+" ++ printf "%04X" c ++ ">"
-- make colors and highlightings
-- | @'markEscape' policy doc@ marks @doc@ with the appropriate
-- marking for escaped characters according to @policy@ | 354 | quoteChar c
| isControl c && isPrintableAscii cHat = ['^', cHat]
| otherwise = sHex
where
cHat = chr $ (bit 6 `xor`) $ ord c
sHex = "<U+" ++ printf "%04X" c ++ ">"
-- make colors and highlightings
-- | @'markEscape' policy doc@ marks @doc@ with the appropriate
-- marking for escaped characters according to @policy@ | 326 | true | true | 1 | 9 | 118 | 101 | 54 | 47 | null | null |
green-haskell/ghc | compiler/cmm/CmmCommonBlockElim.hs | bsd-3-clause | hash_block :: CmmBlock -> HashCode
hash_block block =
fromIntegral (foldBlockNodesB3 (hash_fst, hash_mid, hash_lst) block (0 :: Word32) .&. (0x7fffffff :: Word32))
-- UniqFM doesn't like negative Ints
where hash_fst _ h = h
hash_mid m h = hash_node m + h `shiftL` 1
hash_lst m h = hash_node m + h `shiftL` 1
hash_node :: CmmNode O x -> Word32
hash_node n | dont_care n = 0 -- don't care
hash_node (CmmUnwind _ e) = hash_e e
hash_node (CmmAssign r e) = hash_reg r + hash_e e
hash_node (CmmStore e e') = hash_e e + hash_e e'
hash_node (CmmUnsafeForeignCall t _ as) = hash_tgt t + hash_list hash_e as
hash_node (CmmBranch _) = 23 -- NB. ignore the label
hash_node (CmmCondBranch p _ _) = hash_e p
hash_node (CmmCall e _ _ _ _ _) = hash_e e
hash_node (CmmForeignCall t _ _ _ _ _ _) = hash_tgt t
hash_node (CmmSwitch e _) = hash_e e
hash_node _ = error "hash_node: unknown Cmm node!"
hash_reg :: CmmReg -> Word32
hash_reg (CmmLocal _) = 117
hash_reg (CmmGlobal _) = 19
hash_e :: CmmExpr -> Word32
hash_e (CmmLit l) = hash_lit l
hash_e (CmmLoad e _) = 67 + hash_e e
hash_e (CmmReg r) = hash_reg r
hash_e (CmmMachOp _ es) = hash_list hash_e es -- pessimal - no operator check
hash_e (CmmRegOff r i) = hash_reg r + cvt i
hash_e (CmmStackSlot _ _) = 13
hash_lit :: CmmLit -> Word32
hash_lit (CmmInt i _) = fromInteger i
hash_lit (CmmFloat r _) = truncate r
hash_lit (CmmVec ls) = hash_list hash_lit ls
hash_lit (CmmLabel _) = 119 -- ugh
hash_lit (CmmLabelOff _ i) = cvt $ 199 + i
hash_lit (CmmLabelDiffOff _ _ i) = cvt $ 299 + i
hash_lit (CmmBlock _) = 191 -- ugh
hash_lit (CmmHighStackMark) = cvt 313
hash_tgt (ForeignTarget e _) = hash_e e
hash_tgt (PrimTarget _) = 31 -- lots of these
hash_list f = foldl (\z x -> f x + z) (0::Word32)
cvt = fromInteger . toInteger
-- | Ignore these node types for equality | 2,117 | hash_block :: CmmBlock -> HashCode
hash_block block =
fromIntegral (foldBlockNodesB3 (hash_fst, hash_mid, hash_lst) block (0 :: Word32) .&. (0x7fffffff :: Word32))
-- UniqFM doesn't like negative Ints
where hash_fst _ h = h
hash_mid m h = hash_node m + h `shiftL` 1
hash_lst m h = hash_node m + h `shiftL` 1
hash_node :: CmmNode O x -> Word32
hash_node n | dont_care n = 0 -- don't care
hash_node (CmmUnwind _ e) = hash_e e
hash_node (CmmAssign r e) = hash_reg r + hash_e e
hash_node (CmmStore e e') = hash_e e + hash_e e'
hash_node (CmmUnsafeForeignCall t _ as) = hash_tgt t + hash_list hash_e as
hash_node (CmmBranch _) = 23 -- NB. ignore the label
hash_node (CmmCondBranch p _ _) = hash_e p
hash_node (CmmCall e _ _ _ _ _) = hash_e e
hash_node (CmmForeignCall t _ _ _ _ _ _) = hash_tgt t
hash_node (CmmSwitch e _) = hash_e e
hash_node _ = error "hash_node: unknown Cmm node!"
hash_reg :: CmmReg -> Word32
hash_reg (CmmLocal _) = 117
hash_reg (CmmGlobal _) = 19
hash_e :: CmmExpr -> Word32
hash_e (CmmLit l) = hash_lit l
hash_e (CmmLoad e _) = 67 + hash_e e
hash_e (CmmReg r) = hash_reg r
hash_e (CmmMachOp _ es) = hash_list hash_e es -- pessimal - no operator check
hash_e (CmmRegOff r i) = hash_reg r + cvt i
hash_e (CmmStackSlot _ _) = 13
hash_lit :: CmmLit -> Word32
hash_lit (CmmInt i _) = fromInteger i
hash_lit (CmmFloat r _) = truncate r
hash_lit (CmmVec ls) = hash_list hash_lit ls
hash_lit (CmmLabel _) = 119 -- ugh
hash_lit (CmmLabelOff _ i) = cvt $ 199 + i
hash_lit (CmmLabelDiffOff _ _ i) = cvt $ 299 + i
hash_lit (CmmBlock _) = 191 -- ugh
hash_lit (CmmHighStackMark) = cvt 313
hash_tgt (ForeignTarget e _) = hash_e e
hash_tgt (PrimTarget _) = 31 -- lots of these
hash_list f = foldl (\z x -> f x + z) (0::Word32)
cvt = fromInteger . toInteger
-- | Ignore these node types for equality | 2,117 | hash_block block =
fromIntegral (foldBlockNodesB3 (hash_fst, hash_mid, hash_lst) block (0 :: Word32) .&. (0x7fffffff :: Word32))
-- UniqFM doesn't like negative Ints
where hash_fst _ h = h
hash_mid m h = hash_node m + h `shiftL` 1
hash_lst m h = hash_node m + h `shiftL` 1
hash_node :: CmmNode O x -> Word32
hash_node n | dont_care n = 0 -- don't care
hash_node (CmmUnwind _ e) = hash_e e
hash_node (CmmAssign r e) = hash_reg r + hash_e e
hash_node (CmmStore e e') = hash_e e + hash_e e'
hash_node (CmmUnsafeForeignCall t _ as) = hash_tgt t + hash_list hash_e as
hash_node (CmmBranch _) = 23 -- NB. ignore the label
hash_node (CmmCondBranch p _ _) = hash_e p
hash_node (CmmCall e _ _ _ _ _) = hash_e e
hash_node (CmmForeignCall t _ _ _ _ _ _) = hash_tgt t
hash_node (CmmSwitch e _) = hash_e e
hash_node _ = error "hash_node: unknown Cmm node!"
hash_reg :: CmmReg -> Word32
hash_reg (CmmLocal _) = 117
hash_reg (CmmGlobal _) = 19
hash_e :: CmmExpr -> Word32
hash_e (CmmLit l) = hash_lit l
hash_e (CmmLoad e _) = 67 + hash_e e
hash_e (CmmReg r) = hash_reg r
hash_e (CmmMachOp _ es) = hash_list hash_e es -- pessimal - no operator check
hash_e (CmmRegOff r i) = hash_reg r + cvt i
hash_e (CmmStackSlot _ _) = 13
hash_lit :: CmmLit -> Word32
hash_lit (CmmInt i _) = fromInteger i
hash_lit (CmmFloat r _) = truncate r
hash_lit (CmmVec ls) = hash_list hash_lit ls
hash_lit (CmmLabel _) = 119 -- ugh
hash_lit (CmmLabelOff _ i) = cvt $ 199 + i
hash_lit (CmmLabelDiffOff _ _ i) = cvt $ 299 + i
hash_lit (CmmBlock _) = 191 -- ugh
hash_lit (CmmHighStackMark) = cvt 313
hash_tgt (ForeignTarget e _) = hash_e e
hash_tgt (PrimTarget _) = 31 -- lots of these
hash_list f = foldl (\z x -> f x + z) (0::Word32)
cvt = fromInteger . toInteger
-- | Ignore these node types for equality | 2,082 | false | true | 8 | 9 | 659 | 846 | 392 | 454 | null | null |
ababkin/railoscopy | src/Haste/Perch.hs | mit | tr cont = nelem "tr" `child` cont | 34 | tr cont = nelem "tr" `child` cont | 34 | tr cont = nelem "tr" `child` cont | 34 | false | false | 0 | 6 | 7 | 18 | 9 | 9 | null | null |
sheepforce/Haskell_Data.Chemistry | src/modules/Data/Chemistry/BasisOptimisation.hs | gpl-3.0 | getContrCoeff_print :: Handle -> [Int] -> [Int] -> Bool -> Molden -> IO()
getContrCoeff_print handle setOfBFs setOfMOs renorm molden = do
-- calculate the contraction coefficients
let contrCoeff = getContrCoeff setOfBFs setOfMOs renorm molden
angMomOfAllBFs = concat . map (map _basfun_angular) . _molden_basfuns $ molden
angMomOfSelBFs = [angMomOfAllBFs !! i | i <- setOfBFs]
angMomOfSelBF = head angMomOfSelBFs
-- print them
putStrLn $ "contraction coefficients for"
putStrLn $ " angular momentum : " ++ show (angMom2Orb angMomOfSelBF)
putStrLn $ " basis functions : " ++ show setOfBFs
putStrLn $ " from the MOs : " ++ show setOfMOs
putStrLn $ " renormalized : " ++ show renorm
putStrLn $ ""
mapM_ (hPrintf handle "%9.7f\n") contrCoeff | 789 | getContrCoeff_print :: Handle -> [Int] -> [Int] -> Bool -> Molden -> IO()
getContrCoeff_print handle setOfBFs setOfMOs renorm molden = do
-- calculate the contraction coefficients
let contrCoeff = getContrCoeff setOfBFs setOfMOs renorm molden
angMomOfAllBFs = concat . map (map _basfun_angular) . _molden_basfuns $ molden
angMomOfSelBFs = [angMomOfAllBFs !! i | i <- setOfBFs]
angMomOfSelBF = head angMomOfSelBFs
-- print them
putStrLn $ "contraction coefficients for"
putStrLn $ " angular momentum : " ++ show (angMom2Orb angMomOfSelBF)
putStrLn $ " basis functions : " ++ show setOfBFs
putStrLn $ " from the MOs : " ++ show setOfMOs
putStrLn $ " renormalized : " ++ show renorm
putStrLn $ ""
mapM_ (hPrintf handle "%9.7f\n") contrCoeff | 789 | getContrCoeff_print handle setOfBFs setOfMOs renorm molden = do
-- calculate the contraction coefficients
let contrCoeff = getContrCoeff setOfBFs setOfMOs renorm molden
angMomOfAllBFs = concat . map (map _basfun_angular) . _molden_basfuns $ molden
angMomOfSelBFs = [angMomOfAllBFs !! i | i <- setOfBFs]
angMomOfSelBF = head angMomOfSelBFs
-- print them
putStrLn $ "contraction coefficients for"
putStrLn $ " angular momentum : " ++ show (angMom2Orb angMomOfSelBF)
putStrLn $ " basis functions : " ++ show setOfBFs
putStrLn $ " from the MOs : " ++ show setOfMOs
putStrLn $ " renormalized : " ++ show renorm
putStrLn $ ""
mapM_ (hPrintf handle "%9.7f\n") contrCoeff | 715 | false | true | 0 | 16 | 166 | 224 | 106 | 118 | null | null |
diogob/postgrest | src/PostgREST/OpenAPI.hs | mit | makeMimeList :: [ContentType] -> MimeList
makeMimeList cs = MimeList $ map (fromString . toS . toMime) cs | 105 | makeMimeList :: [ContentType] -> MimeList
makeMimeList cs = MimeList $ map (fromString . toS . toMime) cs | 105 | makeMimeList cs = MimeList $ map (fromString . toS . toMime) cs | 63 | false | true | 0 | 9 | 16 | 41 | 21 | 20 | null | null |
tjakway/ghcjvm | compiler/codeGen/StgCmmLayout.hs | bsd-3-clause | directCall :: Convention -> CLabel -> RepArity -> [StgArg] -> FCode ReturnKind
-- (directCall f n args)
-- calls f(arg1, ..., argn), and applies the result to the remaining args
-- The function f has arity n, and there are guaranteed at least n args
-- Both arity and args include void args
directCall conv lbl arity stg_args
= do { argreps <- getArgRepsAmodes stg_args
; direct_call "directCall" conv lbl arity argreps } | 432 | directCall :: Convention -> CLabel -> RepArity -> [StgArg] -> FCode ReturnKind
directCall conv lbl arity stg_args
= do { argreps <- getArgRepsAmodes stg_args
; direct_call "directCall" conv lbl arity argreps } | 220 | directCall conv lbl arity stg_args
= do { argreps <- getArgRepsAmodes stg_args
; direct_call "directCall" conv lbl arity argreps } | 141 | true | true | 0 | 9 | 83 | 73 | 38 | 35 | null | null |
centromere/cacophony | benchmarks/Types.hs | unlicense | patternToHandshake PatternINpsk1 = noiseINpsk1 | 46 | patternToHandshake PatternINpsk1 = noiseINpsk1 | 46 | patternToHandshake PatternINpsk1 = noiseINpsk1 | 46 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
adz/real_world_haskell | edx-fp1/template-lab6.hs | mit | ex7 = (*) (leaves . head . children . head . children $ xs) (product . map size . children . head . drop 2 . children $ xs) | 123 | ex7 = (*) (leaves . head . children . head . children $ xs) (product . map size . children . head . drop 2 . children $ xs) | 123 | ex7 = (*) (leaves . head . children . head . children $ xs) (product . map size . children . head . drop 2 . children $ xs) | 123 | false | false | 1 | 13 | 28 | 72 | 35 | 37 | null | null |
Daniel-Diaz/processing | Graphics/Web/Processing/Optimize.hs | bsd-3-clause | replaceInCode o t (Sequence xs) = Sequence $ fmap (replaceInCode o t) xs | 72 | replaceInCode o t (Sequence xs) = Sequence $ fmap (replaceInCode o t) xs | 72 | replaceInCode o t (Sequence xs) = Sequence $ fmap (replaceInCode o t) xs | 72 | false | false | 0 | 8 | 12 | 38 | 17 | 21 | null | null |
gnclmorais/flickell | Main.hs | mit | getPhotoSizesUrl :: String -> Photo -> Text
getPhotoSizesUrl apiKey (Photo id _ _ _ _ _ _ _ _) = T.pack $ printf "https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&format=json&api_key=%s&photo_id=%s" apiKey (T.unpack id) | 238 | getPhotoSizesUrl :: String -> Photo -> Text
getPhotoSizesUrl apiKey (Photo id _ _ _ _ _ _ _ _) = T.pack $ printf "https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&format=json&api_key=%s&photo_id=%s" apiKey (T.unpack id) | 238 | getPhotoSizesUrl apiKey (Photo id _ _ _ _ _ _ _ _) = T.pack $ printf "https://api.flickr.com/services/rest/?method=flickr.photos.getSizes&format=json&api_key=%s&photo_id=%s" apiKey (T.unpack id) | 194 | false | true | 0 | 9 | 26 | 71 | 34 | 37 | null | null |
kinoru/wild | src/Parser.hs | agpl-3.0 | parseChangeLog :: ByteString -> [ByteString]
parseChangeLog = parseLines $ \ b -> if "##" `B.isPrefixOf` b
then Just $ f $ B.takeWhile (/= ' ') $ B.dropWhile (== ' ') $ B.drop 2 b
else Nothing
where
f b
| B.head b == '[' = B.takeWhile (/= ']') $ B.tail b
| otherwise = b | 300 | parseChangeLog :: ByteString -> [ByteString]
parseChangeLog = parseLines $ \ b -> if "##" `B.isPrefixOf` b
then Just $ f $ B.takeWhile (/= ' ') $ B.dropWhile (== ' ') $ B.drop 2 b
else Nothing
where
f b
| B.head b == '[' = B.takeWhile (/= ']') $ B.tail b
| otherwise = b | 300 | parseChangeLog = parseLines $ \ b -> if "##" `B.isPrefixOf` b
then Just $ f $ B.takeWhile (/= ' ') $ B.dropWhile (== ' ') $ B.drop 2 b
else Nothing
where
f b
| B.head b == '[' = B.takeWhile (/= ']') $ B.tail b
| otherwise = b | 255 | false | true | 0 | 12 | 84 | 149 | 73 | 76 | null | null |
tpsinnem/Idris-dev | src/IRTS/Bytecode.hs | bsd-3-clause | moveReg off (Loc x : xs) = assign (T off) (L x) ++ moveReg (off + 1) xs | 71 | moveReg off (Loc x : xs) = assign (T off) (L x) ++ moveReg (off + 1) xs | 71 | moveReg off (Loc x : xs) = assign (T off) (L x) ++ moveReg (off + 1) xs | 71 | false | false | 0 | 8 | 17 | 56 | 26 | 30 | null | null |
sdiehl/ghc | libraries/base/GHC/Event/Thread.hs | bsd-3-clause | timerManager :: IORef (Maybe TM.TimerManager)
timerManager = unsafePerformIO $ do
em <- newIORef Nothing
sharedCAF em getOrSetSystemTimerThreadEventManagerStore
| 169 | timerManager :: IORef (Maybe TM.TimerManager)
timerManager = unsafePerformIO $ do
em <- newIORef Nothing
sharedCAF em getOrSetSystemTimerThreadEventManagerStore
| 169 | timerManager = unsafePerformIO $ do
em <- newIORef Nothing
sharedCAF em getOrSetSystemTimerThreadEventManagerStore
| 123 | false | true | 0 | 9 | 25 | 44 | 20 | 24 | null | null |
yiannist/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ip4AddressLocalhost :: String
ip4AddressLocalhost = "127.0.0.1" | 63 | ip4AddressLocalhost :: String
ip4AddressLocalhost = "127.0.0.1" | 63 | ip4AddressLocalhost = "127.0.0.1" | 33 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
PROTEINE-INSAIDERS/lev-tolstoy | bench/Bench/Lev/Reader/Static.hs | bsd-3-clause | read12Int64PlusInt32 :: Reader 0 100 IO Int64
read12Int64PlusInt32 = do
a1 <- readInt64
a2 <- readInt64
a3 <- readInt64
a4 <- readInt64
a5 <- readInt64
a6 <- readInt64
a7 <- readInt64
a8 <- readInt64
a9 <- readInt64
a10 <- readInt64
a11 <- readInt64
a12 <- readInt64
a13 <- readInt32
return (a1 + a2 + a3 + a4
+ a5 + a6 + a7 + a8
+ a9 + a10 + a11 + a12
+ fromIntegral a13)
| 466 | read12Int64PlusInt32 :: Reader 0 100 IO Int64
read12Int64PlusInt32 = do
a1 <- readInt64
a2 <- readInt64
a3 <- readInt64
a4 <- readInt64
a5 <- readInt64
a6 <- readInt64
a7 <- readInt64
a8 <- readInt64
a9 <- readInt64
a10 <- readInt64
a11 <- readInt64
a12 <- readInt64
a13 <- readInt32
return (a1 + a2 + a3 + a4
+ a5 + a6 + a7 + a8
+ a9 + a10 + a11 + a12
+ fromIntegral a13)
| 466 | read12Int64PlusInt32 = do
a1 <- readInt64
a2 <- readInt64
a3 <- readInt64
a4 <- readInt64
a5 <- readInt64
a6 <- readInt64
a7 <- readInt64
a8 <- readInt64
a9 <- readInt64
a10 <- readInt64
a11 <- readInt64
a12 <- readInt64
a13 <- readInt32
return (a1 + a2 + a3 + a4
+ a5 + a6 + a7 + a8
+ a9 + a10 + a11 + a12
+ fromIntegral a13)
| 420 | false | true | 0 | 20 | 169 | 171 | 78 | 93 | null | null |
LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Common/ActorState.hs | bsd-3-clause | actorAssocs :: (FactionId -> Bool) -> LevelId -> State
-> [(ActorId, Actor)]
actorAssocs p lid s =
let f (_, b) = blid b == lid && p (bfid b)
in filter f $ EM.assocs $ sactorD s | 193 | actorAssocs :: (FactionId -> Bool) -> LevelId -> State
-> [(ActorId, Actor)]
actorAssocs p lid s =
let f (_, b) = blid b == lid && p (bfid b)
in filter f $ EM.assocs $ sactorD s | 193 | actorAssocs p lid s =
let f (_, b) = blid b == lid && p (bfid b)
in filter f $ EM.assocs $ sactorD s | 104 | false | true | 0 | 12 | 53 | 102 | 51 | 51 | null | null |
ItsLastDay/academic_university_2016-2018 | subjects/Haskell/8a/homework.hs | gpl-3.0 | divideList' :: (Show a, Fractional a) => [a] -> (String,a)
divideList' [] = ("1.0", 1) | 90 | divideList' :: (Show a, Fractional a) => [a] -> (String,a)
divideList' [] = ("1.0", 1) | 90 | divideList' [] = ("1.0", 1) | 31 | false | true | 0 | 7 | 18 | 50 | 28 | 22 | null | null |
vincenthz/cryptonite | Crypto/PubKey/ECDSA.hs | bsd-3-clause | -- | Sign a digest using hash and private key.
signDigest :: (EllipticCurveECDSA curve, MonadRandom m, HashAlgorithm hash)
=> proxy curve -> PrivateKey curve -> Digest hash -> m (Signature curve)
signDigest prx pk digest = do
k <- curveGenerateScalar prx
case signDigestWith prx k pk digest of
Nothing -> signDigest prx pk digest
Just sig -> return sig
-- | Sign a message using hash and private key. | 437 | signDigest :: (EllipticCurveECDSA curve, MonadRandom m, HashAlgorithm hash)
=> proxy curve -> PrivateKey curve -> Digest hash -> m (Signature curve)
signDigest prx pk digest = do
k <- curveGenerateScalar prx
case signDigestWith prx k pk digest of
Nothing -> signDigest prx pk digest
Just sig -> return sig
-- | Sign a message using hash and private key. | 390 | signDigest prx pk digest = do
k <- curveGenerateScalar prx
case signDigestWith prx k pk digest of
Nothing -> signDigest prx pk digest
Just sig -> return sig
-- | Sign a message using hash and private key. | 230 | true | true | 0 | 11 | 105 | 122 | 57 | 65 | null | null |
dhess/gpio | src/System/GPIO/Linux/Sysfs/Util.hs | bsd-3-clause | pinDirectionValueToBS High = "high\n" | 37 | pinDirectionValueToBS High = "high\n" | 37 | pinDirectionValueToBS High = "high\n" | 37 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
FranklinChen/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | tldeclared _ = [] | 54 | tldeclared _ = [] | 54 | tldeclared _ = [] | 54 | false | false | 0 | 5 | 40 | 11 | 5 | 6 | null | null |
NorfairKing/the-notes | src/Sets/Algebra/Intersection.hs | gpl-2.0 | disjunctDefinition :: Note
disjunctDefinition = de $ do
s ["Two", sets, m a, and, m b, are, "called", disjunct', "if they have no", elements, "in common"]
ma $ a ∩ b =§= emptyset | 186 | disjunctDefinition :: Note
disjunctDefinition = de $ do
s ["Two", sets, m a, and, m b, are, "called", disjunct', "if they have no", elements, "in common"]
ma $ a ∩ b =§= emptyset | 186 | disjunctDefinition = de $ do
s ["Two", sets, m a, and, m b, are, "called", disjunct', "if they have no", elements, "in common"]
ma $ a ∩ b =§= emptyset | 159 | false | true | 0 | 10 | 40 | 75 | 41 | 34 | null | null |
gibiansky/hlint | src/HSE/Scope.hs | bsd-3-clause | possImport i (Qual _ mod x) = fromModuleName mod `elem` map fromModuleName ms && possImport i{importQualified=False} (UnQual an x)
where ms = importModule i : maybeToList (importAs i) | 187 | possImport i (Qual _ mod x) = fromModuleName mod `elem` map fromModuleName ms && possImport i{importQualified=False} (UnQual an x)
where ms = importModule i : maybeToList (importAs i) | 187 | possImport i (Qual _ mod x) = fromModuleName mod `elem` map fromModuleName ms && possImport i{importQualified=False} (UnQual an x)
where ms = importModule i : maybeToList (importAs i) | 187 | false | false | 1 | 8 | 31 | 89 | 41 | 48 | null | null |
isomorphism/webgl | src/Graphics/Rendering/WebGL/Constants.hs | mit | gl_COPY_INVERTED :: GLenum
gl_COPY_INVERTED = 0x150C | 52 | gl_COPY_INVERTED :: GLenum
gl_COPY_INVERTED = 0x150C | 52 | gl_COPY_INVERTED = 0x150C | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/ResolverType.hs | mit | resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident, _isTop}} = do
uidIClaferMap' <- asks iUIDIClaferMap
runListT $ runExceptT $ do
curPath' <- curPath
sident' <- if _sident == "this" then _uid <$> curThis else return _sident
when (isJust curPath') $ do
c <- mapM (isChild uidIClaferMap' sident') $ unionType $ fromJust curPath'
let parentId' = str (fromJust curPath')
unless (or c || parentId' == "root") $ throwError $ SemanticErr _inPos ("'" ++ sident' ++ "' is not a child of type '" ++ parentId' ++ "'")
result <- (p `withType`) <$> typeOfUid sident'
if _isTop
then return result -- Case 1: Use the sident
<++>
addDref result -- Case 2: Dereference the sident 1..* times
<++>
addSome result
else return result -- all not top-level identifiers must be in a path | 857 | resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident, _isTop}} = do
uidIClaferMap' <- asks iUIDIClaferMap
runListT $ runExceptT $ do
curPath' <- curPath
sident' <- if _sident == "this" then _uid <$> curThis else return _sident
when (isJust curPath') $ do
c <- mapM (isChild uidIClaferMap' sident') $ unionType $ fromJust curPath'
let parentId' = str (fromJust curPath')
unless (or c || parentId' == "root") $ throwError $ SemanticErr _inPos ("'" ++ sident' ++ "' is not a child of type '" ++ parentId' ++ "'")
result <- (p `withType`) <$> typeOfUid sident'
if _isTop
then return result -- Case 1: Use the sident
<++>
addDref result -- Case 2: Dereference the sident 1..* times
<++>
addSome result
else return result -- all not top-level identifiers must be in a path | 857 | resolveTPExp' p@PExp{_inPos, _exp = IClaferId{_sident, _isTop}} = do
uidIClaferMap' <- asks iUIDIClaferMap
runListT $ runExceptT $ do
curPath' <- curPath
sident' <- if _sident == "this" then _uid <$> curThis else return _sident
when (isJust curPath') $ do
c <- mapM (isChild uidIClaferMap' sident') $ unionType $ fromJust curPath'
let parentId' = str (fromJust curPath')
unless (or c || parentId' == "root") $ throwError $ SemanticErr _inPos ("'" ++ sident' ++ "' is not a child of type '" ++ parentId' ++ "'")
result <- (p `withType`) <$> typeOfUid sident'
if _isTop
then return result -- Case 1: Use the sident
<++>
addDref result -- Case 2: Dereference the sident 1..* times
<++>
addSome result
else return result -- all not top-level identifiers must be in a path | 857 | false | false | 1 | 21 | 217 | 264 | 125 | 139 | null | null |
hargettp/courier | tests/TestUtils.hs | mit | newUDPAddress6 :: IO Name
newUDPAddress6 = do
NS.SockAddrInet6 p _ _ _ <- availablePort NS.AF_INET6 NS.Datagram
return $ Name $ "localhost:" ++ show p | 154 | newUDPAddress6 :: IO Name
newUDPAddress6 = do
NS.SockAddrInet6 p _ _ _ <- availablePort NS.AF_INET6 NS.Datagram
return $ Name $ "localhost:" ++ show p | 154 | newUDPAddress6 = do
NS.SockAddrInet6 p _ _ _ <- availablePort NS.AF_INET6 NS.Datagram
return $ Name $ "localhost:" ++ show p | 128 | false | true | 0 | 9 | 27 | 59 | 27 | 32 | null | null |
infotroph/pandoc | src/Text/Pandoc/Readers/Org/Inlines.hs | gpl-2.0 | notAfterForbiddenBorderChar :: OrgParser Bool
notAfterForbiddenBorderChar = do
pos <- getPosition
lastFBCPos <- orgStateLastForbiddenCharPos <$> getState
return $ lastFBCPos /= Just pos
-- | Read a sub- or superscript expression | 235 | notAfterForbiddenBorderChar :: OrgParser Bool
notAfterForbiddenBorderChar = do
pos <- getPosition
lastFBCPos <- orgStateLastForbiddenCharPos <$> getState
return $ lastFBCPos /= Just pos
-- | Read a sub- or superscript expression | 235 | notAfterForbiddenBorderChar = do
pos <- getPosition
lastFBCPos <- orgStateLastForbiddenCharPos <$> getState
return $ lastFBCPos /= Just pos
-- | Read a sub- or superscript expression | 189 | false | true | 0 | 8 | 35 | 47 | 22 | 25 | null | null |
ak1211/tractor | src/MatsuiCoJp/Scraper.hs | agpl-3.0 | -- |
-- 符号,数字,小数点以外の文字を破棄する関数
onlySignDigit :: TL.Text -> TL.Text
onlySignDigit = TL.filter isSignDigit | 104 | onlySignDigit :: TL.Text -> TL.Text
onlySignDigit = TL.filter isSignDigit | 73 | onlySignDigit = TL.filter isSignDigit | 37 | true | true | 0 | 8 | 13 | 33 | 15 | 18 | null | null |
mcschroeder/smc | Formula.hs | mit | and (And xs) y = And (y:xs) | 44 | and (And xs) y = And (y:xs) | 44 | and (And xs) y = And (y:xs) | 44 | false | false | 0 | 7 | 23 | 28 | 13 | 15 | null | null |
technogeeky/d-A | include/containers-0.5.0.0/Data/IntMap.hs | gpl-3.0 | -- | /Deprecated./ As of version 0.5, replaced by 'foldr'.
--
-- /O(n)/. Fold the values in the map using the given
-- right-associative binary operator. This function is an equivalent
-- of 'foldr' and is present for compatibility only.
fold :: (a -> b -> b) -> b -> IntMap a -> b
fold = foldr | 294 | fold :: (a -> b -> b) -> b -> IntMap a -> b
fold = foldr | 56 | fold = foldr | 12 | true | true | 0 | 8 | 56 | 42 | 24 | 18 | null | null |
Alllex/stm-data-collection | src/Data/STM/PriorityQueue/Internal/THeapPQ.hs | bsd-3-clause | pqDeleteMin :: Ord k => THeapPQ k b -> STM b
pqDeleteMin (PQ hp) = do
h <- readTVar hp
case h of
Nil -> retry
(Node _ _ _ v vl vr) -> do
l <- readTVar vl
r <- readTVar vr
h' <- l `union` r
writeTVar hp h'
return v | 272 | pqDeleteMin :: Ord k => THeapPQ k b -> STM b
pqDeleteMin (PQ hp) = do
h <- readTVar hp
case h of
Nil -> retry
(Node _ _ _ v vl vr) -> do
l <- readTVar vl
r <- readTVar vr
h' <- l `union` r
writeTVar hp h'
return v | 272 | pqDeleteMin (PQ hp) = do
h <- readTVar hp
case h of
Nil -> retry
(Node _ _ _ v vl vr) -> do
l <- readTVar vl
r <- readTVar vr
h' <- l `union` r
writeTVar hp h'
return v | 227 | false | true | 0 | 13 | 111 | 131 | 59 | 72 | null | null |
energyflowanalysis/efa-2.1 | src/EFA/Flow/Draw.hs | bsd-3-clause | modifyTitle :: String -> DotGraph T.Text -> DotGraph T.Text
modifyTitle str =
Accessor.modify (attrStmtsAcc . graphStatementsAcc) (map g)
where g (GraphAttrs attrs) = GraphAttrs $ map f attrs
g x = x
f (Viz.Label (Viz.StrLabel txt)) =
Viz.Label (Viz.StrLabel (T.append txt (T.pack str)))
f x = x | 333 | modifyTitle :: String -> DotGraph T.Text -> DotGraph T.Text
modifyTitle str =
Accessor.modify (attrStmtsAcc . graphStatementsAcc) (map g)
where g (GraphAttrs attrs) = GraphAttrs $ map f attrs
g x = x
f (Viz.Label (Viz.StrLabel txt)) =
Viz.Label (Viz.StrLabel (T.append txt (T.pack str)))
f x = x | 333 | modifyTitle str =
Accessor.modify (attrStmtsAcc . graphStatementsAcc) (map g)
where g (GraphAttrs attrs) = GraphAttrs $ map f attrs
g x = x
f (Viz.Label (Viz.StrLabel txt)) =
Viz.Label (Viz.StrLabel (T.append txt (T.pack str)))
f x = x | 273 | false | true | 3 | 13 | 84 | 147 | 72 | 75 | null | null |
diminishedprime/.org | reading-list/haskell_programming_from_first_principles/09_12.hs | mit | myAny f (x:xs) = f x || myAny f xs | 34 | myAny f (x:xs) = f x || myAny f xs | 34 | myAny f (x:xs) = f x || myAny f xs | 34 | false | false | 0 | 7 | 9 | 30 | 14 | 16 | null | null |
mlitchard/IX | src/IX/Reactive/Input.hs | mit | filterRight :: Event (Either a b) -> Event b
filterRight e = filterJust $ fromRight <$> filterE isRight e | 105 | filterRight :: Event (Either a b) -> Event b
filterRight e = filterJust $ fromRight <$> filterE isRight e | 105 | filterRight e = filterJust $ fromRight <$> filterE isRight e | 60 | false | true | 0 | 9 | 18 | 49 | 22 | 27 | null | null |
arnizamani/OccamStar | ArithmeticAgentOld.hs | gpl-2.0 | 2 + 1 = 3 | 9 | 2 + 1 = 3 | 9 | 2 + 1 = 3 | 9 | false | false | 2 | 5 | 4 | 13 | 5 | 8 | null | null |
BeautifulDestinations/fb | src/Facebook/Object/Marketing/AdVideo.hs | bsd-3-clause | unVideoChunk_ :: VideoChunk_ -> FilePath
unVideoChunk_ (VideoChunk_ x) = x | 74 | unVideoChunk_ :: VideoChunk_ -> FilePath
unVideoChunk_ (VideoChunk_ x) = x | 74 | unVideoChunk_ (VideoChunk_ x) = x | 33 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
Pnom/haskell-ast-pretty | Test/examples/Unicode.hs | mit | (|<) = lengthOP False (<) | 26 | (|<) = lengthOP False (<) | 26 | (|<) = lengthOP False (<) | 26 | false | false | 0 | 5 | 5 | 15 | 9 | 6 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2017-05-snoyman-applied-haskell-at-lambdaconf/S7TypedProcess.hs | unlicense | main :: IO ()
main = do
-- Run a process, print its exit code
runProcess "true" >>= print
runProcess "false" >>= print
-- Check that the exit code is a success
runProcess_ "true"
-- This will throw an exception: runProcess_ "false"
-- Capture output and error
(dateOut, dateErr) <- readProcess_ "date"
print (dateOut, dateErr)
-- Use shell commands
(dateOut2, dateErr2) <- readProcess_ "date >&2"
print (dateOut2, dateErr2)
-- Interact with a process
let catConfig = setStdin createPipe
$ setStdout byteStringOutput
$ proc "cat" ["/etc/hosts", "-", "/etc/group"]
withProcess_ catConfig $ \p -> do
hPutStr (getStdin p) "\n\nHELLO\n"
hPutStr (getStdin p) "WORLD\n\n\n"
hClose (getStdin p)
atomically (getStdout p) >>= L8.putStr | 859 | main :: IO ()
main = do
-- Run a process, print its exit code
runProcess "true" >>= print
runProcess "false" >>= print
-- Check that the exit code is a success
runProcess_ "true"
-- This will throw an exception: runProcess_ "false"
-- Capture output and error
(dateOut, dateErr) <- readProcess_ "date"
print (dateOut, dateErr)
-- Use shell commands
(dateOut2, dateErr2) <- readProcess_ "date >&2"
print (dateOut2, dateErr2)
-- Interact with a process
let catConfig = setStdin createPipe
$ setStdout byteStringOutput
$ proc "cat" ["/etc/hosts", "-", "/etc/group"]
withProcess_ catConfig $ \p -> do
hPutStr (getStdin p) "\n\nHELLO\n"
hPutStr (getStdin p) "WORLD\n\n\n"
hClose (getStdin p)
atomically (getStdout p) >>= L8.putStr | 859 | main = do
-- Run a process, print its exit code
runProcess "true" >>= print
runProcess "false" >>= print
-- Check that the exit code is a success
runProcess_ "true"
-- This will throw an exception: runProcess_ "false"
-- Capture output and error
(dateOut, dateErr) <- readProcess_ "date"
print (dateOut, dateErr)
-- Use shell commands
(dateOut2, dateErr2) <- readProcess_ "date >&2"
print (dateOut2, dateErr2)
-- Interact with a process
let catConfig = setStdin createPipe
$ setStdout byteStringOutput
$ proc "cat" ["/etc/hosts", "-", "/etc/group"]
withProcess_ catConfig $ \p -> do
hPutStr (getStdin p) "\n\nHELLO\n"
hPutStr (getStdin p) "WORLD\n\n\n"
hClose (getStdin p)
atomically (getStdout p) >>= L8.putStr | 845 | false | true | 0 | 14 | 242 | 220 | 103 | 117 | null | null |
bacchanalia/KitchenSink | KitchenSink/Qualified.hs | gpl-3.0 | -- |('VU.!?')
vu_getq = (VU.!?) | 31 | vu_getq = (VU.!?) | 17 | vu_getq = (VU.!?) | 17 | true | false | 0 | 5 | 4 | 11 | 7 | 4 | null | null |
sjakobi/brick | src/Brick/Widgets/ProgressBar.hs | bsd-3-clause | -- | The attribute of the incomplete portion of the progress bar.
progressIncompleteAttr :: AttrName
progressIncompleteAttr = "progressIncomplete" | 146 | progressIncompleteAttr :: AttrName
progressIncompleteAttr = "progressIncomplete" | 80 | progressIncompleteAttr = "progressIncomplete" | 45 | true | true | 0 | 4 | 17 | 12 | 7 | 5 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs | lgpl-2.1 | -- | A zero vector
vecZero :: (Num a) => Vector2 a
vecZero
= Vector 0 0 | 73 | vecZero :: (Num a) => Vector2 a
vecZero
= Vector 0 0 | 54 | vecZero
= Vector 0 0 | 22 | true | true | 0 | 7 | 18 | 31 | 15 | 16 | null | null |
aelve/hslibs | src/Guide/Diff/Tokenize.hs | bsd-3-clause | -- spaces
consolidate s@(" ":_) =
let (l, r) = span (== " ") s
in T.concat l : consolidate r | 96 | consolidate s@(" ":_) =
let (l, r) = span (== " ") s
in T.concat l : consolidate r | 86 | consolidate s@(" ":_) =
let (l, r) = span (== " ") s
in T.concat l : consolidate r | 86 | true | false | 3 | 10 | 24 | 65 | 30 | 35 | null | null |
nevrenato/Hets_Fork | CSL/Reduce_Interface.hs | gpl-2.0 | exportLemmaRemainder :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
exportLemmaRemainder = exportLemmaGeneric | 144 | exportLemmaRemainder :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
exportLemmaRemainder = exportLemmaGeneric | 144 | exportLemmaRemainder = exportLemmaGeneric | 41 | false | true | 0 | 11 | 14 | 50 | 23 | 27 | null | null |
talanis85/mudblood | src/Mudblood/Contrib/SkillDb.hs | gpl-3.0 | readSkill :: SQL.SQLiteHandle -> String -> IO Int
readSkill sql sk = do
res <- SQL.execStatement sql $ "SELECT value FROM skills WHERE name='" ++ sk ++ "' ORDER BY date DESC"
return $ case res of
Left err -> 0
Right [] -> 0
Right (r:_) -> case r of
(((_, SQL.Int v):_):_) -> fromIntegral v
_ -> 0 | 352 | readSkill :: SQL.SQLiteHandle -> String -> IO Int
readSkill sql sk = do
res <- SQL.execStatement sql $ "SELECT value FROM skills WHERE name='" ++ sk ++ "' ORDER BY date DESC"
return $ case res of
Left err -> 0
Right [] -> 0
Right (r:_) -> case r of
(((_, SQL.Int v):_):_) -> fromIntegral v
_ -> 0 | 352 | readSkill sql sk = do
res <- SQL.execStatement sql $ "SELECT value FROM skills WHERE name='" ++ sk ++ "' ORDER BY date DESC"
return $ case res of
Left err -> 0
Right [] -> 0
Right (r:_) -> case r of
(((_, SQL.Int v):_):_) -> fromIntegral v
_ -> 0 | 302 | false | true | 0 | 20 | 115 | 144 | 70 | 74 | null | null |
shouya/thinking-dumps | transformer/trans.hs | mit | testexpr5 = (App (Abs "v" (Plus (Id "v") (Lit 3)))
(Plus (Lit 3) (Lit 1))) | 91 | testexpr5 = (App (Abs "v" (Plus (Id "v") (Lit 3)))
(Plus (Lit 3) (Lit 1))) | 91 | testexpr5 = (App (Abs "v" (Plus (Id "v") (Lit 3)))
(Plus (Lit 3) (Lit 1))) | 91 | false | false | 0 | 12 | 31 | 62 | 31 | 31 | null | null |
rahulmutt/ghcvm | compiler/Eta/Utils/FiniteMap.hs | bsd-3-clause | foldRight :: (elt -> a -> a) -> a -> Map key elt -> a
foldRight = Map.foldr' | 90 | foldRight :: (elt -> a -> a) -> a -> Map key elt -> a
foldRight = Map.foldr' | 90 | foldRight = Map.foldr' | 29 | false | true | 0 | 9 | 31 | 48 | 22 | 26 | null | null |
bitc/hs-watchman | src/System/Directory/Watchman/FileType.hs | mit | fileTypeFromChar "D" = TSolarisDoor | 35 | fileTypeFromChar "D" = TSolarisDoor | 35 | fileTypeFromChar "D" = TSolarisDoor | 35 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
np/hlatex | Language/LaTeX/Builder/Math.hs | bsd-3-clause | mathscr = mathCmdMathArg "mathscr" | 34 | mathscr = mathCmdMathArg "mathscr" | 34 | mathscr = mathCmdMathArg "mathscr" | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
vincenthz/hs-cipher-rc4 | Benchmarks/Benchmarks.hs | bsd-3-clause | main = defaultMainAll [Stream $ GStreamCipher (undefined :: RC4)] | 65 | main = defaultMainAll [Stream $ GStreamCipher (undefined :: RC4)] | 65 | main = defaultMainAll [Stream $ GStreamCipher (undefined :: RC4)] | 65 | false | false | 1 | 9 | 8 | 29 | 13 | 16 | null | null |
rahulmutt/ghcvm | compiler/Eta/CodeGen/Prim.hs | bsd-3-clause | mkRtsPrimOp CatchRetryOp = (stmGroup, "catchRetry") | 62 | mkRtsPrimOp CatchRetryOp = (stmGroup, "catchRetry") | 62 | mkRtsPrimOp CatchRetryOp = (stmGroup, "catchRetry") | 62 | false | false | 0 | 5 | 15 | 15 | 8 | 7 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/FontFaceSet.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet.size Mozilla FontFaceSet.size documentation>
getSize :: (MonadDOM m) => FontFaceSet -> m Int
getSize self
= liftDOM (round <$> ((self ^. js "size") >>= valToNumber)) | 235 | getSize :: (MonadDOM m) => FontFaceSet -> m Int
getSize self
= liftDOM (round <$> ((self ^. js "size") >>= valToNumber)) | 122 | getSize self
= liftDOM (round <$> ((self ^. js "size") >>= valToNumber)) | 74 | true | true | 0 | 12 | 29 | 58 | 30 | 28 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/FloodlightActivities/Delete.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
fadUploadProtocol :: Lens' FloodlightActivitiesDelete (Maybe Text)
fadUploadProtocol
= lens _fadUploadProtocol
(\ s a -> s{_fadUploadProtocol = a}) | 217 | fadUploadProtocol :: Lens' FloodlightActivitiesDelete (Maybe Text)
fadUploadProtocol
= lens _fadUploadProtocol
(\ s a -> s{_fadUploadProtocol = a}) | 155 | fadUploadProtocol
= lens _fadUploadProtocol
(\ s a -> s{_fadUploadProtocol = a}) | 88 | true | true | 1 | 9 | 33 | 52 | 25 | 27 | null | null |
djudd/blokus | Test.hs | gpl-3.0 | prop_initialCorners_bitmapGtZero = forAllPlayers (\[TerritoryCorner _ _ bits] -> bits > 0) initialCorners | 105 | prop_initialCorners_bitmapGtZero = forAllPlayers (\[TerritoryCorner _ _ bits] -> bits > 0) initialCorners | 105 | prop_initialCorners_bitmapGtZero = forAllPlayers (\[TerritoryCorner _ _ bits] -> bits > 0) initialCorners | 105 | false | false | 0 | 9 | 11 | 33 | 17 | 16 | null | null |
anton-k/language-css | src/Language/Css/Build.hs | bsd-3-clause | -- | \<frequency\>
khz :: Double -> Expr
khz = expr . KHz | 58 | khz :: Double -> Expr
khz = expr . KHz | 38 | khz = expr . KHz | 16 | true | true | 1 | 7 | 13 | 28 | 12 | 16 | null | null |
DavidAlphaFox/darcs | src/Darcs/Util/Printer.hs | gpl-2.0 | -- TODO try to find another way to do this, it's rather a violation
-- of the Doc abstraction
insertBeforeLastline :: Doc -> Doc -> Doc
insertBeforeLastline a b =
-- as this will just get round-tripped back into a Doc,
-- we use 'Standard' as the Target type so the encoding
-- is left alone
case reverse $ map packedString $ linesPS $ renderPS Standard a of
(ll:ls) -> vcat (reverse ls) $$ b $$ ll
[] -> error "empty Doc given as first argument of Printer.insert_before_last_line" | 499 | insertBeforeLastline :: Doc -> Doc -> Doc
insertBeforeLastline a b =
-- as this will just get round-tripped back into a Doc,
-- we use 'Standard' as the Target type so the encoding
-- is left alone
case reverse $ map packedString $ linesPS $ renderPS Standard a of
(ll:ls) -> vcat (reverse ls) $$ b $$ ll
[] -> error "empty Doc given as first argument of Printer.insert_before_last_line" | 405 | insertBeforeLastline a b =
-- as this will just get round-tripped back into a Doc,
-- we use 'Standard' as the Target type so the encoding
-- is left alone
case reverse $ map packedString $ linesPS $ renderPS Standard a of
(ll:ls) -> vcat (reverse ls) $$ b $$ ll
[] -> error "empty Doc given as first argument of Printer.insert_before_last_line" | 363 | true | true | 0 | 12 | 105 | 94 | 48 | 46 | null | null |
jdevelop/hslj | LiveJournal/GetEvents.hs | bsd-3-clause | eventObjectFactory "prop" = Just $ PropertyContainer "" "" "" | 61 | eventObjectFactory "prop" = Just $ PropertyContainer "" "" "" | 61 | eventObjectFactory "prop" = Just $ PropertyContainer "" "" "" | 61 | false | false | 0 | 6 | 8 | 20 | 9 | 11 | null | null |
maciej-bendkowski/boltzmann-brain | Data/Boltzmann/Compiler/Haskell/Algebraic.hs | bsd-3-clause | declListSamplerIO :: String -> [Decl ()]
declListSamplerIO t = declTFun (listSamplerIOName t) type' ["lb", "ub"] body
where
type' = samplerIOType (TyList () $ typeCons t)
body = constructSamplerIO listGenName t | 216 | declListSamplerIO :: String -> [Decl ()]
declListSamplerIO t = declTFun (listSamplerIOName t) type' ["lb", "ub"] body
where
type' = samplerIOType (TyList () $ typeCons t)
body = constructSamplerIO listGenName t | 216 | declListSamplerIO t = declTFun (listSamplerIOName t) type' ["lb", "ub"] body
where
type' = samplerIOType (TyList () $ typeCons t)
body = constructSamplerIO listGenName t | 175 | false | true | 2 | 9 | 35 | 89 | 41 | 48 | null | null |
gcampax/ghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | label_branches join_lbl ((tag,code):branches)
= do lbl <- label_code join_lbl code
branches' <- label_branches join_lbl branches
return ((tag,lbl):branches')
-------------- | 189 | label_branches join_lbl ((tag,code):branches)
= do lbl <- label_code join_lbl code
branches' <- label_branches join_lbl branches
return ((tag,lbl):branches')
-------------- | 189 | label_branches join_lbl ((tag,code):branches)
= do lbl <- label_code join_lbl code
branches' <- label_branches join_lbl branches
return ((tag,lbl):branches')
-------------- | 189 | false | false | 0 | 10 | 34 | 68 | 34 | 34 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.