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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ocramz/optimization | src/Optimization/Constrained/Penalty.hs | bsd-3-clause | maximize :: (Functor f, RealFrac a, Ord a, g ~ V)
=> (FU f a -> f a -> [f a]) -- ^ Primal minimizer
-> Opt f a -- ^ The optimization problem of interest
-> a -- ^ The penalty increase factor
-> f a -- ^ The primal s... | 560 | maximize :: (Functor f, RealFrac a, Ord a, g ~ V)
=> (FU f a -> f a -> [f a]) -- ^ Primal minimizer
-> Opt f a -- ^ The optimization problem of interest
-> a -- ^ The penalty increase factor
-> f a -- ^ The primal s... | 514 | maximize minX (Opt (FU f) gs hs) alpha =
minimize minX (Opt (FU $ negate . f) gs hs) alpha | 94 | true | true | 0 | 12 | 259 | 159 | 81 | 78 | null | null |
adinapoli/xmonad | tests/Properties.hs | bsd-3-clause | prop_focus_master_master (n :: NonNegative Int) (x::T) =
index (foldr (const focusMaster) x [1..n]) == index x | 114 | prop_focus_master_master (n :: NonNegative Int) (x::T) =
index (foldr (const focusMaster) x [1..n]) == index x | 114 | prop_focus_master_master (n :: NonNegative Int) (x::T) =
index (foldr (const focusMaster) x [1..n]) == index x | 114 | false | false | 1 | 9 | 19 | 61 | 29 | 32 | null | null |
opentower/carnap | Carnap/src/Carnap/Calculi/NaturalDeduction/Parser/Lemmon.hs | gpl-3.0 | citations :: Parsec String u [Int]
citations = char '(' *> ((read <$> many1 digit)`sepBy` (char ',' >> spaces)) <* char ')' | 123 | citations :: Parsec String u [Int]
citations = char '(' *> ((read <$> many1 digit)`sepBy` (char ',' >> spaces)) <* char ')' | 123 | citations = char '(' *> ((read <$> many1 digit)`sepBy` (char ',' >> spaces)) <* char ')' | 88 | false | true | 0 | 11 | 21 | 64 | 33 | 31 | null | null |
JohnL4/ProjectEuler | Haskell/Problem032/app/Main.hs | mit | main :: IO ()
main = do
printf "head panDigitalTriples = %s\n" $ show $ head panDigitalTriples
startTime <- getPOSIXTime
printf "sum of products of all pandigital triples x * y = z: %d" sumPandigitalProducts
stopTime <- getPOSIXTime
printf "\t(%s sec)\n" $ show (stopTime - startTime) | 302 | main :: IO ()
main = do
printf "head panDigitalTriples = %s\n" $ show $ head panDigitalTriples
startTime <- getPOSIXTime
printf "sum of products of all pandigital triples x * y = z: %d" sumPandigitalProducts
stopTime <- getPOSIXTime
printf "\t(%s sec)\n" $ show (stopTime - startTime) | 302 | main = do
printf "head panDigitalTriples = %s\n" $ show $ head panDigitalTriples
startTime <- getPOSIXTime
printf "sum of products of all pandigital triples x * y = z: %d" sumPandigitalProducts
stopTime <- getPOSIXTime
printf "\t(%s sec)\n" $ show (stopTime - startTime) | 288 | false | true | 0 | 11 | 63 | 81 | 34 | 47 | null | null |
sumeetchhetri/FrameworkBenchmarks | frameworks/Haskell/servant/servant-tfb/src/Lib.hs | bsd-3-clause | -- | entry point
main
:: Int -- ^ number of capabilities
-> IO ()
main _cap = do
-- create 32 randon number generators
rng <- V.replicateM 32 (SM.newSMGen >>= newMVar)
#ifdef HAS_DB
db <- createPool
(connect dbConnectInfo)
close
_cap
0.5
512
#endif
let ... | 987 | main
:: Int -- ^ number of capabilities
-> IO ()
main _cap = do
-- create 32 randon number generators
rng <- V.replicateM 32 (SM.newSMGen >>= newMVar)
#ifdef HAS_DB
db <- createPool
(connect dbConnectInfo)
close
_cap
0.5
512
#endif
let ctx = Ctx { ctxRn... | 970 | main _cap = do
-- create 32 randon number generators
rng <- V.replicateM 32 (SM.newSMGen >>= newMVar)
#ifdef HAS_DB
db <- createPool
(connect dbConnectInfo)
close
_cap
0.5
512
#endif
let ctx = Ctx { ctxRng = rng
#ifdef HAS_DB
, ctxDb = db
#end... | 912 | true | true | 1 | 11 | 291 | 172 | 94 | 78 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphTest.hs | lgpl-2.1 | mgeq0115 = testGraphEq "g101-g501" False g101 g501 | 50 | mgeq0115 = testGraphEq "g101-g501" False g101 g501 | 50 | mgeq0115 = testGraphEq "g101-g501" False g101 g501 | 50 | false | false | 0 | 5 | 6 | 15 | 7 | 8 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Assoc/TernaryTrie.hs | mit | sameMapBy = sameMapByUsingSubmapBy | 34 | sameMapBy = sameMapByUsingSubmapBy | 34 | sameMapBy = sameMapByUsingSubmapBy | 34 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
ekmett/hmpfr | src/Data/Number/MPFR/Special.hs | bsd-3-clause | j0 :: RoundMode -> Precision -> MPFR -> MPFR
j0 r p = fst . j0_ r p | 71 | j0 :: RoundMode -> Precision -> MPFR -> MPFR
j0 r p = fst . j0_ r p | 71 | j0 r p = fst . j0_ r p | 22 | false | true | 0 | 7 | 21 | 37 | 18 | 19 | null | null |
thalerjonathan/phd | coding/libraries/chimera/examples/ABS/NewAgents/Init.hs | gpl-3.0 | initNewAgents :: Int -> IO ([NewAgentDef], NewAgentEnvironment)
initNewAgents n = do
adefs <- evalRandIO $ mapM createNewAgent [0..(n-1)]
return (adefs, ()) | 160 | initNewAgents :: Int -> IO ([NewAgentDef], NewAgentEnvironment)
initNewAgents n = do
adefs <- evalRandIO $ mapM createNewAgent [0..(n-1)]
return (adefs, ()) | 160 | initNewAgents n = do
adefs <- evalRandIO $ mapM createNewAgent [0..(n-1)]
return (adefs, ()) | 96 | false | true | 0 | 13 | 24 | 77 | 38 | 39 | null | null |
g0v/encoding-mashup-server | src/CharDatabase.hs | bsd-3-clause | deleteChar :: CharName -> Handler b CharDatabase ()
deleteChar cn = do
with db $ execute "update char_info set status = 'deleted' where charname = ?" $ Only cn
return () | 177 | deleteChar :: CharName -> Handler b CharDatabase ()
deleteChar cn = do
with db $ execute "update char_info set status = 'deleted' where charname = ?" $ Only cn
return () | 177 | deleteChar cn = do
with db $ execute "update char_info set status = 'deleted' where charname = ?" $ Only cn
return () | 125 | false | true | 0 | 9 | 38 | 55 | 24 | 31 | null | null |
tonyday567/mvc-extended | src/MVC/Updates.hs | mit | onLeft :: Monad m => FoldM m a b -> FoldM m (Either a x) b
onLeft (FoldM step begin done) = FoldM step' begin done
where
step' x (Left a) = step x a
step' x _ = return x
{-
> onRight (f <*> x) = onRight f <*> onRight x
>
> onRight (pure r) = pure r
-} | 269 | onLeft :: Monad m => FoldM m a b -> FoldM m (Either a x) b
onLeft (FoldM step begin done) = FoldM step' begin done
where
step' x (Left a) = step x a
step' x _ = return x
{-
> onRight (f <*> x) = onRight f <*> onRight x
>
> onRight (pure r) = pure r
-} | 269 | onLeft (FoldM step begin done) = FoldM step' begin done
where
step' x (Left a) = step x a
step' x _ = return x
{-
> onRight (f <*> x) = onRight f <*> onRight x
>
> onRight (pure r) = pure r
-} | 210 | false | true | 0 | 9 | 79 | 102 | 48 | 54 | null | null |
atsukotakahashi/wi | src/library/Yi/Buffer/TextUnit.hs | gpl-2.0 | genMoveB unit (boundDir, boundSide) moveDir =
doUntilB_ (genAtBoundaryB unit boundDir boundSide) (moveB Character moveDir) | 124 | genMoveB unit (boundDir, boundSide) moveDir =
doUntilB_ (genAtBoundaryB unit boundDir boundSide) (moveB Character moveDir) | 124 | genMoveB unit (boundDir, boundSide) moveDir =
doUntilB_ (genAtBoundaryB unit boundDir boundSide) (moveB Character moveDir) | 124 | false | false | 0 | 7 | 15 | 42 | 21 | 21 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2014-07-utrecht/src/Assignment1.hs | unlicense | -- * Exercise 8
-- use !!, elemIndex, map, mapMaybe, transpose
project :: [Field] -> Table -> Table
project columns table@(header:_) =
let cs = mapMaybe (`elemIndex` header) columns
t1 = transpose table
in transpose (map (\n -> t1 !! n) cs) | 256 | project :: [Field] -> Table -> Table
project columns table@(header:_) =
let cs = mapMaybe (`elemIndex` header) columns
t1 = transpose table
in transpose (map (\n -> t1 !! n) cs) | 193 | project columns table@(header:_) =
let cs = mapMaybe (`elemIndex` header) columns
t1 = transpose table
in transpose (map (\n -> t1 !! n) cs) | 156 | true | true | 8 | 10 | 57 | 95 | 51 | 44 | null | null |
conal/hermit | src/HERMIT/Dictionary/Inline.hs | bsd-2-clause | ------------------------------------------------------------------------
-- | 'External's for inlining variables.
externals :: [External]
externals =
[ external "inline" (promoteExprR inlineR :: RewriteH LCore)
[ "(Var v) ==> <defn of v>" ].+ Eval .+ Deep
, external "inline" (promoteExprR . inlineMatch... | 1,043 | externals :: [External]
externals =
[ external "inline" (promoteExprR inlineR :: RewriteH LCore)
[ "(Var v) ==> <defn of v>" ].+ Eval .+ Deep
, external "inline" (promoteExprR . inlineMatchingPredR . mkOccPred :: OccurrenceName -> RewriteH LCore)
[ "Given a specific v, (Var v) ==> <defn of v>" ]... | 928 | externals =
[ external "inline" (promoteExprR inlineR :: RewriteH LCore)
[ "(Var v) ==> <defn of v>" ].+ Eval .+ Deep
, external "inline" (promoteExprR . inlineMatchingPredR . mkOccPred :: OccurrenceName -> RewriteH LCore)
[ "Given a specific v, (Var v) ==> <defn of v>" ] .+ Eval .+ Deep
, e... | 904 | true | true | 0 | 11 | 211 | 198 | 105 | 93 | null | null |
cacay/language-sill | Language/Krill/Monad/Error.hs | mit | attachErrorContext :: Maybe SrcSpan -> Doc -> Doc -> CompilerError -> CompilerError
attachErrorContext loc before after err = CompilerError $ DList.singleton $
Context (ContextInfo loc before after) err | 204 | attachErrorContext :: Maybe SrcSpan -> Doc -> Doc -> CompilerError -> CompilerError
attachErrorContext loc before after err = CompilerError $ DList.singleton $
Context (ContextInfo loc before after) err | 204 | attachErrorContext loc before after err = CompilerError $ DList.singleton $
Context (ContextInfo loc before after) err | 120 | false | true | 0 | 8 | 29 | 64 | 31 | 33 | null | null |
leshchevds/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | qrInstance :: String
qrInstance = "instance" | 44 | qrInstance :: String
qrInstance = "instance" | 44 | qrInstance = "instance" | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kwangkim/pigment | src-lib/Kit/ListZip.hs | mit | moveEarlier :: ListZip a -> Maybe (ListZip a)
moveEarlier (ListZip late a (a' :> early)) =
Just (ListZip (late :< a) a' early) | 130 | moveEarlier :: ListZip a -> Maybe (ListZip a)
moveEarlier (ListZip late a (a' :> early)) =
Just (ListZip (late :< a) a' early) | 130 | moveEarlier (ListZip late a (a' :> early)) =
Just (ListZip (late :< a) a' early) | 84 | false | true | 0 | 9 | 26 | 67 | 33 | 34 | null | null |
shlevy/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs
mkHsQuasiQuote quoter span quote = HsQuasiQuote unqualSplice quoter span quote | 147 | mkHsQuasiQuote :: RdrName -> SrcSpan -> FastString -> HsSplice GhcPs
mkHsQuasiQuote quoter span quote = HsQuasiQuote unqualSplice quoter span quote | 147 | mkHsQuasiQuote quoter span quote = HsQuasiQuote unqualSplice quoter span quote | 78 | false | true | 0 | 8 | 19 | 42 | 20 | 22 | null | null |
nilthehuman/H-99 | Lists.hs | unlicense | myLength' = sum . map (const 1) | 31 | myLength' = sum . map (const 1) | 31 | myLength' = sum . map (const 1) | 31 | false | false | 0 | 8 | 6 | 19 | 9 | 10 | null | null |
lowasser/TrieMap | Data/TrieMap/Representation/Tests.hs | bsd-3-clause | conjoinN :: Testable a => [a] -> Property
conjoinN tests = property $ oneof (Prelude.map property tests) | 104 | conjoinN :: Testable a => [a] -> Property
conjoinN tests = property $ oneof (Prelude.map property tests) | 104 | conjoinN tests = property $ oneof (Prelude.map property tests) | 62 | false | true | 2 | 8 | 16 | 51 | 23 | 28 | null | null |
cmahon/opengl-examples | executable/Cube.hs | bsd-3-clause | initialize :: String -> IO GLFW.Window
initialize title = do
GLFW.setErrorCallback (Just errorCallback)
successfulInit <- GLFW.init
-- if init failed, we exit the program
if not successfulInit then exitFailure else do
GLFW.windowHint $ GLFW.WindowHint'OpenGLDebugContext True
GLFW.windowHint $ GLFW.W... | 627 | initialize :: String -> IO GLFW.Window
initialize title = do
GLFW.setErrorCallback (Just errorCallback)
successfulInit <- GLFW.init
-- if init failed, we exit the program
if not successfulInit then exitFailure else do
GLFW.windowHint $ GLFW.WindowHint'OpenGLDebugContext True
GLFW.windowHint $ GLFW.W... | 627 | initialize title = do
GLFW.setErrorCallback (Just errorCallback)
successfulInit <- GLFW.init
-- if init failed, we exit the program
if not successfulInit then exitFailure else do
GLFW.windowHint $ GLFW.WindowHint'OpenGLDebugContext True
GLFW.windowHint $ GLFW.WindowHint'DepthBits 16
mw <- GLFW... | 588 | false | true | 0 | 19 | 160 | 173 | 76 | 97 | null | null |
phadej/typify-parser | hs/generator/Main.hs | mit | showIndex :: Int -> String
showIndex n = replicate (max 0 $ 3 - length s) '0' ++ s
where s = show n | 101 | showIndex :: Int -> String
showIndex n = replicate (max 0 $ 3 - length s) '0' ++ s
where s = show n | 101 | showIndex n = replicate (max 0 $ 3 - length s) '0' ++ s
where s = show n | 74 | false | true | 0 | 10 | 25 | 55 | 26 | 29 | null | null |
CIFASIS/QuickFuzz | src/Test/QuickFuzz/Gen/Base/Regex.hs | gpl-3.0 | shrinkRegex' PEmpty = [PEmpty] | 30 | shrinkRegex' PEmpty = [PEmpty] | 30 | shrinkRegex' PEmpty = [PEmpty] | 30 | false | false | 0 | 5 | 3 | 12 | 6 | 6 | null | null |
artuuge/IHaskell | ihaskell-display/ihaskell-plot/IHaskell/Display/Plot.hs | mit | figureData :: Figure () -> OutputType -> IO DisplayData
figureData figure format = do
switchToTmpDir
-- Width and height
let size = 300
w = size
h = size
-- Write the image.
let fname = ".ihaskell-plot." ++ extension format
writeFigure format fname (w, h) figure
-- Read back, and convert to... | 637 | figureData :: Figure () -> OutputType -> IO DisplayData
figureData figure format = do
switchToTmpDir
-- Width and height
let size = 300
w = size
h = size
-- Write the image.
let fname = ".ihaskell-plot." ++ extension format
writeFigure format fname (w, h) figure
-- Read back, and convert to... | 637 | figureData figure format = do
switchToTmpDir
-- Width and height
let size = 300
w = size
h = size
-- Write the image.
let fname = ".ihaskell-plot." ++ extension format
writeFigure format fname (w, h) figure
-- Read back, and convert to base64.
imgData <- Char.readFile fname
let value =
... | 581 | false | true | 2 | 15 | 189 | 203 | 91 | 112 | null | null |
zhiyuanshi/fcore | backend/archive/CoreNew.hs | bsd-2-clause | pretty' _ i (JField name f _) = fieldStr name <> dot <> text f
where
fieldStr (Src.Static x) = text x
fieldStr (Src.NonStatic x) = pretty' (6,PrecMinus) i x | 166 | pretty' _ i (JField name f _) = fieldStr name <> dot <> text f
where
fieldStr (Src.Static x) = text x
fieldStr (Src.NonStatic x) = pretty' (6,PrecMinus) i x | 166 | pretty' _ i (JField name f _) = fieldStr name <> dot <> text f
where
fieldStr (Src.Static x) = text x
fieldStr (Src.NonStatic x) = pretty' (6,PrecMinus) i x | 166 | false | false | 1 | 8 | 39 | 86 | 42 | 44 | null | null |
benjaminselfridge/logix | src/Calculus.hs | bsd-3-clause | match :: [FormulaPat] -> [Formula] -> [(FormulaAssignment,TermAssignment)]
match (ZeroaryOpPat op:pats) fs = do
[matchRest | ZeroaryOp op' <- nub fs
, op == op'
, fs' <- [delete (ZeroaryOp op) fs]
, matchRest <- match pats fs'] | 268 | match :: [FormulaPat] -> [Formula] -> [(FormulaAssignment,TermAssignment)]
match (ZeroaryOpPat op:pats) fs = do
[matchRest | ZeroaryOp op' <- nub fs
, op == op'
, fs' <- [delete (ZeroaryOp op) fs]
, matchRest <- match pats fs'] | 268 | match (ZeroaryOpPat op:pats) fs = do
[matchRest | ZeroaryOp op' <- nub fs
, op == op'
, fs' <- [delete (ZeroaryOp op) fs]
, matchRest <- match pats fs'] | 193 | false | true | 0 | 13 | 77 | 112 | 57 | 55 | null | null |
brendanhay/gogol | gogol-containeranalysis/gen/Network/Google/ContainerAnalysis/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'BuildProvenance' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'bpCreator'
--
-- * 'bpSourceProvenance'
--
-- * 'bpCommands'
--
-- * 'bpTriggerId'
--
-- * 'bpStartTime'
--
-- * 'bpBuilderVersion'
--
-- * 'bpE... | 925 | buildProvenance
:: BuildProvenance
buildProvenance =
BuildProvenance'
{ _bpCreator = Nothing
, _bpSourceProvenance = Nothing
, _bpCommands = Nothing
, _bpTriggerId = Nothing
, _bpStartTime = Nothing
, _bpBuilderVersion = Nothing
, _bpEndTime = Nothing
, _bpId = Nothing
, _bpPro... | 465 | buildProvenance =
BuildProvenance'
{ _bpCreator = Nothing
, _bpSourceProvenance = Nothing
, _bpCommands = Nothing
, _bpTriggerId = Nothing
, _bpStartTime = Nothing
, _bpBuilderVersion = Nothing
, _bpEndTime = Nothing
, _bpId = Nothing
, _bpProjectId = Nothing
, _bpBuiltArtifact... | 426 | true | true | 1 | 7 | 202 | 127 | 89 | 38 | null | null |
tomahawkins/trs | Language/TRS/Utils.hs | bsd-3-clause | enum :: [a] -> [(Int,a)]
enum a = zip [0 .. length a - 1] a | 59 | enum :: [a] -> [(Int,a)]
enum a = zip [0 .. length a - 1] a | 59 | enum a = zip [0 .. length a - 1] a | 34 | false | true | 0 | 8 | 15 | 48 | 26 | 22 | null | null |
glguy/simple-spreadsheet-tools | SsToMd.hs | bsd-3-clause | main :: IO ()
main = interact $ \ xs ->
case parse spreadsheetParser "stdin" xs of
Right res -> renderSmd res
Left err -> fail (show err) | 148 | main :: IO ()
main = interact $ \ xs ->
case parse spreadsheetParser "stdin" xs of
Right res -> renderSmd res
Left err -> fail (show err) | 148 | main = interact $ \ xs ->
case parse spreadsheetParser "stdin" xs of
Right res -> renderSmd res
Left err -> fail (show err) | 134 | false | true | 0 | 12 | 38 | 66 | 31 | 35 | null | null |
candu/haskellbook | ch6/matchTheTypes.hs | mit | i :: Num a => a
-- i :: a fails
i = 1 | 37 | i :: Num a => a
i = 1 | 21 | i = 1 | 5 | true | true | 0 | 7 | 13 | 26 | 11 | 15 | null | null |
gnn/Hets | Syntax/Parse_AS_Library.hs | gpl-2.0 | param :: LogicGraph -> AParser st (Annoted SPEC, Range)
param l = do
b <- oBracketT
pa <- aSpec l
c <- cBracketT
return (pa, toRange b [] c) | 156 | param :: LogicGraph -> AParser st (Annoted SPEC, Range)
param l = do
b <- oBracketT
pa <- aSpec l
c <- cBracketT
return (pa, toRange b [] c) | 156 | param l = do
b <- oBracketT
pa <- aSpec l
c <- cBracketT
return (pa, toRange b [] c) | 100 | false | true | 0 | 10 | 44 | 77 | 36 | 41 | null | null |
christiaanb/Idris-dev | src/IRTS/Java/JTypes.hs | bsd-3-clause | sourceTypes (LEq from) = [arithTyToJType from, arithTyToJType from] | 67 | sourceTypes (LEq from) = [arithTyToJType from, arithTyToJType from] | 67 | sourceTypes (LEq from) = [arithTyToJType from, arithTyToJType from] | 67 | false | false | 0 | 7 | 7 | 27 | 13 | 14 | null | null |
artems/htorr | src/Torrent.hs | bsd-3-clause | defaultBlockSize :: PieceBlockSize
defaultBlockSize = 16384 | 59 | defaultBlockSize :: PieceBlockSize
defaultBlockSize = 16384 | 59 | defaultBlockSize = 16384 | 24 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
vikraman/ghc | compiler/main/HscTypes.hs | bsd-3-clause | tyThingParent_maybe (AnId id) = case idDetails id of
RecSelId { sel_tycon = RecSelData tc } ->
Just (ATyCon tc)
ClassOpId cls ->
Just (ATyCon ... | 414 | tyThingParent_maybe (AnId id) = case idDetails id of
RecSelId { sel_tycon = RecSelData tc } ->
Just (ATyCon tc)
ClassOpId cls ->
Just (ATyCon ... | 414 | tyThingParent_maybe (AnId id) = case idDetails id of
RecSelId { sel_tycon = RecSelData tc } ->
Just (ATyCon tc)
ClassOpId cls ->
Just (ATyCon ... | 414 | false | false | 0 | 12 | 265 | 79 | 37 | 42 | null | null |
nh2/quickcheck | Test/QuickCheck/Property.hs | bsd-3-clause | morallyDubiousIOProperty :: Testable prop => IO prop -> Property
morallyDubiousIOProperty = fmap (MkProp . ioRose . fmap unProp) . promote . fmap property | 154 | morallyDubiousIOProperty :: Testable prop => IO prop -> Property
morallyDubiousIOProperty = fmap (MkProp . ioRose . fmap unProp) . promote . fmap property | 154 | morallyDubiousIOProperty = fmap (MkProp . ioRose . fmap unProp) . promote . fmap property | 89 | false | true | 0 | 10 | 22 | 53 | 25 | 28 | null | null |
PierreR/streaming | benchmarks/old/Stream/Prelude/Fused.hs | bsd-3-clause | enumFromTo n m = buildStream (Folding (F.enumFromTo n m)) | 57 | enumFromTo n m = buildStream (Folding (F.enumFromTo n m)) | 57 | enumFromTo n m = buildStream (Folding (F.enumFromTo n m)) | 57 | false | false | 0 | 10 | 8 | 30 | 14 | 16 | null | null |
facebookincubator/duckling | tests/Duckling/Duration/BG/Tests.hs | bsd-3-clause | tests :: TestTree
tests = testGroup "BG Tests"
[ makeCorpusTest [Seal Duration] corpus
] | 92 | tests :: TestTree
tests = testGroup "BG Tests"
[ makeCorpusTest [Seal Duration] corpus
] | 92 | tests = testGroup "BG Tests"
[ makeCorpusTest [Seal Duration] corpus
] | 74 | false | true | 0 | 8 | 17 | 31 | 15 | 16 | null | null |
z0isch/lambda-hive | src/LambdaHive/Types.hs | bsd-3-clause | getMoveString (TopMove pm1 pm2) = getCannonicalId pm1 <> " " <> getCannonicalId pm2 | 83 | getMoveString (TopMove pm1 pm2) = getCannonicalId pm1 <> " " <> getCannonicalId pm2 | 83 | getMoveString (TopMove pm1 pm2) = getCannonicalId pm1 <> " " <> getCannonicalId pm2 | 83 | false | false | 0 | 7 | 12 | 31 | 14 | 17 | null | null |
jparyani/capnproto-boostpython | compiler/src/CxxGenerator.hs | bsd-2-clause | isPrimitive (StructType _) = False | 34 | isPrimitive (StructType _) = False | 34 | isPrimitive (StructType _) = False | 34 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
mightymoose/liquidhaskell | benchmarks/containers-0.5.0.0/tests/map-properties.hs | bsd-3-clause | test_findIndex :: Assertion
test_findIndex = do
findIndex 3 (fromList [(5,"a"), (3,"b")]) @?= 0
findIndex 5 (fromList [(5,"a"), (3,"b")]) @?= 1 | 151 | test_findIndex :: Assertion
test_findIndex = do
findIndex 3 (fromList [(5,"a"), (3,"b")]) @?= 0
findIndex 5 (fromList [(5,"a"), (3,"b")]) @?= 1 | 151 | test_findIndex = do
findIndex 3 (fromList [(5,"a"), (3,"b")]) @?= 0
findIndex 5 (fromList [(5,"a"), (3,"b")]) @?= 1 | 123 | false | true | 0 | 12 | 27 | 90 | 47 | 43 | null | null |
DavidAlphaFox/darcs | src/Darcs/Util/IsoDate.hs | gpl-2.0 | intToMonth 11 = November | 24 | intToMonth 11 = November | 24 | intToMonth 11 = November | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
dgvncsz0f/sssfs | src/SSSFS/Filesystem/Files.hs | gpl-3.0 | unshare :: (StorageHashLike s) => s -> FileHandle -> (BlockIx -> Maybe (Block -> Block)) -> IO FileHandle
unshare s fh0 mkF
| shared fh0 = fmap fh1 newid >>= fmap (flip FileHandle False) . copyBlocks s (unHandle fh0) mkF
| otherwise = return fh0
where fh1 oid = (unHandle fh0) { blocks = (oid, 0)
... | 389 | unshare :: (StorageHashLike s) => s -> FileHandle -> (BlockIx -> Maybe (Block -> Block)) -> IO FileHandle
unshare s fh0 mkF
| shared fh0 = fmap fh1 newid >>= fmap (flip FileHandle False) . copyBlocks s (unHandle fh0) mkF
| otherwise = return fh0
where fh1 oid = (unHandle fh0) { blocks = (oid, 0)
... | 389 | unshare s fh0 mkF
| shared fh0 = fmap fh1 newid >>= fmap (flip FileHandle False) . copyBlocks s (unHandle fh0) mkF
| otherwise = return fh0
where fh1 oid = (unHandle fh0) { blocks = (oid, 0)
, size = 0
} | 283 | false | true | 0 | 13 | 140 | 153 | 76 | 77 | null | null |
rimmington/eclogues | eclogues-impl/app/api/Eclogues/Scheduling/JsonTools.hs | bsd-3-clause | wrap :: (Wrapping w) => Unwrapped w -> w
wrap = (^. from unwrapped) | 67 | wrap :: (Wrapping w) => Unwrapped w -> w
wrap = (^. from unwrapped) | 67 | wrap = (^. from unwrapped) | 26 | false | true | 0 | 8 | 13 | 41 | 19 | 22 | null | null |
keithodulaigh/Hets | CSL/EvalSpec.hs | gpl-2.0 | -- ----------------------- Input Arguments -------------------------
processArgs :: [String] -> Either String ProgSettings
processArgs args =
let (flags, noopts, unrecopts, errs) =
getOpt' (ReturnInOrder PFLib) options args
msgl = checkFlags flags
f str (l, s) = if null l then str else str... | 637 | processArgs :: [String] -> Either String ProgSettings
processArgs args =
let (flags, noopts, unrecopts, errs) =
getOpt' (ReturnInOrder PFLib) options args
msgl = checkFlags flags
f str (l, s) = if null l then str else str ++ "\n" ++ s ++ unlines l
msg = foldl f ""
[ (n... | 567 | processArgs args =
let (flags, noopts, unrecopts, errs) =
getOpt' (ReturnInOrder PFLib) options args
msgl = checkFlags flags
f str (l, s) = if null l then str else str ++ "\n" ++ s ++ unlines l
msg = foldl f ""
[ (noopts, "non-handled extra arguments encountered ")
... | 513 | true | true | 0 | 12 | 197 | 183 | 99 | 84 | null | null |
ribag/ganeti-experiments | src/Ganeti/Path.hs | gpl-2.0 | -- | Helper for building on top of dataDir (internal).
dataDirP :: FilePath -> IO FilePath
dataDirP = (dataDir `pjoin`) | 119 | dataDirP :: FilePath -> IO FilePath
dataDirP = (dataDir `pjoin`) | 64 | dataDirP = (dataDir `pjoin`) | 28 | true | true | 0 | 6 | 19 | 25 | 15 | 10 | null | null |
deweyvm/kayvee | src/Database/Kayvee/Common.hs | mit | bsToSize :: BL.ByteString -> Word64
bsToSize bs =
case (fromInteger . toInteger) <$> BL.unpack bs of
(b0:b1:b2:b3:b4:b5:b6:b7:[]) ->
shiftL b0 56
.|. shiftL b1 48
.|. shiftL b2 40
.|. shiftL b3 32
.|. shiftL b4 24
.|... | 486 | bsToSize :: BL.ByteString -> Word64
bsToSize bs =
case (fromInteger . toInteger) <$> BL.unpack bs of
(b0:b1:b2:b3:b4:b5:b6:b7:[]) ->
shiftL b0 56
.|. shiftL b1 48
.|. shiftL b2 40
.|. shiftL b3 32
.|. shiftL b4 24
.|... | 486 | bsToSize bs =
case (fromInteger . toInteger) <$> BL.unpack bs of
(b0:b1:b2:b3:b4:b5:b6:b7:[]) ->
shiftL b0 56
.|. shiftL b1 48
.|. shiftL b2 40
.|. shiftL b3 32
.|. shiftL b4 24
.|. shiftL b5 16
.|. s... | 450 | false | true | 0 | 17 | 211 | 185 | 88 | 97 | null | null |
alphalambda/k12math | contrib/MHills/GeometryLessons/code/teacher/key_lesson7b.hs | mit | main = drawPicture myPicture | 28 | main = drawPicture myPicture | 28 | main = drawPicture myPicture | 28 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
meiersi/system-io-write | src/Codec/Bounded/Encoding/Internal.hs | bsd-3-clause | boundedEncoding :: Int -- ^ Maximal number of bytes written
-> (a -> Poke) -- ^ Implementation of the encoding scheme
-> Encoding a
boundedEncoding = Encoding | 200 | boundedEncoding :: Int -- ^ Maximal number of bytes written
-> (a -> Poke) -- ^ Implementation of the encoding scheme
-> Encoding a
boundedEncoding = Encoding | 194 | boundedEncoding = Encoding | 26 | false | true | 0 | 8 | 68 | 31 | 17 | 14 | null | null |
tmcdonell/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen/PrefixSum.hs | bsd-3-clause | errorMsg :: String
errorMsg
= error
$ unlines [ "accelerate-cuda does not support rank-polymorphic scans. Please switch to accelerate-llvm-ptx instead."
, ""
, "*** https://hackage.haskell.org/package/accelerate-llvm-ptx ***"
, "*** https://github.com/AccelerateHS/accelerat... | 355 | errorMsg :: String
errorMsg
= error
$ unlines [ "accelerate-cuda does not support rank-polymorphic scans. Please switch to accelerate-llvm-ptx instead."
, ""
, "*** https://hackage.haskell.org/package/accelerate-llvm-ptx ***"
, "*** https://github.com/AccelerateHS/accelerat... | 355 | errorMsg
= error
$ unlines [ "accelerate-cuda does not support rank-polymorphic scans. Please switch to accelerate-llvm-ptx instead."
, ""
, "*** https://hackage.haskell.org/package/accelerate-llvm-ptx ***"
, "*** https://github.com/AccelerateHS/accelerate-llvm **... | 336 | false | true | 2 | 6 | 98 | 34 | 17 | 17 | null | null |
sgillespie/ghc | compiler/hsSyn/HsPat.hs | bsd-3-clause | conPatNeedsParens (InfixCon {}) = True | 41 | conPatNeedsParens (InfixCon {}) = True | 41 | conPatNeedsParens (InfixCon {}) = True | 41 | false | false | 0 | 7 | 7 | 16 | 8 | 8 | null | null |
fmapfmapfmap/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/DescribeApplications.hs | mpl-2.0 | -- | This parameter contains a list of ApplicationDescription.
darsApplications :: Lens' DescribeApplicationsResponse [ApplicationDescription]
darsApplications = lens _darsApplications (\ s a -> s{_darsApplications = a}) . _Default . _Coerce | 241 | darsApplications :: Lens' DescribeApplicationsResponse [ApplicationDescription]
darsApplications = lens _darsApplications (\ s a -> s{_darsApplications = a}) . _Default . _Coerce | 178 | darsApplications = lens _darsApplications (\ s a -> s{_darsApplications = a}) . _Default . _Coerce | 98 | true | true | 1 | 11 | 28 | 56 | 28 | 28 | null | null |
dmbarbour/awelon | hsrc/AO/Compile.hs | bsd-3-clause | opToABC AOp_neg = Op_neg
| 25 | aopToABC AOp_neg = Op_neg | 25 | aopToABC AOp_neg = Op_neg | 25 | false | false | 1 | 4 | 4 | 12 | 4 | 8 | null | null |
seereason/cabal | Cabal/Distribution/Simple/Setup.hs | bsd-3-clause | configureArgs :: Bool -> ConfigFlags -> [String]
configureArgs bcHack flags
= hc_flag
++ optFlag "with-hc-pkg" configHcPkg
++ optFlag' "prefix" prefix
++ optFlag' "bindir" bindir
++ optFlag' "libdir" libdir
++ optFlag' "libexecdir" libexecdir
++ optFlag' "datadir" datadir
++ optFlag' "sysc... | 1,187 | configureArgs :: Bool -> ConfigFlags -> [String]
configureArgs bcHack flags
= hc_flag
++ optFlag "with-hc-pkg" configHcPkg
++ optFlag' "prefix" prefix
++ optFlag' "bindir" bindir
++ optFlag' "libdir" libdir
++ optFlag' "libexecdir" libexecdir
++ optFlag' "datadir" datadir
++ optFlag' "sysc... | 1,187 | configureArgs bcHack flags
= hc_flag
++ optFlag "with-hc-pkg" configHcPkg
++ optFlag' "prefix" prefix
++ optFlag' "bindir" bindir
++ optFlag' "libdir" libdir
++ optFlag' "libexecdir" libexecdir
++ optFlag' "datadir" datadir
++ optFlag' "sysconfdir" sysconfdir
++ configConfigureArgs flags... | 1,138 | false | true | 19 | 11 | 446 | 317 | 141 | 176 | null | null |
kernelim/leveldb-haskell | examples/features.hs | bsd-3-clause | main :: IO ()
main = runResourceT $ do
printVersion
db <- open "/tmp/leveltest"
defaultOptions{ createIfMissing = True
, cacheSize= 2048
}
putStrLn' "Put value"
put db def "foo" "bar"
get db def "foo" >>= liftIO . print
... | 2,445 | main :: IO ()
main = runResourceT $ do
printVersion
db <- open "/tmp/leveltest"
defaultOptions{ createIfMissing = True
, cacheSize= 2048
}
putStrLn' "Put value"
put db def "foo" "bar"
get db def "foo" >>= liftIO . print
... | 2,445 | main = runResourceT $ do
printVersion
db <- open "/tmp/leveltest"
defaultOptions{ createIfMissing = True
, cacheSize= 2048
}
putStrLn' "Put value"
put db def "foo" "bar"
get db def "foo" >>= liftIO . print
putStrLn' ""
... | 2,431 | false | true | 4 | 12 | 838 | 659 | 290 | 369 | null | null |
hferreiro/replay | compiler/utils/IOEnv.hs | bsd-3-clause | tryMostM :: IOEnv env r -> IOEnv env (Either SomeException r)
tryMostM (IOEnv thing) = IOEnv (\ env -> tryMost (thing env)) | 123 | tryMostM :: IOEnv env r -> IOEnv env (Either SomeException r)
tryMostM (IOEnv thing) = IOEnv (\ env -> tryMost (thing env)) | 123 | tryMostM (IOEnv thing) = IOEnv (\ env -> tryMost (thing env)) | 61 | false | true | 0 | 10 | 21 | 67 | 31 | 36 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.Primitive.hs | bsd-3-clause | splitAt :: Prim a => Int -> Vector a -> (Vector a, Vector a)
splitAt = G.splitAt | 80 | splitAt :: Prim a => Int -> Vector a -> (Vector a, Vector a)
splitAt = G.splitAt | 80 | splitAt = G.splitAt | 19 | false | true | 0 | 11 | 16 | 50 | 22 | 28 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/DOMPoint.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint.fromPoint Mozilla DOMPoint.fromPoint documentation>
fromPoint :: (MonadDOM m) => Maybe DOMPointInit -> m DOMPoint
fromPoint other
= liftDOM
(((jsg "DOMPoint") ^. jsf "fromPoint" [toJSVal other]) >>=
fromJSValUnchecked) | 300 | fromPoint :: (MonadDOM m) => Maybe DOMPointInit -> m DOMPoint
fromPoint other
= liftDOM
(((jsg "DOMPoint") ^. jsf "fromPoint" [toJSVal other]) >>=
fromJSValUnchecked) | 183 | fromPoint other
= liftDOM
(((jsg "DOMPoint") ^. jsf "fromPoint" [toJSVal other]) >>=
fromJSValUnchecked) | 121 | true | true | 0 | 12 | 46 | 68 | 34 | 34 | null | null |
kavigupta/Infsabot | Infsabot/Board/Logic.hs | gpl-3.0 | toSeenSpot (GameSpot s (Just rob)) = SeenSpot s $ Just $ robotAppearance rob | 76 | toSeenSpot (GameSpot s (Just rob)) = SeenSpot s $ Just $ robotAppearance rob | 76 | toSeenSpot (GameSpot s (Just rob)) = SeenSpot s $ Just $ robotAppearance rob | 76 | false | false | 0 | 9 | 12 | 37 | 17 | 20 | null | null |
rasendubi/hsreadability | src/Network/Readability/Reader.hs | mit | -- | Delete tag by id.
--
-- This is a @DELETE@ request to @\/tags\/{tagId}@.
deleteTag :: OAuth
-> Credential
-> Integer
-> IO (Response BL.ByteString)
deleteTag oauth cred tagId = deleteRequest oauth cred ("/tags/" ++ show tagId) | 261 | deleteTag :: OAuth
-> Credential
-> Integer
-> IO (Response BL.ByteString)
deleteTag oauth cred tagId = deleteRequest oauth cred ("/tags/" ++ show tagId) | 183 | deleteTag oauth cred tagId = deleteRequest oauth cred ("/tags/" ++ show tagId) | 78 | true | true | 0 | 12 | 67 | 65 | 32 | 33 | null | null |
damoxc/ganeti | src/Ganeti/Query/Common.hs | gpl-2.0 | -- * Error conversion
-- | Convert RpcError to ResultStatus
rpcErrorToStatus :: RpcError -> ResultStatus
rpcErrorToStatus OfflineNodeError = RSOffline | 151 | rpcErrorToStatus :: RpcError -> ResultStatus
rpcErrorToStatus OfflineNodeError = RSOffline | 90 | rpcErrorToStatus OfflineNodeError = RSOffline | 45 | true | true | 0 | 5 | 19 | 24 | 12 | 12 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Hooks/DynamicProperty.hs | bsd-2-clause | dynamicTitle :: ManageHook -> Event -> X All
-- strictly, this should also check _NET_WM_NAME. practically, both will
-- change and each gets its own PropertyEvent, so we'd need to record that
-- we saw the event for that window and ignore the second one. Instead, just
-- trust that nobody sets only _NET_WM_NAME. (I'm ... | 461 | dynamicTitle :: ManageHook -> Event -> X All
dynamicTitle = dynamicPropertyChange "WM_NAME" | 91 | dynamicTitle = dynamicPropertyChange "WM_NAME" | 46 | true | true | 0 | 7 | 73 | 30 | 17 | 13 | null | null |
andreasabel/helf | src/Monolith.hs | mit | abs x e = A.Lam (hash x) Nothing e | 34 | abs x e = A.Lam (hash x) Nothing e | 34 | abs x e = A.Lam (hash x) Nothing e | 34 | false | false | 0 | 7 | 8 | 27 | 12 | 15 | null | null |
black0range/Smutt | src/Smutt/Util/ByteString.hs | mit | getMonthName 6 = "Jun" | 22 | getMonthName 6 = "Jun" | 22 | getMonthName 6 = "Jun" | 22 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
ngzax/urbit | pkg/hs/urbit-king/test/AmesTests.hs | mit | runRAcquire :: RAcquire e a -> RIO e a
runRAcquire acq = rwith acq pure | 71 | runRAcquire :: RAcquire e a -> RIO e a
runRAcquire acq = rwith acq pure | 71 | runRAcquire acq = rwith acq pure | 32 | false | true | 0 | 6 | 14 | 33 | 15 | 18 | null | null |
DavidRutqvist/ParserOperators-D7012E-Lab2 | test/TestStatement.hs | bsd-3-clause | p9 = fromString s9 | 18 | p9 = fromString s9 | 18 | p9 = fromString s9 | 18 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
petester42/haskell-hockey | src/Hockey/Formatting.hs | mit | -- return 00:00 if not good
timeFromComponents :: Int -> Int -> TimeOfDay
timeFromComponents hour minute = fromJust $ makeTimeOfDayValid hour minute 0 | 150 | timeFromComponents :: Int -> Int -> TimeOfDay
timeFromComponents hour minute = fromJust $ makeTimeOfDayValid hour minute 0 | 122 | timeFromComponents hour minute = fromJust $ makeTimeOfDayValid hour minute 0 | 76 | true | true | 0 | 6 | 22 | 36 | 18 | 18 | null | null |
riccardotommasini/plp16 | haskell/prepared/ESE20181204/state.hs | apache-2.0 | mapTreeM :: (Monad m) => (t -> m a) -> Tree t -> m (Tree a)
mapTreeM f (Leaf a) = do
b <- f a
return (Leaf b) | 129 | mapTreeM :: (Monad m) => (t -> m a) -> Tree t -> m (Tree a)
mapTreeM f (Leaf a) = do
b <- f a
return (Leaf b) | 125 | mapTreeM f (Leaf a) = do
b <- f a
return (Leaf b) | 65 | false | true | 0 | 11 | 48 | 84 | 39 | 45 | null | null |
cbaatz/hamu8080 | src/Hamu8080/Compute.hs | mit | -- RPE
doOp 0xEA = getF Parity >>= \p -> when p jmp | 51 | doOp 0xEA = getF Parity >>= \p -> when p jmp | 44 | doOp 0xEA = getF Parity >>= \p -> when p jmp | 44 | true | false | 0 | 7 | 12 | 27 | 13 | 14 | null | null |
acowley/ghc | testsuite/tests/partial-sigs/should_compile/SplicesUsed.hs | bsd-3-clause | maybeBool :: $(metaType1)
maybeBool = $(metaExp2) $(metaExp1) | 61 | maybeBool :: $(metaType1)
maybeBool = $(metaExp2) $(metaExp1) | 61 | maybeBool = $(metaExp2) $(metaExp1) | 35 | false | true | 0 | 8 | 6 | 32 | 14 | 18 | null | null |
brendanhay/gogol | gogol-servicenetworking/gen/Network/Google/Resource/ServiceNetworking/Services/Projects/Global/Networks/PeeredDNSDomains/Create.hs | mpl-2.0 | -- | Required. Parent resource identifying the connection for which the
-- peered DNS domain will be created in the format:
-- \`services\/{service}\/projects\/{project}\/global\/networks\/{network}\`
-- {service} is the peering service that is managing connectivity for the
-- service producer\'s organization. For Goog... | 757 | spgnpddcParent :: Lens' ServicesProjectsGlobalNetworksPeeredDNSDomainsCreate Text
spgnpddcParent
= lens _spgnpddcParent
(\ s a -> s{_spgnpddcParent = a}) | 161 | spgnpddcParent
= lens _spgnpddcParent
(\ s a -> s{_spgnpddcParent = a}) | 79 | true | true | 0 | 9 | 103 | 50 | 30 | 20 | null | null |
mightymoose/liquidhaskell | tests/todo/baderror.hs | bsd-3-clause | (x:xs) \\ ys = if x `elem` ys then xs \\ ys else x:(xs \\ ys) | 61 | (x:xs) \\ ys = if x `elem` ys then xs \\ ys else x:(xs \\ ys) | 61 | (x:xs) \\ ys = if x `elem` ys then xs \\ ys else x:(xs \\ ys) | 61 | false | false | 0 | 8 | 15 | 48 | 26 | 22 | null | null |
freizl/freizl.github.com-old | src/Hakyll/Web/Pandoc.hs | bsd-3-clause | defaultHakyllReaderOptions :: ReaderOptions
defaultHakyllReaderOptions = def
{ -- The following option causes pandoc to read smart typography, a nice
-- and free bonus.
readerSmart = True
} | 209 | defaultHakyllReaderOptions :: ReaderOptions
defaultHakyllReaderOptions = def
{ -- The following option causes pandoc to read smart typography, a nice
-- and free bonus.
readerSmart = True
} | 209 | defaultHakyllReaderOptions = def
{ -- The following option causes pandoc to read smart typography, a nice
-- and free bonus.
readerSmart = True
} | 165 | false | true | 0 | 6 | 46 | 24 | 14 | 10 | null | null |
CRogers/stack | src/Options/Applicative/Builder/Extra.hs | bsd-3-clause | -- | Enable/disable flags for a @Bool@, without a default case (to allow chaining @<|>@s).
boolFlagsNoDefault :: String -> String -> Mod FlagFields Bool -> Parser Bool
boolFlagsNoDefault = enableDisableFlagsNoDefault True False | 227 | boolFlagsNoDefault :: String -> String -> Mod FlagFields Bool -> Parser Bool
boolFlagsNoDefault = enableDisableFlagsNoDefault True False | 136 | boolFlagsNoDefault = enableDisableFlagsNoDefault True False | 59 | true | true | 0 | 8 | 31 | 37 | 18 | 19 | null | null |
stevana/haarss | src/Haarss/Model/Window.hs | isc | top' f g = fmap f . top . fmap g | 34 | top' f g = fmap f . top . fmap g | 34 | top' f g = fmap f . top . fmap g | 34 | false | false | 0 | 7 | 12 | 25 | 11 | 14 | null | null |
awto/genuine-control-prompt | src/Control/Monad/Indexed/Cont/Dynamic.hs | bsd-3-clause | prompt, reset :: Cont t b t t -> b
prompt e = runCont e theta1 [] | 65 | prompt, reset :: Cont t b t t -> b
prompt e = runCont e theta1 [] | 65 | prompt e = runCont e theta1 [] | 30 | false | true | 2 | 7 | 16 | 47 | 20 | 27 | null | null |
tolysz/Haxl | Haxl/Core/Monad.hs | bsd-3-clause | wrapFetchInTimer :: PerformFetch -> IO (IORef Microseconds, PerformFetch)
wrapFetchInTimer f = do
r <- newIORef 0
case f of
SyncFetch io -> return (r, SyncFetch (time io >>= writeIORef r))
AsyncFetch f -> do
inner_r <- newIORef 0
return (r, AsyncFetch $ \inner -> do
total <- time (f (... | 434 | wrapFetchInTimer :: PerformFetch -> IO (IORef Microseconds, PerformFetch)
wrapFetchInTimer f = do
r <- newIORef 0
case f of
SyncFetch io -> return (r, SyncFetch (time io >>= writeIORef r))
AsyncFetch f -> do
inner_r <- newIORef 0
return (r, AsyncFetch $ \inner -> do
total <- time (f (... | 434 | wrapFetchInTimer f = do
r <- newIORef 0
case f of
SyncFetch io -> return (r, SyncFetch (time io >>= writeIORef r))
AsyncFetch f -> do
inner_r <- newIORef 0
return (r, AsyncFetch $ \inner -> do
total <- time (f (time inner >>= writeIORef inner_r))
inner_t <- readIORef inner_r
... | 360 | false | true | 0 | 24 | 115 | 175 | 81 | 94 | null | null |
dmjio/aeson | src/Data/Aeson/TH.hs | bsd-3-clause | -- | Generates a lambda expression which encodes the given data type or
-- data family instance constructor as a 'Value'.
mkToJSON :: Options -- ^ Encoding options.
-> Name -- ^ Name of the type to encode.
-> Q Exp
mkToJSON = mkToJSONCommon toJSONClass | 270 | mkToJSON :: Options -- ^ Encoding options.
-> Name -- ^ Name of the type to encode.
-> Q Exp
mkToJSON = mkToJSONCommon toJSONClass | 148 | mkToJSON = mkToJSONCommon toJSONClass | 37 | true | true | 0 | 7 | 62 | 29 | 16 | 13 | null | null |
polux/snippets | HRM.hs | apache-2.0 | writeInstruction :: Instruction -> HRM ()
writeInstruction instr = HRM $ do
tell [instr]
modify succ | 104 | writeInstruction :: Instruction -> HRM ()
writeInstruction instr = HRM $ do
tell [instr]
modify succ | 104 | writeInstruction instr = HRM $ do
tell [instr]
modify succ | 62 | false | true | 0 | 9 | 19 | 42 | 19 | 23 | null | null |
slasser/AllStar | Test/AllStarTests.hs | bsd-3-clause | ambigParseTest1 = TestCase (assertEqual "for parse [a],"
True
(let parseResult = parse ['a'] (NT 'S') ambigATNEnv True
isLeft pr = case pr of
... | 476 | ambigParseTest1 = TestCase (assertEqual "for parse [a],"
True
(let parseResult = parse ['a'] (NT 'S') ambigATNEnv True
isLeft pr = case pr of
... | 476 | ambigParseTest1 = TestCase (assertEqual "for parse [a],"
True
(let parseResult = parse ['a'] (NT 'S') ambigATNEnv True
isLeft pr = case pr of
... | 476 | false | false | 0 | 16 | 317 | 81 | 39 | 42 | null | null |
LFDM/hstats | src/lib/GitDir.hs | bsd-3-clause | getGitDirPath = path | 20 | getGitDirPath = path | 20 | getGitDirPath = path | 20 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
andreasfrom/bule | Main.hs | mit | run (Type _) _ = error "run Type" | 38 | run (Type _) _ = error "run Type" | 38 | run (Type _) _ = error "run Type" | 38 | false | false | 1 | 6 | 12 | 20 | 9 | 11 | null | null |
hspec/hspec | hspec-core/src/Test/Hspec/Core/Config.hs | mit | readFailureReportOnRerun :: Config -> IO (Maybe FailureReport)
readFailureReportOnRerun config
| configRerun config = readFailureReport config
| otherwise = return Nothing | 175 | readFailureReportOnRerun :: Config -> IO (Maybe FailureReport)
readFailureReportOnRerun config
| configRerun config = readFailureReport config
| otherwise = return Nothing | 175 | readFailureReportOnRerun config
| configRerun config = readFailureReport config
| otherwise = return Nothing | 112 | false | true | 1 | 8 | 23 | 49 | 22 | 27 | null | null |
deepfire/mood | tests/FlexTest.hs | agpl-3.0 | test_margin9 ∷ TestTree
test_margin9 =
let r = node 100 100
[ leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 10 0
, leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 0 10
, leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 10 20
] & geo.direction .~ DirRow
& layou... | 626 | test_margin9 ∷ TestTree
test_margin9 =
let r = node 100 100
[ leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 10 0
, leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 0 10
, leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 10 20
] & geo.direction .~ DirRow
& layou... | 626 | test_margin9 =
let r = node 100 100
[ leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 10 0
, leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 0 10
, leaf' (Just 10) Nothing & geo.margin .~ LRTB 0 0 10 20
] & geo.direction .~ DirRow
& layout (mkSize 100 100)
in ... | 602 | false | true | 0 | 18 | 201 | 290 | 139 | 151 | null | null |
torrlane/haskell_learning | app/ParseCsvMain.hs | bsd-3-clause | -- Take a function that returns a double, execute it, and format the result to 2 dp.
toTwoDpF f as x = (show . toTwoDp) (f as x) | 128 | toTwoDpF f as x = (show . toTwoDp) (f as x) | 43 | toTwoDpF f as x = (show . toTwoDp) (f as x) | 43 | true | false | 0 | 7 | 27 | 32 | 16 | 16 | null | null |
z0isch/ten-twenty-five | Main.hs | mit | historyView storage saveChanged = mdo
savedGames <- liftIO $ getSavedGames storage
gameHistoryDyn <- holdDyn savedGames saveChanged
numGamesDyn <- mapDyn length gameHistoryDyn
bestScoreDyn <- mapDyn bestScore gameHistoryDyn
avgScoreDyn <- mapDyn (trimTo 2 . averageScore) gameHistoryDyn
rPercentDyn <- mapDyn... | 1,983 | historyView storage saveChanged = mdo
savedGames <- liftIO $ getSavedGames storage
gameHistoryDyn <- holdDyn savedGames saveChanged
numGamesDyn <- mapDyn length gameHistoryDyn
bestScoreDyn <- mapDyn bestScore gameHistoryDyn
avgScoreDyn <- mapDyn (trimTo 2 . averageScore) gameHistoryDyn
rPercentDyn <- mapDyn... | 1,983 | historyView storage saveChanged = mdo
savedGames <- liftIO $ getSavedGames storage
gameHistoryDyn <- holdDyn savedGames saveChanged
numGamesDyn <- mapDyn length gameHistoryDyn
bestScoreDyn <- mapDyn bestScore gameHistoryDyn
avgScoreDyn <- mapDyn (trimTo 2 . averageScore) gameHistoryDyn
rPercentDyn <- mapDyn... | 1,983 | false | false | 0 | 16 | 488 | 677 | 307 | 370 | null | null |
chreekat/snowdrift | Model/User.hs | agpl-3.0 | archiveNotificationsDB :: UserId -> DB ()
archiveNotificationsDB user_id = do
archiveUserNotificationsDB user_id
archiveProjectNotificationsDB user_id | 158 | archiveNotificationsDB :: UserId -> DB ()
archiveNotificationsDB user_id = do
archiveUserNotificationsDB user_id
archiveProjectNotificationsDB user_id | 158 | archiveNotificationsDB user_id = do
archiveUserNotificationsDB user_id
archiveProjectNotificationsDB user_id | 116 | false | true | 0 | 7 | 21 | 35 | 15 | 20 | null | null |
iconnect/aws-sign4 | Aws/Sign4.hs | bsd-3-clause | to_hex :: B.ByteString -> B.ByteString
to_hex = BC.pack . foldr f "" . BC.unpack
where
f c t = intToDigit (n `div` 16) : intToDigit (n `mod` 16) : t
where
n = ord c
-- generate a 'canonical' ISO 8601 UTC date | 237 | to_hex :: B.ByteString -> B.ByteString
to_hex = BC.pack . foldr f "" . BC.unpack
where
f c t = intToDigit (n `div` 16) : intToDigit (n `mod` 16) : t
where
n = ord c
-- generate a 'canonical' ISO 8601 UTC date | 237 | to_hex = BC.pack . foldr f "" . BC.unpack
where
f c t = intToDigit (n `div` 16) : intToDigit (n `mod` 16) : t
where
n = ord c
-- generate a 'canonical' ISO 8601 UTC date | 198 | false | true | 3 | 9 | 71 | 107 | 49 | 58 | null | null |
kmate/raw-feldspar | src/Feldspar/Frontend.hs | bsd-3-clause | switch :: (Syntax a, Syntax b, PrimType (Internal a))
=> b -- ^ Default result
-> [(a,b)] -- ^ Cases (match, result)
-> a -- ^ Scrutinee
-> b -- ^ Result
switch def [] _ = def | 213 | switch :: (Syntax a, Syntax b, PrimType (Internal a))
=> b -- ^ Default result
-> [(a,b)] -- ^ Cases (match, result)
-> a -- ^ Scrutinee
-> b
switch def [] _ = def | 194 | switch def [] _ = def | 21 | true | true | 0 | 11 | 75 | 74 | 40 | 34 | null | null |
Macil-dev/440P-old | src/Data/P440/XML/Instances/ComplexTypes.hs | unlicense | -- Сведения о налоговом органе СвНОТип
свНО name (СвНО кодНО наимНО) =
complex_ name
["КодНО" =: кодНО
,"НаимНО" =: наимНО] | 155 | свНО name (СвНО кодНО наимНО) =
complex_ name
["КодНО" =: кодНО
,"НаимНО" =: наимНО] | 115 | свНО name (СвНО кодНО наимНО) =
complex_ name
["КодНО" =: кодНО
,"НаимНО" =: наимНО] | 115 | true | false | 0 | 8 | 51 | 93 | 44 | 49 | null | null |
jwiegley/ghc-release | utils/hsc2hs/CrossCodegen.hs | gpl-3.0 | -- Skips over some #if or other conditional that we found to be false.
-- I.e. the argument should be a zipper whose cursor is one past the #if,
-- and returns a zipper whose cursor points at the next item which
-- could possibly be compiled.
skipFalseConditional :: Zipper Token -> Either String (Zipper Token)
skipFals... | 368 | skipFalseConditional :: Zipper Token -> Either String (Zipper Token)
skipFalseConditional (End _) = Left "unterminated endif" | 125 | skipFalseConditional (End _) = Left "unterminated endif" | 56 | true | true | 0 | 8 | 62 | 45 | 23 | 22 | null | null |
sawatani/bitcoin-hall | src/Fathens/Bitcoin/Wallet/Keys.hs | gpl-3.0 | (@*) :: Word256 -> EC.Point -> EC.Point
(@*) s p = pointMul curve (toInteger s) p | 81 | (@*) :: Word256 -> EC.Point -> EC.Point
(@*) s p = pointMul curve (toInteger s) p | 81 | (@*) s p = pointMul curve (toInteger s) p | 41 | false | true | 0 | 9 | 15 | 51 | 25 | 26 | null | null |
fiigii/fJS | TypeInferencer.hs | mit | unify t (TyVar v) = v `bind` t | 30 | unify t (TyVar v) = v `bind` t | 30 | unify t (TyVar v) = v `bind` t | 30 | false | false | 0 | 7 | 7 | 24 | 12 | 12 | null | null |
johnnymo87/heap | test/TreeCreatorSpec.hs | mit | elemAt :: [Direction] -> Tree a -> a
elemAt [] (Branch x _ _) = x | 69 | elemAt :: [Direction] -> Tree a -> a
elemAt [] (Branch x _ _) = x | 69 | elemAt [] (Branch x _ _) = x | 32 | false | true | 0 | 7 | 19 | 42 | 21 | 21 | null | null |
danstiner/clod | test/Tests/Machine.hs | mit | prop_groupBy_concat :: [Int] -> Property.Result
prop_groupBy_concat xs =
mkResult (Just $ concat grouped == xs) msg
where
grouped = run (source xs ~> groupBy (==))
msg = "grouping: " ++ (show grouped) | 212 | prop_groupBy_concat :: [Int] -> Property.Result
prop_groupBy_concat xs =
mkResult (Just $ concat grouped == xs) msg
where
grouped = run (source xs ~> groupBy (==))
msg = "grouping: " ++ (show grouped) | 212 | prop_groupBy_concat xs =
mkResult (Just $ concat grouped == xs) msg
where
grouped = run (source xs ~> groupBy (==))
msg = "grouping: " ++ (show grouped) | 164 | false | true | 4 | 8 | 43 | 97 | 43 | 54 | null | null |
prashant007/AMPL | myAMPL/src/MyParser/InterpretAMPL.hs | mit | services_AMPL OUT "intTerm2" = -2 | 33 | services_AMPL OUT "intTerm2" = -2 | 33 | services_AMPL OUT "intTerm2" = -2 | 33 | false | false | 0 | 5 | 4 | 13 | 6 | 7 | null | null |
ribag/ganeti-experiments | src/Ganeti/Utils.hs | gpl-2.0 | -- | A 'head' version in the I/O monad, for validating parameters
-- without which we cannot continue.
exitIfEmpty :: String -> [a] -> IO a
exitIfEmpty _ (x:_) = return x | 170 | exitIfEmpty :: String -> [a] -> IO a
exitIfEmpty _ (x:_) = return x | 67 | exitIfEmpty _ (x:_) = return x | 30 | true | true | 0 | 10 | 31 | 46 | 23 | 23 | null | null |
jgm/texmath | src/Text/TeXMath/Readers/TeX.hs | gpl-2.0 | hacek 'D' = "Ď" | 15 | hacek 'D' = "Ď" | 15 | hacek 'D' = "Ď" | 15 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
vito/atomo-old | Atomo/Typecheck.hs | mit | Error e >>* _ = Error e | 23 | Error e >>* _ = Error e | 23 | Error e >>* _ = Error e | 23 | false | false | 0 | 6 | 6 | 18 | 7 | 11 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.2.0/Data/ByteString/Lazy/Internal.hs | bsd-3-clause | chunkOverhead :: Int
chunkOverhead = 2 * sizeOf (undefined :: Int) | 66 | chunkOverhead :: Int
chunkOverhead = 2 * sizeOf (undefined :: Int) | 66 | chunkOverhead = 2 * sizeOf (undefined :: Int) | 45 | false | true | 0 | 7 | 10 | 24 | 13 | 11 | null | null |
bagl/takusen-oracle | Database/Oracle/Enumerator.hs | bsd-3-clause | ord32ToInt :: Word32 -> Int
word32ToInt n = fromIntegral n
| 59 | word32ToInt :: Word32 -> Int
word32ToInt n = fromIntegral n | 59 | word32ToInt n = fromIntegral n | 30 | false | true | 0 | 7 | 10 | 26 | 11 | 15 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.