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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
technogeeky/pearl-sorting-with-bialgebras | src/Pearl/SWB/Section07.hs | gpl-3.0 | meld :: Heap (Lf Heap :/\: SList (Lf Heap )) -> SList (Lf Heap )
meld KE = SNil | 134 | meld :: Heap (Lf Heap :/\: SList (Lf Heap )) -> SList (Lf Heap )
meld KE = SNil | 133 | meld KE = SNil | 66 | false | true | 0 | 11 | 73 | 53 | 24 | 29 | null | null |
modeswitch/barrelfish | tools/flounder/BackendCommon.hs | mit | binding_struct_destroy :: String -> C.Expr -> [C.Stmt]
binding_struct_destroy ifn binding_var
= [C.Ex $ C.Call "flounder_support_waitset_chanstate_destroy"
[C.AddressOf $ C.FieldOf binding_var "register_chanstate"],
C.Ex $ C.Call "flounder_support_waitset_chanstate_destroy"
[C.Address... | 368 | binding_struct_destroy :: String -> C.Expr -> [C.Stmt]
binding_struct_destroy ifn binding_var
= [C.Ex $ C.Call "flounder_support_waitset_chanstate_destroy"
[C.AddressOf $ C.FieldOf binding_var "register_chanstate"],
C.Ex $ C.Call "flounder_support_waitset_chanstate_destroy"
[C.Address... | 368 | binding_struct_destroy ifn binding_var
= [C.Ex $ C.Call "flounder_support_waitset_chanstate_destroy"
[C.AddressOf $ C.FieldOf binding_var "register_chanstate"],
C.Ex $ C.Call "flounder_support_waitset_chanstate_destroy"
[C.AddressOf $ C.FieldOf binding_var "tx_cont_chanstate"]] | 313 | false | true | 0 | 11 | 63 | 95 | 48 | 47 | null | null |
mischel/tct-trs-gubs | app/Main.hs | bsd-3-clause | solvers = [minBound ..] :: [G.SMTSolver] | 42 | solvers = [minBound ..] :: [G.SMTSolver] | 42 | solvers = [minBound ..] :: [G.SMTSolver] | 42 | false | false | 0 | 6 | 7 | 21 | 12 | 9 | null | null |
nevrenato/Hets_Fork | Common/IRI.hs | gpl-2.0 | pnCharsBase :: GenParser Char st Char
pnCharsBase = satisfy pnCharsBaseP | 72 | pnCharsBase :: GenParser Char st Char
pnCharsBase = satisfy pnCharsBaseP | 72 | pnCharsBase = satisfy pnCharsBaseP | 34 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
sdiehl/ghc | compiler/GHC/Cmm/Graph.hs | bsd-3-clause | mkCbranch :: CmmExpr -> BlockId -> BlockId -> Maybe Bool -> CmmAGraph
mkCbranch pred ifso ifnot likely =
mkLast (CmmCondBranch pred ifso ifnot likely) | 158 | mkCbranch :: CmmExpr -> BlockId -> BlockId -> Maybe Bool -> CmmAGraph
mkCbranch pred ifso ifnot likely =
mkLast (CmmCondBranch pred ifso ifnot likely) | 158 | mkCbranch pred ifso ifnot likely =
mkLast (CmmCondBranch pred ifso ifnot likely) | 82 | false | true | 0 | 9 | 31 | 54 | 26 | 28 | null | null |
sdiehl/ghc | utils/genapply/Main.hs | bsd-3-clause | genBitmapArray :: [[ArgRep]] -> Doc
genBitmapArray types =
vcat [
text "section \"rodata\" {",
text "stg_arg_bitmaps:",
text "W_ 0; W_ 0; W_ 0;", -- ARG_GEN, ARG_GEN_BIG, ARG_BCO
vcat (map gen_bitmap types),
text "}"
]
where
gen_bitmap ty = text "W_" <+> int bitmap_val <> semi
where... | 447 | genBitmapArray :: [[ArgRep]] -> Doc
genBitmapArray types =
vcat [
text "section \"rodata\" {",
text "stg_arg_bitmaps:",
text "W_ 0; W_ 0; W_ 0;", -- ARG_GEN, ARG_GEN_BIG, ARG_BCO
vcat (map gen_bitmap types),
text "}"
]
where
gen_bitmap ty = text "W_" <+> int bitmap_val <> semi
where... | 447 | genBitmapArray types =
vcat [
text "section \"rodata\" {",
text "stg_arg_bitmaps:",
text "W_ 0; W_ 0; W_ 0;", -- ARG_GEN, ARG_GEN_BIG, ARG_BCO
vcat (map gen_bitmap types),
text "}"
]
where
gen_bitmap ty = text "W_" <+> int bitmap_val <> semi
where bitmap_val =
(fromI... | 411 | false | true | 0 | 12 | 127 | 131 | 66 | 65 | null | null |
frantisekfarka/ghc-dsi | libraries/base/GHC/Event/Thread.hs | bsd-3-clause | -- | Retrieve the system event manager for the capability on which the
-- calling thread is running.
--
-- This function always returns 'Just' the current thread's event manager
-- when using the threaded RTS and 'Nothing' otherwise.
getSystemEventManager :: IO (Maybe EventManager)
getSystemEventManager = do
t <- myT... | 475 | getSystemEventManager :: IO (Maybe EventManager)
getSystemEventManager = do
t <- myThreadId
(cap, _) <- threadCapability t
eventManagerArray <- readIORef eventManager
mmgr <- readIOArray eventManagerArray cap
return $ fmap snd mmgr | 241 | getSystemEventManager = do
t <- myThreadId
(cap, _) <- threadCapability t
eventManagerArray <- readIORef eventManager
mmgr <- readIOArray eventManagerArray cap
return $ fmap snd mmgr | 192 | true | true | 1 | 9 | 78 | 86 | 40 | 46 | null | null |
olsner/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | plusGRE :: GlobalRdrElt -> GlobalRdrElt -> GlobalRdrElt
-- Used when the gre_name fields match
plusGRE g1 g2
= GRE { gre_name = gre_name g1
, gre_lcl = gre_lcl g1 || gre_lcl g2
, gre_imp = gre_imp g1 ++ gre_imp g2
, gre_par = gre_par g1 `plusParent` gre_par g2 } | 293 | plusGRE :: GlobalRdrElt -> GlobalRdrElt -> GlobalRdrElt
plusGRE g1 g2
= GRE { gre_name = gre_name g1
, gre_lcl = gre_lcl g1 || gre_lcl g2
, gre_imp = gre_imp g1 ++ gre_imp g2
, gre_par = gre_par g1 `plusParent` gre_par g2 } | 254 | plusGRE g1 g2
= GRE { gre_name = gre_name g1
, gre_lcl = gre_lcl g1 || gre_lcl g2
, gre_imp = gre_imp g1 ++ gre_imp g2
, gre_par = gre_par g1 `plusParent` gre_par g2 } | 198 | true | true | 0 | 9 | 79 | 95 | 47 | 48 | null | null |
genos/online_problems | advent_of_code_2019/day04/src/Main.hs | mit | main :: IO ()
main = traverse_ print [part1, part2] | 51 | main :: IO ()
main = traverse_ print [part1, part2] | 51 | main = traverse_ print [part1, part2] | 37 | false | true | 1 | 6 | 9 | 30 | 14 | 16 | null | null |
spechub/Hets | Interfaces/Command.hs | gpl-2.0 | selectCmdList :: [SelectCmd]
selectCmdList = [minBound .. maxBound] | 67 | selectCmdList :: [SelectCmd]
selectCmdList = [minBound .. maxBound] | 67 | selectCmdList = [minBound .. maxBound] | 38 | false | true | 0 | 7 | 7 | 27 | 13 | 14 | null | null |
gust/feature-creature | legacy/lib/Features/SearchableFeature.hs | mit | withBH' :: ElasticSearchConfig -> BH IO a -> IO a
withBH' esConfig a =
withBH defaultManagerSettings (Server (pack (getESUrl esConfig))) a | 140 | withBH' :: ElasticSearchConfig -> BH IO a -> IO a
withBH' esConfig a =
withBH defaultManagerSettings (Server (pack (getESUrl esConfig))) a | 140 | withBH' esConfig a =
withBH defaultManagerSettings (Server (pack (getESUrl esConfig))) a | 90 | false | true | 0 | 11 | 22 | 63 | 28 | 35 | null | null |
NorfairKing/the-notes | src/Computability/Languages/Macro.hs | gpl-2.0 | -- | Infix operator for language concatenation
(<@@>) :: Note -> Note -> Note
(<@@>) = (<>) | 91 | (<@@>) :: Note -> Note -> Note
(<@@>) = (<>) | 44 | (<@@>) = (<>) | 13 | true | true | 0 | 6 | 16 | 26 | 17 | 9 | null | null |
triplepointfive/soten | src/Codec/Soten/Data/ObjData.hs | mit | -- | Generates an empty model object.
newModel :: Model
newModel = Model
{ faces = V.empty
, vertsAcc = V.empty
, texstsAcc = V.empty
, normAcc = V.empty
, objName = ""
} | 203 | newModel :: Model
newModel = Model
{ faces = V.empty
, vertsAcc = V.empty
, texstsAcc = V.empty
, normAcc = V.empty
, objName = ""
} | 165 | newModel = Model
{ faces = V.empty
, vertsAcc = V.empty
, texstsAcc = V.empty
, normAcc = V.empty
, objName = ""
} | 147 | true | true | 0 | 8 | 66 | 56 | 33 | 23 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M10/D02/Solution.hs | mit | eachBlock dl (h:t) = cont (isLineBreak h) h dl t | 48 | eachBlock dl (h:t) = cont (isLineBreak h) h dl t | 48 | eachBlock dl (h:t) = cont (isLineBreak h) h dl t | 48 | false | false | 0 | 6 | 9 | 38 | 16 | 22 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo WriteJFloatArrayOp =
mkGenPrimOp (fsLit "writeJFloatArray#") [alphaTyVar, betaTyVar]
[ mkObjectPrimTy alphaTy, intPrimTy, floatPrimTy, mkStatePrimTy betaTy ]
$ mkStatePrimTy betaTy | 197 | primOpInfo WriteJFloatArrayOp =
mkGenPrimOp (fsLit "writeJFloatArray#") [alphaTyVar, betaTyVar]
[ mkObjectPrimTy alphaTy, intPrimTy, floatPrimTy, mkStatePrimTy betaTy ]
$ mkStatePrimTy betaTy | 197 | primOpInfo WriteJFloatArrayOp =
mkGenPrimOp (fsLit "writeJFloatArray#") [alphaTyVar, betaTyVar]
[ mkObjectPrimTy alphaTy, intPrimTy, floatPrimTy, mkStatePrimTy betaTy ]
$ mkStatePrimTy betaTy | 197 | false | false | 2 | 7 | 24 | 55 | 27 | 28 | null | null |
beni55/ghcjs | src/Compiler/JMacro/QQ.hs | mit | quoteJMExp :: String -> TH.ExpQ
quoteJMExp s = case parseJM s of
Right x -> jm2th x
Left err -> do
(line,_) <- TH.loc_start <$> TH.location
let pos = errorPos err
let newPos = setSourceLine pos $ line + sourceLine pos - 1
... | 364 | quoteJMExp :: String -> TH.ExpQ
quoteJMExp s = case parseJM s of
Right x -> jm2th x
Left err -> do
(line,_) <- TH.loc_start <$> TH.location
let pos = errorPos err
let newPos = setSourceLine pos $ line + sourceLine pos - 1
... | 364 | quoteJMExp s = case parseJM s of
Right x -> jm2th x
Left err -> do
(line,_) <- TH.loc_start <$> TH.location
let pos = errorPos err
let newPos = setSourceLine pos $ line + sourceLine pos - 1
fail (show $ setErrorPos... | 332 | false | true | 0 | 16 | 154 | 126 | 58 | 68 | null | null |
hbrouwer/pdrt-sandbox | src/Data/PDRS/Structure.hs | apache-2.0 | isMergePDRS (PMerge {}) = True | 34 | isMergePDRS (PMerge {}) = True | 34 | isMergePDRS (PMerge {}) = True | 34 | false | false | 0 | 7 | 8 | 16 | 8 | 8 | null | null |
kharvd/tridiagonal | Tridiagonal.hs | bsd-3-clause | solveEquation MethodUnstable = Unstable.getSolution | 51 | solveEquation MethodUnstable = Unstable.getSolution | 51 | solveEquation MethodUnstable = Unstable.getSolution | 51 | false | false | 0 | 5 | 3 | 12 | 5 | 7 | null | null |
cutsea110/kabu | Main.hs | bsd-3-clause | insertBrand :: Brand -> DB Int64
insertBrand = execute' "insert into brand (name,category,lastupdated,code,market) values (?,?,?,?,?)" | 134 | insertBrand :: Brand -> DB Int64
insertBrand = execute' "insert into brand (name,category,lastupdated,code,market) values (?,?,?,?,?)" | 134 | insertBrand = execute' "insert into brand (name,category,lastupdated,code,market) values (?,?,?,?,?)" | 101 | false | true | 0 | 6 | 14 | 21 | 10 | 11 | null | null |
vTurbine/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | trModuleTyConKey = mkPreludeDataConUnique 43 | 67 | trModuleTyConKey = mkPreludeDataConUnique 43 | 67 | trModuleTyConKey = mkPreludeDataConUnique 43 | 67 | false | false | 0 | 5 | 26 | 9 | 4 | 5 | null | null |
sbidin/sdl2-ttf | src/SDL/Font.hs | mit | -- | A helper for unmanaged 'Surface's, since it is not exposed by SDL itself.
unmanaged :: Ptr SDL.Raw.Surface -> Surface
unmanaged p = Surface p Nothing | 154 | unmanaged :: Ptr SDL.Raw.Surface -> Surface
unmanaged p = Surface p Nothing | 75 | unmanaged p = Surface p Nothing | 31 | true | true | 0 | 8 | 26 | 37 | 16 | 21 | null | null |
google/cabal2bazel | bzl/tests/rules/Data/ByteString.hs | apache-2.0 | foo :: Int
foo = 42 | 19 | foo :: Int
foo = 42 | 19 | foo = 42 | 8 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
bgamari/git-haskell-org-hooks | src/validate-whitespace.hs | gpl-3.0 | lintBlob :: [Text] -> Text -> [LintMsg]
lintBlob blobs0 blob1 = execWriter $ do
-- Perform simple invariant-preservation checks
when (hasTabs blob1 && not (any hasTabs blobs0)) $ do
tell [ LintMsg LintLvlErr lno l "introduces TAB"
| (lno,l) <- zip [1..] lns
, "\t" `T.isInfixOf`... | 1,289 | lintBlob :: [Text] -> Text -> [LintMsg]
lintBlob blobs0 blob1 = execWriter $ do
-- Perform simple invariant-preservation checks
when (hasTabs blob1 && not (any hasTabs blobs0)) $ do
tell [ LintMsg LintLvlErr lno l "introduces TAB"
| (lno,l) <- zip [1..] lns
, "\t" `T.isInfixOf`... | 1,289 | lintBlob blobs0 blob1 = execWriter $ do
-- Perform simple invariant-preservation checks
when (hasTabs blob1 && not (any hasTabs blobs0)) $ do
tell [ LintMsg LintLvlErr lno l "introduces TAB"
| (lno,l) <- zip [1..] lns
, "\t" `T.isInfixOf` l
]
when (hasTrail bl... | 1,249 | false | true | 0 | 16 | 458 | 429 | 221 | 208 | null | null |
oldmanmike/ghc | compiler/codeGen/StgCmmUtils.hs | bsd-3-clause | mkTaggedObjectLoad
:: DynFlags -> LocalReg -> LocalReg -> ByteOff -> DynTag -> CmmAGraph
-- (loadTaggedObjectField reg base off tag) generates assignment
-- reg = bitsK[ base + off - tag ]
-- where K is fixed by 'reg'
mkTaggedObjectLoad dflags reg base offset tag
= mkAssign (CmmLocal reg)
(CmmLoad... | 490 | mkTaggedObjectLoad
:: DynFlags -> LocalReg -> LocalReg -> ByteOff -> DynTag -> CmmAGraph
mkTaggedObjectLoad dflags reg base offset tag
= mkAssign (CmmLocal reg)
(CmmLoad (cmmOffsetB dflags
(CmmReg (CmmLocal base))
(offset - tag))
... | 356 | mkTaggedObjectLoad dflags reg base offset tag
= mkAssign (CmmLocal reg)
(CmmLoad (cmmOffsetB dflags
(CmmReg (CmmLocal base))
(offset - tag))
(localRegType reg)) | 265 | true | true | 0 | 13 | 170 | 102 | 52 | 50 | null | null |
expipiplus1/vulkan | openxr/src/OpenXR/Version.hs | bsd-3-clause | _VERSION_MAJOR :: Version -> Word16
_VERSION_MAJOR (Version v) = fromIntegral $ (v `shiftR` 48) .&. 0xffff | 106 | _VERSION_MAJOR :: Version -> Word16
_VERSION_MAJOR (Version v) = fromIntegral $ (v `shiftR` 48) .&. 0xffff | 106 | _VERSION_MAJOR (Version v) = fromIntegral $ (v `shiftR` 48) .&. 0xffff | 70 | false | true | 0 | 8 | 15 | 41 | 22 | 19 | null | null |
vincenthz/hs-foundation | basement/Basement/From.hs | bsd-3-clause | -- | same as tryFrom but reversed
tryInto :: TryInto b a => a -> Maybe b
tryInto = tryFrom | 90 | tryInto :: TryInto b a => a -> Maybe b
tryInto = tryFrom | 56 | tryInto = tryFrom | 17 | true | true | 0 | 7 | 19 | 28 | 14 | 14 | null | null |
portnov/yaledger | YaLedger/Kernel/Monad.hs | bsd-3-clause | runAtomically :: Throws InternalError l => Atomic l a -> Ledger l a
runAtomically (EMT (LedgerStateT action)) = do -- `do' in StateT IO
st <- get
(result, st') <- wrapIO $ atomically $ runStateT action st
case result of
Right a -> do
put st'
return a
Left (callT... | 378 | runAtomically :: Throws InternalError l => Atomic l a -> Ledger l a
runAtomically (EMT (LedgerStateT action)) = do -- `do' in StateT IO
st <- get
(result, st') <- wrapIO $ atomically $ runStateT action st
case result of
Right a -> do
put st'
return a
Left (callT... | 378 | runAtomically (EMT (LedgerStateT action)) = do -- `do' in StateT IO
st <- get
(result, st') <- wrapIO $ atomically $ runStateT action st
case result of
Right a -> do
put st'
return a
Left (callTrace, e) -> wrapE $ rethrow callTrace (checkedException e) | 310 | false | true | 0 | 14 | 115 | 146 | 67 | 79 | null | null |
DavidAlphaFox/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | isFamilyDecl _other = False | 34 | isFamilyDecl _other = False | 34 | isFamilyDecl _other = False | 34 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
spechub/Hets | CASL/CCC/TermFormula.hs | gpl-2.0 | splitAxiom :: FORMULA f -> ([FORMULA f], FORMULA f)
splitAxiom f = case stripAllQuant f of
Relation f1 c f2 _ | c /= Equivalence ->
let (f3, f4) = splitAxiom f2 in (f1 : f3, f4)
f' -> ([], f')
-- | get the premise of a formula, without implication return... | 325 | splitAxiom :: FORMULA f -> ([FORMULA f], FORMULA f)
splitAxiom f = case stripAllQuant f of
Relation f1 c f2 _ | c /= Equivalence ->
let (f3, f4) = splitAxiom f2 in (f1 : f3, f4)
f' -> ([], f')
-- | get the premise of a formula, without implication return... | 325 | splitAxiom f = case stripAllQuant f of
Relation f1 c f2 _ | c /= Equivalence ->
let (f3, f4) = splitAxiom f2 in (f1 : f3, f4)
f' -> ([], f')
-- | get the premise of a formula, without implication return true | 273 | false | true | 0 | 13 | 118 | 114 | 57 | 57 | null | null |
greyson/HasCraft | src/Data/Pocketmine/Chunk.hs | gpl-2.0 | coordToIndex x y z = (128 * 16 * x) + (128 * z) + y | 51 | coordToIndex x y z = (128 * 16 * x) + (128 * z) + y | 51 | coordToIndex x y z = (128 * 16 * x) + (128 * z) + y | 51 | false | false | 0 | 9 | 15 | 41 | 20 | 21 | null | null |
gibiansky/hlint | data/Default.hs | bsd-3-clause | error "Redundant seq" = x `seq` x ==> x | 39 | error "Redundant seq" = x `seq` x ==> x | 39 | error "Redundant seq" = x `seq` x ==> x | 39 | false | false | 2 | 5 | 8 | 28 | 12 | 16 | null | null |
ryoia/bneijt.nl | hakyll.hs | gpl-3.0 | dropPat :: String -> Routes
dropPat pat = gsubRoute pat (const "") | 66 | dropPat :: String -> Routes
dropPat pat = gsubRoute pat (const "") | 66 | dropPat pat = gsubRoute pat (const "") | 38 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
Undeterminant/taffybar | src/System/Taffybar/MPRIS.hs | bsd-3-clause | stateCallback :: Label -> Signal -> IO ()
stateCallback w s =
case fromVariant (signalBody s !! 0) of
Just st -> case structureItems st of
(pstate:_) -> case (fromVariant pstate) :: Maybe Int32 of
Just 2 -> postGUIAsync $ widgetHideAll w
Just 1 -> postGUIAsync $ widgetHideAll w
Just ... | 418 | stateCallback :: Label -> Signal -> IO ()
stateCallback w s =
case fromVariant (signalBody s !! 0) of
Just st -> case structureItems st of
(pstate:_) -> case (fromVariant pstate) :: Maybe Int32 of
Just 2 -> postGUIAsync $ widgetHideAll w
Just 1 -> postGUIAsync $ widgetHideAll w
Just ... | 418 | stateCallback w s =
case fromVariant (signalBody s !! 0) of
Just st -> case structureItems st of
(pstate:_) -> case (fromVariant pstate) :: Maybe Int32 of
Just 2 -> postGUIAsync $ widgetHideAll w
Just 1 -> postGUIAsync $ widgetHideAll w
Just 0 -> postGUIAsync $ widgetShowAll w
... | 376 | false | true | 0 | 15 | 121 | 172 | 80 | 92 | null | null |
spechub/Hets | Framework/AS.hs | gpl-2.0 | printLogicDef :: LogicDef -> Doc
printLogicDef (LogicDef l ml s m f p pa) =
vcat [ text newlogicS <+> pretty l
, text " " <+> text metaS <+> pretty ml
, text " " <+> text syntaxS <+> pretty s
, text " " <+> text modelsS <+> pretty m
, text " " <+> text foundationS <+> pretty f
, tex... | 415 | printLogicDef :: LogicDef -> Doc
printLogicDef (LogicDef l ml s m f p pa) =
vcat [ text newlogicS <+> pretty l
, text " " <+> text metaS <+> pretty ml
, text " " <+> text syntaxS <+> pretty s
, text " " <+> text modelsS <+> pretty m
, text " " <+> text foundationS <+> pretty f
, tex... | 415 | printLogicDef (LogicDef l ml s m f p pa) =
vcat [ text newlogicS <+> pretty l
, text " " <+> text metaS <+> pretty ml
, text " " <+> text syntaxS <+> pretty s
, text " " <+> text modelsS <+> pretty m
, text " " <+> text foundationS <+> pretty f
, text " " <+> text proofsS <+> pretty... | 382 | false | true | 0 | 8 | 133 | 172 | 79 | 93 | null | null |
markuspf/Idris-dev | src/Idris/Docs.hs | bsd-3-clause | showDoc ist d
| nullDocstring d = empty
| otherwise = text " -- " <>
renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d | 173 | showDoc ist d
| nullDocstring d = empty
| otherwise = text " -- " <>
renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d | 173 | showDoc ist d
| nullDocstring d = empty
| otherwise = text " -- " <>
renderDocstring (renderDocTerm (pprintDelab ist) (normaliseAll (tt_ctxt ist) [])) d | 173 | false | false | 1 | 12 | 45 | 69 | 32 | 37 | null | null |
jbracker/supermonad-plugin | src/Control/Super/Monad/Functions.hs | bsd-3-clause | apM_ :: ( Return n, ReturnCts n
, Bind m n n, BindCts m n n
) => (a -> m b) -> [a] -> n ()
mapM_ f = void . mapM f
| 133 | mapM_ :: ( Return n, ReturnCts n
, Bind m n n, BindCts m n n
) => (a -> m b) -> [a] -> n ()
mapM_ f = void . mapM f | 133 | mapM_ f = void . mapM f | 23 | false | true | 0 | 9 | 52 | 82 | 41 | 41 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_BUFFER_MAP_POINTER_ARB :: GLenum
gl_BUFFER_MAP_POINTER_ARB = 0x88BD | 70 | gl_BUFFER_MAP_POINTER_ARB :: GLenum
gl_BUFFER_MAP_POINTER_ARB = 0x88BD | 70 | gl_BUFFER_MAP_POINTER_ARB = 0x88BD | 34 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
cjhveal/H-99 | 19.hs | mit | rotate :: [a] -> Int -> [a]
rotate [] _ = [] | 44 | rotate :: [a] -> Int -> [a]
rotate [] _ = [] | 44 | rotate [] _ = [] | 16 | false | true | 0 | 9 | 11 | 40 | 19 | 21 | null | null |
achirkin/easytensor | easytensor/Setup.hs | bsd-3-clause | addHaddockArgs (("haddock", args):otherProgsArgs)
= ("haddock", args ++ newHaddockGhcArgs) : otherProgsArgs | 109 | addHaddockArgs (("haddock", args):otherProgsArgs)
= ("haddock", args ++ newHaddockGhcArgs) : otherProgsArgs | 109 | addHaddockArgs (("haddock", args):otherProgsArgs)
= ("haddock", args ++ newHaddockGhcArgs) : otherProgsArgs | 109 | false | false | 0 | 7 | 11 | 37 | 20 | 17 | null | null |
keithodulaigh/Hets | CASL/Morphism.hs | gpl-2.0 | inducedAnnoMap :: Sort_map -> Op_map -> Pred_map -> AnnoMap -> AnnoMap
inducedAnnoMap sm om pm = MapSet.foldWithKey
( \ sy s -> MapSet.insert (mapSymbol sm om pm sy) s) MapSet.empty | 183 | inducedAnnoMap :: Sort_map -> Op_map -> Pred_map -> AnnoMap -> AnnoMap
inducedAnnoMap sm om pm = MapSet.foldWithKey
( \ sy s -> MapSet.insert (mapSymbol sm om pm sy) s) MapSet.empty | 183 | inducedAnnoMap sm om pm = MapSet.foldWithKey
( \ sy s -> MapSet.insert (mapSymbol sm om pm sy) s) MapSet.empty | 112 | false | true | 0 | 10 | 31 | 73 | 36 | 37 | null | null |
jml/hazard | lib/Hazard/Views.hs | apache-2.0 | dualResponse :: (ToJSON a, MonadIO m) => a -> H.Html -> ActionT m b
dualResponse j h = do
format <- preferredFormat
case format of
PrefJSON -> json j
_ -> do
setHeader "Content-Type" "text/html; charset=utf-8"
lazyBytes . renderHtml $ h | 256 | dualResponse :: (ToJSON a, MonadIO m) => a -> H.Html -> ActionT m b
dualResponse j h = do
format <- preferredFormat
case format of
PrefJSON -> json j
_ -> do
setHeader "Content-Type" "text/html; charset=utf-8"
lazyBytes . renderHtml $ h | 256 | dualResponse j h = do
format <- preferredFormat
case format of
PrefJSON -> json j
_ -> do
setHeader "Content-Type" "text/html; charset=utf-8"
lazyBytes . renderHtml $ h | 188 | false | true | 0 | 13 | 60 | 94 | 44 | 50 | null | null |
orblivion/Haskell-Synth | Components.hs | mit | sig_sequence :: [([Signal], Progression)] -> Signal
sig_sequence sequenceData = sig_sequence' sequenceData [flatSignal 0] where
sig_sequence' :: [([Signal], Progression)] -> [Signal] -> Signal
sig_sequence' [] existingSignals = sig_adder existingSignals
sig_sequence' ((newSignals, startingDelay):nextSeq) ex... | 723 | sig_sequence :: [([Signal], Progression)] -> Signal
sig_sequence sequenceData = sig_sequence' sequenceData [flatSignal 0] where
sig_sequence' :: [([Signal], Progression)] -> [Signal] -> Signal
sig_sequence' [] existingSignals = sig_adder existingSignals
sig_sequence' ((newSignals, startingDelay):nextSeq) ex... | 723 | sig_sequence sequenceData = sig_sequence' sequenceData [flatSignal 0] where
sig_sequence' :: [([Signal], Progression)] -> [Signal] -> Signal
sig_sequence' [] existingSignals = sig_adder existingSignals
sig_sequence' ((newSignals, startingDelay):nextSeq) existingSignals = catSignals [beforeNewSignals, afterN... | 671 | false | true | 0 | 14 | 115 | 186 | 99 | 87 | null | null |
urbit/urbit | pkg/hs/urbit-king/lib/Urbit/Vere/Ports.hs | mit | isResetAndRetry _ = False | 35 | isResetAndRetry _ = False | 35 | isResetAndRetry _ = False | 35 | false | false | 0 | 4 | 13 | 10 | 4 | 6 | null | null |
rdnetto/H2V | H2V/RenderVerilog.hs | gpl-2.0 | renderBuiltin resID EnumList par args@(min:step:max:[]) = VNodeDef resID def (ass ++ doneAs) mod where
--bounded
def = defineNode resID (DList UndefinedType) par
(ass, mod) = renderListGen resID min step (Just max) par
doneAs = genericDone resID [min, step, max] | 278 | renderBuiltin resID EnumList par args@(min:step:max:[]) = VNodeDef resID def (ass ++ doneAs) mod where
--bounded
def = defineNode resID (DList UndefinedType) par
(ass, mod) = renderListGen resID min step (Just max) par
doneAs = genericDone resID [min, step, max] | 278 | renderBuiltin resID EnumList par args@(min:step:max:[]) = VNodeDef resID def (ass ++ doneAs) mod where
--bounded
def = defineNode resID (DList UndefinedType) par
(ass, mod) = renderListGen resID min step (Just max) par
doneAs = genericDone resID [min, step, max] | 278 | false | false | 0 | 11 | 54 | 119 | 63 | 56 | null | null |
stevedonnelly/haskell | code/Text/Scanner.hs | mit | tokenId = first3 | 16 | tokenId = first3 | 16 | tokenId = first3 | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
Motions/motions | src/Bio/Motions/Utils/Geometry.hs | apache-2.0 | boundingCube :: [Point] -> Cube
boundingCube ps = Cube{..}
where
minCorner = foldr1 (liftA2 min) ps
maxCorner = foldr1 (liftA2 max) ps
-- |A cube extended in each direction by the given radius.
-- Warning: possible integer overflows with large distances. | 265 | boundingCube :: [Point] -> Cube
boundingCube ps = Cube{..}
where
minCorner = foldr1 (liftA2 min) ps
maxCorner = foldr1 (liftA2 max) ps
-- |A cube extended in each direction by the given radius.
-- Warning: possible integer overflows with large distances. | 265 | boundingCube ps = Cube{..}
where
minCorner = foldr1 (liftA2 min) ps
maxCorner = foldr1 (liftA2 max) ps
-- |A cube extended in each direction by the given radius.
-- Warning: possible integer overflows with large distances. | 233 | false | true | 0 | 7 | 51 | 63 | 33 | 30 | null | null |
dzeban/haskell-exercises | rwh/ch03/Exercises.hs | mit | height (Node _ left right) = 1 + max (height left) (height right) | 65 | height (Node _ left right) = 1 + max (height left) (height right) | 65 | height (Node _ left right) = 1 + max (height left) (height right) | 65 | false | false | 0 | 8 | 12 | 40 | 19 | 21 | null | null |
shlevy/ghc | compiler/basicTypes/VarEnv.hs | bsd-3-clause | rnSwap :: RnEnv2 -> RnEnv2
-- ^ swap the meaning of left and right
rnSwap (RV2 { envL = envL, envR = envR, in_scope = in_scope })
= RV2 { envL = envR, envR = envL, in_scope = in_scope } | 187 | rnSwap :: RnEnv2 -> RnEnv2
rnSwap (RV2 { envL = envL, envR = envR, in_scope = in_scope })
= RV2 { envL = envR, envR = envL, in_scope = in_scope } | 147 | rnSwap (RV2 { envL = envL, envR = envR, in_scope = in_scope })
= RV2 { envL = envR, envR = envL, in_scope = in_scope } | 120 | true | true | 0 | 8 | 41 | 71 | 40 | 31 | null | null |
elieux/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | primOrdOps :: String -- The class involved
-> TyCon -- The tycon involved
-> Type -- The type
-> (RdrName, RdrName, RdrName, RdrName, RdrName) -- (lt,le,eq,ge,gt)
-- See Note [Deriving and unboxed types] in TcDeriv
primOrdOps str tycon ty = assoc_ty_id str tycon ordOpTbl ty | 320 | primOrdOps :: String -- The class involved
-> TyCon -- The tycon involved
-> Type -- The type
-> (RdrName, RdrName, RdrName, RdrName, RdrName)
primOrdOps str tycon ty = assoc_ty_id str tycon ordOpTbl ty | 247 | primOrdOps str tycon ty = assoc_ty_id str tycon ordOpTbl ty | 59 | true | true | 0 | 10 | 90 | 64 | 35 | 29 | null | null |
llllllllll/h16cc | Assembler/Core.hs | gpl-2.0 | resolveReg R8_f = 0x22 | 23 | resolveReg R8_f = 0x22 | 23 | resolveReg R8_f = 0x22 | 23 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
cirquit/quizlearner | resources/form/mforms_customfield_1.hs | mit | q1_a1, q1_a2, q1_a3,q1_a4,q2_a1, q2_a2, q2_a3, q2_a4 :: Answer
q1_a1 = Answer {aidentity="id_1", acontent="1", isCorrect=False, hint="This is hint!"} | 149 | q1_a1, q1_a2, q1_a3,q1_a4,q2_a1, q2_a2, q2_a3, q2_a4 :: Answer
q1_a1 = Answer {aidentity="id_1", acontent="1", isCorrect=False, hint="This is hint!"} | 149 | q1_a1 = Answer {aidentity="id_1", acontent="1", isCorrect=False, hint="This is hint!"} | 86 | false | true | 13 | 7 | 16 | 82 | 38 | 44 | null | null |
smurphy8/tach | core-libs/tach-acid-impulse-lib/src/Tach/Acid/Impulse/Cruds/Read.hs | mit | getTVSimpleImpulse :: TVKey -> Int -> Query TVSimpleImpulseTypeStore (Either ErrorValue TVNoKey)
getTVSimpleImpulse tk tm = queryFcn <$> ask
where
fakeTvNoKey = TVNoKey tm 0.0 -- fake data entry used to query the db
queryFcn st
|(isKey st) && (timeIsIn st) = views _TVSimpleImpulseRep (\s -> elookupLE fa... | 794 | getTVSimpleImpulse :: TVKey -> Int -> Query TVSimpleImpulseTypeStore (Either ErrorValue TVNoKey)
getTVSimpleImpulse tk tm = queryFcn <$> ask
where
fakeTvNoKey = TVNoKey tm 0.0 -- fake data entry used to query the db
queryFcn st
|(isKey st) && (timeIsIn st) = views _TVSimpleImpulseRep (\s -> elookupLE fa... | 794 | getTVSimpleImpulse tk tm = queryFcn <$> ask
where
fakeTvNoKey = TVNoKey tm 0.0 -- fake data entry used to query the db
queryFcn st
|(isKey st) && (timeIsIn st) = views _TVSimpleImpulseRep (\s -> elookupLE fakeTvNoKey s) st
|otherwise = Left $ ErrorValue ErrorOutOfBounds
timeIsIn st = let strt... | 696 | false | true | 3 | 12 | 191 | 227 | 111 | 116 | null | null |
Erdwolf/autotool-bonn | src/TypeCheckBonn/Infer.hs | gpl-2.0 | nested :: Int -> M a -> M a
nested n = censor (map (nest n)) | 60 | nested :: Int -> M a -> M a
nested n = censor (map (nest n)) | 60 | nested n = censor (map (nest n)) | 32 | false | true | 0 | 9 | 15 | 47 | 21 | 26 | null | null |
alang9/deque | Data/Deque/NonCat.hs | bsd-3-clause | fixup2' (BigR (XR (B3 a b c) (B0)) N LEmpty) = go3 a b c | 110 | fixup2' (BigR (XR (B3 a b c) (B0)) N LEmpty) = go3 a b c | 110 | fixup2' (BigR (XR (B3 a b c) (B0)) N LEmpty) = go3 a b c | 110 | false | false | 0 | 10 | 68 | 48 | 23 | 25 | null | null |
dmjio/hackernews | ghcjs-src/Web/HackerNews.hs | mit | -- | Retrieve `BestStories`
getBestStories :: IO (Either HackerNewsError BestStories)
getBestStories = issueAjax Nothing "beststories" | 134 | getBestStories :: IO (Either HackerNewsError BestStories)
getBestStories = issueAjax Nothing "beststories" | 106 | getBestStories = issueAjax Nothing "beststories" | 48 | true | true | 0 | 7 | 14 | 28 | 14 | 14 | null | null |
gafiatulin/codewars | src/8 kyu/LazyNext.hs | mit | next item [x] = Nothing | 23 | next item [x] = Nothing | 23 | next item [x] = Nothing | 23 | false | false | 0 | 6 | 4 | 14 | 7 | 7 | null | null |
mkloczko/derive-storable-plugin | src/Foreign/Storable/Generic/Plugin/Internal/Compile.hs | mit | isLitOrGlobal _ = Nothing | 25 | isLitOrGlobal _ = Nothing | 25 | isLitOrGlobal _ = Nothing | 25 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
soumyadsanyal/99 | ch03/soumya.hs | gpl-2.0 | quux a =
let
a="foo"
in
a++"eek!" | 39 | quux a =
let
a="foo"
in
a++"eek!" | 39 | quux a =
let
a="foo"
in
a++"eek!" | 39 | false | false | 2 | 8 | 12 | 27 | 11 | 16 | null | null |
bkach/HaskellRaycaster | src/RayCaster/Color.hs | apache-2.0 | pink :: Color
pink = Color 1 0.5 0.5 | 36 | pink :: Color
pink = Color 1 0.5 0.5 | 36 | pink = Color 1 0.5 0.5 | 22 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
UCSD-PL/nano-js | Language/Nano/Types.hs | bsd-3-clause | getWhiles :: [Statement SourceSpan] -> [Statement SourceSpan]
getWhiles stmts = everything (++) ([] `mkQ` fromWhile) stmts
where
fromWhile s@(WhileStmt {}) = [s]
fromWhile _ = []
-----------------------------------------------------------------------------------
-- | Helpers for extracti... | 635 | getWhiles :: [Statement SourceSpan] -> [Statement SourceSpan]
getWhiles stmts = everything (++) ([] `mkQ` fromWhile) stmts
where
fromWhile s@(WhileStmt {}) = [s]
fromWhile _ = []
-----------------------------------------------------------------------------------
-- | Helpers for extracti... | 635 | getWhiles stmts = everything (++) ([] `mkQ` fromWhile) stmts
where
fromWhile s@(WhileStmt {}) = [s]
fromWhile _ = []
-----------------------------------------------------------------------------------
-- | Helpers for extracting specifications from @ECMAScript3@ @Statement@
------------... | 573 | false | true | 2 | 9 | 113 | 105 | 56 | 49 | null | null |
urv/fixhs | src/Data/FIX/Spec/FIX40.hs | lgpl-2.1 | mAdvertisement :: FIXMessageSpec
mAdvertisement = FMSpec
{ msName = "Advertisement"
, msType = C.pack "7"
, msHeader = headerFIX40
, msBody = mAdvertisementBody
, msTrailer = trailerFIX40 }
where
mAdvertisementBody =
LT.insert (tnum tAdvId) tAdvId $
LT.insert (tnum tAdvTransType) tAdvT... | 920 | mAdvertisement :: FIXMessageSpec
mAdvertisement = FMSpec
{ msName = "Advertisement"
, msType = C.pack "7"
, msHeader = headerFIX40
, msBody = mAdvertisementBody
, msTrailer = trailerFIX40 }
where
mAdvertisementBody =
LT.insert (tnum tAdvId) tAdvId $
LT.insert (tnum tAdvTransType) tAdvT... | 920 | mAdvertisement = FMSpec
{ msName = "Advertisement"
, msType = C.pack "7"
, msHeader = headerFIX40
, msBody = mAdvertisementBody
, msTrailer = trailerFIX40 }
where
mAdvertisementBody =
LT.insert (tnum tAdvId) tAdvId $
LT.insert (tnum tAdvTransType) tAdvTransType $
LT.insert (tnum ... | 887 | false | true | 1 | 8 | 223 | 338 | 155 | 183 | null | null |
arjunguha/haskell-couchdb | src/Database/CouchDB/Unsafe.hs | bsd-3-clause | -- |Creates a new database. Throws an exception if the database already
-- exists.
createDB :: String -> CouchMonad ()
createDB name = do
resp <- request' name PUT
unless (rspCode resp == (2,0,1)) $
error (rspReason resp) | 231 | createDB :: String -> CouchMonad ()
createDB name = do
resp <- request' name PUT
unless (rspCode resp == (2,0,1)) $
error (rspReason resp) | 146 | createDB name = do
resp <- request' name PUT
unless (rspCode resp == (2,0,1)) $
error (rspReason resp) | 110 | true | true | 0 | 11 | 47 | 75 | 37 | 38 | null | null |
kyoungrok0517/linguist | samples/Haskell/HsColour.hs | mit | top'n'tail CSS title = CSS.top'n'tail title | 46 | top'n'tail CSS title = CSS.top'n'tail title | 46 | top'n'tail CSS title = CSS.top'n'tail title | 46 | false | false | 0 | 6 | 8 | 17 | 7 | 10 | null | null |
OliverFlecke/Funci | src/Parser.hs | bsd-3-clause | parse2Expr :: (Read a, Show a, Num a) => [Token a] -> Either (Exception a) (Expr a, [Token a])
parse2Expr tokens = parse1Expr tokens | 132 | parse2Expr :: (Read a, Show a, Num a) => [Token a] -> Either (Exception a) (Expr a, [Token a])
parse2Expr tokens = parse1Expr tokens | 132 | parse2Expr tokens = parse1Expr tokens | 37 | false | true | 0 | 11 | 23 | 78 | 38 | 40 | null | null |
romanb/amazonka | amazonka-sdb/gen/Network/AWS/SDB/Select.hs | mpl-2.0 | -- | The expression used to query the domain.
sSelectExpression :: Lens' Select Text
sSelectExpression =
lens _sSelectExpression (\s a -> s { _sSelectExpression = a }) | 171 | sSelectExpression :: Lens' Select Text
sSelectExpression =
lens _sSelectExpression (\s a -> s { _sSelectExpression = a }) | 125 | sSelectExpression =
lens _sSelectExpression (\s a -> s { _sSelectExpression = a }) | 86 | true | true | 1 | 9 | 30 | 44 | 22 | 22 | null | null |
gridaphobe/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | hsExprNeedsParens (HsType {}) = False | 45 | hsExprNeedsParens (HsType {}) = False | 45 | hsExprNeedsParens (HsType {}) = False | 45 | false | false | 0 | 7 | 12 | 16 | 8 | 8 | null | null |
cje/system-log-transform | test/TParser.hs | cc0-1.0 | testParseLine = TestCase $ do let l = "May 8 23:39:47 bracket.local sandboxd[39866] ([39865]): mdworker(39865) deny mach-lookup com.apple.ls.boxd"
let dateRef = Date May 8
let timeRef = Time 23 39 47
let dateTimeRef = Datetim... | 1,612 | testParseLine = TestCase $ do let l = "May 8 23:39:47 bracket.local sandboxd[39866] ([39865]): mdworker(39865) deny mach-lookup com.apple.ls.boxd"
let dateRef = Date May 8
let timeRef = Time 23 39 47
let dateTimeRef = Datetim... | 1,612 | testParseLine = TestCase $ do let l = "May 8 23:39:47 bracket.local sandboxd[39866] ([39865]): mdworker(39865) deny mach-lookup com.apple.ls.boxd"
let dateRef = Date May 8
let timeRef = Time 23 39 47
let dateTimeRef = Datetim... | 1,612 | false | false | 17 | 9 | 998 | 234 | 119 | 115 | null | null |
nushio3/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | anyTy :: Type
anyTy = mkTyConTy anyTyCon | 40 | anyTy :: Type
anyTy = mkTyConTy anyTyCon | 40 | anyTy = mkTyConTy anyTyCon | 26 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
gbataille/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | blockCommands :: M.Map String (LP Blocks)
blockCommands = M.fromList $
[ ("par", mempty <$ skipopts)
, ("title", mempty <$ (skipopts *>
(grouped inline >>= addMeta "title")
<|> (grouped block >>= addMeta "title")))
, ("subtitle", mempty <$ (skipopts *> tok >>= addMe... | 2,949 | blockCommands :: M.Map String (LP Blocks)
blockCommands = M.fromList $
[ ("par", mempty <$ skipopts)
, ("title", mempty <$ (skipopts *>
(grouped inline >>= addMeta "title")
<|> (grouped block >>= addMeta "title")))
, ("subtitle", mempty <$ (skipopts *> tok >>= addMe... | 2,949 | blockCommands = M.fromList $
[ ("par", mempty <$ skipopts)
, ("title", mempty <$ (skipopts *>
(grouped inline >>= addMeta "title")
<|> (grouped block >>= addMeta "title")))
, ("subtitle", mempty <$ (skipopts *> tok >>= addMeta "subtitle"))
, ("author", mempty <$ (... | 2,907 | false | true | 6 | 13 | 649 | 862 | 501 | 361 | null | null |
smurphy8/issue-add | src/Action/Internal/Label.hs | bsd-3-clause | fromLabelString "Clean" = Right Clean | 56 | fromLabelString "Clean" = Right Clean | 56 | fromLabelString "Clean" = Right Clean | 56 | false | false | 0 | 5 | 23 | 12 | 5 | 7 | null | null |
MWRuszczycky/Chemno | src/RunModes.hs | bsd-3-clause | getAllKeys :: T.ChemnoState -> T.CMTrans IO T.ChemnoState
-- ^Extract all the unique keys from all the parsed LaTeX files and
-- and set them as the dictionary in the chemno state. Values for
-- each key in the association list are just empty strings.
getAllKeys c = do
let keys = M.extractKeys . T.files $ c
ret... | 345 | getAllKeys :: T.ChemnoState -> T.CMTrans IO T.ChemnoState
getAllKeys c = do
let keys = M.extractKeys . T.files $ c
return $ c { T.dict = keys } | 151 | getAllKeys c = do
let keys = M.extractKeys . T.files $ c
return $ c { T.dict = keys } | 93 | true | true | 0 | 12 | 71 | 70 | 36 | 34 | null | null |
cmwilhelm/setGame | library/SetGame/Cards.hs | mit | allCards :: [Card]
allCards = addIds $ [Card] <*> colors <*> shades <*> numbers <*> shapes
where addIds partials = zipWith ($) partials [1..] | 143 | allCards :: [Card]
allCards = addIds $ [Card] <*> colors <*> shades <*> numbers <*> shapes
where addIds partials = zipWith ($) partials [1..] | 143 | allCards = addIds $ [Card] <*> colors <*> shades <*> numbers <*> shapes
where addIds partials = zipWith ($) partials [1..] | 124 | false | true | 2 | 9 | 25 | 67 | 33 | 34 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT08.hs | gpl-3.0 | even (S Z) = False | 18 | even (S Z) = False | 18 | even (S Z) = False | 18 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
pierric/neural-network | Backend-blashs/Data/NeuralNetwork/Backend/BLASHS/Utils.hs | bsd-3-clause | -- | create a new 'DenseMatrix' of some constant
newDenseMatrixConst:: (V.Storable a, MonadIO m) => Int -> Int -> a -> m (DenseMatrix a)
newDenseMatrixConst r c v = liftIO $ DenseMatrix r c <$> V.replicate (r*c) v | 213 | newDenseMatrixConst:: (V.Storable a, MonadIO m) => Int -> Int -> a -> m (DenseMatrix a)
newDenseMatrixConst r c v = liftIO $ DenseMatrix r c <$> V.replicate (r*c) v | 164 | newDenseMatrixConst r c v = liftIO $ DenseMatrix r c <$> V.replicate (r*c) v | 76 | true | true | 0 | 11 | 37 | 84 | 42 | 42 | null | null |
uuhan/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSGt (ATInt (ITFixed ty))) [x, y] = bitOp v "SGt" ty [x, y] | 67 | doOp v (LSGt (ATInt (ITFixed ty))) [x, y] = bitOp v "SGt" ty [x, y] | 67 | doOp v (LSGt (ATInt (ITFixed ty))) [x, y] = bitOp v "SGt" ty [x, y] | 67 | false | false | 1 | 11 | 14 | 55 | 27 | 28 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrelInfo.hs | bsd-3-clause | primOpId :: PrimOp -> Id
primOpId op = primOpIds ! primOpTag op | 63 | primOpId :: PrimOp -> Id
primOpId op = primOpIds ! primOpTag op | 63 | primOpId op = primOpIds ! primOpTag op | 38 | false | true | 2 | 7 | 11 | 31 | 13 | 18 | null | null |
brendanhay/gogol | gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/List.hs | mpl-2.0 | -- | JSONP
pilCallback :: Lens' ProjectsInstancesList (Maybe Text)
pilCallback
= lens _pilCallback (\ s a -> s{_pilCallback = a}) | 131 | pilCallback :: Lens' ProjectsInstancesList (Maybe Text)
pilCallback
= lens _pilCallback (\ s a -> s{_pilCallback = a}) | 120 | pilCallback
= lens _pilCallback (\ s a -> s{_pilCallback = a}) | 64 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
pjones/vimeta | src/Vimeta/Core/MappingFile.hs | bsd-2-clause | -- | Skip whitespace.
whitespace :: Parser (Token a)
whitespace = skipMany1 space >> return Comment | 99 | whitespace :: Parser (Token a)
whitespace = skipMany1 space >> return Comment | 77 | whitespace = skipMany1 space >> return Comment | 46 | true | true | 0 | 7 | 15 | 31 | 15 | 16 | null | null |
openbrainsrc/Simple-SVM | Examples/PlotOneClass.hs | bsd-3-clause | main = do
pts ::[(Double,Double)]
<- withSystemRandom $ \g -> zip <$> replicateM 30 (scaledN g :: IO Double)
<*> replicateM 30 (scaledN g :: IO Double)
let (msg, svm2) = trainOneClass 0.01 (RBF 1) pts
putStrLn msg
let plot =
foldl (atop) (... | 857 | main = do
pts ::[(Double,Double)]
<- withSystemRandom $ \g -> zip <$> replicateM 30 (scaledN g :: IO Double)
<*> replicateM 30 (scaledN g :: IO Double)
let (msg, svm2) = trainOneClass 0.01 (RBF 1) pts
putStrLn msg
let plot =
foldl (atop) (... | 857 | main = do
pts ::[(Double,Double)]
<- withSystemRandom $ \g -> zip <$> replicateM 30 (scaledN g :: IO Double)
<*> replicateM 30 (scaledN g :: IO Double)
let (msg, svm2) = trainOneClass 0.01 (RBF 1) pts
putStrLn msg
let plot =
foldl (atop) (... | 857 | false | false | 1 | 17 | 341 | 372 | 187 | 185 | null | null |
lovasko/swim | src/Command/Deflate/Perform.hs | bsd-2-clause | deflate :: FilePath -- ^ file path
-> IO () -- ^ action
deflate path = storyLoad path >>= \case
Left err -> errorPrint err >> exitFailure
Right story -> storySave story (fmtChange FmtZip path) >> exitSuccess
-- | Perform story deflation on a selected file. | 301 | deflate :: FilePath -- ^ file path
-> IO ()
deflate path = storyLoad path >>= \case
Left err -> errorPrint err >> exitFailure
Right story -> storySave story (fmtChange FmtZip path) >> exitSuccess
-- | Perform story deflation on a selected file. | 286 | deflate path = storyLoad path >>= \case
Left err -> errorPrint err >> exitFailure
Right story -> storySave story (fmtChange FmtZip path) >> exitSuccess
-- | Perform story deflation on a selected file. | 233 | true | true | 4 | 7 | 90 | 59 | 31 | 28 | null | null |
codemac/yi-editor | src/Yi/Buffer/Misc.hs | gpl-2.0 | getMarkPointB :: Mark -> BufferM Point
getMarkPointB m = markPoint <$> getMarkValueB m | 86 | getMarkPointB :: Mark -> BufferM Point
getMarkPointB m = markPoint <$> getMarkValueB m | 86 | getMarkPointB m = markPoint <$> getMarkValueB m | 47 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
sgillespie/ghc | compiler/nativeGen/RegAlloc/Liveness.hs | bsd-3-clause | eraseDeltasLive
:: Instruction instr
=> LiveCmmDecl statics instr
-> LiveCmmDecl statics instr
eraseDeltasLive cmm
= mapBlockTop eraseBlock cmm
where
eraseBlock (BasicBlock id lis)
= BasicBlock id
$ filter (\(LiveInstr i _) -> not $ isJust $ take... | 564 | eraseDeltasLive
:: Instruction instr
=> LiveCmmDecl statics instr
-> LiveCmmDecl statics instr
eraseDeltasLive cmm
= mapBlockTop eraseBlock cmm
where
eraseBlock (BasicBlock id lis)
= BasicBlock id
$ filter (\(LiveInstr i _) -> not $ isJust $ takeD... | 563 | eraseDeltasLive cmm
= mapBlockTop eraseBlock cmm
where
eraseBlock (BasicBlock id lis)
= BasicBlock id
$ filter (\(LiveInstr i _) -> not $ isJust $ takeDeltaInstr i)
$ lis
-- | Patch the registers in this code according to this register mapping.
-- als... | 444 | false | true | 0 | 11 | 175 | 108 | 51 | 57 | null | null |
sampou-org/pfad | Code/Code21.hs | bsd-3-clause | fold1 :: (Either a [b] -> b) -> Tree a -> b
fold1 f t = case t of
Leaf x -> f (Left x)
Node ts -> f (Right (map (fold1 f) ts)) | 180 | fold1 :: (Either a [b] -> b) -> Tree a -> b
fold1 f t = case t of
Leaf x -> f (Left x)
Node ts -> f (Right (map (fold1 f) ts)) | 180 | fold1 f t = case t of
Leaf x -> f (Left x)
Node ts -> f (Right (map (fold1 f) ts)) | 128 | false | true | 0 | 14 | 87 | 96 | 46 | 50 | null | null |
scwe/HaskSee | ImageLibrary.hs | gpl-2.0 | thresholdFilter :: Pixel GrayImage -> [[Pixel GrayImage]] -> Pixel GrayImage
thresholdFilter threshold ((pixel:_):_) = if pixel > threshold then 255 else 0 | 155 | thresholdFilter :: Pixel GrayImage -> [[Pixel GrayImage]] -> Pixel GrayImage
thresholdFilter threshold ((pixel:_):_) = if pixel > threshold then 255 else 0 | 155 | thresholdFilter threshold ((pixel:_):_) = if pixel > threshold then 255 else 0 | 78 | false | true | 0 | 9 | 21 | 70 | 35 | 35 | null | null |
cartazio/omega | src/NarrowData.hs | bsd-3-clause | -- freshen :: (NMonad z n v t m) => t -> m t
freshen x =
case project x of
(VarN s) -> varFresh s
(FunN n xs) -> do { ys <- mapM freshen xs; return(fun n ys)}
(ConN n xs) -> do { ys <- mapM freshen xs; return(con n ys)}
(RelN (EqR (x,y))) -> do { a <- freshen x; b <- freshen y; return(eq [a,b]) } | 311 | freshen x =
case project x of
(VarN s) -> varFresh s
(FunN n xs) -> do { ys <- mapM freshen xs; return(fun n ys)}
(ConN n xs) -> do { ys <- mapM freshen xs; return(con n ys)}
(RelN (EqR (x,y))) -> do { a <- freshen x; b <- freshen y; return(eq [a,b]) } | 266 | freshen x =
case project x of
(VarN s) -> varFresh s
(FunN n xs) -> do { ys <- mapM freshen xs; return(fun n ys)}
(ConN n xs) -> do { ys <- mapM freshen xs; return(con n ys)}
(RelN (EqR (x,y))) -> do { a <- freshen x; b <- freshen y; return(eq [a,b]) } | 266 | true | false | 0 | 13 | 84 | 184 | 91 | 93 | null | null |
AndrasKovacs/elte-cbsd | src/CBSD/Messages/TH.hs | bsd-3-clause | taggingOptions :: Options
taggingOptions =
defaultOptions {
fieldLabelModifier = stripPrefix,
constructorTagModifier = stripPrefix,
sumEncoding = defaultTaggedObject {
tagFieldName = messageTypeField,
contentsFieldName = contentField
}
} | 293 | taggingOptions :: Options
taggingOptions =
defaultOptions {
fieldLabelModifier = stripPrefix,
constructorTagModifier = stripPrefix,
sumEncoding = defaultTaggedObject {
tagFieldName = messageTypeField,
contentsFieldName = contentField
}
} | 293 | taggingOptions =
defaultOptions {
fieldLabelModifier = stripPrefix,
constructorTagModifier = stripPrefix,
sumEncoding = defaultTaggedObject {
tagFieldName = messageTypeField,
contentsFieldName = contentField
}
} | 267 | false | true | 0 | 8 | 80 | 45 | 28 | 17 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.Generic.New.hs | bsd-3-clause | unsafeSlice i n m = apply (MVector.unsafeSlice i n) m | 53 | unsafeSlice i n m = apply (MVector.unsafeSlice i n) m | 53 | unsafeSlice i n m = apply (MVector.unsafeSlice i n) m | 53 | false | false | 0 | 8 | 9 | 28 | 13 | 15 | null | null |
ekr/tamarin-prover | lib/term/src/Term/Builtin/Convenience.hs | gpl-3.0 | lv9 = LVar "v9" LSortMsg 0 | 26 | lv9 = LVar "v9" LSortMsg 0 | 26 | lv9 = LVar "v9" LSortMsg 0 | 26 | false | false | 1 | 5 | 5 | 17 | 6 | 11 | null | null |
Mathnerd314/lamdu | src/Lamdu/CodeEdit/ExpressionEdit/BuiltinEdit.hs | gpl-3.0 | builtinFDConfig :: FocusDelegator.Config
builtinFDConfig = FocusDelegator.Config
{ FocusDelegator.startDelegatingKeys = [E.ModKey E.noMods E.KeyEnter]
, FocusDelegator.startDelegatingDoc = E.Doc ["Edit", "Change imported name"]
, FocusDelegator.stopDelegatingKeys = [E.ModKey E.noMods E.KeyEsc]
, FocusDelegator.... | 380 | builtinFDConfig :: FocusDelegator.Config
builtinFDConfig = FocusDelegator.Config
{ FocusDelegator.startDelegatingKeys = [E.ModKey E.noMods E.KeyEnter]
, FocusDelegator.startDelegatingDoc = E.Doc ["Edit", "Change imported name"]
, FocusDelegator.stopDelegatingKeys = [E.ModKey E.noMods E.KeyEsc]
, FocusDelegator.... | 380 | builtinFDConfig = FocusDelegator.Config
{ FocusDelegator.startDelegatingKeys = [E.ModKey E.noMods E.KeyEnter]
, FocusDelegator.startDelegatingDoc = E.Doc ["Edit", "Change imported name"]
, FocusDelegator.stopDelegatingKeys = [E.ModKey E.noMods E.KeyEsc]
, FocusDelegator.stopDelegatingDoc = E.Doc ["Edit", "Stop ... | 339 | false | true | 0 | 10 | 44 | 103 | 56 | 47 | null | null |
haskell-streaming/streaming | benchmarks/old/benchmarks.hs | bsd-3-clause | gooo :: Int -> Int
gooo = runIdentity . N.sum . N.take 1000 . forever . (\a -> Construct (a :> Done ())) | 104 | gooo :: Int -> Int
gooo = runIdentity . N.sum . N.take 1000 . forever . (\a -> Construct (a :> Done ())) | 104 | gooo = runIdentity . N.sum . N.take 1000 . forever . (\a -> Construct (a :> Done ())) | 85 | false | true | 0 | 13 | 22 | 68 | 32 | 36 | null | null |
mgold/Elm | src/Parse/Helpers.hs | bsd-3-clause | spaceyPrefixBy :: IParser sep -> IParser a -> IParser [a]
spaceyPrefixBy sep parser =
many (commitIf (whitespace >> sep) (padded sep >> parser)) | 146 | spaceyPrefixBy :: IParser sep -> IParser a -> IParser [a]
spaceyPrefixBy sep parser =
many (commitIf (whitespace >> sep) (padded sep >> parser)) | 146 | spaceyPrefixBy sep parser =
many (commitIf (whitespace >> sep) (padded sep >> parser)) | 88 | false | true | 0 | 10 | 24 | 69 | 32 | 37 | null | null |
ForestPhoenix/FPSurvey | Query/Types.hs | mit | isOther _ = False | 17 | isOther _ = False | 17 | isOther _ = False | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-sheets/gen/Network/Google/Resource/Sheets/Spreadsheets/Values/Update.hs | mpl-2.0 | -- | Determines how dates, times, and durations in the response should be
-- rendered. This is ignored if response_value_render_option is
-- FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.
svuResponseDateTimeRenderOption :: Lens' SpreadsheetsValuesUpdate (Maybe SpreadsheetsValuesUpdateResponseDate... | 468 | svuResponseDateTimeRenderOption :: Lens' SpreadsheetsValuesUpdate (Maybe SpreadsheetsValuesUpdateResponseDateTimeRenderOption)
svuResponseDateTimeRenderOption
= lens _svuResponseDateTimeRenderOption
(\ s a -> s{_svuResponseDateTimeRenderOption = a}) | 257 | svuResponseDateTimeRenderOption
= lens _svuResponseDateTimeRenderOption
(\ s a -> s{_svuResponseDateTimeRenderOption = a}) | 130 | true | true | 0 | 8 | 54 | 51 | 27 | 24 | null | null |
mietek/stack | src/Stack/Constants.hs | bsd-3-clause | -- | Relative location of build artifacts.
distRelativeDir :: (MonadThrow m, MonadReader env m, HasPlatform env)
=> PackageIdentifier -- ^ Cabal version
-> m (Path Rel Dir)
distRelativeDir cabalPkgVer = do
platform <- platformRelDir
cabal <- parseRelDir $ "Cabal-" ++
... | 737 | distRelativeDir :: (MonadThrow m, MonadReader env m, HasPlatform env)
=> PackageIdentifier -- ^ Cabal version
-> m (Path Rel Dir)
distRelativeDir cabalPkgVer = do
platform <- platformRelDir
cabal <- parseRelDir $ "Cabal-" ++
versionString (packageIdentifierVersion ca... | 694 | distRelativeDir cabalPkgVer = do
platform <- platformRelDir
cabal <- parseRelDir $ "Cabal-" ++
versionString (packageIdentifierVersion cabalPkgVer)
return $ $(mkRelDir "dist-stack/") </> platform </> cabal
-- pkgIndexDir :: Config -> Path Abs Dir
-- pkgIndexDir config =
-- configStackRoot co... | 532 | true | true | 0 | 12 | 167 | 116 | 61 | 55 | null | null |
maoe/ordrea-gtk | src/FRP/Ordrea/Gtk.hs | bsd-3-clause | performGtkAsync :: Event (IO ()) -> SignalGen (Event ())
performGtkAsync = perform postGUIAsync | 95 | performGtkAsync :: Event (IO ()) -> SignalGen (Event ())
performGtkAsync = perform postGUIAsync | 95 | performGtkAsync = perform postGUIAsync | 38 | false | true | 0 | 9 | 12 | 40 | 19 | 21 | null | null |
harendra-kumar/stack | src/Stack/Solver.hs | bsd-3-clause | -- | Perform some basic checks on a list of cabal files to be used for creating
-- stack config. It checks for duplicate package names, package name and
-- cabal file name mismatch and reports any issues related to those.
--
-- If no error occurs it returns filepath and @GenericPackageDescription@s
-- pairs as well as ... | 3,141 | cabalPackagesCheck
:: ( MonadBaseControl IO m, MonadIO m, MonadLogger m, MonadMask m
, MonadReader env m, HasConfig env , HasGHCVariant env
, HasHttpManager env , HasLogLevel env , HasReExec env
, HasTerminal env)
=> [Path Abs File]
-> String
-> Maybe String
-> m ( Map Packa... | 2,754 | cabalPackagesCheck cabalfps noPkgMsg dupErrMsg = do
when (null cabalfps) $
error noPkgMsg
relpaths <- mapM makeRelativeToCurrentDir cabalfps
$logInfo $ "Using cabal packages:"
$logInfo $ T.pack (formatGroup relpaths)
(warnings, gpds) <- fmap unzip (mapM readPackageUnresolved cabalfps)
... | 2,353 | true | true | 0 | 17 | 888 | 689 | 343 | 346 | null | null |
vTurbine/ghc | compiler/cmm/CmmNode.hs | bsd-3-clause | mapForeignTarget :: (CmmExpr -> CmmExpr) -> ForeignTarget -> ForeignTarget
mapForeignTarget exp (ForeignTarget e c) = ForeignTarget (exp e) c | 143 | mapForeignTarget :: (CmmExpr -> CmmExpr) -> ForeignTarget -> ForeignTarget
mapForeignTarget exp (ForeignTarget e c) = ForeignTarget (exp e) c | 143 | mapForeignTarget exp (ForeignTarget e c) = ForeignTarget (exp e) c | 68 | false | true | 0 | 7 | 20 | 50 | 25 | 25 | null | null |
christiaanb/clash-compiler | clash-lib/src/CLaSH/Netlist/Id.hs | bsd-2-clause | countCommas :: Int -> UserString -> (Int,UserString)
countCommas n (uncons -> Just (',',cs)) = countCommas (n+1) cs | 115 | countCommas :: Int -> UserString -> (Int,UserString)
countCommas n (uncons -> Just (',',cs)) = countCommas (n+1) cs | 115 | countCommas n (uncons -> Just (',',cs)) = countCommas (n+1) cs | 62 | false | true | 0 | 9 | 16 | 58 | 31 | 27 | null | null |
markflorisson/hpack | testrepo/bytestring-0.10.2.0/Data/ByteString/Lazy.hs | bsd-3-clause | illegalBufferSize :: Handle -> String -> Int -> IO a
illegalBufferSize handle fn sz =
ioError (mkIOError illegalOperationErrorType msg (Just handle) Nothing)
--TODO: System.IO uses InvalidArgument here, but it's not exported :-(
where
msg = fn ++ ": illegal ByteString size " ++ showsPrec 9 sz []
-- |... | 627 | illegalBufferSize :: Handle -> String -> Int -> IO a
illegalBufferSize handle fn sz =
ioError (mkIOError illegalOperationErrorType msg (Just handle) Nothing)
--TODO: System.IO uses InvalidArgument here, but it's not exported :-(
where
msg = fn ++ ": illegal ByteString size " ++ showsPrec 9 sz []
-- |... | 627 | illegalBufferSize handle fn sz =
ioError (mkIOError illegalOperationErrorType msg (Just handle) Nothing)
--TODO: System.IO uses InvalidArgument here, but it's not exported :-(
where
msg = fn ++ ": illegal ByteString size " ++ showsPrec 9 sz []
-- | Read entire handle contents /lazily/ into a 'ByteStr... | 574 | false | true | 0 | 9 | 117 | 89 | 48 | 41 | null | null |
dbp/positionsites | src/State/Page.hs | bsd-3-clause | newPage :: Page -> AppHandler (Maybe Int)
newPage (Page _ si fl st bd) = idQuery "insert into pages (site_id, flat, structured, body) values (?,?,?,?) returning id" (si, fl, st, bd) | 181 | newPage :: Page -> AppHandler (Maybe Int)
newPage (Page _ si fl st bd) = idQuery "insert into pages (site_id, flat, structured, body) values (?,?,?,?) returning id" (si, fl, st, bd) | 181 | newPage (Page _ si fl st bd) = idQuery "insert into pages (site_id, flat, structured, body) values (?,?,?,?) returning id" (si, fl, st, bd) | 139 | false | true | 0 | 9 | 30 | 62 | 31 | 31 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.