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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ezyang/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | mkConstraintTupleStr 1 = "Unit%" | 33 | mkConstraintTupleStr 1 = "Unit%" | 33 | mkConstraintTupleStr 1 = "Unit%" | 33 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
arnizamani/OccamStar | Haskell.hs | gpl-2.0 | getSubExpRhs (HsGuardedRhss es) = concatMap (\(HsGuardedRhs _ e1 e2) -> getSubExp e1 ++ getSubExp e2) es | 104 | getSubExpRhs (HsGuardedRhss es) = concatMap (\(HsGuardedRhs _ e1 e2) -> getSubExp e1 ++ getSubExp e2) es | 104 | getSubExpRhs (HsGuardedRhss es) = concatMap (\(HsGuardedRhs _ e1 e2) -> getSubExp e1 ++ getSubExp e2) es | 104 | false | false | 0 | 9 | 15 | 48 | 23 | 25 | null | null |
ucsd-progsys/nanomaly | src/NanoML/Step.hs | bsd-3-clause | findRoot :: (?callStack :: CallStack) => Graph -> Node -> Graph.Node
findRoot gr e = case lookup e . map (\(a,b) -> (b,a)) $ Graph.labNodes gr of
Just n -> n
Nothing -> trace (printf "findRoot: couldn't find: %s" (show e)) 0
-- findRoot gr e = do
-- en <- makeStableName =<< evaluate e
-- let p (n,x) = do xn <- ... | 831 | findRoot :: (?callStack :: CallStack) => Graph -> Node -> Graph.Node
findRoot gr e = case lookup e . map (\(a,b) -> (b,a)) $ Graph.labNodes gr of
Just n -> n
Nothing -> trace (printf "findRoot: couldn't find: %s" (show e)) 0
-- findRoot gr e = do
-- en <- makeStableName =<< evaluate e
-- let p (n,x) = do xn <- ... | 831 | findRoot gr e = case lookup e . map (\(a,b) -> (b,a)) $ Graph.labNodes gr of
Just n -> n
Nothing -> trace (printf "findRoot: couldn't find: %s" (show e)) 0
-- findRoot gr e = do
-- en <- makeStableName =<< evaluate e
-- let p (n,x) = do xn <- makeStableName =<< evaluate x
-- return (xn == en)... | 762 | false | true | 4 | 11 | 202 | 127 | 72 | 55 | null | null |
0culus/SimpleJSON | src/Prettify.hs | mit | fits :: Int -> String -> Bool
w `fits` _ | w < 0 = False | 56 | fits :: Int -> String -> Bool
w `fits` _ | w < 0 = False | 56 | w `fits` _ | w < 0 = False | 26 | false | true | 0 | 8 | 15 | 41 | 19 | 22 | null | null |
vasily-kartashov/playground | euler/problem-037.hs | apache-2.0 | main =
print $ sum $ take 11 $ filter isTruncatablePrime primes | 65 | main =
print $ sum $ take 11 $ filter isTruncatablePrime primes | 65 | main =
print $ sum $ take 11 $ filter isTruncatablePrime primes | 65 | false | false | 0 | 7 | 13 | 26 | 12 | 14 | null | null |
zhiyuanshi/fcore | examples/case_studies/FOLogic.hs | bsd-2-clause | vars (Or l r) = vars l `Set.union` vars r | 47 | vars (Or l r) = vars l `Set.union` vars r | 47 | vars (Or l r) = vars l `Set.union` vars r | 47 | false | false | 0 | 6 | 15 | 32 | 15 | 17 | null | null |
ctford/Idris-Elba-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | simple_app :: Elab' aux () -> Elab' aux () -> String -> Elab' aux ()
simple_app fun arg appstr =
do a <- getNameFrom (sMN 0 "argTy")
b <- getNameFrom (sMN 0 "retTy")
f <- getNameFrom (sMN 0 "f")
s <- getNameFrom (sMN 0 "s")
claim a RType
claim b RType
claim f (RBind (sMN 0 ... | 1,161 | simple_app :: Elab' aux () -> Elab' aux () -> String -> Elab' aux ()
simple_app fun arg appstr =
do a <- getNameFrom (sMN 0 "argTy")
b <- getNameFrom (sMN 0 "retTy")
f <- getNameFrom (sMN 0 "f")
s <- getNameFrom (sMN 0 "s")
claim a RType
claim b RType
claim f (RBind (sMN 0 ... | 1,161 | simple_app fun arg appstr =
do a <- getNameFrom (sMN 0 "argTy")
b <- getNameFrom (sMN 0 "retTy")
f <- getNameFrom (sMN 0 "f")
s <- getNameFrom (sMN 0 "s")
claim a RType
claim b RType
claim f (RBind (sMN 0 "aX") (Pi (Var a)) (Var b))
tm <- get_term
start_unify ... | 1,092 | false | true | 0 | 13 | 383 | 387 | 175 | 212 | null | null |
dzamkov/Oedel | src/Graphics/Oedel/Terminal/Block.hs | mit | comps _ Dependent = Dependent | 29 | comps _ Dependent = Dependent | 29 | comps _ Dependent = Dependent | 29 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
nishiuramakoto/erasm-plusplus | src/haskell/PartialOrder.hs | gpl-3.0 | propPartialOrd ::Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
propPartialOrd le x y z = propReflexive le x &&
propTransitive le x y z &&
propAntiSymmetric le x y | 216 | propPartialOrd ::Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
propPartialOrd le x y z = propReflexive le x &&
propTransitive le x y z &&
propAntiSymmetric le x y | 216 | propPartialOrd le x y z = propReflexive le x &&
propTransitive le x y z &&
propAntiSymmetric le x y | 151 | false | true | 0 | 9 | 88 | 83 | 40 | 43 | null | null |
jystic/language-csharp | src/Language/CSharp/Parser.hs | bsd-3-clause | ------------------------------------------------------------------------
-- Types
localType :: P LocalType
localType = Type <$> type_
<|> var *> pure Var | 162 | localType :: P LocalType
localType = Type <$> type_
<|> var *> pure Var | 79 | localType = Type <$> type_
<|> var *> pure Var | 54 | true | true | 0 | 7 | 25 | 31 | 16 | 15 | null | null |
weshack/thelist | TheList/Handler/Offers.hs | gpl-3.0 | getAcceptOfferR :: OfferId -> Handler Value
getAcceptOfferR oId = do
logged_in <- requireAuthId
mOffer <- runDB $ get oId
case mOffer of
Just offer -> do
transaction <- runDB $ get404 (offerTransaction offer)
case ((transactionVendor transaction) == logged_in) of
True -> do... | 1,981 | getAcceptOfferR :: OfferId -> Handler Value
getAcceptOfferR oId = do
logged_in <- requireAuthId
mOffer <- runDB $ get oId
case mOffer of
Just offer -> do
transaction <- runDB $ get404 (offerTransaction offer)
case ((transactionVendor transaction) == logged_in) of
True -> do... | 1,981 | getAcceptOfferR oId = do
logged_in <- requireAuthId
mOffer <- runDB $ get oId
case mOffer of
Just offer -> do
transaction <- runDB $ get404 (offerTransaction offer)
case ((transactionVendor transaction) == logged_in) of
True -> do
(TOD currTime _) <- liftIO ... | 1,937 | false | true | 0 | 24 | 807 | 473 | 240 | 233 | null | null |
wfleming/advent-of-code-2016 | 2016/src/D10Lib.hs | bsd-3-clause | full _ = False | 14 | full _ = False | 14 | full _ = False | 14 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
adunning/pandoc-citeproc | src/Text/CSL/Pandoc.hs | bsd-3-clause | -- | Process a 'Pandoc' document by adding citations formatted
-- according to a CSL style. Add a bibliography (if one is called
-- for) at the end of the document.
processCites :: Style -> [Reference] -> Pandoc -> Pandoc
processCites style refs (Pandoc m1 b1) =
let metanocites = lookupMeta "nocite" m1
nocit... | 1,547 | processCites :: Style -> [Reference] -> Pandoc -> Pandoc
processCites style refs (Pandoc m1 b1) =
let metanocites = lookupMeta "nocite" m1
nocites = mkNociteWildcards refs . query getCitation <$> metanocites
Pandoc m2 b2 = evalState (walkM setHashes $ Pandoc (deleteMeta "nocite" m1) b1) 1
g... | 1,381 | processCites style refs (Pandoc m1 b1) =
let metanocites = lookupMeta "nocite" m1
nocites = mkNociteWildcards refs . query getCitation <$> metanocites
Pandoc m2 b2 = evalState (walkM setHashes $ Pandoc (deleteMeta "nocite" m1) b1) 1
grps = query getCitation (Pandoc m2 b2) ++ fromMa... | 1,324 | true | true | 0 | 16 | 513 | 427 | 206 | 221 | null | null |
facebookincubator/duckling | Duckling/Numeral/JA/Rules.hs | bsd-3-clause | ruleInteger15 :: Rule
ruleInteger15 = Rule
{ name = "integer (20000..90000)"
, pattern =
[ numberBetween 2 10
, regex "万"
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10000
_ -> Nothing
} | 277 | ruleInteger15 :: Rule
ruleInteger15 = Rule
{ name = "integer (20000..90000)"
, pattern =
[ numberBetween 2 10
, regex "万"
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10000
_ -> Nothing
} | 277 | ruleInteger15 = Rule
{ name = "integer (20000..90000)"
, pattern =
[ numberBetween 2 10
, regex "万"
]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData{TNumeral.value = v}:_) -> double $ v * 10000
_ -> Nothing
} | 255 | false | true | 0 | 17 | 76 | 107 | 55 | 52 | null | null |
olorin/amazonka | amazonka-iam/gen/Network/AWS/IAM/GenerateCredentialReport.hs | mpl-2.0 | -- | The response status code.
gcrrsResponseStatus :: Lens' GenerateCredentialReportResponse Int
gcrrsResponseStatus = lens _gcrrsResponseStatus (\ s a -> s{_gcrrsResponseStatus = a}) | 183 | gcrrsResponseStatus :: Lens' GenerateCredentialReportResponse Int
gcrrsResponseStatus = lens _gcrrsResponseStatus (\ s a -> s{_gcrrsResponseStatus = a}) | 152 | gcrrsResponseStatus = lens _gcrrsResponseStatus (\ s a -> s{_gcrrsResponseStatus = a}) | 86 | true | true | 1 | 9 | 21 | 43 | 22 | 21 | null | null |
sdiehl/ghc | compiler/basicTypes/DataCon.hs | bsd-3-clause | isTupleDataCon :: DataCon -> Bool
isTupleDataCon (MkData {dcRepTyCon = tc}) = isTupleTyCon tc | 93 | isTupleDataCon :: DataCon -> Bool
isTupleDataCon (MkData {dcRepTyCon = tc}) = isTupleTyCon tc | 93 | isTupleDataCon (MkData {dcRepTyCon = tc}) = isTupleTyCon tc | 59 | false | true | 0 | 9 | 12 | 33 | 17 | 16 | null | null |
avieth/postgresql-simple | src/Database/PostgreSQL/Simple.hs | bsd-3-clause | ellipsis :: ByteString -> ByteString
ellipsis bs
| B.length bs > 15 = B.take 10 bs `B.append` "[...]"
| otherwise = bs | 133 | ellipsis :: ByteString -> ByteString
ellipsis bs
| B.length bs > 15 = B.take 10 bs `B.append` "[...]"
| otherwise = bs | 133 | ellipsis bs
| B.length bs > 15 = B.take 10 bs `B.append` "[...]"
| otherwise = bs | 96 | false | true | 0 | 10 | 36 | 57 | 27 | 30 | null | null |
ozgurakgun/Idris-dev | src/IRTS/Compiler.hs | bsd-3-clause | irTerm top vs env (Constant TheWorld) = return LNothing | 55 | irTerm top vs env (Constant TheWorld) = return LNothing | 55 | irTerm top vs env (Constant TheWorld) = return LNothing | 55 | false | false | 0 | 7 | 8 | 25 | 11 | 14 | null | null |
ejlilley/AbstractMusic | LilyParse.hs | gpl-3.0 | fromLilyNoteName L_BES = "bes" | 32 | fromLilyNoteName L_BES = "bes" | 32 | fromLilyNoteName L_BES = "bes" | 32 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs | bsd-3-clause | gl_COLOR_ATTACHMENT8 :: GLenum
gl_COLOR_ATTACHMENT8 = 0x8CE8 | 60 | gl_COLOR_ATTACHMENT8 :: GLenum
gl_COLOR_ATTACHMENT8 = 0x8CE8 | 60 | gl_COLOR_ATTACHMENT8 = 0x8CE8 | 29 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
gridaphobe/ghc | compiler/types/OptCoercion.hs | bsd-3-clause | checkAxInstCo :: Coercion -> Maybe CoAxBranch
-- defined here to avoid dependencies in Coercion
-- If you edit this function, you may need to update the GHC formalism
-- See Note [GHC Formalism] in CoreLint
checkAxInstCo (AxiomInstCo ax ind cos)
= let branch = coAxiomNthBranch ax ind
tvs = coAx... | 1,330 | checkAxInstCo :: Coercion -> Maybe CoAxBranch
checkAxInstCo (AxiomInstCo ax ind cos)
= let branch = coAxiomNthBranch ax ind
tvs = coAxBranchTyVars branch
cvs = coAxBranchCoVars branch
incomps = coAxBranchIncomps branch
(tys, cotys) = splitAtList tvs (map (p... | 1,169 | checkAxInstCo (AxiomInstCo ax ind cos)
= let branch = coAxiomNthBranch ax ind
tvs = coAxBranchTyVars branch
cvs = coAxBranchCoVars branch
incomps = coAxBranchIncomps branch
(tys, cotys) = splitAtList tvs (map (pFst . coercionKind) cos)
co_args ... | 1,123 | true | true | 0 | 14 | 366 | 311 | 153 | 158 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | complementarily = id | 20 | complementarily = id | 20 | complementarily = id | 20 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
supki/wybor | src/TTY.hs | bsd-2-clause | moveCursor :: TTY -> Int -> Int -> IO ()
moveCursor = Ansi.hSetCursorPosition . outHandle | 89 | moveCursor :: TTY -> Int -> Int -> IO ()
moveCursor = Ansi.hSetCursorPosition . outHandle | 89 | moveCursor = Ansi.hSetCursorPosition . outHandle | 48 | false | true | 0 | 9 | 14 | 34 | 17 | 17 | null | null |
AngusP/NSFWbot | nsfwbot.hs | mit | thin :: Blame -> Blame
thin [] = [] | 35 | thin :: Blame -> Blame
thin [] = [] | 35 | thin [] = [] | 12 | false | true | 0 | 8 | 8 | 28 | 12 | 16 | null | null |
vikraman/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprMatchContextNoun RecUpd = text "record-update construct" | 68 | pprMatchContextNoun RecUpd = text "record-update construct" | 68 | pprMatchContextNoun RecUpd = text "record-update construct" | 68 | false | false | 0 | 5 | 14 | 12 | 5 | 7 | null | null |
synsem/texhs | test/Text/TeX/ParserSpec.hs | gpl-3.0 | testsAccents :: Test
testsAccents = testGroup "accents"
[ testCase "top-level diaeresis applied to single char" $
parseTeX "" (mkCtrlSeq "\"": mkString "ab")
@?=
[Plain "a\x0308", Plain "b"]
, testCase "top-level tilde applied to single char" $
parseTeX "" (mkCtrlSeq "~": mkString "ab")
@?=
... | 1,725 | testsAccents :: Test
testsAccents = testGroup "accents"
[ testCase "top-level diaeresis applied to single char" $
parseTeX "" (mkCtrlSeq "\"": mkString "ab")
@?=
[Plain "a\x0308", Plain "b"]
, testCase "top-level tilde applied to single char" $
parseTeX "" (mkCtrlSeq "~": mkString "ab")
@?=
... | 1,725 | testsAccents = testGroup "accents"
[ testCase "top-level diaeresis applied to single char" $
parseTeX "" (mkCtrlSeq "\"": mkString "ab")
@?=
[Plain "a\x0308", Plain "b"]
, testCase "top-level tilde applied to single char" $
parseTeX "" (mkCtrlSeq "~": mkString "ab")
@?=
[Plain "a\x0303", Pla... | 1,704 | false | true | 0 | 15 | 391 | 492 | 236 | 256 | null | null |
noschinl/cyp | src/Test/Info2/Cyp/Term.hs | mit | unparseLiteral (PrimInt _ c _) = show c | 39 | unparseLiteral (PrimInt _ c _) = show c | 39 | unparseLiteral (PrimInt _ c _) = show c | 39 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
eklavya/Idris-dev | src/Idris/Prover.hs | bsd-3-clause | proverFC = FC "(prover shell)" (0, 0) (0, 0) | 44 | proverFC = FC "(prover shell)" (0, 0) (0, 0) | 44 | proverFC = FC "(prover shell)" (0, 0) (0, 0) | 44 | false | false | 0 | 6 | 8 | 25 | 14 | 11 | null | null |
sdiehl/ghc | compiler/basicTypes/Literal.hs | bsd-3-clause | double2IntLit (LitDouble f) = mkLitIntUnchecked (truncate f) | 64 | double2IntLit (LitDouble f) = mkLitIntUnchecked (truncate f) | 64 | double2IntLit (LitDouble f) = mkLitIntUnchecked (truncate f) | 64 | false | false | 0 | 7 | 10 | 25 | 11 | 14 | null | null |
uduki/hsQt | Qtc/ClassTypes/Gui.hs | bsd-2-clause | qGraphicsSceneContextMenuEventAddFinalizer :: QGraphicsSceneContextMenuEvent a -> IO ()
qGraphicsSceneContextMenuEventAddFinalizer (Object fp)
= addForeignPtrFinalizer qtc_QGraphicsSceneContextMenuEvent_getFinalizer fp | 220 | qGraphicsSceneContextMenuEventAddFinalizer :: QGraphicsSceneContextMenuEvent a -> IO ()
qGraphicsSceneContextMenuEventAddFinalizer (Object fp)
= addForeignPtrFinalizer qtc_QGraphicsSceneContextMenuEvent_getFinalizer fp | 220 | qGraphicsSceneContextMenuEventAddFinalizer (Object fp)
= addForeignPtrFinalizer qtc_QGraphicsSceneContextMenuEvent_getFinalizer fp | 132 | false | true | 0 | 7 | 15 | 37 | 17 | 20 | null | null |
jcberentsen/causality | src/Likelyhood.hs | bsd-3-clause | toggle_alternative :: (Eq r, Eq name) => Evidence name r -> Alternatives name r -> Alternatives name r
toggle_alternative alt (Alternatives alts) = if elem alt alts then Alternatives (delete alt alts) else Alternatives $ alt:alts | 229 | toggle_alternative :: (Eq r, Eq name) => Evidence name r -> Alternatives name r -> Alternatives name r
toggle_alternative alt (Alternatives alts) = if elem alt alts then Alternatives (delete alt alts) else Alternatives $ alt:alts | 229 | toggle_alternative alt (Alternatives alts) = if elem alt alts then Alternatives (delete alt alts) else Alternatives $ alt:alts | 126 | false | true | 0 | 8 | 35 | 97 | 46 | 51 | null | null |
glguy/tt-ratings | DataStore.hs | bsd-3-clause | getEventIdByMatchId :: HasSqlite m => MatchId -> m (Maybe EventId)
getEventIdByMatchId matchId = do
do xs <- query "SELECT eventId FROM match WHERE matchId = ?" (Only matchId)
return $! case xs of
[] -> Nothing
Only x:_ -> Just x | 256 | getEventIdByMatchId :: HasSqlite m => MatchId -> m (Maybe EventId)
getEventIdByMatchId matchId = do
do xs <- query "SELECT eventId FROM match WHERE matchId = ?" (Only matchId)
return $! case xs of
[] -> Nothing
Only x:_ -> Just x | 256 | getEventIdByMatchId matchId = do
do xs <- query "SELECT eventId FROM match WHERE matchId = ?" (Only matchId)
return $! case xs of
[] -> Nothing
Only x:_ -> Just x | 189 | false | true | 0 | 14 | 67 | 90 | 41 | 49 | null | null |
dorchard/unfix | Language/Haskell/Unfix.hs | bsd-2-clause | unfixType t = AppT (AppT ArrowT t) t | 61 | unfixType t = AppT (AppT ArrowT t) t | 61 | unfixType t = AppT (AppT ArrowT t) t | 61 | false | false | 0 | 7 | 32 | 22 | 10 | 12 | null | null |
mattias-lundell/timber-llvm | src/Common.hs | bsd-3-clause | zipFilter (f:fs) (x:xs)
| f = x : zipFilter fs xs
| otherwise = zipFilter fs xs | 127 | zipFilter (f:fs) (x:xs)
| f = x : zipFilter fs xs
| otherwise = zipFilter fs xs | 127 | zipFilter (f:fs) (x:xs)
| f = x : zipFilter fs xs
| otherwise = zipFilter fs xs | 127 | false | false | 1 | 7 | 64 | 52 | 25 | 27 | null | null |
jsgf/gloop | Settings.hs | bsd-2-clause | -- | Your application will keep a connection pool and take connections from
-- there as necessary instead of continually creating new connections. This
-- value gives the maximum number of connections to be open at a given time.
-- If your application requests a connection when all connections are in
-- use, that reque... | 714 | connectionCount :: Int
connectionCount = 10 | 43 | connectionCount = 10 | 20 | true | true | 0 | 6 | 122 | 29 | 18 | 11 | null | null |
ekmett/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getRegister' _ is32Bit (CmmMachOp (MO_SS_Conv W64 W32)
[CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]])
| is32Bit = do
ChildCode64 code rlo <- iselExpr64 x
return $ Fixed II32 (getHiVRegFromLo rlo) code | 232 | getRegister' _ is32Bit (CmmMachOp (MO_SS_Conv W64 W32)
[CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]])
| is32Bit = do
ChildCode64 code rlo <- iselExpr64 x
return $ Fixed II32 (getHiVRegFromLo rlo) code | 232 | getRegister' _ is32Bit (CmmMachOp (MO_SS_Conv W64 W32)
[CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]])
| is32Bit = do
ChildCode64 code rlo <- iselExpr64 x
return $ Fixed II32 (getHiVRegFromLo rlo) code | 232 | false | false | 1 | 12 | 56 | 105 | 47 | 58 | null | null |
spinda/liquidhaskell | tests/gsoc15/unknown/pos/RBTree.hs | bsd-3-clause | where
(_, t) = deleteMin' x l r | 50 | where
(_, t) = deleteMin' x l r | 50 | where
(_, t) = deleteMin' x l r | 50 | false | false | 0 | 5 | 26 | 23 | 11 | 12 | null | null |
alexisVallet/deep-banana | src/DeepBanana/Layer/CUDA/Numeric.hs | bsd-3-clause | scale :: (Device d, MonadCudaError m, Shape s, TensorScalar a)
=> Layer m a '[] (a, Tensor d s a) (Tensor d s a)
scale = combinePasses' fwdscale bwdscale
where fwdscale (x,y) = return $ liftFixed1 (x *^) y
bwdscale (x,y) _ = return $ \upgrad -> unsafeRunCudaError $ do
case toAnyFixed $ shape y... | 651 | scale :: (Device d, MonadCudaError m, Shape s, TensorScalar a)
=> Layer m a '[] (a, Tensor d s a) (Tensor d s a)
scale = combinePasses' fwdscale bwdscale
where fwdscale (x,y) = return $ liftFixed1 (x *^) y
bwdscale (x,y) _ = return $ \upgrad -> unsafeRunCudaError $ do
case toAnyFixed $ shape y... | 651 | scale = combinePasses' fwdscale bwdscale
where fwdscale (x,y) = return $ liftFixed1 (x *^) y
bwdscale (x,y) _ = return $ \upgrad -> unsafeRunCudaError $ do
case toAnyFixed $ shape y of
AnyFixed fshp -> do
fy <- shapeConvert fshp y
fdy <- shapeConvert fshp upgrad
... | 532 | false | true | 0 | 23 | 215 | 267 | 127 | 140 | null | null |
onponomarev/ganeti | src/Ganeti/Query/Filter.hs | bsd-2-clause | makeSimpleFilter namefield vals =
OrFilter $ map (EQFilter namefield . either QuotedString NumericValue) vals | 111 | makeSimpleFilter namefield vals =
OrFilter $ map (EQFilter namefield . either QuotedString NumericValue) vals | 111 | makeSimpleFilter namefield vals =
OrFilter $ map (EQFilter namefield . either QuotedString NumericValue) vals | 111 | false | false | 0 | 9 | 15 | 35 | 16 | 19 | null | null |
bgw/hs-rpal | src/Evaluator/Environment.hs | gpl-3.0 | environmentLookup (Environment (AstIdentifier key) value next)
(AstIdentifier query) =
if query == key then
value
else
environmentLookup next (AstIdentifier query) | 205 | environmentLookup (Environment (AstIdentifier key) value next)
(AstIdentifier query) =
if query == key then
value
else
environmentLookup next (AstIdentifier query) | 205 | environmentLookup (Environment (AstIdentifier key) value next)
(AstIdentifier query) =
if query == key then
value
else
environmentLookup next (AstIdentifier query) | 205 | false | false | 0 | 9 | 61 | 56 | 28 | 28 | null | null |
mihaimaruseac/statistics | Statistics/Distribution/Poisson/Internal.hs | bsd-2-clause | upperCoefficients12 :: [Double]
upperCoefficients12 = [1/12, 1/24, 19/360, 863/2520, 1375/1008,
33953/5040, 57281/1440, 3250433/11880,
378351/176, -37521922090657/720720,
-612415657466657/131040, -3476857538815223/65520,
-243882... | 542 | upperCoefficients12 :: [Double]
upperCoefficients12 = [1/12, 1/24, 19/360, 863/2520, 1375/1008,
33953/5040, 57281/1440, 3250433/11880,
378351/176, -37521922090657/720720,
-612415657466657/131040, -3476857538815223/65520,
-243882... | 542 | upperCoefficients12 = [1/12, 1/24, 19/360, 863/2520, 1375/1008,
33953/5040, 57281/1440, 3250433/11880,
378351/176, -37521922090657/720720,
-612415657466657/131040, -3476857538815223/65520,
-243882174660761/1440, -341607967279006... | 510 | false | true | 0 | 7 | 185 | 176 | 99 | 77 | null | null |
kmate/HaRe | old/testing/subIntroPattern/InfixIn3_TokOut.hs | bsd-3-clause | j :: Int -> Try -> [Int]
j v x@(C1 b_1@(C2 b_2)) = [] | 53 | j :: Int -> Try -> [Int]
j v x@(C1 b_1@(C2 b_2)) = [] | 53 | j v x@(C1 b_1@(C2 b_2)) = [] | 28 | false | true | 0 | 10 | 13 | 53 | 26 | 27 | null | null |
rrnewton/accelerate | Data/Array/Accelerate/Trafo/Vectorise.hs | bsd-3-clause | enumSegLinear :: forall sh. Shape sh => S.Acc (Segments sh) -> S.Acc (Vector Int)
enumSegLinear segs = enum_s
where
sizes = S.map S.shapeSize segs
ones = S.fill (S.shape segs) (1 :: S.Exp Int)
ones_s = replicateSeg segs ones
enum_s = S.afst $ S.scanl'Seg (+) 0 ones_s sizes | 291 | enumSegLinear :: forall sh. Shape sh => S.Acc (Segments sh) -> S.Acc (Vector Int)
enumSegLinear segs = enum_s
where
sizes = S.map S.shapeSize segs
ones = S.fill (S.shape segs) (1 :: S.Exp Int)
ones_s = replicateSeg segs ones
enum_s = S.afst $ S.scanl'Seg (+) 0 ones_s sizes | 291 | enumSegLinear segs = enum_s
where
sizes = S.map S.shapeSize segs
ones = S.fill (S.shape segs) (1 :: S.Exp Int)
ones_s = replicateSeg segs ones
enum_s = S.afst $ S.scanl'Seg (+) 0 ones_s sizes | 209 | false | true | 0 | 10 | 64 | 134 | 67 | 67 | null | null |
li-zhirui/EoplLangs | src/InferredLang/TypeChecker.hs | bsd-3-clause | liftTry :: TypeTry a -> TypeStateTry a
liftTry (Left err) = throwError err | 75 | liftTry :: TypeTry a -> TypeStateTry a
liftTry (Left err) = throwError err | 75 | liftTry (Left err) = throwError err | 36 | false | true | 0 | 9 | 13 | 38 | 16 | 22 | null | null |
deepakjois/hs-logo | src/Diagrams/TwoD/Path/Turtle/Internal.hs | bsd-3-clause | -- * Helper functions
-- Makes a "TurtlePath" from a "Turtle"’s @currTrail@ field
makeTurtlePath :: TurtleState
-> Located (Trail R2)
-> TurtlePath
makeTurtlePath t tr = TurtlePath (currPenStyle t) tr | 231 | makeTurtlePath :: TurtleState
-> Located (Trail R2)
-> TurtlePath
makeTurtlePath t tr = TurtlePath (currPenStyle t) tr | 148 | makeTurtlePath t tr = TurtlePath (currPenStyle t) tr | 52 | true | true | 0 | 9 | 60 | 46 | 23 | 23 | null | null |
bitemyapp/bloodhound | tests/Test/Highlights.hs | bsd-3-clause | initHighlights :: Text -> BH IO (Either EsError (Maybe HitHighlight))
initHighlights fieldName = do
_ <- insertData
_ <- insertOther
let query = QueryMatchQuery $ mkMatchQuery (FieldName fieldName) (QueryString "haskell")
let testHighlight = Highlights Nothing [FieldHighlight (FieldName fieldName) Nothing]
le... | 405 | initHighlights :: Text -> BH IO (Either EsError (Maybe HitHighlight))
initHighlights fieldName = do
_ <- insertData
_ <- insertOther
let query = QueryMatchQuery $ mkMatchQuery (FieldName fieldName) (QueryString "haskell")
let testHighlight = Highlights Nothing [FieldHighlight (FieldName fieldName) Nothing]
le... | 405 | initHighlights fieldName = do
_ <- insertData
_ <- insertOther
let query = QueryMatchQuery $ mkMatchQuery (FieldName fieldName) (QueryString "haskell")
let testHighlight = Highlights Nothing [FieldHighlight (FieldName fieldName) Nothing]
let search = mkHighlightSearch (Just query) testHighlight
searchTweetH... | 335 | false | true | 0 | 14 | 59 | 135 | 62 | 73 | null | null |
oldmanmike/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | mkSelectorEntryLabel :: Bool -> Int -> CLabel
mkSelectorInfoLabel upd off = RtsLabel (RtsSelectorInfoTable upd off) | 119 | mkSelectorEntryLabel :: Bool -> Int -> CLabel
mkSelectorInfoLabel upd off = RtsLabel (RtsSelectorInfoTable upd off) | 119 | mkSelectorInfoLabel upd off = RtsLabel (RtsSelectorInfoTable upd off) | 73 | false | true | 0 | 7 | 18 | 35 | 17 | 18 | null | null |
brendanhay/gogol | gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs | mpl-2.0 | -- | The last known proposal revision number.
aProposalRevisionNumber :: Lens' AddOrderDealsRequest (Maybe Int64)
aProposalRevisionNumber
= lens _aProposalRevisionNumber
(\ s a -> s{_aProposalRevisionNumber = a})
. mapping _Coerce | 244 | aProposalRevisionNumber :: Lens' AddOrderDealsRequest (Maybe Int64)
aProposalRevisionNumber
= lens _aProposalRevisionNumber
(\ s a -> s{_aProposalRevisionNumber = a})
. mapping _Coerce | 198 | aProposalRevisionNumber
= lens _aProposalRevisionNumber
(\ s a -> s{_aProposalRevisionNumber = a})
. mapping _Coerce | 130 | true | true | 2 | 8 | 41 | 59 | 28 | 31 | null | null |
bkoropoff/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | inferCon = sMN 0 "__infer" | 27 | inferCon = sMN 0 "__infer" | 27 | inferCon = sMN 0 "__infer" | 27 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
ctford/Idris-Elba-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | declared (PRecord _ _ _ n _ _ c _) = [n, c] | 43 | declared (PRecord _ _ _ n _ _ c _) = [n, c] | 43 | declared (PRecord _ _ _ n _ _ c _) = [n, c] | 43 | false | false | 0 | 7 | 12 | 35 | 18 | 17 | null | null |
Teaspot-Studio/Urho3D-Haskell | src/Graphics/Urho3D/Input/InputConstants.hs | mit | keyKPPower :: Int
keyKPPower = fromIntegral $ [C.pure| int {KEY_KP_POWER} |] | 76 | keyKPPower :: Int
keyKPPower = fromIntegral $ [C.pure| int {KEY_KP_POWER} |] | 76 | keyKPPower = fromIntegral $ [C.pure| int {KEY_KP_POWER} |] | 58 | false | true | 0 | 6 | 10 | 21 | 13 | 8 | null | null |
gnn/Hets | Common/Keywords.hs | gpl-2.0 | interpretationS :: String
interpretationS = "interpretation" | 60 | interpretationS :: String
interpretationS = "interpretation" | 60 | interpretationS = "interpretation" | 34 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
brendanhay/gogol | gogol-toolresults/gen/Network/Google/ToolResults/Types/Product.hs | mpl-2.0 | -- | The total number of in-app purchases flows explored: how many times the
-- robo tries to buy a SKU.
iapfInAppPurchasesFlowsExplored :: Lens' InAppPurchasesFound (Maybe Int32)
iapfInAppPurchasesFlowsExplored
= lens _iapfInAppPurchasesFlowsExplored
(\ s a -> s{_iapfInAppPurchasesFlowsExplored = a})
. m... | 334 | iapfInAppPurchasesFlowsExplored :: Lens' InAppPurchasesFound (Maybe Int32)
iapfInAppPurchasesFlowsExplored
= lens _iapfInAppPurchasesFlowsExplored
(\ s a -> s{_iapfInAppPurchasesFlowsExplored = a})
. mapping _Coerce | 229 | iapfInAppPurchasesFlowsExplored
= lens _iapfInAppPurchasesFlowsExplored
(\ s a -> s{_iapfInAppPurchasesFlowsExplored = a})
. mapping _Coerce | 154 | true | true | 1 | 8 | 54 | 59 | 29 | 30 | null | null |
sellerlabs/monad-metrics | src/Control/Monad/Metrics/Internal.hs | mit | sToHour = sToMin . sToMin | 25 | sToHour = sToMin . sToMin | 25 | sToHour = sToMin . sToMin | 25 | false | false | 1 | 5 | 4 | 13 | 5 | 8 | null | null |
bergey/plots | src/Plots/Types/Ribbon.hs | bsd-3-clause | addtofst :: Double -> [Double] -> [Double]
addtofst a (x:xs) = (a+x):xs | 71 | addtofst :: Double -> [Double] -> [Double]
addtofst a (x:xs) = (a+x):xs | 71 | addtofst a (x:xs) = (a+x):xs | 28 | false | true | 0 | 7 | 11 | 48 | 26 | 22 | null | null |
lamefun/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | lookupAnySubdoc :: (Eq name1) =>
name1 -> [(name1, DocForDecl name2)] -> DocForDecl name2
lookupAnySubdoc n subdocs = case lookup n subdocs of
Nothing -> noDocForDecl
Just docs -> docs
-------------------------------------------------------------------------------
-- * Data & newtype declaratio... | 402 | lookupAnySubdoc :: (Eq name1) =>
name1 -> [(name1, DocForDecl name2)] -> DocForDecl name2
lookupAnySubdoc n subdocs = case lookup n subdocs of
Nothing -> noDocForDecl
Just docs -> docs
-------------------------------------------------------------------------------
-- * Data & newtype declaratio... | 402 | lookupAnySubdoc n subdocs = case lookup n subdocs of
Nothing -> noDocForDecl
Just docs -> docs
-------------------------------------------------------------------------------
-- * Data & newtype declarations
------------------------------------------------------------------------------- | 293 | false | true | 3 | 10 | 61 | 77 | 39 | 38 | null | null |
RefactoringTools/HaRe | src/Language/Haskell/Refact/Utils/ExactPrint.hs | bsd-3-clause | --This just pulls out the successful result from an exact print parser or throws an error if the parse was unsuccessful.
handleParseResult :: String -> Either (GHC.SrcSpan, String) (Anns, a) -> RefactGhc (Anns, a)
handleParseResult msg e = case e of
(Left (_, errStr)) -> error $ "The parse from: " ++ msg ++ " with er... | 490 | handleParseResult :: String -> Either (GHC.SrcSpan, String) (Anns, a) -> RefactGhc (Anns, a)
handleParseResult msg e = case e of
(Left (_, errStr)) -> error $ "The parse from: " ++ msg ++ " with error: " ++ errStr
(Right res) -> return res
-- This creates an empty annotation for every located item where an annotat... | 369 | handleParseResult msg e = case e of
(Left (_, errStr)) -> error $ "The parse from: " ++ msg ++ " with error: " ++ errStr
(Right res) -> return res
-- This creates an empty annotation for every located item where an annotation does not already exist in the given AST chunk | 276 | true | true | 0 | 11 | 91 | 107 | 57 | 50 | null | null |
rickynils/pvd | Pvd.hs | bsd-3-clause | options =
[ Option "h" ["help"] (NoArg Help) "print this help text"
, Option "p" ["port"] (ReqArg Port "PORT") "photo viewer daemon port"
, Option "c" ["cache"] (ReqArg (CacheSize . read) "SIZE") "photo cache size"
, Option "l" ["playlist"] (ReqArg Playlist "PLAYLIST") "playlist file"
] | 297 | options =
[ Option "h" ["help"] (NoArg Help) "print this help text"
, Option "p" ["port"] (ReqArg Port "PORT") "photo viewer daemon port"
, Option "c" ["cache"] (ReqArg (CacheSize . read) "SIZE") "photo cache size"
, Option "l" ["playlist"] (ReqArg Playlist "PLAYLIST") "playlist file"
] | 297 | options =
[ Option "h" ["help"] (NoArg Help) "print this help text"
, Option "p" ["port"] (ReqArg Port "PORT") "photo viewer daemon port"
, Option "c" ["cache"] (ReqArg (CacheSize . read) "SIZE") "photo cache size"
, Option "l" ["playlist"] (ReqArg Playlist "PLAYLIST") "playlist file"
] | 297 | false | false | 1 | 11 | 54 | 107 | 54 | 53 | null | null |
Toxaris/pandoc-lit | src/Text/Pandoc/Lit.hs | bsd-3-clause | processBiblatex :: Command -> Command
processBiblatex (Transform config)
= Transform (config {configCiteMethod = Biblatex}) | 125 | processBiblatex :: Command -> Command
processBiblatex (Transform config)
= Transform (config {configCiteMethod = Biblatex}) | 125 | processBiblatex (Transform config)
= Transform (config {configCiteMethod = Biblatex}) | 87 | false | true | 0 | 9 | 15 | 44 | 21 | 23 | null | null |
ben-schulz/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyTTApp :: Name -> [Term] -> ElabD Term
reifyTTApp t [nt, n, x]
| t == reflm "P" = do nt' <- reifyTTNameType nt
n' <- reifyTTName n
x' <- reifyTT x
return $ P nt' n' x' | 283 | reifyTTApp :: Name -> [Term] -> ElabD Term
reifyTTApp t [nt, n, x]
| t == reflm "P" = do nt' <- reifyTTNameType nt
n' <- reifyTTName n
x' <- reifyTT x
return $ P nt' n' x' | 283 | reifyTTApp t [nt, n, x]
| t == reflm "P" = do nt' <- reifyTTNameType nt
n' <- reifyTTName n
x' <- reifyTT x
return $ P nt' n' x' | 240 | false | true | 0 | 9 | 149 | 96 | 44 | 52 | null | null |
dehun/bce | src/Bce/Miner.hs | mit | coinbaseTransaction :: Db.Db -> PubKey -> Set.Set Transaction -> IO Transaction
coinbaseTransaction db ownerKey txs = do
Just maxReward <- Db.maxCoinbaseReward db (Set.toList txs)
return $ CoinbaseTransaction $ Set.fromList [TxOutput maxReward ownerKey] | 261 | coinbaseTransaction :: Db.Db -> PubKey -> Set.Set Transaction -> IO Transaction
coinbaseTransaction db ownerKey txs = do
Just maxReward <- Db.maxCoinbaseReward db (Set.toList txs)
return $ CoinbaseTransaction $ Set.fromList [TxOutput maxReward ownerKey] | 261 | coinbaseTransaction db ownerKey txs = do
Just maxReward <- Db.maxCoinbaseReward db (Set.toList txs)
return $ CoinbaseTransaction $ Set.fromList [TxOutput maxReward ownerKey] | 181 | false | true | 0 | 11 | 39 | 89 | 41 | 48 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/PreProcess.hs | bsd-3-clause | ppCpp :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppCpp = ppCpp' [] | 70 | ppCpp :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppCpp = ppCpp' [] | 70 | ppCpp = ppCpp' [] | 17 | false | true | 0 | 8 | 10 | 30 | 13 | 17 | null | null |
bitrauser/aoc | src/AOC2015/Day22.hs | bsd-3-clause | effectPoison :: Effect
effectPoison (attacker, defender) =
case statsType attacker of
NPC -> (applyDamage 3 attacker, defender)
PC -> (attacker, applyDamage 3 defender)
-- | Recharge spell effect. | 213 | effectPoison :: Effect
effectPoison (attacker, defender) =
case statsType attacker of
NPC -> (applyDamage 3 attacker, defender)
PC -> (attacker, applyDamage 3 defender)
-- | Recharge spell effect. | 213 | effectPoison (attacker, defender) =
case statsType attacker of
NPC -> (applyDamage 3 attacker, defender)
PC -> (attacker, applyDamage 3 defender)
-- | Recharge spell effect. | 190 | false | true | 0 | 9 | 44 | 62 | 33 | 29 | null | null |
hvr/jhc | src/Name/Names.hs | mit | fromUnboxedNameTuple n = case show n of
'(':'#':xs | (ns@(_:_),"#)") <- span isDigit xs -> return (read ns::Int)
_ -> fail $ "Not unboxed tuple: " ++ show n | 164 | fromUnboxedNameTuple n = case show n of
'(':'#':xs | (ns@(_:_),"#)") <- span isDigit xs -> return (read ns::Int)
_ -> fail $ "Not unboxed tuple: " ++ show n | 164 | fromUnboxedNameTuple n = case show n of
'(':'#':xs | (ns@(_:_),"#)") <- span isDigit xs -> return (read ns::Int)
_ -> fail $ "Not unboxed tuple: " ++ show n | 164 | false | false | 1 | 15 | 36 | 93 | 44 | 49 | null | null |
rueshyna/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Comments/Approve.hs | mpl-2.0 | -- | The ID of the comment to mark as not spam.
caCommentId :: Lens' CommentsApprove Text
caCommentId
= lens _caCommentId (\ s a -> s{_caCommentId = a}) | 154 | caCommentId :: Lens' CommentsApprove Text
caCommentId
= lens _caCommentId (\ s a -> s{_caCommentId = a}) | 106 | caCommentId
= lens _caCommentId (\ s a -> s{_caCommentId = a}) | 64 | true | true | 0 | 9 | 29 | 47 | 23 | 24 | null | null |
flyrry/word-ladder | src/Ladder/Graph.hs | mit | --distance a b = foldr (\(la,lb) total -> if la == lb then total else total+1) 0 (zip a b)
buildGraph :: [String] -> WordGraph
buildGraph ws = (S.fromList ws, ws) | 163 | buildGraph :: [String] -> WordGraph
buildGraph ws = (S.fromList ws, ws) | 71 | buildGraph ws = (S.fromList ws, ws) | 35 | true | true | 0 | 7 | 31 | 33 | 18 | 15 | null | null |
svenssonjoel/ObsidianGFX | Examples/Simple/FractalsExec.hs | bsd-3-clause | main = perform | 14 | main = perform | 14 | main = perform | 14 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
keithodulaigh/Hets | Common/XPath.hs | gpl-2.0 | -- | skip left paren
lpar :: Parser ()
lpar = forget (symbol "(") | 65 | lpar :: Parser ()
lpar = forget (symbol "(") | 44 | lpar = forget (symbol "(") | 26 | true | true | 0 | 7 | 13 | 26 | 13 | 13 | null | null |
elordin/haskell-tetris | main.hs | mit | menuHandler :: TVar [Key] -> TVar Game -> IO ()
menuHandler queue game = do
input <- readInput queue
case input of
Just (Char '\ESC') -> exitSuccess
Just (SpecialKey KeyUp) -> toggleMenuItem
Just (SpecialKey KeyDown) -> toggleMenuItem
Just (Char '\n') -> select
... | 1,999 | menuHandler :: TVar [Key] -> TVar Game -> IO ()
menuHandler queue game = do
input <- readInput queue
case input of
Just (Char '\ESC') -> exitSuccess
Just (SpecialKey KeyUp) -> toggleMenuItem
Just (SpecialKey KeyDown) -> toggleMenuItem
Just (Char '\n') -> select
... | 1,999 | menuHandler queue game = do
input <- readInput queue
case input of
Just (Char '\ESC') -> exitSuccess
Just (SpecialKey KeyUp) -> toggleMenuItem
Just (SpecialKey KeyDown) -> toggleMenuItem
Just (Char '\n') -> select
Just (Char '\r') -> select
... | 1,951 | false | true | 1 | 19 | 915 | 581 | 267 | 314 | null | null |
laonawuli/warofwordsinhaskell | src/DataBase.hs | mit | getWordLengthList :: IO [Int]
getWordLengthList = do
conn <- open getDBURL
dataSet <- query_ conn "SELECT DISTINCT LENGTH(WORD) FROM DICTIONARY"
close conn
return (extractWordLengthList dataSet) | 202 | getWordLengthList :: IO [Int]
getWordLengthList = do
conn <- open getDBURL
dataSet <- query_ conn "SELECT DISTINCT LENGTH(WORD) FROM DICTIONARY"
close conn
return (extractWordLengthList dataSet) | 202 | getWordLengthList = do
conn <- open getDBURL
dataSet <- query_ conn "SELECT DISTINCT LENGTH(WORD) FROM DICTIONARY"
close conn
return (extractWordLengthList dataSet) | 172 | false | true | 0 | 9 | 32 | 57 | 25 | 32 | null | null |
erochest/barth-scrape | src/BarthPar/Lens.hs | apache-2.0 | inputWord :: Lens' InputRow Token
inputWord = _2 | 48 | inputWord :: Lens' InputRow Token
inputWord = _2 | 48 | inputWord = _2 | 14 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.Fusion.Stream.Monadic.hs | bsd-3-clause | replicateM n p = Stream step n
where
{-# INLINE [0] step #-}
step i | i <= 0 = return Done
| otherwise = do { x <- p; return $ Yield x (i-1) } | 166 | replicateM n p = Stream step n
where
{-# INLINE [0] step #-}
step i | i <= 0 = return Done
| otherwise = do { x <- p; return $ Yield x (i-1) } | 166 | replicateM n p = Stream step n
where
{-# INLINE [0] step #-}
step i | i <= 0 = return Done
| otherwise = do { x <- p; return $ Yield x (i-1) } | 166 | false | false | 1 | 12 | 59 | 84 | 38 | 46 | null | null |
cshung/MiscLab | Haskell99/q08.test.hs | mit | test6 = TestCase (assertEqualIntList "compress [1,2,2] should be [1,2]. " ([1,2] ) (compress [1,2,2])) | 105 | test6 = TestCase (assertEqualIntList "compress [1,2,2] should be [1,2]. " ([1,2] ) (compress [1,2,2])) | 105 | test6 = TestCase (assertEqualIntList "compress [1,2,2] should be [1,2]. " ([1,2] ) (compress [1,2,2])) | 105 | false | false | 1 | 10 | 16 | 47 | 24 | 23 | null | null |
siddhanathan/ghc | testsuite/tests/rename/should_compile/timing001.hs | bsd-3-clause | a105 = a106 | 11 | a105 = a106 | 11 | a105 = a106 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
yliu120/K3 | src/Language/K3/Analysis/SEffects/Inference.hs | apache-2.0 | filkupcM :: Int -> FInfM [Identifier]
filkupcM n = get >>= liftEitherM . flip filkupc n | 87 | filkupcM :: Int -> FInfM [Identifier]
filkupcM n = get >>= liftEitherM . flip filkupc n | 87 | filkupcM n = get >>= liftEitherM . flip filkupc n | 49 | false | true | 0 | 7 | 15 | 37 | 18 | 19 | null | null |
sheganinans/applicative-nestedmap | src/Data/Nested/Internal.hs | bsd-3-clause | nullTree ∷ Tree κ α → Bool
nullTree = nullForest ∘ forest | 57 | nullTree ∷ Tree κ α → Bool
nullTree = nullForest ∘ forest | 57 | nullTree = nullForest ∘ forest | 30 | false | true | 0 | 7 | 11 | 31 | 13 | 18 | null | null |
DavidAlphaFox/darcs | harness/Darcs/Test/Patch/V1Model.hs | gpl-2.0 | emptyDir :: Dir
emptyDir = RepoItem $ T.SubTree T.emptyTree | 59 | emptyDir :: Dir
emptyDir = RepoItem $ T.SubTree T.emptyTree | 59 | emptyDir = RepoItem $ T.SubTree T.emptyTree | 43 | false | true | 0 | 7 | 8 | 22 | 11 | 11 | null | null |
tobsan/yane | CPUHelpers.hs | gpl-3.0 | setZN :: (NesCPU m) => Operand -> m ()
setZN oper = do setFlagZ $ oper == 0
setFlagN $ oper < 0
-- Pull the program counter from stack | 151 | setZN :: (NesCPU m) => Operand -> m ()
setZN oper = do setFlagZ $ oper == 0
setFlagN $ oper < 0
-- Pull the program counter from stack | 151 | setZN oper = do setFlagZ $ oper == 0
setFlagN $ oper < 0
-- Pull the program counter from stack | 112 | false | true | 0 | 9 | 46 | 60 | 28 | 32 | null | null |
tysonzero/dama | src/Dama/Parser/Parser.hs | mit | exprRChain :: Parser ExprR
exprRChain = ExprRC <$> exprRCChain
<|> exprRApp | 84 | exprRChain :: Parser ExprR
exprRChain = ExprRC <$> exprRCChain
<|> exprRApp | 84 | exprRChain = ExprRC <$> exprRCChain
<|> exprRApp | 57 | false | true | 0 | 6 | 19 | 22 | 11 | 11 | null | null |
chengzh2008/hpffp | src/ch23-State/RandomExample.hs | bsd-3-clause | rollDieThreeTimes :: (Die, Die, Die)
rollDieThreeTimes = do
let s = mkStdGen 0
range = (1, 6)
(d1, s1) = randomR range s
(d2, s2) = randomR range s1
(d3, _) = randomR range s2
(intToDie d1, intToDie d2, intToDie d3) | 243 | rollDieThreeTimes :: (Die, Die, Die)
rollDieThreeTimes = do
let s = mkStdGen 0
range = (1, 6)
(d1, s1) = randomR range s
(d2, s2) = randomR range s1
(d3, _) = randomR range s2
(intToDie d1, intToDie d2, intToDie d3) | 243 | rollDieThreeTimes = do
let s = mkStdGen 0
range = (1, 6)
(d1, s1) = randomR range s
(d2, s2) = randomR range s1
(d3, _) = randomR range s2
(intToDie d1, intToDie d2, intToDie d3) | 206 | false | true | 0 | 10 | 68 | 115 | 61 | 54 | null | null |
kawamuray/ganeti | src/Ganeti/Path.hs | gpl-2.0 | -- | Simple helper to concat two paths.
pjoin :: IO String -> String -> IO String
pjoin a b = do
a' <- a
return $ a' </> b
-- | Returns the root directory, which can be either the real root or
-- the virtual root. | 218 | pjoin :: IO String -> String -> IO String
pjoin a b = do
a' <- a
return $ a' </> b
-- | Returns the root directory, which can be either the real root or
-- the virtual root. | 178 | pjoin a b = do
a' <- a
return $ a' </> b
-- | Returns the root directory, which can be either the real root or
-- the virtual root. | 136 | true | true | 0 | 8 | 52 | 56 | 26 | 30 | null | null |
urbanslug/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | labelType (CmmLabel _ _ CmmRet) = CodeLabel | 59 | labelType (CmmLabel _ _ CmmRet) = CodeLabel | 59 | labelType (CmmLabel _ _ CmmRet) = CodeLabel | 59 | false | false | 0 | 6 | 22 | 20 | 9 | 11 | null | null |
haslab/SecreC | src/Language/SecreC/TypeChecker/Expression.hs | gpl-3.0 | tcExpr ret (UnaryExpr l op e) = do
e' <- limitExprC ReadOnlyExpr $ tcExpr Nothing e
let t = typed $ loc e'
top <- tcOp op
case (top,e) of
-- hack to translate a literal cast to a qualified expression
(OpCast lcast cast,e@(LitPExpr {})) -> do
castty <- typeToBaseType (unTyped ... | 729 | tcExpr ret (UnaryExpr l op e) = do
e' <- limitExprC ReadOnlyExpr $ tcExpr Nothing e
let t = typed $ loc e'
top <- tcOp op
case (top,e) of
-- hack to translate a literal cast to a qualified expression
(OpCast lcast cast,e@(LitPExpr {})) -> do
castty <- typeToBaseType (unTyped ... | 729 | tcExpr ret (UnaryExpr l op e) = do
e' <- limitExprC ReadOnlyExpr $ tcExpr Nothing e
let t = typed $ loc e'
top <- tcOp op
case (top,e) of
-- hack to translate a literal cast to a qualified expression
(OpCast lcast cast,e@(LitPExpr {})) -> do
castty <- typeToBaseType (unTyped ... | 729 | false | false | 0 | 17 | 213 | 339 | 162 | 177 | null | null |
serokell/log-warper | src/System/Wlog/Color.hs | mit | colorizerBuilder :: Severity -> Builder -> Builder
colorizerBuilder pr s =
let (before, after) = table pr in B.fromText (toText before) <> s <> B.fromText (toText after) | 173 | colorizerBuilder :: Severity -> Builder -> Builder
colorizerBuilder pr s =
let (before, after) = table pr in B.fromText (toText before) <> s <> B.fromText (toText after) | 173 | colorizerBuilder pr s =
let (before, after) = table pr in B.fromText (toText before) <> s <> B.fromText (toText after) | 122 | false | true | 0 | 11 | 30 | 75 | 36 | 39 | null | null |
michiexile/hplex | pershom/src/Math/Simplicial/Simplex.hs | bsd-3-clause | longS2 :: Simplex Int
longS2 = fromList ([0..50000] ++ [50002, 50001] ++ [50003..100000]) | 89 | longS2 :: Simplex Int
longS2 = fromList ([0..50000] ++ [50002, 50001] ++ [50003..100000]) | 89 | longS2 = fromList ([0..50000] ++ [50002, 50001] ++ [50003..100000]) | 67 | false | true | 0 | 9 | 12 | 44 | 24 | 20 | null | null |
nushio3/ghc | compiler/hsSyn/HsBinds.hs | bsd-3-clause | isTypeLSig _ = False | 39 | isTypeLSig _ = False | 39 | isTypeLSig _ = False | 39 | false | false | 0 | 4 | 22 | 10 | 4 | 6 | null | null |
AshyIsMe/osxmonad | OSXMonad/Keys.hs | bsd-3-clause | osxKeyToX11 0x53 = xK_KP_1 | 26 | osxKeyToX11 0x53 = xK_KP_1 | 26 | osxKeyToX11 0x53 = xK_KP_1 | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
paolino/mootzoo | DB/Get.hs | mit | canRetract' _ _ _ = False | 25 | canRetract' _ _ _ = False | 25 | canRetract' _ _ _ = False | 25 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
facebookarchive/lex-pass | src/Transf/AntiPattern.hs | bsd-3-clause | assignablesGoRight :: Ast -> Transformed Ast
assignablesGoRight = modAll . modIfBlockExpr $ modWSCap2 exprLRValToRight | 118 | assignablesGoRight :: Ast -> Transformed Ast
assignablesGoRight = modAll . modIfBlockExpr $ modWSCap2 exprLRValToRight | 118 | assignablesGoRight = modAll . modIfBlockExpr $ modWSCap2 exprLRValToRight | 73 | false | true | 0 | 7 | 13 | 34 | 15 | 19 | null | null |
intolerable/GroupProject | src/Emulator/Interpreter.hs | bsd-2-clause | prefetchedTHUMB :: Address -> Address
prefetchedTHUMB addr = addr - 4 | 69 | prefetchedTHUMB :: Address -> Address
prefetchedTHUMB addr = addr - 4 | 69 | prefetchedTHUMB addr = addr - 4 | 31 | false | true | 0 | 5 | 10 | 22 | 11 | 11 | null | null |
athanclark/cassowary-haskell | src/Linear/Constraints/Weights.hs | bsd-3-clause | onBoth f (These x y) = f x y | 28 | onBoth f (These x y) = f x y | 28 | onBoth f (These x y) = f x y | 28 | false | false | 0 | 6 | 8 | 26 | 11 | 15 | null | null |
koba-e964/hayashii-mcc | zekamashi/AsmHelper.hs | bsd-3-clause | rhp = Reg 27 | 12 | rhp = Reg 27 | 12 | rhp = Reg 27 | 12 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
olorin/amazonka | amazonka-cloudfront/gen/Network/AWS/CloudFront/Types.hs | mpl-2.0 | -- | The Amazon S3 origin server specified does not refer to a valid Amazon
-- S3 bucket.
_InvalidOrigin :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidOrigin = _ServiceError . hasStatus 400 . hasCode "InvalidOrigin" | 237 | _InvalidOrigin :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidOrigin = _ServiceError . hasStatus 400 . hasCode "InvalidOrigin" | 147 | _InvalidOrigin = _ServiceError . hasStatus 400 . hasCode "InvalidOrigin" | 72 | true | true | 0 | 8 | 36 | 47 | 23 | 24 | null | null |
rscprof/kalium | src/Kalium/Util.hs | bsd-3-clause | -- Fuse with the first successful element
nofar = far endoFailure | 65 | nofar = far endoFailure | 23 | nofar = far endoFailure | 23 | true | false | 0 | 5 | 10 | 10 | 5 | 5 | null | null |
raptros/respond | src/Web/Respond/Response.hs | bsd-3-clause | -- * use the RequestErrorHandlers
-- | an action that gets the currently installed unsupported method handler
-- and applies it to the arguments
handleUnsupportedMethod :: MonadRespond m => [StdMethod] -> Method -> m ResponseReceived
handleUnsupportedMethod supported unsupported = do
handler <- getHandler (view un... | 445 | handleUnsupportedMethod :: MonadRespond m => [StdMethod] -> Method -> m ResponseReceived
handleUnsupportedMethod supported unsupported = do
handler <- getHandler (view unsupportedMethod)
handler supported unsupported
-- | an action that gets the installed unmatched path handler and uses it | 299 | handleUnsupportedMethod supported unsupported = do
handler <- getHandler (view unsupportedMethod)
handler supported unsupported
-- | an action that gets the installed unmatched path handler and uses it | 210 | true | true | 0 | 11 | 71 | 70 | 33 | 37 | null | null |
okue/Haskyapi | app/Model.hs | mit | lookupCoupon :: String -> IO (Maybe Coupon)
lookupCoupon x =
lookupTemplate id $ selectList [CouponKey ==. x] [LimitTo 1] | 123 | lookupCoupon :: String -> IO (Maybe Coupon)
lookupCoupon x =
lookupTemplate id $ selectList [CouponKey ==. x] [LimitTo 1] | 123 | lookupCoupon x =
lookupTemplate id $ selectList [CouponKey ==. x] [LimitTo 1] | 79 | false | true | 0 | 8 | 20 | 52 | 25 | 27 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/GHC/Event/PSQ.hs | bsd-3-clause | rbalance k p v l m r
| size' l + size' r < 2 = rloser k p v l m r
| size' r > omega * size' l = rbalanceLeft k p v l m r
| size' l > omega * size' r = rbalanceRight k p v l m r
| otherwise = rloser k p v l m r | 260 | rbalance k p v l m r
| size' l + size' r < 2 = rloser k p v l m r
| size' r > omega * size' l = rbalanceLeft k p v l m r
| size' l > omega * size' r = rbalanceRight k p v l m r
| otherwise = rloser k p v l m r | 260 | rbalance k p v l m r
| size' l + size' r < 2 = rloser k p v l m r
| size' r > omega * size' l = rbalanceLeft k p v l m r
| size' l > omega * size' r = rbalanceRight k p v l m r
| otherwise = rloser k p v l m r | 260 | false | false | 1 | 10 | 115 | 156 | 68 | 88 | null | null |
damoxc/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | -- | Extend UID pool, must be list of lists describing UID ranges (two
-- items, start and end inclusive.
pAddUids :: Field
pAddUids = optionalField $ simpleField "add_uids" [t| [[(Int, Int)]] |] | 195 | pAddUids :: Field
pAddUids = optionalField $ simpleField "add_uids" [t| [[(Int, Int)]] |] | 89 | pAddUids = optionalField $ simpleField "add_uids" [t| [[(Int, Int)]] |] | 71 | true | true | 0 | 6 | 32 | 26 | 16 | 10 | null | null |
kindl/Hypatia | src/Lexer.hs | mit | makeIdent ms i = Varid ms i | 27 | makeIdent ms i = Varid ms i | 27 | makeIdent ms i = Varid ms i | 27 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
chreekat/snowdrift | Handler/Donate.hs | agpl-3.0 | getDonateR :: Handler Html
getDonateR =
defaultLayout $ do
snowdriftTitle "Donate"
$(widgetFile "donatepage") | 129 | getDonateR :: Handler Html
getDonateR =
defaultLayout $ do
snowdriftTitle "Donate"
$(widgetFile "donatepage") | 129 | getDonateR =
defaultLayout $ do
snowdriftTitle "Donate"
$(widgetFile "donatepage") | 102 | false | true | 0 | 10 | 32 | 34 | 15 | 19 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.