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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
frantisekfarka/ghc-dsi
|
libraries/base/Foreign/C/Error.hs
|
bsd-3-clause
|
eBADF = Errno (CONST_EBADF)
| 37 |
eBADF = Errno (CONST_EBADF)
| 37 |
eBADF = Errno (CONST_EBADF)
| 37 | false | false | 0 | 6 | 13 | 12 | 6 | 6 | null | null |
markus-git/imperative-edsl-vhdl
|
src/Language/Embedded/Hardware/Expression/Represent/Bit.hs
|
bsd-3-clause
|
bitMul :: KnownNat n => Bits n -> Bits n -> Bits n
bitMul = lift2 (*)
| 69 |
bitMul :: KnownNat n => Bits n -> Bits n -> Bits n
bitMul = lift2 (*)
| 69 |
bitMul = lift2 (*)
| 18 | false | true | 0 | 8 | 16 | 40 | 19 | 21 | null | null |
zaxtax/naive_bayes
|
NaiveBayesMain.hs
|
bsd-3-clause
|
sample g m = do
maybeX <- unMeasure m g
case maybeX of
Nothing -> fail "Sample rejected"
Just x -> return x
| 120 |
sample g m = do
maybeX <- unMeasure m g
case maybeX of
Nothing -> fail "Sample rejected"
Just x -> return x
| 120 |
sample g m = do
maybeX <- unMeasure m g
case maybeX of
Nothing -> fail "Sample rejected"
Just x -> return x
| 120 | false | false | 0 | 10 | 35 | 51 | 22 | 29 | null | null |
b1g3ar5/CsvDatabase
|
src/CsvStats.hs
|
gpl-3.0
|
msum :: (Fractional a) => ColType a -> a
msum = mfoldl (+) 0.0
| 63 |
msum :: (Fractional a) => ColType a -> a
msum = mfoldl (+) 0.0
| 62 |
msum = mfoldl (+) 0.0
| 21 | false | true | 0 | 7 | 14 | 34 | 18 | 16 | null | null |
dkensinger/haskell
|
haskell-primes/NaurPrimes.hs
|
gpl-3.0
|
ns :: [Int]
ns = map fromIntegral esSmallPrimes
| 47 |
ns :: [Int]
ns = map fromIntegral esSmallPrimes
| 47 |
ns = map fromIntegral esSmallPrimes
| 35 | false | true | 0 | 7 | 7 | 25 | 11 | 14 | null | null |
marcinmrotek/hsqml-transient
|
src/Graphics/QML/Transient/Method.hs
|
gpl-3.0
|
nullaryMethod
:: ( MethodAction (IO a)
, MethodSuffix (MethodReplacedResult (IO a) (MethodResult (IO a)))
, (MethodResult (IO a)) ~ a
)
=> String
-> IO a
-> Build (React a)
-- ^Add a method that does not take any arguments.
nullaryMethod = method
| 262 |
nullaryMethod
:: ( MethodAction (IO a)
, MethodSuffix (MethodReplacedResult (IO a) (MethodResult (IO a)))
, (MethodResult (IO a)) ~ a
)
=> String
-> IO a
-> Build (React a)
nullaryMethod = method
| 211 |
nullaryMethod = method
| 22 | true | true | 0 | 13 | 58 | 105 | 51 | 54 | null | null |
cnc-patch/disass
|
src/Language/Assembly/X86/Parse.hs
|
bsd-3-clause
|
parseSIB :: (Stream s m Word8, Monad m) => ParsecT s PState m (Word8, Word8, Word8)
parseSIB = modRM <$> anyWord8
| 113 |
parseSIB :: (Stream s m Word8, Monad m) => ParsecT s PState m (Word8, Word8, Word8)
parseSIB = modRM <$> anyWord8
| 113 |
parseSIB = modRM <$> anyWord8
| 29 | false | true | 0 | 7 | 20 | 52 | 28 | 24 | null | null |
phaazon/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
|
bsd-3-clause
|
gl_LUMINANCE8_OES :: GLenum
gl_LUMINANCE8_OES = 0x8040
| 54 |
gl_LUMINANCE8_OES :: GLenum
gl_LUMINANCE8_OES = 0x8040
| 54 |
gl_LUMINANCE8_OES = 0x8040
| 26 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
pparkkin/eta
|
compiler/ETA/Types/TyCon.hs
|
bsd-3-clause
|
-- | Is this a PromotedDataCon?
isPromotedDataCon :: TyCon -> Bool
isPromotedDataCon (PromotedDataCon {}) = True
| 112 |
isPromotedDataCon :: TyCon -> Bool
isPromotedDataCon (PromotedDataCon {}) = True
| 80 |
isPromotedDataCon (PromotedDataCon {}) = True
| 45 | true | true | 0 | 6 | 15 | 31 | 15 | 16 | null | null |
nikki-and-the-robots/nikki
|
src/Sorts/DeathStones.hs
|
lgpl-3.0
|
stones :: [StoneDescription]
stones =
-- horizontal
(SortId "deathstones/lasers/horizontal",
(laserDir </> "laser-horizontal_00") :
(laserDir </> "laser-horizontal_01") :
[],
Position 1 17,
fmap fromUber $ Size 8 5) :
(SortId "deathstones/lasers/horizontal-small",
(laserDir </> "laser-horizontal-small_00") :
(laserDir </> "laser-horizontal-small_01") :
[],
Position 1 17,
fmap fromUber $ Size 1 5) :
-- vertical
(SortId "deathstones/lasers/vertical",
(laserDir </> "laser-vertical_00") :
(laserDir </> "laser-vertical_01") :
[],
Position 17 1,
fmap fromUber $ Size 5 8) :
(SortId "deathstones/lasers/vertical-small",
(laserDir </> "laser-vertical-small_00") :
(laserDir </> "laser-vertical-small_01") :
[],
Position 17 1,
fmap fromUber $ Size 5 1) :
[]
| 884 |
stones :: [StoneDescription]
stones =
-- horizontal
(SortId "deathstones/lasers/horizontal",
(laserDir </> "laser-horizontal_00") :
(laserDir </> "laser-horizontal_01") :
[],
Position 1 17,
fmap fromUber $ Size 8 5) :
(SortId "deathstones/lasers/horizontal-small",
(laserDir </> "laser-horizontal-small_00") :
(laserDir </> "laser-horizontal-small_01") :
[],
Position 1 17,
fmap fromUber $ Size 1 5) :
-- vertical
(SortId "deathstones/lasers/vertical",
(laserDir </> "laser-vertical_00") :
(laserDir </> "laser-vertical_01") :
[],
Position 17 1,
fmap fromUber $ Size 5 8) :
(SortId "deathstones/lasers/vertical-small",
(laserDir </> "laser-vertical-small_00") :
(laserDir </> "laser-vertical-small_01") :
[],
Position 17 1,
fmap fromUber $ Size 5 1) :
[]
| 884 |
stones =
-- horizontal
(SortId "deathstones/lasers/horizontal",
(laserDir </> "laser-horizontal_00") :
(laserDir </> "laser-horizontal_01") :
[],
Position 1 17,
fmap fromUber $ Size 8 5) :
(SortId "deathstones/lasers/horizontal-small",
(laserDir </> "laser-horizontal-small_00") :
(laserDir </> "laser-horizontal-small_01") :
[],
Position 1 17,
fmap fromUber $ Size 1 5) :
-- vertical
(SortId "deathstones/lasers/vertical",
(laserDir </> "laser-vertical_00") :
(laserDir </> "laser-vertical_01") :
[],
Position 17 1,
fmap fromUber $ Size 5 8) :
(SortId "deathstones/lasers/vertical-small",
(laserDir </> "laser-vertical-small_00") :
(laserDir </> "laser-vertical-small_01") :
[],
Position 17 1,
fmap fromUber $ Size 5 1) :
[]
| 855 | false | true | 0 | 13 | 223 | 258 | 135 | 123 | null | null |
Oscarzhao/haskell
|
pearl_algorithm_design/01_smallest_free_number/main.hs
|
apache-2.0
|
firstFalse xs = length $ takeWhile (\i -> xs!i) [0..]
| 53 |
firstFalse xs = length $ takeWhile (\i -> xs!i) [0..]
| 53 |
firstFalse xs = length $ takeWhile (\i -> xs!i) [0..]
| 53 | false | false | 0 | 9 | 9 | 33 | 17 | 16 | null | null |
pgavin/secdh
|
lib/SECDH/Eval.hs
|
bsd-3-clause
|
secdhInitProgram :: Program -> SECDH
secdhInitProgram prog =
secdhInit emptyEnv emptyHeap (LetRecT prog (VarT (Var mainProgramName)))
| 135 |
secdhInitProgram :: Program -> SECDH
secdhInitProgram prog =
secdhInit emptyEnv emptyHeap (LetRecT prog (VarT (Var mainProgramName)))
| 135 |
secdhInitProgram prog =
secdhInit emptyEnv emptyHeap (LetRecT prog (VarT (Var mainProgramName)))
| 98 | false | true | 0 | 11 | 17 | 52 | 23 | 29 | null | null |
lostbean/radio-fm69
|
src/Radio/RFM69.hs
|
bsd-3-clause
|
readRadioStatus :: Radio ()
readRadioStatus = do
(regRead :: Radio RegOpMode ) >>= liftIO . print
(regRead :: Radio PacketConfig2) >>= liftIO . print
(regRead :: Radio RegPaLevel ) >>= liftIO . print
(regRead :: Radio IRQFlags ) >>= liftIO . print
(regRead :: Radio IRQFlags2 ) >>= liftIO . print
| 318 |
readRadioStatus :: Radio ()
readRadioStatus = do
(regRead :: Radio RegOpMode ) >>= liftIO . print
(regRead :: Radio PacketConfig2) >>= liftIO . print
(regRead :: Radio RegPaLevel ) >>= liftIO . print
(regRead :: Radio IRQFlags ) >>= liftIO . print
(regRead :: Radio IRQFlags2 ) >>= liftIO . print
| 318 |
readRadioStatus = do
(regRead :: Radio RegOpMode ) >>= liftIO . print
(regRead :: Radio PacketConfig2) >>= liftIO . print
(regRead :: Radio RegPaLevel ) >>= liftIO . print
(regRead :: Radio IRQFlags ) >>= liftIO . print
(regRead :: Radio IRQFlags2 ) >>= liftIO . print
| 290 | false | true | 0 | 10 | 72 | 116 | 58 | 58 | null | null |
spechub/Hets
|
TPTP/Parser.hs
|
gpl-2.0
|
{- -----------------------------------------------------------------------------
TCF formulae
----------------------------------------------------------------------------- -}
-- <tcf_formula> ::= <tcf_logic_formula> | <tff_typed_atom>
tcf_formula :: CharParser st TCF_formula
tcf_formula = parserTrace "tcf_formula" (
liftM TCFF_logic tcf_logic_formula
<|> liftM TCFF_atom tff_typed_atom
<?> "tcf_formula"
)
| 425 |
tcf_formula :: CharParser st TCF_formula
tcf_formula = parserTrace "tcf_formula" (
liftM TCFF_logic tcf_logic_formula
<|> liftM TCFF_atom tff_typed_atom
<?> "tcf_formula"
)
| 180 |
tcf_formula = parserTrace "tcf_formula" (
liftM TCFF_logic tcf_logic_formula
<|> liftM TCFF_atom tff_typed_atom
<?> "tcf_formula"
)
| 139 | true | true | 0 | 9 | 49 | 44 | 22 | 22 | null | null |
Happy0/snowdrift
|
Model/Wiki/Sql.hs
|
agpl-3.0
|
exprWikiPageOnProject :: SqlExpr (Entity WikiPage) -> ProjectId -> SqlExpr (Value Bool)
exprWikiPageOnProject wp project_id = wp ^. WikiPageProject ==. val project_id
| 166 |
exprWikiPageOnProject :: SqlExpr (Entity WikiPage) -> ProjectId -> SqlExpr (Value Bool)
exprWikiPageOnProject wp project_id = wp ^. WikiPageProject ==. val project_id
| 166 |
exprWikiPageOnProject wp project_id = wp ^. WikiPageProject ==. val project_id
| 78 | false | true | 0 | 9 | 20 | 53 | 25 | 28 | null | null |
hellok/PetaBricks
|
scripts/oldtuner2/src/Autotune.hs
|
mit
|
printProgress :: AutotuneState -> IO ()
printProgress state = do let c = evaluationCount state
size = autotunePopulationSize state
total = if (generation state) == 1
then size
else 2*size
progress = printf "%.2f" ((100 * (fromIntegral c) / (fromIntegral total)) :: Double)
let msgTemplate = "% evaluations done"
textWidth = (length " 00.00") + (length msgTemplate)
msg = padLeft textWidth $ progress ++ msgTemplate
if showProgress state
then do putStr $ replicate (if c == 1 then 0 else textWidth) '\b'
putStr msg
else return ()
(progressOutput state) $ msg ++ "\n"
where
padLeft :: Int -> String -> String
padLeft l str = (replicate (l - (length str)) ' ') ++ str
| 1,095 |
printProgress :: AutotuneState -> IO ()
printProgress state = do let c = evaluationCount state
size = autotunePopulationSize state
total = if (generation state) == 1
then size
else 2*size
progress = printf "%.2f" ((100 * (fromIntegral c) / (fromIntegral total)) :: Double)
let msgTemplate = "% evaluations done"
textWidth = (length " 00.00") + (length msgTemplate)
msg = padLeft textWidth $ progress ++ msgTemplate
if showProgress state
then do putStr $ replicate (if c == 1 then 0 else textWidth) '\b'
putStr msg
else return ()
(progressOutput state) $ msg ++ "\n"
where
padLeft :: Int -> String -> String
padLeft l str = (replicate (l - (length str)) ' ') ++ str
| 1,095 |
printProgress state = do let c = evaluationCount state
size = autotunePopulationSize state
total = if (generation state) == 1
then size
else 2*size
progress = printf "%.2f" ((100 * (fromIntegral c) / (fromIntegral total)) :: Double)
let msgTemplate = "% evaluations done"
textWidth = (length " 00.00") + (length msgTemplate)
msg = padLeft textWidth $ progress ++ msgTemplate
if showProgress state
then do putStr $ replicate (if c == 1 then 0 else textWidth) '\b'
putStr msg
else return ()
(progressOutput state) $ msg ++ "\n"
where
padLeft :: Int -> String -> String
padLeft l str = (replicate (l - (length str)) ' ') ++ str
| 1,055 | false | true | 0 | 16 | 544 | 285 | 140 | 145 | null | null |
mettekou/ghc
|
compiler/prelude/TysPrim.hs
|
bsd-3-clause
|
eqReprPrimTyConName = mkBuiltInPrimTc (fsLit "~R#") eqReprPrimTyConKey eqReprPrimTyCon
| 96 |
eqReprPrimTyConName = mkBuiltInPrimTc (fsLit "~R#") eqReprPrimTyConKey eqReprPrimTyCon
| 96 |
eqReprPrimTyConName = mkBuiltInPrimTc (fsLit "~R#") eqReprPrimTyConKey eqReprPrimTyCon
| 96 | false | false | 0 | 7 | 16 | 19 | 9 | 10 | null | null |
Orvid/fbthrift
|
thrift/lib/hs/Thrift/Protocol/Compact.hs
|
apache-2.0
|
zigZagToI16 :: Word16 -> Int16
zigZagToI16 n = fromIntegral $ (n `shiftR` 1) `xor` negate (n .&. 0x1)
| 101 |
zigZagToI16 :: Word16 -> Int16
zigZagToI16 n = fromIntegral $ (n `shiftR` 1) `xor` negate (n .&. 0x1)
| 101 |
zigZagToI16 n = fromIntegral $ (n `shiftR` 1) `xor` negate (n .&. 0x1)
| 70 | false | true | 0 | 8 | 17 | 52 | 27 | 25 | null | null |
traunio/helen-haskell
|
src/Lib.hs
|
gpl-2.0
|
-- Fail time
readit xs = PD (TS date time) price
where line = words xs
date = readDate $ head line
time = line !! 1
price = read (line !! 2 ) :: Price
| 176 |
readit xs = PD (TS date time) price
where line = words xs
date = readDate $ head line
time = line !! 1
price = read (line !! 2 ) :: Price
| 163 |
readit xs = PD (TS date time) price
where line = words xs
date = readDate $ head line
time = line !! 1
price = read (line !! 2 ) :: Price
| 163 | true | false | 3 | 7 | 61 | 85 | 38 | 47 | null | null |
codemac/yi-editor
|
src/Yi/IReader.hs
|
gpl-2.0
|
dbLocation :: IO FilePath
dbLocation = getHomeDirectory >>= \home -> return (home ++ "/.yi/articles.db")
| 104 |
dbLocation :: IO FilePath
dbLocation = getHomeDirectory >>= \home -> return (home ++ "/.yi/articles.db")
| 104 |
dbLocation = getHomeDirectory >>= \home -> return (home ++ "/.yi/articles.db")
| 78 | false | true | 0 | 9 | 13 | 33 | 17 | 16 | null | null |
spechub/Hets
|
FreeCAD/XMLPrinter.hs
|
gpl-2.0
|
getNOChildren :: NamedObject -> [Element]
getNOChildren no = [makePlaceElem place, makeObjElem obj] where
pobj = object no
obj = o pobj
place = p pobj
| 162 |
getNOChildren :: NamedObject -> [Element]
getNOChildren no = [makePlaceElem place, makeObjElem obj] where
pobj = object no
obj = o pobj
place = p pobj
| 162 |
getNOChildren no = [makePlaceElem place, makeObjElem obj] where
pobj = object no
obj = o pobj
place = p pobj
| 120 | false | true | 0 | 7 | 36 | 59 | 30 | 29 | null | null |
sheyll/b9-vm-image-builder
|
src/lib/B9/QCUtil.hs
|
mit
|
smaller :: Gen a -> Gen a
smaller g = sized (flip resize g . max 0 . flip (-) 1)
| 80 |
smaller :: Gen a -> Gen a
smaller g = sized (flip resize g . max 0 . flip (-) 1)
| 80 |
smaller g = sized (flip resize g . max 0 . flip (-) 1)
| 54 | false | true | 0 | 9 | 20 | 53 | 25 | 28 | null | null |
mightymoose/liquidhaskell
|
benchmarks/containers-0.5.0.0/Data/Sequence.hs
|
bsd-3-clause
|
partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
partition p = foldl part (empty, empty)
where
part (xs, ys) x
| p x = (xs |> x, ys)
| otherwise = (xs, ys |> x)
-- | /O(n)/. The 'filter' function takes a predicate @p@ and a sequence
-- @xs@ and returns a sequence of those elements which satisfy the
-- predicate.
| 346 |
partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
partition p = foldl part (empty, empty)
where
part (xs, ys) x
| p x = (xs |> x, ys)
| otherwise = (xs, ys |> x)
-- | /O(n)/. The 'filter' function takes a predicate @p@ and a sequence
-- @xs@ and returns a sequence of those elements which satisfy the
-- predicate.
| 346 |
partition p = foldl part (empty, empty)
where
part (xs, ys) x
| p x = (xs |> x, ys)
| otherwise = (xs, ys |> x)
-- | /O(n)/. The 'filter' function takes a predicate @p@ and a sequence
-- @xs@ and returns a sequence of those elements which satisfy the
-- predicate.
| 294 | false | true | 0 | 10 | 96 | 121 | 62 | 59 | null | null |
silkapp/xmlhtml-xpath
|
src/Xml/XPath/Evaluator.hs
|
bsd-3-clause
|
nameTest :: ArrowF [] (~>) => NameTest -> Z Text ~> Z Text
nameTest Star = id
| 84 |
nameTest :: ArrowF [] (~>) => NameTest -> Z Text ~> Z Text
nameTest Star = id
| 84 |
nameTest Star = id
| 25 | false | true | 0 | 8 | 23 | 45 | 21 | 24 | null | null |
UCSD-PL/RefScript
|
src/Language/Rsc/SSA/SSA.hs
|
bsd-3-clause
|
lvalExp (LDot l e s) = DotRef <$> fr_ l <*> pure e <*> (Id <$> fr_ l <*> pure s)
| 87 |
lvalExp (LDot l e s) = DotRef <$> fr_ l <*> pure e <*> (Id <$> fr_ l <*> pure s)
| 87 |
lvalExp (LDot l e s) = DotRef <$> fr_ l <*> pure e <*> (Id <$> fr_ l <*> pure s)
| 87 | false | false | 0 | 9 | 27 | 54 | 25 | 29 | null | null |
vincenthz/quarry
|
src/Quarry.hs
|
bsd-3-clause
|
usage Exist = error "usage: quarry exists <repository-path> <file> ..."
| 72 |
usage Exist = error "usage: quarry exists <repository-path> <file> ..."
| 72 |
usage Exist = error "usage: quarry exists <repository-path> <file> ..."
| 72 | false | false | 0 | 5 | 10 | 12 | 5 | 7 | null | null |
geraldus/lambdacms
|
lambdacms-core/LambdaCms/Core/Handler/ActionLog.hs
|
mit
|
logToJsonLog :: (LambdaCmsAdmin master, IsString method, Monad m) =>
(Route master -> method -> Maybe r)
-> (r -> Text)
-> (UTCTime -> String)
-> (Entity ActionLog, Entity User)
-> m JsonLog
logToJsonLog can renderUrl toAgo (Entity _ log', Entity userId user) = do
let mUserUrl = renderUrl <$> (can (coreR $ UserAdminR $ UserAdminEditR userId) "GET")
return $ JsonLog
{ message = actionLogMessage log'
, username = userName user
, userUrl = mUserUrl
, timeAgo = toAgo $ actionLogCreatedAt log'
}
| 651 |
logToJsonLog :: (LambdaCmsAdmin master, IsString method, Monad m) =>
(Route master -> method -> Maybe r)
-> (r -> Text)
-> (UTCTime -> String)
-> (Entity ActionLog, Entity User)
-> m JsonLog
logToJsonLog can renderUrl toAgo (Entity _ log', Entity userId user) = do
let mUserUrl = renderUrl <$> (can (coreR $ UserAdminR $ UserAdminEditR userId) "GET")
return $ JsonLog
{ message = actionLogMessage log'
, username = userName user
, userUrl = mUserUrl
, timeAgo = toAgo $ actionLogCreatedAt log'
}
| 651 |
logToJsonLog can renderUrl toAgo (Entity _ log', Entity userId user) = do
let mUserUrl = renderUrl <$> (can (coreR $ UserAdminR $ UserAdminEditR userId) "GET")
return $ JsonLog
{ message = actionLogMessage log'
, username = userName user
, userUrl = mUserUrl
, timeAgo = toAgo $ actionLogCreatedAt log'
}
| 380 | false | true | 0 | 15 | 237 | 205 | 103 | 102 | null | null |
dmjio/miso
|
examples/compose-update/Main.hs
|
bsd-3-clause
|
-- | A lens into the first element of a tuple. Both @lens@ and
-- @microlens@ provide this under the same name.
_1 :: Lens (a,c) (b,c) a b
_1 f (a,c) = (,c) <$> f a
| 164 |
_1 :: Lens (a,c) (b,c) a b
_1 f (a,c) = (,c) <$> f a
| 52 |
_1 f (a,c) = (,c) <$> f a
| 25 | true | true | 3 | 5 | 36 | 66 | 32 | 34 | null | null |
simonmichael/hledger
|
hledger-lib/Hledger/Read/CsvReader.hs
|
gpl-3.0
|
showRecord :: CsvRecord -> Text
showRecord r = "record values: "<>T.intercalate "," (map (wrap "\"" "\"") r)
| 108 |
showRecord :: CsvRecord -> Text
showRecord r = "record values: "<>T.intercalate "," (map (wrap "\"" "\"") r)
| 108 |
showRecord r = "record values: "<>T.intercalate "," (map (wrap "\"" "\"") r)
| 76 | false | true | 0 | 10 | 16 | 45 | 22 | 23 | null | null |
brendanhay/gogol
|
gogol-testing/gen/Network/Google/Testing/Types/Product.hs
|
mpl-2.0
|
-- | Tags for this dimension. Example: \"default\".
oTags :: Lens' Orientation [Text]
oTags
= lens _oTags (\ s a -> s{_oTags = a}) . _Default .
_Coerce
| 159 |
oTags :: Lens' Orientation [Text]
oTags
= lens _oTags (\ s a -> s{_oTags = a}) . _Default .
_Coerce
| 107 |
oTags
= lens _oTags (\ s a -> s{_oTags = a}) . _Default .
_Coerce
| 73 | true | true | 1 | 11 | 35 | 55 | 28 | 27 | null | null |
cjlarose/Haskell-Graphs
|
GraphGen.hs
|
mit
|
star :: (Enum a, Num a, Show a) => a -> Graph.LabeledGraph
star n = Graph.graphFromEdgeList [("1", (show v)) | v <- [2..n]]
| 123 |
star :: (Enum a, Num a, Show a) => a -> Graph.LabeledGraph
star n = Graph.graphFromEdgeList [("1", (show v)) | v <- [2..n]]
| 123 |
star n = Graph.graphFromEdgeList [("1", (show v)) | v <- [2..n]]
| 64 | false | true | 0 | 9 | 22 | 79 | 40 | 39 | null | null |
Norberg/gui_scad
|
test/DSL/GenerateSpec.hs
|
gpl-3.0
|
spec :: Spec
spec = do
describe "forestToText" $ do
context "single cube" $ do
it "with size" $ do
let forest = [Node (Cube $ Size 1.0) []]
forestToText forest `shouldBe` "cube(1.0);\n"
it "with dimension" $ do
let forest = [Node (Cube $ Dimension 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "cube([1.0, 2.0, 3.0]);\n"
context "single cylinder" $ do
it "with r, center = True" $ do
let forest = [Node (Cylinder 10.0 (Radius 2.0) Nothing True) []]
forestToText forest `shouldBe`
"cylinder(h = 10.0, r = 2.0, center = true);\n"
it "with d, center = false" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) Nothing False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d = 3.3, center = false);\n"
it "with r1, r2, center = True" $ do
let forest = [Node (Cylinder 2.5 (Radius 3.3) (Just $ Radius 4.5) True) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, r1 = 3.3, r2 = 4.5, center = true);\n"
it "with d1, d2, center = False" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) (Just $ Diameter 4.5) False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d1 = 3.3, d2 = 4.5, center = false);\n"
it "with d1, r2, center = False" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) (Just $ Radius 4.5) False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d1 = 3.3, r2 = 4.5, center = false);\n"
context "single sphere" $ do
it "with radius" $ do
let forest = [Node (Sphere (Radius 2.0)) []]
forestToText forest `shouldBe` "sphere(2.0);\n"
it "with diameter" $ do
let forest = [Node (Sphere (Diameter 1.0)) []]
forestToText forest `shouldBe` "sphere(d = 1.0);\n"
context "translate" $ do
it "single translate" $ do
let forest = [Node (Translate 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "translate(1.0, 2.0, 3.0);\n"
it "nested translate" $ do
let forest = [Node (Translate 1.0 2.0 3.0) [Node (Translate 4.0 5.0 6.0) []]]
forestToText forest `shouldBe`
"translate(1.0, 2.0, 3.0)\n{\n translate(4.0, 5.0, 6.0);\n}\n"
context "rotate" $ do
it "single rotate" $ do
let forest = [Node (Rotate 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "rotate(1.0, 2.0, 3.0);\n"
it "nested rotate" $ do
let forest = [Node (Rotate 1.0 2.0 3.0) [Node (Rotate 4.0 5.0 6.0) []]]
forestToText forest `shouldBe`
"rotate(1.0, 2.0, 3.0)\n{\n rotate(4.0, 5.0, 6.0);\n}\n"
context "union" $ do
it "single union" $ do
let forest = [Node Union []]
forestToText forest `shouldBe` "union();\n"
it "nested union" $ do
let forest = [Node Union [Node Union []]]
forestToText forest `shouldBe`
"union()\n{\n union();\n}\n"
context "difference" $ do
it "single difference" $ do
let forest = [Node Difference []]
forestToText forest `shouldBe` "difference();\n"
it "nested difference" $ do
let forest = [Node Difference [Node Difference []]]
forestToText forest `shouldBe`
"difference()\n{\n difference();\n}\n"
context "intersection" $ do
it "single intersection" $ do
let forest = [Node Intersection []]
forestToText forest `shouldBe` "intersection();\n"
it "nested intersection" $ do
let forest = [Node Intersection [Node Intersection []]]
forestToText forest `shouldBe`
"intersection()\n{\n intersection();\n}\n"
| 3,953 |
spec :: Spec
spec = do
describe "forestToText" $ do
context "single cube" $ do
it "with size" $ do
let forest = [Node (Cube $ Size 1.0) []]
forestToText forest `shouldBe` "cube(1.0);\n"
it "with dimension" $ do
let forest = [Node (Cube $ Dimension 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "cube([1.0, 2.0, 3.0]);\n"
context "single cylinder" $ do
it "with r, center = True" $ do
let forest = [Node (Cylinder 10.0 (Radius 2.0) Nothing True) []]
forestToText forest `shouldBe`
"cylinder(h = 10.0, r = 2.0, center = true);\n"
it "with d, center = false" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) Nothing False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d = 3.3, center = false);\n"
it "with r1, r2, center = True" $ do
let forest = [Node (Cylinder 2.5 (Radius 3.3) (Just $ Radius 4.5) True) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, r1 = 3.3, r2 = 4.5, center = true);\n"
it "with d1, d2, center = False" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) (Just $ Diameter 4.5) False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d1 = 3.3, d2 = 4.5, center = false);\n"
it "with d1, r2, center = False" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) (Just $ Radius 4.5) False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d1 = 3.3, r2 = 4.5, center = false);\n"
context "single sphere" $ do
it "with radius" $ do
let forest = [Node (Sphere (Radius 2.0)) []]
forestToText forest `shouldBe` "sphere(2.0);\n"
it "with diameter" $ do
let forest = [Node (Sphere (Diameter 1.0)) []]
forestToText forest `shouldBe` "sphere(d = 1.0);\n"
context "translate" $ do
it "single translate" $ do
let forest = [Node (Translate 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "translate(1.0, 2.0, 3.0);\n"
it "nested translate" $ do
let forest = [Node (Translate 1.0 2.0 3.0) [Node (Translate 4.0 5.0 6.0) []]]
forestToText forest `shouldBe`
"translate(1.0, 2.0, 3.0)\n{\n translate(4.0, 5.0, 6.0);\n}\n"
context "rotate" $ do
it "single rotate" $ do
let forest = [Node (Rotate 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "rotate(1.0, 2.0, 3.0);\n"
it "nested rotate" $ do
let forest = [Node (Rotate 1.0 2.0 3.0) [Node (Rotate 4.0 5.0 6.0) []]]
forestToText forest `shouldBe`
"rotate(1.0, 2.0, 3.0)\n{\n rotate(4.0, 5.0, 6.0);\n}\n"
context "union" $ do
it "single union" $ do
let forest = [Node Union []]
forestToText forest `shouldBe` "union();\n"
it "nested union" $ do
let forest = [Node Union [Node Union []]]
forestToText forest `shouldBe`
"union()\n{\n union();\n}\n"
context "difference" $ do
it "single difference" $ do
let forest = [Node Difference []]
forestToText forest `shouldBe` "difference();\n"
it "nested difference" $ do
let forest = [Node Difference [Node Difference []]]
forestToText forest `shouldBe`
"difference()\n{\n difference();\n}\n"
context "intersection" $ do
it "single intersection" $ do
let forest = [Node Intersection []]
forestToText forest `shouldBe` "intersection();\n"
it "nested intersection" $ do
let forest = [Node Intersection [Node Intersection []]]
forestToText forest `shouldBe`
"intersection()\n{\n intersection();\n}\n"
| 3,953 |
spec = do
describe "forestToText" $ do
context "single cube" $ do
it "with size" $ do
let forest = [Node (Cube $ Size 1.0) []]
forestToText forest `shouldBe` "cube(1.0);\n"
it "with dimension" $ do
let forest = [Node (Cube $ Dimension 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "cube([1.0, 2.0, 3.0]);\n"
context "single cylinder" $ do
it "with r, center = True" $ do
let forest = [Node (Cylinder 10.0 (Radius 2.0) Nothing True) []]
forestToText forest `shouldBe`
"cylinder(h = 10.0, r = 2.0, center = true);\n"
it "with d, center = false" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) Nothing False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d = 3.3, center = false);\n"
it "with r1, r2, center = True" $ do
let forest = [Node (Cylinder 2.5 (Radius 3.3) (Just $ Radius 4.5) True) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, r1 = 3.3, r2 = 4.5, center = true);\n"
it "with d1, d2, center = False" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) (Just $ Diameter 4.5) False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d1 = 3.3, d2 = 4.5, center = false);\n"
it "with d1, r2, center = False" $ do
let forest = [Node (Cylinder 2.5 (Diameter 3.3) (Just $ Radius 4.5) False) []]
forestToText forest `shouldBe`
"cylinder(h = 2.5, d1 = 3.3, r2 = 4.5, center = false);\n"
context "single sphere" $ do
it "with radius" $ do
let forest = [Node (Sphere (Radius 2.0)) []]
forestToText forest `shouldBe` "sphere(2.0);\n"
it "with diameter" $ do
let forest = [Node (Sphere (Diameter 1.0)) []]
forestToText forest `shouldBe` "sphere(d = 1.0);\n"
context "translate" $ do
it "single translate" $ do
let forest = [Node (Translate 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "translate(1.0, 2.0, 3.0);\n"
it "nested translate" $ do
let forest = [Node (Translate 1.0 2.0 3.0) [Node (Translate 4.0 5.0 6.0) []]]
forestToText forest `shouldBe`
"translate(1.0, 2.0, 3.0)\n{\n translate(4.0, 5.0, 6.0);\n}\n"
context "rotate" $ do
it "single rotate" $ do
let forest = [Node (Rotate 1.0 2.0 3.0) []]
forestToText forest `shouldBe` "rotate(1.0, 2.0, 3.0);\n"
it "nested rotate" $ do
let forest = [Node (Rotate 1.0 2.0 3.0) [Node (Rotate 4.0 5.0 6.0) []]]
forestToText forest `shouldBe`
"rotate(1.0, 2.0, 3.0)\n{\n rotate(4.0, 5.0, 6.0);\n}\n"
context "union" $ do
it "single union" $ do
let forest = [Node Union []]
forestToText forest `shouldBe` "union();\n"
it "nested union" $ do
let forest = [Node Union [Node Union []]]
forestToText forest `shouldBe`
"union()\n{\n union();\n}\n"
context "difference" $ do
it "single difference" $ do
let forest = [Node Difference []]
forestToText forest `shouldBe` "difference();\n"
it "nested difference" $ do
let forest = [Node Difference [Node Difference []]]
forestToText forest `shouldBe`
"difference()\n{\n difference();\n}\n"
context "intersection" $ do
it "single intersection" $ do
let forest = [Node Intersection []]
forestToText forest `shouldBe` "intersection();\n"
it "nested intersection" $ do
let forest = [Node Intersection [Node Intersection []]]
forestToText forest `shouldBe`
"intersection()\n{\n intersection();\n}\n"
| 3,940 | false | true | 0 | 77 | 1,326 | 1,160 | 537 | 623 | null | null |
xcv-/hfind
|
src/System/HFind/Expr/Types/Value.hs
|
mit
|
typeName TNode = "fsnode"
| 27 |
typeName TNode = "fsnode"
| 27 |
typeName TNode = "fsnode"
| 27 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
christian-marie/flippers
|
src/Data/Function/Flippers.hs
|
bsd-3-clause
|
-- | Move the second argument to the first place
rotate2 :: (a -> b -> c) -> (b -> a -> c)
rotate2 = flip
| 105 |
rotate2 :: (a -> b -> c) -> (b -> a -> c)
rotate2 = flip
| 56 |
rotate2 = flip
| 14 | true | true | 0 | 8 | 25 | 38 | 21 | 17 | null | null |
shlevy/ghc
|
compiler/cmm/PprC.hs
|
bsd-3-clause
|
machRepCType :: CmmType -> SDoc
machRepCType ty | isFloatType ty = machRep_F_CType w
| otherwise = machRep_U_CType w
where
w = typeWidth ty
| 194 |
machRepCType :: CmmType -> SDoc
machRepCType ty | isFloatType ty = machRep_F_CType w
| otherwise = machRep_U_CType w
where
w = typeWidth ty
| 194 |
machRepCType ty | isFloatType ty = machRep_F_CType w
| otherwise = machRep_U_CType w
where
w = typeWidth ty
| 162 | false | true | 2 | 8 | 77 | 59 | 24 | 35 | null | null |
NorfairKing/the-notes
|
src/Cryptography/ComputationalProblems/Games/BitGuessingProblems/Macro.hs
|
gpl-2.0
|
-- * Discrete games
-- ** Stop symbol for discrete distinguishers
stopsym_ :: Note
stopsym_ = comm0 "dashv"
| 108 |
stopsym_ :: Note
stopsym_ = comm0 "dashv"
| 41 |
stopsym_ = comm0 "dashv"
| 24 | true | true | 0 | 6 | 18 | 23 | 10 | 13 | null | null |
rubenmoor/sf-servant-tutorial
|
src/Lib.hs
|
bsd-3-clause
|
-- database action
getUsers :: IO [User]
getUsers = pure [alice, bob]
| 69 |
getUsers :: IO [User]
getUsers = pure [alice, bob]
| 50 |
getUsers = pure [alice, bob]
| 28 | true | true | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
snoyberg/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
listTyConKey = mkPreludeTyConUnique 24
| 65 |
listTyConKey = mkPreludeTyConUnique 24
| 65 |
listTyConKey = mkPreludeTyConUnique 24
| 65 | false | false | 0 | 5 | 30 | 9 | 4 | 5 | null | null |
tabemann/botwars
|
src/Robots/Genetic/HunterKiller/Params.hs
|
bsd-3-clause
|
parsePolynomial (RobotConfigEntry name (RobotConfigBool _)) _ =
Left . Text.pack $ Printf.printf "%s: not a polynomial" name
| 126 |
parsePolynomial (RobotConfigEntry name (RobotConfigBool _)) _ =
Left . Text.pack $ Printf.printf "%s: not a polynomial" name
| 126 |
parsePolynomial (RobotConfigEntry name (RobotConfigBool _)) _ =
Left . Text.pack $ Printf.printf "%s: not a polynomial" name
| 126 | false | false | 1 | 9 | 18 | 43 | 20 | 23 | null | null |
anttisalonen/starrover
|
src/CreateTerrain.hs
|
mit
|
testRandomGalaxy :: Int -> Int -> Galaxy Terrain
testRandomGalaxy v numsys =
let r = mkStdGen v
in evalState (createGalaxy (createTerrain stdGoods) "milky way" (take numsys $ nearsystems ++ map show [1..numsys])) r
| 218 |
testRandomGalaxy :: Int -> Int -> Galaxy Terrain
testRandomGalaxy v numsys =
let r = mkStdGen v
in evalState (createGalaxy (createTerrain stdGoods) "milky way" (take numsys $ nearsystems ++ map show [1..numsys])) r
| 218 |
testRandomGalaxy v numsys =
let r = mkStdGen v
in evalState (createGalaxy (createTerrain stdGoods) "milky way" (take numsys $ nearsystems ++ map show [1..numsys])) r
| 169 | false | true | 0 | 13 | 36 | 86 | 41 | 45 | null | null |
diku-dk/futhark
|
src/Futhark/CodeGen/ImpGen/GPU/ToOpenCL.hs
|
isc
|
typesInCode (Call _ _ es) = mconcat $ map typesInArg es
where
typesInArg MemArg {} = mempty
typesInArg (ExpArg e) = typesInExp e
| 138 |
typesInCode (Call _ _ es) = mconcat $ map typesInArg es
where
typesInArg MemArg {} = mempty
typesInArg (ExpArg e) = typesInExp e
| 138 |
typesInCode (Call _ _ es) = mconcat $ map typesInArg es
where
typesInArg MemArg {} = mempty
typesInArg (ExpArg e) = typesInExp e
| 138 | false | false | 1 | 7 | 32 | 59 | 28 | 31 | null | null |
rueshyna/gogol
|
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
|
mpl-2.0
|
-- | Etag of this resource.
ilEtag :: Lens' I18nLanguage (Maybe Text)
ilEtag = lens _ilEtag (\ s a -> s{_ilEtag = a})
| 117 |
ilEtag :: Lens' I18nLanguage (Maybe Text)
ilEtag = lens _ilEtag (\ s a -> s{_ilEtag = a})
| 89 |
ilEtag = lens _ilEtag (\ s a -> s{_ilEtag = a})
| 47 | true | true | 0 | 9 | 22 | 46 | 25 | 21 | null | null |
enolan/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
strLogCat :: LogCat -> String
strLogCat IParse = "parser"
| 60 |
strLogCat :: LogCat -> String
strLogCat IParse = "parser"
| 60 |
strLogCat IParse = "parser"
| 30 | false | true | 0 | 7 | 11 | 24 | 10 | 14 | null | null |
Paow/encore
|
src/ir/AST/PrettyPrinter.hs
|
bsd-3-clause
|
ppExpr ExtractorPattern {name, arg = arg@Skip{}} =
ppName name <> ppExpr arg
| 80 |
ppExpr ExtractorPattern {name, arg = arg@Skip{}} =
ppName name <> ppExpr arg
| 80 |
ppExpr ExtractorPattern {name, arg = arg@Skip{}} =
ppName name <> ppExpr arg
| 80 | false | false | 2 | 9 | 15 | 40 | 19 | 21 | null | null |
kaoskorobase/mescaline
|
lib/mescaline-patterns/src/Mescaline/Pattern/Compiler.hs
|
gpl-3.0
|
binFunc AST.F_multiply = (*)
| 28 |
binFunc AST.F_multiply = (*)
| 28 |
binFunc AST.F_multiply = (*)
| 28 | false | false | 0 | 6 | 3 | 13 | 7 | 6 | null | null |
nomeata/ghc
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
getAmode' :: Bool -> CmmExpr -> NatM Amode
getAmode' _ (CmmRegOff r n) = getAmode $ mangleIndexTree r n
| 103 |
getAmode' :: Bool -> CmmExpr -> NatM Amode
getAmode' _ (CmmRegOff r n) = getAmode $ mangleIndexTree r n
| 103 |
getAmode' _ (CmmRegOff r n) = getAmode $ mangleIndexTree r n
| 60 | false | true | 0 | 7 | 18 | 44 | 21 | 23 | null | null |
syohex/ghc-mod
|
Gap.hs
|
bsd-3-clause
|
setLogAction :: DynFlags
-> (DynFlags -> Severity -> SrcSpan -> PprStyle -> SDoc -> IO ())
-> DynFlags
setLogAction df f =
#if __GLASGOW_HASKELL__ >= 706
df { log_action = f }
| 205 |
setLogAction :: DynFlags
-> (DynFlags -> Severity -> SrcSpan -> PprStyle -> SDoc -> IO ())
-> DynFlags
setLogAction df f =
#if __GLASGOW_HASKELL__ >= 706
df { log_action = f }
| 205 |
setLogAction df f =
#if __GLASGOW_HASKELL__ >= 706
df { log_action = f }
| 76 | false | true | 0 | 14 | 61 | 61 | 32 | 29 | null | null |
snoyberg/ghc
|
compiler/hsSyn/HsUtils.hs
|
bsd-3-clause
|
mkHsDictLet :: TcEvBinds -> LHsExpr Id -> LHsExpr Id
mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr
| 114 |
mkHsDictLet :: TcEvBinds -> LHsExpr Id -> LHsExpr Id
mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr
| 114 |
mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr
| 61 | false | true | 0 | 8 | 16 | 45 | 20 | 25 | null | null |
s9gf4ult/yesod
|
yesod-core/Yesod/Core/Handler.hs
|
mit
|
redirectWith :: (MonadHandler m, RedirectUrl (HandlerSite m) url)
=> H.Status
-> url
-> m a
redirectWith status url = do
urlText <- toTextUrl url
handlerError $ HCRedirect status urlText
| 233 |
redirectWith :: (MonadHandler m, RedirectUrl (HandlerSite m) url)
=> H.Status
-> url
-> m a
redirectWith status url = do
urlText <- toTextUrl url
handlerError $ HCRedirect status urlText
| 233 |
redirectWith status url = do
urlText <- toTextUrl url
handlerError $ HCRedirect status urlText
| 102 | false | true | 0 | 8 | 75 | 74 | 35 | 39 | null | null |
jeremyong/Yaiba
|
Yaiba/Ideal.hs
|
bsd-3-clause
|
getPolys :: Ideal ord -> [Poly ord]
getPolys (I a) = DL.map fst (DV.toList a)
| 77 |
getPolys :: Ideal ord -> [Poly ord]
getPolys (I a) = DL.map fst (DV.toList a)
| 77 |
getPolys (I a) = DL.map fst (DV.toList a)
| 41 | false | true | 0 | 9 | 14 | 54 | 24 | 30 | null | null |
beni55/haste-compiler
|
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
|
bsd-3-clause
|
-- | Reads vector; offset in bytes.
readWord16X8OffAddr# :: Addr# -> Int# -> State# s -> (# State# s,Word16X8# #)
readWord16X8OffAddr# = let x = x in x
| 153 |
readWord16X8OffAddr# :: Addr# -> Int# -> State# s -> (# State# s,Word16X8# #)
readWord16X8OffAddr# = let x = x in x
| 115 |
readWord16X8OffAddr# = let x = x in x
| 37 | true | true | 0 | 11 | 29 | 53 | 24 | 29 | null | null |
MaxGabriel/hedis
|
src/Database/Redis/PubSub.hs
|
bsd-3-clause
|
decodeMsg :: Reply -> PubSubReply
decodeMsg r@(MultiBulk (Just (r0:r1:r2:rs))) = either (errMsg r) id $ do
kind <- decode r0
case kind :: ByteString of
"message" -> Msg <$> decodeMessage
"pmessage" -> Msg <$> decodePMessage
"subscribe" -> return Subscribed
"psubscribe" -> return Subscribed
"unsubscribe" -> Unsubscribed <$> decodeCnt
"punsubscribe" -> Unsubscribed <$> decodeCnt
_ -> errMsg r
where
decodeMessage = Message <$> decode r1 <*> decode r2
decodePMessage = PMessage <$> decode r1 <*> decode r2 <*> decode (head rs)
decodeCnt = fromInteger <$> decode r2
| 677 |
decodeMsg :: Reply -> PubSubReply
decodeMsg r@(MultiBulk (Just (r0:r1:r2:rs))) = either (errMsg r) id $ do
kind <- decode r0
case kind :: ByteString of
"message" -> Msg <$> decodeMessage
"pmessage" -> Msg <$> decodePMessage
"subscribe" -> return Subscribed
"psubscribe" -> return Subscribed
"unsubscribe" -> Unsubscribed <$> decodeCnt
"punsubscribe" -> Unsubscribed <$> decodeCnt
_ -> errMsg r
where
decodeMessage = Message <$> decode r1 <*> decode r2
decodePMessage = PMessage <$> decode r1 <*> decode r2 <*> decode (head rs)
decodeCnt = fromInteger <$> decode r2
| 677 |
decodeMsg r@(MultiBulk (Just (r0:r1:r2:rs))) = either (errMsg r) id $ do
kind <- decode r0
case kind :: ByteString of
"message" -> Msg <$> decodeMessage
"pmessage" -> Msg <$> decodePMessage
"subscribe" -> return Subscribed
"psubscribe" -> return Subscribed
"unsubscribe" -> Unsubscribed <$> decodeCnt
"punsubscribe" -> Unsubscribed <$> decodeCnt
_ -> errMsg r
where
decodeMessage = Message <$> decode r1 <*> decode r2
decodePMessage = PMessage <$> decode r1 <*> decode r2 <*> decode (head rs)
decodeCnt = fromInteger <$> decode r2
| 643 | false | true | 2 | 14 | 198 | 218 | 104 | 114 | null | null |
1yefuwang1/haskell99problems
|
src/H99/BinaryTrees.hs
|
bsd-3-clause
|
stringToTree [c] = Just $ Branch c Empty Empty
| 46 |
stringToTree [c] = Just $ Branch c Empty Empty
| 46 |
stringToTree [c] = Just $ Branch c Empty Empty
| 46 | false | false | 0 | 6 | 8 | 23 | 11 | 12 | null | null |
ekmett/ghc
|
compiler/main/DriverPipeline.hs
|
bsd-3-clause
|
runHookedPhase :: PhasePlus -> FilePath -> DynFlags
-> CompPipeline (PhasePlus, FilePath)
runHookedPhase pp input dflags =
lookupHook runPhaseHook runPhase dflags pp input dflags
| 195 |
runHookedPhase :: PhasePlus -> FilePath -> DynFlags
-> CompPipeline (PhasePlus, FilePath)
runHookedPhase pp input dflags =
lookupHook runPhaseHook runPhase dflags pp input dflags
| 195 |
runHookedPhase pp input dflags =
lookupHook runPhaseHook runPhase dflags pp input dflags
| 90 | false | true | 0 | 10 | 39 | 57 | 27 | 30 | null | null |
spechub/Hets
|
SoftFOL/ParseTPTP.hs
|
gpl-2.0
|
upperWord :: Parser String
upperWord = luWord upper
| 51 |
upperWord :: Parser String
upperWord = luWord upper
| 51 |
upperWord = luWord upper
| 24 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
seereason/ghcjs
|
src/Gen2/Sinker.hs
|
mit
|
isSmallSinkableLit (MachInt i) = i > -100000 && i < 100000
| 59 |
isSmallSinkableLit (MachInt i) = i > -100000 && i < 100000
| 59 |
isSmallSinkableLit (MachInt i) = i > -100000 && i < 100000
| 59 | false | false | 0 | 8 | 11 | 29 | 14 | 15 | null | null |
advancedtelematic/quickcheck-state-machine-model
|
test/CrudWebserverDb.hs
|
bsd-3-clause
|
------------------------------------------------------------------------
app :: Bug -> ConnectionPool -> Application
app bug pool = serve (Proxy :: Proxy Api) (server bug pool)
| 177 |
app :: Bug -> ConnectionPool -> Application
app bug pool = serve (Proxy :: Proxy Api) (server bug pool)
| 103 |
app bug pool = serve (Proxy :: Proxy Api) (server bug pool)
| 59 | true | true | 0 | 7 | 20 | 47 | 24 | 23 | null | null |
yliu120/K3
|
src/Language/K3/Core/Declaration.hs
|
apache-2.0
|
dPropertyV (Right pv) = pv
| 26 |
dPropertyV (Right pv) = pv
| 26 |
dPropertyV (Right pv) = pv
| 26 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
ion1/swtor-ui
|
src/SWTOR/UIProfile/Layout.hs
|
mit
|
scaleBy :: Rational -> (Rational, Rational) -> (Rational, Rational)
scaleBy scale (x, y) = (scale * x, scale * y)
| 113 |
scaleBy :: Rational -> (Rational, Rational) -> (Rational, Rational)
scaleBy scale (x, y) = (scale * x, scale * y)
| 113 |
scaleBy scale (x, y) = (scale * x, scale * y)
| 45 | false | true | 0 | 7 | 19 | 56 | 32 | 24 | null | null |
Denommus/stack
|
src/main/Main.hs
|
bsd-3-clause
|
imgDockerCmd :: () -> GlobalOpts -> IO ()
imgDockerCmd () go@GlobalOpts{..} = do
withBuildConfigExt
go
Nothing
(\lk ->
do globalFixCodePage go $
Stack.Build.build
(const (return ()))
(Just lk)
defaultBuildOpts
Image.stageContainerImageArtifacts)
(Just Image.createContainerImageFromStage)
-- | Load the configuration with a manager. Convenience function used
-- throughout this module.
| 549 |
imgDockerCmd :: () -> GlobalOpts -> IO ()
imgDockerCmd () go@GlobalOpts{..} = do
withBuildConfigExt
go
Nothing
(\lk ->
do globalFixCodePage go $
Stack.Build.build
(const (return ()))
(Just lk)
defaultBuildOpts
Image.stageContainerImageArtifacts)
(Just Image.createContainerImageFromStage)
-- | Load the configuration with a manager. Convenience function used
-- throughout this module.
| 549 |
imgDockerCmd () go@GlobalOpts{..} = do
withBuildConfigExt
go
Nothing
(\lk ->
do globalFixCodePage go $
Stack.Build.build
(const (return ()))
(Just lk)
defaultBuildOpts
Image.stageContainerImageArtifacts)
(Just Image.createContainerImageFromStage)
-- | Load the configuration with a manager. Convenience function used
-- throughout this module.
| 507 | false | true | 0 | 18 | 210 | 117 | 58 | 59 | null | null |
plaprade/haskoin
|
haskoin-wallet/src/Network/Haskoin/Wallet/Client/Commands.hs
|
unlicense
|
printTx :: Maybe Address -> JsonTx -> String
printTx aM tx@JsonTx{..} = unlines $
[ "Id : " ++ cs (txHashToHex jsonTxHash) ]
++
[ "Value : " ++ printTxType jsonTxType ++ " " ++ show jsonTxValue ]
++
[ "Confidence : " ++ printTxConfidence tx ]
++ concat
[ printAddrInfos "Inputs : " jsonTxInputs
| not (null jsonTxInputs)
]
++ concat
[ printAddrInfos "Outputs : " jsonTxOutputs
| not (null jsonTxOutputs)
]
++ concat
[ printAddrInfos "Change : " jsonTxChange
| not (null jsonTxChange)
]
where
printAddrInfos header xs =
(header ++ f (head xs)) :
map ((" " ++) . f) (tail xs)
f (AddressInfo addr valM local) = unwords $
cs (addrToBase58 addr) :
[ show v | v <- maybeToList valM ]
++
[ "<-" | maybe local (== addr) aM ]
| 878 |
printTx :: Maybe Address -> JsonTx -> String
printTx aM tx@JsonTx{..} = unlines $
[ "Id : " ++ cs (txHashToHex jsonTxHash) ]
++
[ "Value : " ++ printTxType jsonTxType ++ " " ++ show jsonTxValue ]
++
[ "Confidence : " ++ printTxConfidence tx ]
++ concat
[ printAddrInfos "Inputs : " jsonTxInputs
| not (null jsonTxInputs)
]
++ concat
[ printAddrInfos "Outputs : " jsonTxOutputs
| not (null jsonTxOutputs)
]
++ concat
[ printAddrInfos "Change : " jsonTxChange
| not (null jsonTxChange)
]
where
printAddrInfos header xs =
(header ++ f (head xs)) :
map ((" " ++) . f) (tail xs)
f (AddressInfo addr valM local) = unwords $
cs (addrToBase58 addr) :
[ show v | v <- maybeToList valM ]
++
[ "<-" | maybe local (== addr) aM ]
| 878 |
printTx aM tx@JsonTx{..} = unlines $
[ "Id : " ++ cs (txHashToHex jsonTxHash) ]
++
[ "Value : " ++ printTxType jsonTxType ++ " " ++ show jsonTxValue ]
++
[ "Confidence : " ++ printTxConfidence tx ]
++ concat
[ printAddrInfos "Inputs : " jsonTxInputs
| not (null jsonTxInputs)
]
++ concat
[ printAddrInfos "Outputs : " jsonTxOutputs
| not (null jsonTxOutputs)
]
++ concat
[ printAddrInfos "Change : " jsonTxChange
| not (null jsonTxChange)
]
where
printAddrInfos header xs =
(header ++ f (head xs)) :
map ((" " ++) . f) (tail xs)
f (AddressInfo addr valM local) = unwords $
cs (addrToBase58 addr) :
[ show v | v <- maybeToList valM ]
++
[ "<-" | maybe local (== addr) aM ]
| 833 | false | true | 12 | 10 | 297 | 320 | 152 | 168 | null | null |
abakst/brisk-prelude
|
examples/Simple02.hs
|
bsd-3-clause
|
main :: Process ()
main = do me <- getSelfPid
spawnLocal (send me ())
who <- expect
send who me
| 126 |
main :: Process ()
main = do me <- getSelfPid
spawnLocal (send me ())
who <- expect
send who me
| 125 |
main = do me <- getSelfPid
spawnLocal (send me ())
who <- expect
send who me
| 106 | false | true | 0 | 10 | 50 | 54 | 24 | 30 | null | null |
Twinside/pandoc
|
src/Text/Pandoc/Writers/Docx.hs
|
gpl-2.0
|
inlinesToOpenXML :: WriterOptions -> [Inline] -> WS [Element]
inlinesToOpenXML opts lst = concat `fmap` mapM (inlineToOpenXML opts) lst
| 135 |
inlinesToOpenXML :: WriterOptions -> [Inline] -> WS [Element]
inlinesToOpenXML opts lst = concat `fmap` mapM (inlineToOpenXML opts) lst
| 135 |
inlinesToOpenXML opts lst = concat `fmap` mapM (inlineToOpenXML opts) lst
| 73 | false | true | 0 | 8 | 17 | 50 | 26 | 24 | null | null |
icyfork/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
checkFunctionDeclarations params
(T_Function id (FunctionKeyword hasKeyword) (FunctionParentheses hasParens) _ _) =
case shellType params of
Bash -> return ()
Ksh ->
when (hasKeyword && hasParens) $
err id 2111 "ksh does not allow 'function' keyword and '()' at the same time."
Sh -> do
when (hasKeyword && hasParens) $
warn id 2112 "'function' keyword is non-standard. Delete it."
when (hasKeyword && not hasParens) $
warn id 2113 "'function' keyword is non-standard. Use 'foo()' instead of 'function foo'."
| 628 |
checkFunctionDeclarations params
(T_Function id (FunctionKeyword hasKeyword) (FunctionParentheses hasParens) _ _) =
case shellType params of
Bash -> return ()
Ksh ->
when (hasKeyword && hasParens) $
err id 2111 "ksh does not allow 'function' keyword and '()' at the same time."
Sh -> do
when (hasKeyword && hasParens) $
warn id 2112 "'function' keyword is non-standard. Delete it."
when (hasKeyword && not hasParens) $
warn id 2113 "'function' keyword is non-standard. Use 'foo()' instead of 'function foo'."
| 628 |
checkFunctionDeclarations params
(T_Function id (FunctionKeyword hasKeyword) (FunctionParentheses hasParens) _ _) =
case shellType params of
Bash -> return ()
Ksh ->
when (hasKeyword && hasParens) $
err id 2111 "ksh does not allow 'function' keyword and '()' at the same time."
Sh -> do
when (hasKeyword && hasParens) $
warn id 2112 "'function' keyword is non-standard. Delete it."
when (hasKeyword && not hasParens) $
warn id 2113 "'function' keyword is non-standard. Use 'foo()' instead of 'function foo'."
| 628 | false | false | 0 | 14 | 196 | 139 | 65 | 74 | null | null |
bttr/psqueues
|
src/Data/OrdPSQ/Internal.hs
|
bsd-3-clause
|
minView (Winner (E k p v) t m) = Just (k, p, v, secondBest t m)
| 63 |
minView (Winner (E k p v) t m) = Just (k, p, v, secondBest t m)
| 63 |
minView (Winner (E k p v) t m) = Just (k, p, v, secondBest t m)
| 63 | false | false | 0 | 9 | 15 | 49 | 25 | 24 | null | null |
tolysz/prepare-ghcjs
|
spec-lts8/aeson/benchmarks/AesonMap.hs
|
bsd-3-clause
|
value10000 = value 10000
| 24 |
value10000 = value 10000
| 24 |
value10000 = value 10000
| 24 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
AlbinTheander/oden
|
cli/Oden/CLI.hs
|
mit
|
commandsInfo :: String
commandsInfo = unlines [
"Commands:",
"",
" build compile all source files in the Oden path",
" run run a specific Oden file as main",
" lint check an Oden file for errors and warnings",
" print-inferred infer types and print the package in the given file",
" print-compiled compile and print the package in the given file",
""
]
| 431 |
commandsInfo :: String
commandsInfo = unlines [
"Commands:",
"",
" build compile all source files in the Oden path",
" run run a specific Oden file as main",
" lint check an Oden file for errors and warnings",
" print-inferred infer types and print the package in the given file",
" print-compiled compile and print the package in the given file",
""
]
| 431 |
commandsInfo = unlines [
"Commands:",
"",
" build compile all source files in the Oden path",
" run run a specific Oden file as main",
" lint check an Oden file for errors and warnings",
" print-inferred infer types and print the package in the given file",
" print-compiled compile and print the package in the given file",
""
]
| 408 | false | true | 0 | 6 | 141 | 38 | 23 | 15 | null | null |
jkr/pandoc-citeproc
|
src/Text/CSL/Util.hs
|
bsd-3-clause
|
parseBool (Number n) = case fromJSON (Number n) of
Success (0 :: Int) -> return False
Success _ -> return True
Error e -> fail $ "Could not read boolean: " ++ e
| 264 |
parseBool (Number n) = case fromJSON (Number n) of
Success (0 :: Int) -> return False
Success _ -> return True
Error e -> fail $ "Could not read boolean: " ++ e
| 264 |
parseBool (Number n) = case fromJSON (Number n) of
Success (0 :: Int) -> return False
Success _ -> return True
Error e -> fail $ "Could not read boolean: " ++ e
| 264 | false | false | 0 | 10 | 136 | 76 | 35 | 41 | null | null |
tomahawkins/trs
|
attic/RTL.hs
|
bsd-3-clause
|
nextId :: RTL Int
nextId = do
db <- get
let i = rtlNextId db
put $ db { rtlNextId = i + 1 }
return i
| 108 |
nextId :: RTL Int
nextId = do
db <- get
let i = rtlNextId db
put $ db { rtlNextId = i + 1 }
return i
| 108 |
nextId = do
db <- get
let i = rtlNextId db
put $ db { rtlNextId = i + 1 }
return i
| 90 | false | true | 0 | 10 | 34 | 58 | 27 | 31 | null | null |
giorgidze/HCodecs
|
src/Codec/ByteString/Parser.hs
|
bsd-3-clause
|
-- | Skip ahead @n@ bytes. Fails if fewer than @n@ bytes are available.
skip :: Word64 -> Parser ()
skip n = readN (fromIntegral n) (const ())
| 142 |
skip :: Word64 -> Parser ()
skip n = readN (fromIntegral n) (const ())
| 70 |
skip n = readN (fromIntegral n) (const ())
| 42 | true | true | 0 | 8 | 27 | 49 | 22 | 27 | null | null |
robeverest/accelerate
|
Data/Array/Accelerate/Trafo/Algebra.hs
|
bsd-3-clause
|
evalAtanh :: Elt a => FloatingType a -> a :-> a
evalAtanh ty | FloatingDict <- floatingDict ty = eval1 atanh
| 108 |
evalAtanh :: Elt a => FloatingType a -> a :-> a
evalAtanh ty | FloatingDict <- floatingDict ty = eval1 atanh
| 108 |
evalAtanh ty | FloatingDict <- floatingDict ty = eval1 atanh
| 60 | false | true | 0 | 9 | 20 | 48 | 21 | 27 | null | null |
pparkkin/eta
|
compiler/ETA/SimplCore/OccurAnal.hs
|
bsd-3-clause
|
isRhsEnv :: OccEnv -> Bool
isRhsEnv (OccEnv { occ_encl = OccRhs }) = True
| 77 |
isRhsEnv :: OccEnv -> Bool
isRhsEnv (OccEnv { occ_encl = OccRhs }) = True
| 77 |
isRhsEnv (OccEnv { occ_encl = OccRhs }) = True
| 50 | false | true | 0 | 9 | 17 | 30 | 16 | 14 | null | null |
bergmark/clay
|
src/Clay/Border.hs
|
bsd-3-clause
|
-------------------------------------------------------------------------------
borderRadius :: Size a -> Css
borderRadius = key "border-radius"
| 145 |
borderRadius :: Size a -> Css
borderRadius = key "border-radius"
| 64 |
borderRadius = key "border-radius"
| 34 | true | true | 0 | 6 | 11 | 22 | 11 | 11 | null | null |
brendanhay/gogol
|
gogol-compute/gen/Network/Google/Resource/Compute/Routes/Insert.hs
|
mpl-2.0
|
-- | Project ID for this request.
rouProject :: Lens' RoutesInsert Text
rouProject
= lens _rouProject (\ s a -> s{_rouProject = a})
| 133 |
rouProject :: Lens' RoutesInsert Text
rouProject
= lens _rouProject (\ s a -> s{_rouProject = a})
| 99 |
rouProject
= lens _rouProject (\ s a -> s{_rouProject = a})
| 61 | true | true | 0 | 9 | 24 | 42 | 22 | 20 | null | null |
juodaspaulius/clafer-old-customBNFC
|
src/Language/Clafer/Front/LayoutResolver.hs
|
mit
|
addNewLines' :: (Monad m) => Int -> [Token] -> ClaferT m [ExToken]
addNewLines' _ [] = return []
| 116 |
addNewLines' :: (Monad m) => Int -> [Token] -> ClaferT m [ExToken]
addNewLines' _ [] = return []
| 116 |
addNewLines' _ [] = return []
| 49 | false | true | 0 | 9 | 37 | 51 | 26 | 25 | null | null |
anttisalonen/freekick2
|
src/Listings.hs
|
gpl-3.0
|
showPlayerNation 7 = "Denmark"
| 30 |
showPlayerNation 7 = "Denmark"
| 30 |
showPlayerNation 7 = "Denmark"
| 30 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
music-suite/musicxml2
|
test/Main.hs
|
bsd-3-clause
|
misc = fromParts
"Miscellaneous tests"
"None"
(partList ["Voice"])
[
[
bar [
defaultDivisions,
trebleClef,
-- key eb Major,
commonTime,
rehearsal "A",
text "hello world!",
dynamic MP,
tuplet 5 4 $ beam $ slur $ staccato $ music [
note c (1/8),
note d (1/8),
note c (1/8),
note d (1/8),
note c (1/8)
],
tuplet 3 2 $ music [
note eb (1/4) & accent,
chord [d,a,fs'] (1/4),
note g_ (1/4) & beginTie & beginSlur
]
]
,
bar [
note g_ (1/4) & endTie,
note ab_ (1/4) & endSlur,
beam $ music [
note c (1/16) & accent,
note c (2/16),
note c (1/16)
],
slur $ music [
note c (3/8) & beginGliss,
note b_ (1/8) & endGliss
]
]
,
bar [
crescFromTo PP FF $ music [
slur $ music [
note c (3/8),
note d (1/8)
],
slur $ music [
note e (3/8),
note f (1/8)
]
]
]
]
]
| 1,628 |
misc = fromParts
"Miscellaneous tests"
"None"
(partList ["Voice"])
[
[
bar [
defaultDivisions,
trebleClef,
-- key eb Major,
commonTime,
rehearsal "A",
text "hello world!",
dynamic MP,
tuplet 5 4 $ beam $ slur $ staccato $ music [
note c (1/8),
note d (1/8),
note c (1/8),
note d (1/8),
note c (1/8)
],
tuplet 3 2 $ music [
note eb (1/4) & accent,
chord [d,a,fs'] (1/4),
note g_ (1/4) & beginTie & beginSlur
]
]
,
bar [
note g_ (1/4) & endTie,
note ab_ (1/4) & endSlur,
beam $ music [
note c (1/16) & accent,
note c (2/16),
note c (1/16)
],
slur $ music [
note c (3/8) & beginGliss,
note b_ (1/8) & endGliss
]
]
,
bar [
crescFromTo PP FF $ music [
slur $ music [
note c (3/8),
note d (1/8)
],
slur $ music [
note e (3/8),
note f (1/8)
]
]
]
]
]
| 1,628 |
misc = fromParts
"Miscellaneous tests"
"None"
(partList ["Voice"])
[
[
bar [
defaultDivisions,
trebleClef,
-- key eb Major,
commonTime,
rehearsal "A",
text "hello world!",
dynamic MP,
tuplet 5 4 $ beam $ slur $ staccato $ music [
note c (1/8),
note d (1/8),
note c (1/8),
note d (1/8),
note c (1/8)
],
tuplet 3 2 $ music [
note eb (1/4) & accent,
chord [d,a,fs'] (1/4),
note g_ (1/4) & beginTie & beginSlur
]
]
,
bar [
note g_ (1/4) & endTie,
note ab_ (1/4) & endSlur,
beam $ music [
note c (1/16) & accent,
note c (2/16),
note c (1/16)
],
slur $ music [
note c (3/8) & beginGliss,
note b_ (1/8) & endGliss
]
]
,
bar [
crescFromTo PP FF $ music [
slur $ music [
note c (3/8),
note d (1/8)
],
slur $ music [
note e (3/8),
note f (1/8)
]
]
]
]
]
| 1,628 | false | false | 0 | 18 | 1,041 | 496 | 260 | 236 | null | null |
urv/fixhs
|
src/Data/FIX/Spec/FIX42.hs
|
lgpl-2.1
|
tRefAllocID :: FIXTag
tRefAllocID = FIXTag
{ tName = "RefAllocID"
, tnum = 72
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary }
| 159 |
tRefAllocID :: FIXTag
tRefAllocID = FIXTag
{ tName = "RefAllocID"
, tnum = 72
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary }
| 159 |
tRefAllocID = FIXTag
{ tName = "RefAllocID"
, tnum = 72
, tparser = toFIXString
, arbitraryValue = FIXString <$> arbitrary }
| 137 | false | true | 0 | 8 | 37 | 45 | 26 | 19 | null | null |
dxtr/hagento
|
src/Lib.hs
|
bsd-3-clause
|
run :: Options -> IO ()
run opts@Options { optRoot = root, subCommand = Args.XmlListFiles } = do
putStrLn $ show opts
files <- Xml.getXmlFiles root
putStrLn $ show files
--map putStrLn files
| 198 |
run :: Options -> IO ()
run opts@Options { optRoot = root, subCommand = Args.XmlListFiles } = do
putStrLn $ show opts
files <- Xml.getXmlFiles root
putStrLn $ show files
--map putStrLn files
| 198 |
run opts@Options { optRoot = root, subCommand = Args.XmlListFiles } = do
putStrLn $ show opts
files <- Xml.getXmlFiles root
putStrLn $ show files
--map putStrLn files
| 174 | false | true | 7 | 10 | 40 | 84 | 38 | 46 | null | null |
vincenthz/language-c
|
src/Language/C/Analysis/TypeCheck.hs
|
bsd-3-clause
|
typeDefAttrs :: (MonadCError m, MonadSymtab m) =>
NodeInfo -> Ident -> m Attributes
typeDefAttrs ni i =
do dt <- getDefTable
case lookupIdent i dt of
Nothing -> astError ni $ "can't find typedef name: " ++ identToString i
Just (Left (TypeDef _ t attrs _)) -> (attrs ++) `liftM` deepTypeAttrs t
Just (Right _) -> astError ni $ "not a typedef name: " ++ identToString i
| 411 |
typeDefAttrs :: (MonadCError m, MonadSymtab m) =>
NodeInfo -> Ident -> m Attributes
typeDefAttrs ni i =
do dt <- getDefTable
case lookupIdent i dt of
Nothing -> astError ni $ "can't find typedef name: " ++ identToString i
Just (Left (TypeDef _ t attrs _)) -> (attrs ++) `liftM` deepTypeAttrs t
Just (Right _) -> astError ni $ "not a typedef name: " ++ identToString i
| 411 |
typeDefAttrs ni i =
do dt <- getDefTable
case lookupIdent i dt of
Nothing -> astError ni $ "can't find typedef name: " ++ identToString i
Just (Left (TypeDef _ t attrs _)) -> (attrs ++) `liftM` deepTypeAttrs t
Just (Right _) -> astError ni $ "not a typedef name: " ++ identToString i
| 311 | false | true | 0 | 14 | 110 | 150 | 72 | 78 | null | null |
codeq/language-py
|
src/Language/Py/ParserMonad.hs
|
bsd-3-clause
|
internalError :: String -> P a
internalError = throwError . StrError
| 68 |
internalError :: String -> P a
internalError = throwError . StrError
| 68 |
internalError = throwError . StrError
| 37 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
michaelt/text-pipes
|
Pipes/Text.hs
|
bsd-3-clause
|
-- | Retrieve the first 'Char'
head :: (Monad m) => Producer Text m () -> m (Maybe Char)
head = go
where
go p = do
x <- nextChar p
case x of
Left _ -> return Nothing
Right (c, _) -> return (Just c)
| 252 |
head :: (Monad m) => Producer Text m () -> m (Maybe Char)
head = go
where
go p = do
x <- nextChar p
case x of
Left _ -> return Nothing
Right (c, _) -> return (Just c)
| 221 |
head = go
where
go p = do
x <- nextChar p
case x of
Left _ -> return Nothing
Right (c, _) -> return (Just c)
| 163 | true | true | 0 | 12 | 100 | 112 | 52 | 60 | null | null |
lspitzner/brittany
|
source/library/Language/Haskell/Brittany/Internal/LayouterBasics.hs
|
agpl-3.0
|
runFilteredAlternative :: CollectAltM () -> ToBriDocM BriDocNumbered
runFilteredAlternative (CollectAltM action) = docAlt $ Writer.execWriter action
| 148 |
runFilteredAlternative :: CollectAltM () -> ToBriDocM BriDocNumbered
runFilteredAlternative (CollectAltM action) = docAlt $ Writer.execWriter action
| 148 |
runFilteredAlternative (CollectAltM action) = docAlt $ Writer.execWriter action
| 79 | false | true | 0 | 7 | 14 | 41 | 19 | 22 | null | null |
spinda/liquidhaskell
|
tests/gsoc15/unknown/pos/OrdList.hs
|
bsd-3-clause
|
foldrOL k z (Two b1 b2) = foldrOL k (foldrOL k z b2) b1
| 55 |
foldrOL k z (Two b1 b2) = foldrOL k (foldrOL k z b2) b1
| 55 |
foldrOL k z (Two b1 b2) = foldrOL k (foldrOL k z b2) b1
| 55 | false | false | 0 | 7 | 13 | 38 | 18 | 20 | null | null |
lukexi/ghc-7.8-arm64
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
-- These PrimOps are NOPs in Cmm
nopOp :: PrimOp -> Bool
nopOp Int2WordOp = True
| 85 |
nopOp :: PrimOp -> Bool
nopOp Int2WordOp = True
| 51 |
nopOp Int2WordOp = True
| 27 | true | true | 0 | 7 | 20 | 25 | 11 | 14 | null | null |
brendanhay/gogol
|
gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/Locations/DlpJobs/List.hs
|
mpl-2.0
|
-- | The type of job. Defaults to \`DlpJobType.INSPECT\`
oldjlType :: Lens' OrganizationsLocationsDlpJobsList (Maybe OrganizationsLocationsDlpJobsListType)
oldjlType
= lens _oldjlType (\ s a -> s{_oldjlType = a})
| 214 |
oldjlType :: Lens' OrganizationsLocationsDlpJobsList (Maybe OrganizationsLocationsDlpJobsListType)
oldjlType
= lens _oldjlType (\ s a -> s{_oldjlType = a})
| 157 |
oldjlType
= lens _oldjlType (\ s a -> s{_oldjlType = a})
| 58 | true | true | 0 | 9 | 27 | 48 | 25 | 23 | null | null |
lukexi/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
setExtensionFlag', unSetExtensionFlag' :: ExtensionFlag -> DynFlags -> DynFlags
setExtensionFlag' f dflags = foldr ($) (xopt_set dflags f) deps
where
deps = [ if turn_on then setExtensionFlag' d
else unSetExtensionFlag' d
| (f', turn_on, d) <- impliedFlags, f' == f ]
-- When you set f, set the ones it implies
-- NB: use setExtensionFlag recursively, in case the implied flags
-- implies further flags
| 473 |
setExtensionFlag', unSetExtensionFlag' :: ExtensionFlag -> DynFlags -> DynFlags
setExtensionFlag' f dflags = foldr ($) (xopt_set dflags f) deps
where
deps = [ if turn_on then setExtensionFlag' d
else unSetExtensionFlag' d
| (f', turn_on, d) <- impliedFlags, f' == f ]
-- When you set f, set the ones it implies
-- NB: use setExtensionFlag recursively, in case the implied flags
-- implies further flags
| 473 |
setExtensionFlag' f dflags = foldr ($) (xopt_set dflags f) deps
where
deps = [ if turn_on then setExtensionFlag' d
else unSetExtensionFlag' d
| (f', turn_on, d) <- impliedFlags, f' == f ]
-- When you set f, set the ones it implies
-- NB: use setExtensionFlag recursively, in case the implied flags
-- implies further flags
| 393 | false | true | 3 | 9 | 134 | 105 | 53 | 52 | null | null |
lukexi/vr-pal
|
src/Graphics/VR/Pal/SDLUtils.hs
|
bsd-3-clause
|
onKey :: Monad m => Event -> Keycode -> m () -> m ()
onKey = ifKey ()
| 69 |
onKey :: Monad m => Event -> Keycode -> m () -> m ()
onKey = ifKey ()
| 69 |
onKey = ifKey ()
| 16 | false | true | 0 | 10 | 17 | 45 | 21 | 24 | null | null |
tdammers/ginger
|
src/Text/Ginger/Optimizer.hs
|
mit
|
optimizeMacro (Macro args body) = Macro args (optimize body)
| 60 |
optimizeMacro (Macro args body) = Macro args (optimize body)
| 60 |
optimizeMacro (Macro args body) = Macro args (optimize body)
| 60 | false | false | 0 | 7 | 8 | 29 | 13 | 16 | null | null |
jrahm/Radiation
|
src/Radiation/Parsers/Internal/CStyle.hs
|
bsd-2-clause
|
parens :: Parser BS.ByteString
parens = between '(' ')'
| 55 |
parens :: Parser BS.ByteString
parens = between '(' ')'
| 55 |
parens = between '(' ')'
| 24 | false | true | 0 | 6 | 8 | 21 | 10 | 11 | null | null |
5outh/Bang
|
src/Bang/Interface/Drum.hs
|
mit
|
snareDrum2 :: Music PercussionSound
snareDrum2 = qd SnareDrum2
| 62 |
snareDrum2 :: Music PercussionSound
snareDrum2 = qd SnareDrum2
| 62 |
snareDrum2 = qd SnareDrum2
| 26 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
Norberg/moves
|
Moves/Core.hs
|
bsd-3-clause
|
getRightOrExit :: Show a => Either a b -> b
getRightOrExit (Right a) = a
| 72 |
getRightOrExit :: Show a => Either a b -> b
getRightOrExit (Right a) = a
| 72 |
getRightOrExit (Right a) = a
| 28 | false | true | 0 | 7 | 14 | 36 | 17 | 19 | null | null |
sgillespie/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
-----------------------------------------------------------------------
eq_Expr :: TyCon -> Type -> LHsExpr RdrName -> LHsExpr RdrName -> LHsExpr RdrName
eq_Expr tycon ty a b
| not (isUnliftedType ty) = genOpApp a eq_RDR b
| otherwise = genPrimOpApp a prim_eq b
where
(_, _, prim_eq, _, _) = primOrdOps "Eq" tycon ty
| 343 |
eq_Expr :: TyCon -> Type -> LHsExpr RdrName -> LHsExpr RdrName -> LHsExpr RdrName
eq_Expr tycon ty a b
| not (isUnliftedType ty) = genOpApp a eq_RDR b
| otherwise = genPrimOpApp a prim_eq b
where
(_, _, prim_eq, _, _) = primOrdOps "Eq" tycon ty
| 270 |
eq_Expr tycon ty a b
| not (isUnliftedType ty) = genOpApp a eq_RDR b
| otherwise = genPrimOpApp a prim_eq b
where
(_, _, prim_eq, _, _) = primOrdOps "Eq" tycon ty
| 188 | true | true | 1 | 10 | 73 | 117 | 56 | 61 | null | null |
felipecsl/show-do-milhao
|
src/Lib.hs
|
apache-2.0
|
libMain :: IO ()
libMain = do
-- O programa consistia em três rodadas e uma pergunta final: a primeira continha 5 perguntas,
-- cada uma valendo mil reais cumulativos. A segunda, de 5 perguntas valendo R$ 10 mil
-- cumulativos cada. A terceira, de 5 perguntas de R$100 mil reais cumulativos cada.
-- A última pergunta valia R$ 1 milhão.
let winRange = [1..5]
stopRange = [5, 10, 20, 30, 40]
errorRange = [2, 5, 10, 15, 20]
correctPrizes = [map (*1000) winRange] ++ [map (*10000) winRange] ++ [map (*100000) winRange] ++ [[1000000]]
stopPrizes = [map (*1000) [0..5]] ++ [map (*1000) stopRange] ++ [map (*10000) stopRange] ++ [[500000]]
errorPrizes = [map (*500) [0..4]] ++ [map (*1000) errorRange] ++ [map (*10000) errorRange] ++ [[0]]
prizes = Prizes correctPrizes stopPrizes errorPrizes
-- We need to disable stdin buffering otherwise getChar won't work well
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
openFile "questions.txt" ReadMode >>= hGetContents >>= parseSections >>= printQuestionGroups prizes
| 1,108 |
libMain :: IO ()
libMain = do
-- O programa consistia em três rodadas e uma pergunta final: a primeira continha 5 perguntas,
-- cada uma valendo mil reais cumulativos. A segunda, de 5 perguntas valendo R$ 10 mil
-- cumulativos cada. A terceira, de 5 perguntas de R$100 mil reais cumulativos cada.
-- A última pergunta valia R$ 1 milhão.
let winRange = [1..5]
stopRange = [5, 10, 20, 30, 40]
errorRange = [2, 5, 10, 15, 20]
correctPrizes = [map (*1000) winRange] ++ [map (*10000) winRange] ++ [map (*100000) winRange] ++ [[1000000]]
stopPrizes = [map (*1000) [0..5]] ++ [map (*1000) stopRange] ++ [map (*10000) stopRange] ++ [[500000]]
errorPrizes = [map (*500) [0..4]] ++ [map (*1000) errorRange] ++ [map (*10000) errorRange] ++ [[0]]
prizes = Prizes correctPrizes stopPrizes errorPrizes
-- We need to disable stdin buffering otherwise getChar won't work well
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
openFile "questions.txt" ReadMode >>= hGetContents >>= parseSections >>= printQuestionGroups prizes
| 1,108 |
libMain = do
-- O programa consistia em três rodadas e uma pergunta final: a primeira continha 5 perguntas,
-- cada uma valendo mil reais cumulativos. A segunda, de 5 perguntas valendo R$ 10 mil
-- cumulativos cada. A terceira, de 5 perguntas de R$100 mil reais cumulativos cada.
-- A última pergunta valia R$ 1 milhão.
let winRange = [1..5]
stopRange = [5, 10, 20, 30, 40]
errorRange = [2, 5, 10, 15, 20]
correctPrizes = [map (*1000) winRange] ++ [map (*10000) winRange] ++ [map (*100000) winRange] ++ [[1000000]]
stopPrizes = [map (*1000) [0..5]] ++ [map (*1000) stopRange] ++ [map (*10000) stopRange] ++ [[500000]]
errorPrizes = [map (*500) [0..4]] ++ [map (*1000) errorRange] ++ [map (*10000) errorRange] ++ [[0]]
prizes = Prizes correctPrizes stopPrizes errorPrizes
-- We need to disable stdin buffering otherwise getChar won't work well
hSetBuffering stdin NoBuffering
hSetBuffering stdout NoBuffering
openFile "questions.txt" ReadMode >>= hGetContents >>= parseSections >>= printQuestionGroups prizes
| 1,091 | false | true | 0 | 15 | 241 | 313 | 176 | 137 | null | null |
ishiy1993/mk-sode1
|
src/Del/Encode/Fmr.hs
|
bsd-3-clause
|
encodeExp (Pow e1 e2) = "(" ++ encodeExp e1 ++ ")**(" ++ encodeExp e2 ++ ")"
| 76 |
encodeExp (Pow e1 e2) = "(" ++ encodeExp e1 ++ ")**(" ++ encodeExp e2 ++ ")"
| 76 |
encodeExp (Pow e1 e2) = "(" ++ encodeExp e1 ++ ")**(" ++ encodeExp e2 ++ ")"
| 76 | false | false | 0 | 9 | 15 | 39 | 18 | 21 | null | null |
Taketrung/HsPredictor
|
tests/TestSuites/ParserHTMLSpec.hs
|
mit
|
spec = fromHUnitTest $ TestList [
TestLabel ">>readMatches" test_readMatches,
TestLabel ">>convertHtml" test_convertHtml,
TestLabel ">>fillHoles" test_fillHoles]
| 167 |
spec = fromHUnitTest $ TestList [
TestLabel ">>readMatches" test_readMatches,
TestLabel ">>convertHtml" test_convertHtml,
TestLabel ">>fillHoles" test_fillHoles]
| 167 |
spec = fromHUnitTest $ TestList [
TestLabel ">>readMatches" test_readMatches,
TestLabel ">>convertHtml" test_convertHtml,
TestLabel ">>fillHoles" test_fillHoles]
| 167 | false | false | 1 | 8 | 20 | 40 | 18 | 22 | null | null |
hirokai/PaperServer
|
Model/PaperMongo.hs
|
bsd-2-clause
|
countPapersByFilter :: Text -> Bson.Document -> Handler Int
countPapersByFilter email filt = do
c <- queryRawMongoOne $ countMatching email filt
return $ fromMaybe 0 c
-- This function assumes query has correct user_email for filtering.
| 241 |
countPapersByFilter :: Text -> Bson.Document -> Handler Int
countPapersByFilter email filt = do
c <- queryRawMongoOne $ countMatching email filt
return $ fromMaybe 0 c
-- This function assumes query has correct user_email for filtering.
| 241 |
countPapersByFilter email filt = do
c <- queryRawMongoOne $ countMatching email filt
return $ fromMaybe 0 c
-- This function assumes query has correct user_email for filtering.
| 181 | false | true | 0 | 9 | 39 | 58 | 27 | 31 | null | null |
SwiftsNamesake/ALUT
|
src/Sound/ALUT/Loaders.hs
|
bsd-3-clause
|
createBufferWaveform :: ALenum -> Float -> Float -> Float -> IO ALuint
createBufferWaveform w f p d =
alut_CreateBufferWaveform w (realToFrac f) (realToFrac p) (realToFrac d)
| 177 |
createBufferWaveform :: ALenum -> Float -> Float -> Float -> IO ALuint
createBufferWaveform w f p d =
alut_CreateBufferWaveform w (realToFrac f) (realToFrac p) (realToFrac d)
| 177 |
createBufferWaveform w f p d =
alut_CreateBufferWaveform w (realToFrac f) (realToFrac p) (realToFrac d)
| 106 | false | true | 0 | 9 | 28 | 66 | 32 | 34 | null | null |
michaelficarra/purescript
|
src/Language/PureScript/Constants.hs
|
mit
|
dataArrayUnsafe :: String
dataArrayUnsafe = "Data_Array_Unsafe"
| 63 |
dataArrayUnsafe :: String
dataArrayUnsafe = "Data_Array_Unsafe"
| 63 |
dataArrayUnsafe = "Data_Array_Unsafe"
| 37 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
lzlarryli/advent_of_code_2016
|
day12/part2.hs
|
mit
|
context0 :: Context
context0 = H.fromList ([(var : "", 0) | var <- "abd"] ++ [("c", 1)])
| 88 |
context0 :: Context
context0 = H.fromList ([(var : "", 0) | var <- "abd"] ++ [("c", 1)])
| 88 |
context0 = H.fromList ([(var : "", 0) | var <- "abd"] ++ [("c", 1)])
| 68 | false | true | 0 | 10 | 16 | 59 | 31 | 28 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.