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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ethercrow/yi | yi-core/src/Yi/Config/Simple.hs | gpl-2.0 | -- | Which side to display the scroll bar on.
scrollBarSide :: Field Side
scrollBarSide = configUIA . configLeftSideScrollBarA . fromBool
where
fromBool :: Lens' Bool Side
fromBool = lens (\b -> if b then LeftSide else RightSide)
(\_ s -> case s of { LeftSide -> True; RightSide -> False })
-- | Should the scroll bar autohide? | 358 | scrollBarSide :: Field Side
scrollBarSide = configUIA . configLeftSideScrollBarA . fromBool
where
fromBool :: Lens' Bool Side
fromBool = lens (\b -> if b then LeftSide else RightSide)
(\_ s -> case s of { LeftSide -> True; RightSide -> False })
-- | Should the scroll bar autohide? | 312 | scrollBarSide = configUIA . configLeftSideScrollBarA . fromBool
where
fromBool :: Lens' Bool Side
fromBool = lens (\b -> if b then LeftSide else RightSide)
(\_ s -> case s of { LeftSide -> True; RightSide -> False })
-- | Should the scroll bar autohide? | 284 | true | true | 0 | 10 | 89 | 92 | 51 | 41 | null | null |
michalt/cvector | Data/CVector.hs | bsd-3-clause | izipWith5
:: (Int -> a -> b -> c -> d -> e -> f)
-> CVector a -> CVector b -> CVector c -> CVector d -> CVector e -> CVector f
izipWith5 = G.izipWith5 | 154 | izipWith5
:: (Int -> a -> b -> c -> d -> e -> f)
-> CVector a -> CVector b -> CVector c -> CVector d -> CVector e -> CVector f
izipWith5 = G.izipWith5 | 154 | izipWith5 = G.izipWith5 | 23 | false | true | 0 | 13 | 39 | 88 | 40 | 48 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Embedded.hs | bsd-3-clause | -- | A short-hand notion for @ elAttr \"source\" ... @
source ∷ forall t m a. DomBuilder t m ⇒ Source → m a → m a
source bm children = snd <$> source' bm children | 162 | source ∷ forall t m a. DomBuilder t m ⇒ Source → m a → m a
source bm children = snd <$> source' bm children | 107 | source bm children = snd <$> source' bm children | 48 | true | true | 0 | 9 | 36 | 56 | 28 | 28 | null | null |
jyp/ling | MiniC/Skel.hs | bsd-3-clause | transDec :: Dec -> Result
transDec x = case x of
Dec qtyp ident arrs -> failure x | 83 | transDec :: Dec -> Result
transDec x = case x of
Dec qtyp ident arrs -> failure x | 83 | transDec x = case x of
Dec qtyp ident arrs -> failure x | 57 | false | true | 0 | 8 | 19 | 43 | 19 | 24 | null | null |
rwtodd/small_programs | i_ching/haskell/iching.hs | gpl-2.0 | trigram_names :: Arr.Array Int String
trigram_names = Arr.listArray (0,7) [
"K'UN / RECEPTIVE / EARTH ",
"CHEN / AROUSING / THUNDER ",
"K'AN / ABYSMAL / WATER ",
"TUI / JOYOUS / LAKE ",
"KEN / KEEPING STILL / MOUNTAIN",
"LI / CLINGING / FIRE ",
"SUN / GENTLE / WIND ",
"CH'IEN / CREATIVE /HEAVEN "
] | 366 | trigram_names :: Arr.Array Int String
trigram_names = Arr.listArray (0,7) [
"K'UN / RECEPTIVE / EARTH ",
"CHEN / AROUSING / THUNDER ",
"K'AN / ABYSMAL / WATER ",
"TUI / JOYOUS / LAKE ",
"KEN / KEEPING STILL / MOUNTAIN",
"LI / CLINGING / FIRE ",
"SUN / GENTLE / WIND ",
"CH'IEN / CREATIVE /HEAVEN "
] | 366 | trigram_names = Arr.listArray (0,7) [
"K'UN / RECEPTIVE / EARTH ",
"CHEN / AROUSING / THUNDER ",
"K'AN / ABYSMAL / WATER ",
"TUI / JOYOUS / LAKE ",
"KEN / KEEPING STILL / MOUNTAIN",
"LI / CLINGING / FIRE ",
"SUN / GENTLE / WIND ",
"CH'IEN / CREATIVE /HEAVEN "
] | 328 | false | true | 0 | 6 | 124 | 55 | 32 | 23 | null | null |
SAdams601/HaRe | old/refactorer/RefacDupTrans.hs | bsd-3-clause | compareExp pats e@(Exp (HsInfixApp e1 o1 e2)) (Exp (HsInfixApp e3 o2 e4))
= Exp (HsInfixApp e1' o1' e2')
where
e1' = compareExp pats e1 e3
o1'
| o1 == o2 = o1
| otherwise = HsVar (nameToPNT "$I")
e2' = compareExp pats e2 e4 | 268 | compareExp pats e@(Exp (HsInfixApp e1 o1 e2)) (Exp (HsInfixApp e3 o2 e4))
= Exp (HsInfixApp e1' o1' e2')
where
e1' = compareExp pats e1 e3
o1'
| o1 == o2 = o1
| otherwise = HsVar (nameToPNT "$I")
e2' = compareExp pats e2 e4 | 268 | compareExp pats e@(Exp (HsInfixApp e1 o1 e2)) (Exp (HsInfixApp e3 o2 e4))
= Exp (HsInfixApp e1' o1' e2')
where
e1' = compareExp pats e1 e3
o1'
| o1 == o2 = o1
| otherwise = HsVar (nameToPNT "$I")
e2' = compareExp pats e2 e4 | 268 | false | false | 3 | 10 | 88 | 144 | 60 | 84 | null | null |
grandpascorpion/canon | Math/NumberTheory/Canon.hs | gpl-3.0 | gcrToCR :: GCR_ -> CR_
gcrToCR c = map (\(p,e) -> (p, cToI e)) c | 64 | gcrToCR :: GCR_ -> CR_
gcrToCR c = map (\(p,e) -> (p, cToI e)) c | 64 | gcrToCR c = map (\(p,e) -> (p, cToI e)) c | 41 | false | true | 0 | 9 | 14 | 52 | 26 | 26 | null | null |
DaMSL/K3 | src/Language/K3/Analysis/SEffects/Inference.hs | apache-2.0 | prettyPair :: (Show a, Pretty b) => (a,b) -> [Text]
prettyPair (a,b) = [T.pack $ show a ++ " => "] %+ PT.prettyLines b | 118 | prettyPair :: (Show a, Pretty b) => (a,b) -> [Text]
prettyPair (a,b) = [T.pack $ show a ++ " => "] %+ PT.prettyLines b | 118 | prettyPair (a,b) = [T.pack $ show a ++ " => "] %+ PT.prettyLines b | 66 | false | true | 0 | 9 | 23 | 73 | 39 | 34 | null | null |
f1u77y/xmonad-contrib | XMonad/Prompt/Pass.hs | bsd-3-clause | -- | Generate a 30 characters password for a given entry.
-- If the entry already exists, it is updated with a new password.
--
generatePassword :: String -> X ()
generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30" | 246 | generatePassword :: String -> X ()
generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30" | 118 | generatePassword passLabel = spawn $ "pass generate --force " ++ passLabel ++ " 30" | 83 | true | true | 0 | 7 | 44 | 38 | 20 | 18 | null | null |
jchildren/jolly | src/Jolly/Types/Infer.hs | mit | constraintsExpr ::
TypeEnv -> Expr -> Either TypeError ([Constraint], Subst, Type, Scheme)
constraintsExpr env ex =
case runInfer env (infer ex) of
Left err -> Left err
Right (ty, cs) ->
case runSolve cs of
Left err -> Left err
Right subst -> Right (cs, subst, ty, sc)
where sc = closeOver $ apply subst ty | 353 | constraintsExpr ::
TypeEnv -> Expr -> Either TypeError ([Constraint], Subst, Type, Scheme)
constraintsExpr env ex =
case runInfer env (infer ex) of
Left err -> Left err
Right (ty, cs) ->
case runSolve cs of
Left err -> Left err
Right subst -> Right (cs, subst, ty, sc)
where sc = closeOver $ apply subst ty | 353 | constraintsExpr env ex =
case runInfer env (infer ex) of
Left err -> Left err
Right (ty, cs) ->
case runSolve cs of
Left err -> Left err
Right subst -> Right (cs, subst, ty, sc)
where sc = closeOver $ apply subst ty | 257 | false | true | 0 | 14 | 102 | 145 | 73 | 72 | null | null |
DbIHbKA/lsh | test/LSHSpec.hs | mit | spec :: Spec
spec = describe "nearest" $
it "find nearest record" $
L.nearest ['x', 'y', 'z', 'h'] fill_lsh `shouldBe`
[5] | 134 | spec :: Spec
spec = describe "nearest" $
it "find nearest record" $
L.nearest ['x', 'y', 'z', 'h'] fill_lsh `shouldBe`
[5] | 134 | spec = describe "nearest" $
it "find nearest record" $
L.nearest ['x', 'y', 'z', 'h'] fill_lsh `shouldBe`
[5] | 121 | false | true | 0 | 7 | 32 | 61 | 30 | 31 | null | null |
brodyberg/LearnHaskell | Web/sqlitetest/SimpleJSON.hs | mit | getDouble _ = Nothing | 31 | getDouble _ = Nothing | 31 | getDouble _ = Nothing | 31 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/DynamoDBTableAttributeDefinition.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-attributedef.html#cfn-dynamodb-attributedef-attributename-attributetype
ddbtadAttributeType :: Lens' DynamoDBTableAttributeDefinition (Val AttributeType)
ddbtadAttributeType = lens _dynamoDBTableAttributeDefinitionAttributeType (\s a -> s { _dynamoDBTableAttributeDefinitionAttributeType = a }) | 385 | ddbtadAttributeType :: Lens' DynamoDBTableAttributeDefinition (Val AttributeType)
ddbtadAttributeType = lens _dynamoDBTableAttributeDefinitionAttributeType (\s a -> s { _dynamoDBTableAttributeDefinitionAttributeType = a }) | 222 | ddbtadAttributeType = lens _dynamoDBTableAttributeDefinitionAttributeType (\s a -> s { _dynamoDBTableAttributeDefinitionAttributeType = a }) | 140 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/book/2007-Programming_in_Haskell-1st_Edition-Graham_Hutton/ch_06_8.hs | unlicense | e3af :: [Test]
e3af = U.tt "e3af"
[ and1 [False, True]
, and1 [True, False]
, and2 [False, True]
, and2 [True, False]
]
False | 155 | e3af :: [Test]
e3af = U.tt "e3af"
[ and1 [False, True]
, and1 [True, False]
, and2 [False, True]
, and2 [True, False]
]
False | 155 | e3af = U.tt "e3af"
[ and1 [False, True]
, and1 [True, False]
, and2 [False, True]
, and2 [True, False]
]
False | 140 | false | true | 0 | 8 | 54 | 71 | 40 | 31 | null | null |
pshendry/project-euler-solutions | 0016/solution.hs | mit | main = putStrLn $ show solve | 28 | main = putStrLn $ show solve | 28 | main = putStrLn $ show solve | 28 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
romildo/gsynt | src/Doc.hs | isc | clearDoc :: Doc a -> Doc a
clearDoc (Doc _ x) = Doc [] x | 56 | clearDoc :: Doc a -> Doc a
clearDoc (Doc _ x) = Doc [] x | 56 | clearDoc (Doc _ x) = Doc [] x | 29 | false | true | 0 | 7 | 14 | 39 | 18 | 21 | null | null |
AndrewRademacher/stack | src/Stack/Build/Source.hs | bsd-3-clause | extendExtraDeps
:: (HasBuildConfig env, MonadIO m, MonadLogger m, MonadReader env m, HasHttpManager env, MonadBaseControl IO m, MonadMask m)
=> Map PackageName Version -- ^ original extra deps
-> Map PackageName Version -- ^ package identifiers from the command line
-> Set PackageName -- ^ all packages added on the command line
-> m (Map PackageName Version) -- ^ new extradeps
extendExtraDeps extraDeps0 cliExtraDeps unknowns = do
(errs, unknowns') <- fmap partitionEithers $ mapM addUnknown $ Set.toList unknowns
case errs of
[] -> return $ Map.unions $ extraDeps1 : unknowns'
_ -> do
bconfig <- asks getBuildConfig
throwM $ UnknownTargets
(Set.fromList errs)
Map.empty -- TODO check the cliExtraDeps for presence in index
(bcStackYaml bconfig)
where
extraDeps1 = Map.union extraDeps0 cliExtraDeps
addUnknown pn = do
case Map.lookup pn extraDeps1 of
Just _ -> return (Right Map.empty)
Nothing -> do
mlatestVersion <- getLatestVersion pn
case mlatestVersion of
Just v -> return (Right $ Map.singleton pn v)
Nothing -> return (Left pn)
getLatestVersion pn = do
vs <- getPackageVersions pn
return (fmap fst (Set.maxView vs))
-- | Compare the current filesystem state to the cached information, and
-- determine (1) if the files are dirty, and (2) the new cache values. | 1,520 | extendExtraDeps
:: (HasBuildConfig env, MonadIO m, MonadLogger m, MonadReader env m, HasHttpManager env, MonadBaseControl IO m, MonadMask m)
=> Map PackageName Version -- ^ original extra deps
-> Map PackageName Version -- ^ package identifiers from the command line
-> Set PackageName -- ^ all packages added on the command line
-> m (Map PackageName Version)
extendExtraDeps extraDeps0 cliExtraDeps unknowns = do
(errs, unknowns') <- fmap partitionEithers $ mapM addUnknown $ Set.toList unknowns
case errs of
[] -> return $ Map.unions $ extraDeps1 : unknowns'
_ -> do
bconfig <- asks getBuildConfig
throwM $ UnknownTargets
(Set.fromList errs)
Map.empty -- TODO check the cliExtraDeps for presence in index
(bcStackYaml bconfig)
where
extraDeps1 = Map.union extraDeps0 cliExtraDeps
addUnknown pn = do
case Map.lookup pn extraDeps1 of
Just _ -> return (Right Map.empty)
Nothing -> do
mlatestVersion <- getLatestVersion pn
case mlatestVersion of
Just v -> return (Right $ Map.singleton pn v)
Nothing -> return (Left pn)
getLatestVersion pn = do
vs <- getPackageVersions pn
return (fmap fst (Set.maxView vs))
-- | Compare the current filesystem state to the cached information, and
-- determine (1) if the files are dirty, and (2) the new cache values. | 1,501 | extendExtraDeps extraDeps0 cliExtraDeps unknowns = do
(errs, unknowns') <- fmap partitionEithers $ mapM addUnknown $ Set.toList unknowns
case errs of
[] -> return $ Map.unions $ extraDeps1 : unknowns'
_ -> do
bconfig <- asks getBuildConfig
throwM $ UnknownTargets
(Set.fromList errs)
Map.empty -- TODO check the cliExtraDeps for presence in index
(bcStackYaml bconfig)
where
extraDeps1 = Map.union extraDeps0 cliExtraDeps
addUnknown pn = do
case Map.lookup pn extraDeps1 of
Just _ -> return (Right Map.empty)
Nothing -> do
mlatestVersion <- getLatestVersion pn
case mlatestVersion of
Just v -> return (Right $ Map.singleton pn v)
Nothing -> return (Left pn)
getLatestVersion pn = do
vs <- getPackageVersions pn
return (fmap fst (Set.maxView vs))
-- | Compare the current filesystem state to the cached information, and
-- determine (1) if the files are dirty, and (2) the new cache values. | 1,120 | true | true | 2 | 20 | 447 | 378 | 180 | 198 | null | null |
DanielG/cabal-helper | src/CabalHelper/Compiletime/CompPrograms.hs | apache-2.0 | patchBuildToolProgs SStack progs = do
-- otherwise fall back to creating a symlink farm
--
-- This is of course all quite horrible and we would much prefer just
-- being able to pass executable paths straight through to stack but
-- currently there is no option to let us do that.
withSystemTempDirectory "cabal-helper-symlinks" $ \bindir -> do
createProgSymlink True bindir $ ghcProgram progs
createProgSymlink True bindir $ ghcPkgProgram progs
createProgSymlink False bindir $ haddockProgram progs
return $ progs
{ stackEnv =
[("PATH", EnvPrepend $ bindir ++ [searchPathSeparator])] ++
stackEnv progs
} | 648 | patchBuildToolProgs SStack progs = do
-- otherwise fall back to creating a symlink farm
--
-- This is of course all quite horrible and we would much prefer just
-- being able to pass executable paths straight through to stack but
-- currently there is no option to let us do that.
withSystemTempDirectory "cabal-helper-symlinks" $ \bindir -> do
createProgSymlink True bindir $ ghcProgram progs
createProgSymlink True bindir $ ghcPkgProgram progs
createProgSymlink False bindir $ haddockProgram progs
return $ progs
{ stackEnv =
[("PATH", EnvPrepend $ bindir ++ [searchPathSeparator])] ++
stackEnv progs
} | 648 | patchBuildToolProgs SStack progs = do
-- otherwise fall back to creating a symlink farm
--
-- This is of course all quite horrible and we would much prefer just
-- being able to pass executable paths straight through to stack but
-- currently there is no option to let us do that.
withSystemTempDirectory "cabal-helper-symlinks" $ \bindir -> do
createProgSymlink True bindir $ ghcProgram progs
createProgSymlink True bindir $ ghcPkgProgram progs
createProgSymlink False bindir $ haddockProgram progs
return $ progs
{ stackEnv =
[("PATH", EnvPrepend $ bindir ++ [searchPathSeparator])] ++
stackEnv progs
} | 648 | false | false | 0 | 18 | 135 | 118 | 58 | 60 | null | null |
rcallahan/thermonuc | ThermoNuc/Dat.hs | bsd-3-clause | dhd_asint1x2 :: Ptr Double
dhd_asint1x2 = $(embedDoubleArray "dat/asint1x2.DHD") | 80 | dhd_asint1x2 :: Ptr Double
dhd_asint1x2 = $(embedDoubleArray "dat/asint1x2.DHD") | 80 | dhd_asint1x2 = $(embedDoubleArray "dat/asint1x2.DHD") | 53 | false | true | 0 | 8 | 7 | 27 | 11 | 16 | null | null |
keithodulaigh/Hets | Comorphisms/QVTR2CASL.hs | gpl-2.0 | buildOCLFormula varS (NotB e) = C.Negation (buildOCLFormula varS e) nullRange | 77 | buildOCLFormula varS (NotB e) = C.Negation (buildOCLFormula varS e) nullRange | 77 | buildOCLFormula varS (NotB e) = C.Negation (buildOCLFormula varS e) nullRange | 77 | false | false | 0 | 7 | 9 | 32 | 15 | 17 | null | null |
mdorman/couch-simple | src/lib/Database/Couch/Explicit/DocBase.hs | mit | accessBase :: ByteString -- ^ A prefix for the document ID
-> DocId -- ^ The document ID
-> Maybe DocRev -- ^ An optional document revision
-> RequestBuilder ()
accessBase prefix docid rev = do
docPath prefix docid
maybe (return ()) (setHeaders . return . ("If-None-Match" ,) . reqDocRev) rev
-- | All modifications want to allow conflict recognition and parameters | 403 | accessBase :: ByteString -- ^ A prefix for the document ID
-> DocId -- ^ The document ID
-> Maybe DocRev -- ^ An optional document revision
-> RequestBuilder ()
accessBase prefix docid rev = do
docPath prefix docid
maybe (return ()) (setHeaders . return . ("If-None-Match" ,) . reqDocRev) rev
-- | All modifications want to allow conflict recognition and parameters | 403 | accessBase prefix docid rev = do
docPath prefix docid
maybe (return ()) (setHeaders . return . ("If-None-Match" ,) . reqDocRev) rev
-- | All modifications want to allow conflict recognition and parameters | 209 | false | true | 0 | 11 | 99 | 87 | 44 | 43 | null | null |
IreneKnapp/direct-sqlite | Database/SQLite3.hs | mit | -- | <https://www.sqlite.org/c3ref/step.html>
--
-- Faster step for statements that don't callback to Haskell
-- functions (e.g. by using custom SQL functions).
stepNoCB :: Statement -> IO StepResult
stepNoCB statement =
Direct.stepNoCB statement >>= checkError (DetailStatement statement) "stepNoCB" | 304 | stepNoCB :: Statement -> IO StepResult
stepNoCB statement =
Direct.stepNoCB statement >>= checkError (DetailStatement statement) "stepNoCB" | 143 | stepNoCB statement =
Direct.stepNoCB statement >>= checkError (DetailStatement statement) "stepNoCB" | 104 | true | true | 0 | 8 | 41 | 45 | 23 | 22 | null | null |
phischu/fragnix | tests/packages/scotty/Text.PrettyPrint.Annotated.HughesPJ.hs | bsd-3-clause | reduceHoriz doc = (NotEmpty, doc) | 44 | reduceHoriz doc = (NotEmpty, doc) | 44 | reduceHoriz doc = (NotEmpty, doc) | 44 | false | false | 0 | 5 | 15 | 15 | 8 | 7 | null | null |
boj/garbage | src/NaiveGame2.hs | bsd-3-clause | nloops !w n = nloops (loop w) (n - 1) | 37 | nloops !w n = nloops (loop w) (n - 1) | 37 | nloops !w n = nloops (loop w) (n - 1) | 37 | false | false | 0 | 7 | 9 | 30 | 14 | 16 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M08/D22/Exercise.hs | mit | hashtags :: [GraphJ] -> [(String, Hashtag)]
hashtags = undefined | 64 | hashtags :: [GraphJ] -> [(String, Hashtag)]
hashtags = undefined | 64 | hashtags = undefined | 20 | false | true | 0 | 7 | 8 | 27 | 16 | 11 | null | null |
iliastsi/gac | src/basicTypes/UnTypedAst.hs | mit | dumpUStmt :: Int -> UStmt -> String
-- UStmtNothing
dumpUStmt ind UStmtNothing = indent ind ++ ";" | 98 | dumpUStmt :: Int -> UStmt -> String
dumpUStmt ind UStmtNothing = indent ind ++ ";" | 82 | dumpUStmt ind UStmtNothing = indent ind ++ ";" | 46 | true | true | 0 | 6 | 16 | 32 | 16 | 16 | null | null |
utdemir/wai | warp/Network/Wai/Handler/Warp/Response.hs | mit | containsNewlines :: ByteString -> Bool
containsNewlines = S.any (\w -> w == _cr || w == _lf) | 92 | containsNewlines :: ByteString -> Bool
containsNewlines = S.any (\w -> w == _cr || w == _lf) | 92 | containsNewlines = S.any (\w -> w == _cr || w == _lf) | 53 | false | true | 0 | 10 | 16 | 40 | 21 | 19 | null | null |
antonlogvinenko/javelin | src/Javelin/Lib/ByteCode/Stats.hs | mit | oc LStore2 = "lstore_2" | 23 | oc LStore2 = "lstore_2" | 23 | oc LStore2 = "lstore_2" | 23 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
musixmatch/thrift | lib/hs/src/TBinaryProtocol.hs | apache-2.0 | floatBits :: Double -> Word64
floatBits (D# d#) = W64# (unsafeCoerce# d#) | 77 | floatBits :: Double -> Word64
floatBits (D# d#) = W64# (unsafeCoerce# d#) | 73 | floatBits (D# d#) = W64# (unsafeCoerce# d#) | 43 | false | true | 0 | 7 | 15 | 33 | 16 | 17 | null | null |
enolan/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | idemodeProcess fn (SetOpt ShowOrigErr) = do process fn (SetOpt ShowOrigErr)
iPrintResult "" | 135 | idemodeProcess fn (SetOpt ShowOrigErr) = do process fn (SetOpt ShowOrigErr)
iPrintResult "" | 135 | idemodeProcess fn (SetOpt ShowOrigErr) = do process fn (SetOpt ShowOrigErr)
iPrintResult "" | 135 | false | false | 0 | 9 | 55 | 37 | 16 | 21 | null | null |
joelburget/daily-typecheckers | src/Day2.hs | bsd-3-clause | check :: Ctx -> (CExpr :<: Val) -> Either String ()
check ctx (tm :<: ty) = case tm of
Lam expr -> case ty of
VPi specDomTy codomTy ->
-- just check that the body returns the codomain given an input of the
-- domain
check ((VVar 0 :<: specDomTy) <: ctx) (expr :<: codomTy specDomTy)
_ -> Left "this lambda is not that other thing"
CheckI expr -> do
iTy <- infer ctx expr
case (ty, iTy) of
(_, Ok iTy') -> if iTy' == ty then Right () else Left "failed checking!"
(VPi specDomTy specCodomTy, IPi iDomTy iCodomTy) -> do
when (specDomTy /= iDomTy) $ Left "failed checking!"
_ <- iCodomTy specDomTy
return ()
_ -> Left "okay, well this doesn't match at all" | 732 | check :: Ctx -> (CExpr :<: Val) -> Either String ()
check ctx (tm :<: ty) = case tm of
Lam expr -> case ty of
VPi specDomTy codomTy ->
-- just check that the body returns the codomain given an input of the
-- domain
check ((VVar 0 :<: specDomTy) <: ctx) (expr :<: codomTy specDomTy)
_ -> Left "this lambda is not that other thing"
CheckI expr -> do
iTy <- infer ctx expr
case (ty, iTy) of
(_, Ok iTy') -> if iTy' == ty then Right () else Left "failed checking!"
(VPi specDomTy specCodomTy, IPi iDomTy iCodomTy) -> do
when (specDomTy /= iDomTy) $ Left "failed checking!"
_ <- iCodomTy specDomTy
return ()
_ -> Left "okay, well this doesn't match at all" | 732 | check ctx (tm :<: ty) = case tm of
Lam expr -> case ty of
VPi specDomTy codomTy ->
-- just check that the body returns the codomain given an input of the
-- domain
check ((VVar 0 :<: specDomTy) <: ctx) (expr :<: codomTy specDomTy)
_ -> Left "this lambda is not that other thing"
CheckI expr -> do
iTy <- infer ctx expr
case (ty, iTy) of
(_, Ok iTy') -> if iTy' == ty then Right () else Left "failed checking!"
(VPi specDomTy specCodomTy, IPi iDomTy iCodomTy) -> do
when (specDomTy /= iDomTy) $ Left "failed checking!"
_ <- iCodomTy specDomTy
return ()
_ -> Left "okay, well this doesn't match at all" | 680 | false | true | 0 | 19 | 206 | 259 | 124 | 135 | null | null |
flocc-net/flocc | v0.1/Compiler/Types2/TypeAssignment.hs | apache-2.0 | typeOfVal (I _) = intTy | 23 | typeOfVal (I _) = intTy | 23 | typeOfVal (I _) = intTy | 23 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'McfDataRowsItemItemConversionPathValueItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mdriicpviInteractionType'
--
-- * 'mdriicpviNodeValue'
mcfDataRowsItemItemConversionPathValueItem
:: McfDataRowsItemItemConversionPathValueItem
mcfDataRowsItemItemConversionPathValueItem =
McfDataRowsItemItemConversionPathValueItem'
{_mdriicpviInteractionType = Nothing, _mdriicpviNodeValue = Nothing} | 514 | mcfDataRowsItemItemConversionPathValueItem
:: McfDataRowsItemItemConversionPathValueItem
mcfDataRowsItemItemConversionPathValueItem =
McfDataRowsItemItemConversionPathValueItem'
{_mdriicpviInteractionType = Nothing, _mdriicpviNodeValue = Nothing} | 256 | mcfDataRowsItemItemConversionPathValueItem =
McfDataRowsItemItemConversionPathValueItem'
{_mdriicpviInteractionType = Nothing, _mdriicpviNodeValue = Nothing} | 163 | true | true | 1 | 7 | 59 | 39 | 23 | 16 | null | null |
koengit/induction-examples | Sort_MergeSortBottomUp.hs | mit | --------------------------------------------------------------------------------
ordered :: Ord a => [a] -> Bool
ordered [] = True | 137 | ordered :: Ord a => [a] -> Bool
ordered [] = True | 55 | ordered [] = True | 23 | true | true | 0 | 7 | 19 | 35 | 17 | 18 | null | null |
betaveros/bcodex | Text/Bcodex/Radix.hs | mit | toUpperRadixStream :: Int -> CxList Int -> CxList Char
toUpperRadixStream radix = mapRights toUpper . toRadixStream radix | 121 | toUpperRadixStream :: Int -> CxList Int -> CxList Char
toUpperRadixStream radix = mapRights toUpper . toRadixStream radix | 121 | toUpperRadixStream radix = mapRights toUpper . toRadixStream radix | 66 | false | true | 0 | 7 | 16 | 38 | 17 | 21 | null | null |
codingiam/sandbox-hs | src/Ch04a.hs | bsd-3-clause | elem' :: (Eq a) => a -> [a] -> Bool
elem' e = foldl (\a y -> if e == y then True else a) False | 94 | elem' :: (Eq a) => a -> [a] -> Bool
elem' e = foldl (\a y -> if e == y then True else a) False | 94 | elem' e = foldl (\a y -> if e == y then True else a) False | 58 | false | true | 0 | 9 | 25 | 61 | 33 | 28 | null | null |
sixears/rainbow-lines | src/Console/Rainbow.hs | mit | clines :: Stringish s => [Chunk s] -> CLines s
clines = CLines . clines'
where -- take a list of chunks, split embedded chunks at newlines to
-- produce a non-empty list of clines
clines' :: Stringish s => [Chunk s] -> [CLine s]
clines' cs = fmap (CLine . reverse) . reverse $ foldl f [] cs
-- given a list of proto-clines (each [Chunk s] will be a
-- proto-cline), and another chunk, split the chunk as necessary;
-- add the pieces to the existing proto-cline or form new
-- cline(s) as appropriate
f :: Stringish s => [[Chunk s]] -> Chunk s -> [[Chunk s]]
f a c = case a of
[] -> fmap (:[]) . reverse $ lines' c
a' : as ->
case lines' c of
[] -> -- lines' is guaranteed to never
-- return the empty list
error "lines' gave []!"
[x] -> -- a single-element list; no line breaks
(x : a') : as
l' : ls -> concat [ fmap (:[]) (reverse ls)
, [l' : a']
, as ]
--------------------------------------------------------------------------------
-- putLn -------------------------------
-- | write a newline to stdout | 1,563 | clines :: Stringish s => [Chunk s] -> CLines s
clines = CLines . clines'
where -- take a list of chunks, split embedded chunks at newlines to
-- produce a non-empty list of clines
clines' :: Stringish s => [Chunk s] -> [CLine s]
clines' cs = fmap (CLine . reverse) . reverse $ foldl f [] cs
-- given a list of proto-clines (each [Chunk s] will be a
-- proto-cline), and another chunk, split the chunk as necessary;
-- add the pieces to the existing proto-cline or form new
-- cline(s) as appropriate
f :: Stringish s => [[Chunk s]] -> Chunk s -> [[Chunk s]]
f a c = case a of
[] -> fmap (:[]) . reverse $ lines' c
a' : as ->
case lines' c of
[] -> -- lines' is guaranteed to never
-- return the empty list
error "lines' gave []!"
[x] -> -- a single-element list; no line breaks
(x : a') : as
l' : ls -> concat [ fmap (:[]) (reverse ls)
, [l' : a']
, as ]
--------------------------------------------------------------------------------
-- putLn -------------------------------
-- | write a newline to stdout | 1,563 | clines = CLines . clines'
where -- take a list of chunks, split embedded chunks at newlines to
-- produce a non-empty list of clines
clines' :: Stringish s => [Chunk s] -> [CLine s]
clines' cs = fmap (CLine . reverse) . reverse $ foldl f [] cs
-- given a list of proto-clines (each [Chunk s] will be a
-- proto-cline), and another chunk, split the chunk as necessary;
-- add the pieces to the existing proto-cline or form new
-- cline(s) as appropriate
f :: Stringish s => [[Chunk s]] -> Chunk s -> [[Chunk s]]
f a c = case a of
[] -> fmap (:[]) . reverse $ lines' c
a' : as ->
case lines' c of
[] -> -- lines' is guaranteed to never
-- return the empty list
error "lines' gave []!"
[x] -> -- a single-element list; no line breaks
(x : a') : as
l' : ls -> concat [ fmap (:[]) (reverse ls)
, [l' : a']
, as ]
--------------------------------------------------------------------------------
-- putLn -------------------------------
-- | write a newline to stdout | 1,516 | false | true | 0 | 17 | 747 | 289 | 152 | 137 | null | null |
qpliu/esolang | featured/glass.hs | gpl-3.0 | cmdPushNum :: Float -> Op
cmdPushNum num cont st@State{stStack = stack} =
incPC cont st{stStack = ValNum num:stack} | 119 | cmdPushNum :: Float -> Op
cmdPushNum num cont st@State{stStack = stack} =
incPC cont st{stStack = ValNum num:stack} | 119 | cmdPushNum num cont st@State{stStack = stack} =
incPC cont st{stStack = ValNum num:stack} | 93 | false | true | 5 | 8 | 21 | 54 | 26 | 28 | null | null |
sdiehl/ghc | compiler/utils/Pretty.hs | bsd-3-clause | sepNB g p k ys
= sep1 g p k ys | 32 | sepNB g p k ys
= sep1 g p k ys | 32 | sepNB g p k ys
= sep1 g p k ys | 32 | false | false | 0 | 5 | 12 | 24 | 11 | 13 | null | null |
yuto-matsum/contest-util-hs | src/My/List.hs | mit | -- リストと計算結果のタプル列を作成
traceList :: (a -> b) -> [a] -> [(a,b)]
traceList op xs = zip xs (map op xs) | 96 | traceList :: (a -> b) -> [a] -> [(a,b)]
traceList op xs = zip xs (map op xs) | 76 | traceList op xs = zip xs (map op xs) | 36 | true | true | 0 | 8 | 19 | 57 | 31 | 26 | null | null |
iqsf/HFitUI | src/WebUI/Scripts/JavaScript/HJSElementDOM.hs | bsd-3-clause | -- Добавляем слушателя
addEventListener :: (BuilderHSL l)
=> String
-> l
-> Bool
-> HSL HLangJS HLangJS
addEventListener tp listener flag = do
c <- ask
hl <- return $ HL $ "window.addEventListener( \'" ++ tp ++ "\'," ++ (buildHSL_L c listener) ++ "," ++ (buildHSL c flag) ++ " );" ++ (hbc_entryLine c)
modify (:> hl)
return hl | 414 | addEventListener :: (BuilderHSL l)
=> String
-> l
-> Bool
-> HSL HLangJS HLangJS
addEventListener tp listener flag = do
c <- ask
hl <- return $ HL $ "window.addEventListener( \'" ++ tp ++ "\'," ++ (buildHSL_L c listener) ++ "," ++ (buildHSL c flag) ++ " );" ++ (hbc_entryLine c)
modify (:> hl)
return hl | 390 | addEventListener tp listener flag = do
c <- ask
hl <- return $ HL $ "window.addEventListener( \'" ++ tp ++ "\'," ++ (buildHSL_L c listener) ++ "," ++ (buildHSL c flag) ++ " );" ++ (hbc_entryLine c)
modify (:> hl)
return hl | 239 | true | true | 0 | 17 | 146 | 138 | 66 | 72 | null | null |
siddhanathan/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey | 70 | bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey | 70 | bindMName = varQual gHC_BASE (fsLit ">>=") bindMClassOpKey | 70 | false | false | 0 | 7 | 18 | 19 | 9 | 10 | null | null |
kazu-yamamoto/domain-auth | Network/DomainAuth/SPF/Resolver.hs | bsd-3-clause | exceptIPv4 _ = True | 37 | exceptIPv4 _ = True | 37 | exceptIPv4 _ = True | 37 | false | false | 0 | 4 | 21 | 10 | 4 | 6 | null | null |
Tener/personal-library-yesod | Model.hs | bsd-2-clause | showRole GuestRole = "guest" | 28 | showRole GuestRole = "guest" | 28 | showRole GuestRole = "guest" | 28 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
taojang/haskell-programming-book-exercise | src/ch28/Chapter28.hs | bsd-3-clause | snoc :: DList a -> a -> DList a
--snoc (DL f) x = DL $ foldr (:) [x] . f
snoc (DL f) x = DL $ (f [x] ++) | 104 | snoc :: DList a -> a -> DList a
snoc (DL f) x = DL $ (f [x] ++) | 63 | snoc (DL f) x = DL $ (f [x] ++) | 31 | true | true | 0 | 10 | 30 | 56 | 27 | 29 | null | null |
ivanperez-keera/Yampa | yampa/src/FRP/Yampa/Hybrid.hs | bsd-3-clause | dHold :: a -> SF (Event a) a
dHold a0 = hold a0 >>> iPre a0 | 59 | dHold :: a -> SF (Event a) a
dHold a0 = hold a0 >>> iPre a0 | 59 | dHold a0 = hold a0 >>> iPre a0 | 30 | false | true | 2 | 9 | 15 | 44 | 19 | 25 | null | null |
nomeata/ghc | compiler/vectorise/Vectorise/Type/Classify.hs | bsd-3-clause | classifyTyCons :: UniqFM Bool -- ^type constructor conversion status
-> [TyCon] -- ^type constructors that need to be classified
-> ([TyCon], [TyCon], [TyCon]) -- ^tycons to be converted & not to be converted
classifyTyCons convStatus tcs = classify [] [] [] convStatus (tyConGroups tcs)
where
classify conv keep ignored _ [] = (conv, keep, ignored)
classify conv keep ignored cs ((tcs, ds) : rs)
| can_convert && must_convert
= classify (tcs ++ conv) keep ignored (cs `addListToUFM` [(tc, True) | tc <- tcs]) rs
| can_convert
= classify conv (tcs ++ keep) ignored (cs `addListToUFM` [(tc, False) | tc <- tcs]) rs
| otherwise
= classify conv keep (tcs ++ ignored) cs rs
where
refs = ds `delListFromUniqSet` tcs
can_convert = (isNullUFM (refs `minusUFM` cs) && all convertable tcs)
|| isShowClass tcs
must_convert = foldUFM (||) False (intersectUFM_C const cs refs)
&& (not . isShowClass $ tcs)
-- We currently admit Haskell 2011-style data and newtype declarations as well as type
-- constructors representing classes.
convertable tc
= (isDataTyCon tc || isNewTyCon tc) && all isVanillaDataCon (tyConDataCons tc)
|| isClassTyCon tc
-- !!!FIXME: currently we allow 'Show' in vectorised code without actually providing a
-- vectorised definition (to be able to vectorise 'Num')
isShowClass [tc] = tyConName tc == showClassName
isShowClass _ = False
-- Used to group type constructors into mutually dependent groups.
-- | 1,718 | classifyTyCons :: UniqFM Bool -- ^type constructor conversion status
-> [TyCon] -- ^type constructors that need to be classified
-> ([TyCon], [TyCon], [TyCon])
classifyTyCons convStatus tcs = classify [] [] [] convStatus (tyConGroups tcs)
where
classify conv keep ignored _ [] = (conv, keep, ignored)
classify conv keep ignored cs ((tcs, ds) : rs)
| can_convert && must_convert
= classify (tcs ++ conv) keep ignored (cs `addListToUFM` [(tc, True) | tc <- tcs]) rs
| can_convert
= classify conv (tcs ++ keep) ignored (cs `addListToUFM` [(tc, False) | tc <- tcs]) rs
| otherwise
= classify conv keep (tcs ++ ignored) cs rs
where
refs = ds `delListFromUniqSet` tcs
can_convert = (isNullUFM (refs `minusUFM` cs) && all convertable tcs)
|| isShowClass tcs
must_convert = foldUFM (||) False (intersectUFM_C const cs refs)
&& (not . isShowClass $ tcs)
-- We currently admit Haskell 2011-style data and newtype declarations as well as type
-- constructors representing classes.
convertable tc
= (isDataTyCon tc || isNewTyCon tc) && all isVanillaDataCon (tyConDataCons tc)
|| isClassTyCon tc
-- !!!FIXME: currently we allow 'Show' in vectorised code without actually providing a
-- vectorised definition (to be able to vectorise 'Num')
isShowClass [tc] = tyConName tc == showClassName
isShowClass _ = False
-- Used to group type constructors into mutually dependent groups.
-- | 1,665 | classifyTyCons convStatus tcs = classify [] [] [] convStatus (tyConGroups tcs)
where
classify conv keep ignored _ [] = (conv, keep, ignored)
classify conv keep ignored cs ((tcs, ds) : rs)
| can_convert && must_convert
= classify (tcs ++ conv) keep ignored (cs `addListToUFM` [(tc, True) | tc <- tcs]) rs
| can_convert
= classify conv (tcs ++ keep) ignored (cs `addListToUFM` [(tc, False) | tc <- tcs]) rs
| otherwise
= classify conv keep (tcs ++ ignored) cs rs
where
refs = ds `delListFromUniqSet` tcs
can_convert = (isNullUFM (refs `minusUFM` cs) && all convertable tcs)
|| isShowClass tcs
must_convert = foldUFM (||) False (intersectUFM_C const cs refs)
&& (not . isShowClass $ tcs)
-- We currently admit Haskell 2011-style data and newtype declarations as well as type
-- constructors representing classes.
convertable tc
= (isDataTyCon tc || isNewTyCon tc) && all isVanillaDataCon (tyConDataCons tc)
|| isClassTyCon tc
-- !!!FIXME: currently we allow 'Show' in vectorised code without actually providing a
-- vectorised definition (to be able to vectorise 'Num')
isShowClass [tc] = tyConName tc == showClassName
isShowClass _ = False
-- Used to group type constructors into mutually dependent groups.
-- | 1,431 | true | true | 6 | 12 | 526 | 425 | 231 | 194 | null | null |
danidiaz/tailfile-hinotify | tests/tests.hs | mit | newlines :: [ByteString] -> ByteString
newlines bs = mconcat . map (\b -> b <> "\n") $ bs | 89 | newlines :: [ByteString] -> ByteString
newlines bs = mconcat . map (\b -> b <> "\n") $ bs | 89 | newlines bs = mconcat . map (\b -> b <> "\n") $ bs | 50 | false | true | 0 | 10 | 17 | 44 | 23 | 21 | null | null |
Elastifile/git-sling | server/src/Sling/Lib.hs | gpl-2.0 | eprintTo :: System.IO.Handle -> Text -> EShell ()
eprintTo x t = liftIO $ do
System.IO.hPutStrLn x (T.unpack t)
System.IO.hFlush x | 138 | eprintTo :: System.IO.Handle -> Text -> EShell ()
eprintTo x t = liftIO $ do
System.IO.hPutStrLn x (T.unpack t)
System.IO.hFlush x | 138 | eprintTo x t = liftIO $ do
System.IO.hPutStrLn x (T.unpack t)
System.IO.hFlush x | 88 | false | true | 0 | 11 | 28 | 64 | 31 | 33 | null | null |
prSquirrel/turingmachine | src/Machine.hs | bsd-3-clause | buildAcceptanceMap :: [Transition] -> Map Accept Transition
buildAcceptanceMap transitions =
Map.fromList tuples
where
tuples = map accept transitions `zip` transitions | 176 | buildAcceptanceMap :: [Transition] -> Map Accept Transition
buildAcceptanceMap transitions =
Map.fromList tuples
where
tuples = map accept transitions `zip` transitions | 176 | buildAcceptanceMap transitions =
Map.fromList tuples
where
tuples = map accept transitions `zip` transitions | 116 | false | true | 0 | 6 | 27 | 50 | 25 | 25 | null | null |
gafiatulin/codewars | src/4 kyu/SumByFactors.hs | mit | sumOfDivided xs = toAscList . fromListWith (+) . concatMap (\n -> map (\d -> (d, n)) . divisors $ n ) $ xs | 106 | sumOfDivided xs = toAscList . fromListWith (+) . concatMap (\n -> map (\d -> (d, n)) . divisors $ n ) $ xs | 106 | sumOfDivided xs = toAscList . fromListWith (+) . concatMap (\n -> map (\d -> (d, n)) . divisors $ n ) $ xs | 106 | false | false | 0 | 15 | 22 | 62 | 33 | 29 | null | null |
brendanhay/khan | khan/Khan/Model/IAM/Role.hs | mpl-2.0 | update :: Naming a => a -> TrustPath -> PolicyPath -> AWS Role
update (names -> n@Names{..}) tpath ppath = do
(t, p) <- (,)
<$> renderTemplate o (_trust tpath)
<*> renderTemplate o (_policy ppath)
i <- sendAsync $ CreateInstanceProfile profileName Nothing
r <- sendAsync $ CreateRole (LText.toStrict t) Nothing profileName
b <- wait i >>= created
_ <- wait r >>= created
ar <- sendAsync $ AddRoleToInstanceProfile profileName profileName
pr <- sendAsync $ PutRolePolicy (LText.toStrict p) profileName profileName
wait ar >>= verifyIAM "LimitExceeded"
waitAsync_ pr <* say "Updated policy for Role {}" [profileName]
when b $ do
say "Waiting {} seconds for IAM Role replication..." [B delay]
delaySeconds delay
find n
where
Object o = toJSON n
created (Right _) = return True
created e = verifyIAM "EntityAlreadyExists" e >> return False
delay = 5 | 956 | update :: Naming a => a -> TrustPath -> PolicyPath -> AWS Role
update (names -> n@Names{..}) tpath ppath = do
(t, p) <- (,)
<$> renderTemplate o (_trust tpath)
<*> renderTemplate o (_policy ppath)
i <- sendAsync $ CreateInstanceProfile profileName Nothing
r <- sendAsync $ CreateRole (LText.toStrict t) Nothing profileName
b <- wait i >>= created
_ <- wait r >>= created
ar <- sendAsync $ AddRoleToInstanceProfile profileName profileName
pr <- sendAsync $ PutRolePolicy (LText.toStrict p) profileName profileName
wait ar >>= verifyIAM "LimitExceeded"
waitAsync_ pr <* say "Updated policy for Role {}" [profileName]
when b $ do
say "Waiting {} seconds for IAM Role replication..." [B delay]
delaySeconds delay
find n
where
Object o = toJSON n
created (Right _) = return True
created e = verifyIAM "EntityAlreadyExists" e >> return False
delay = 5 | 956 | update (names -> n@Names{..}) tpath ppath = do
(t, p) <- (,)
<$> renderTemplate o (_trust tpath)
<*> renderTemplate o (_policy ppath)
i <- sendAsync $ CreateInstanceProfile profileName Nothing
r <- sendAsync $ CreateRole (LText.toStrict t) Nothing profileName
b <- wait i >>= created
_ <- wait r >>= created
ar <- sendAsync $ AddRoleToInstanceProfile profileName profileName
pr <- sendAsync $ PutRolePolicy (LText.toStrict p) profileName profileName
wait ar >>= verifyIAM "LimitExceeded"
waitAsync_ pr <* say "Updated policy for Role {}" [profileName]
when b $ do
say "Waiting {} seconds for IAM Role replication..." [B delay]
delaySeconds delay
find n
where
Object o = toJSON n
created (Right _) = return True
created e = verifyIAM "EntityAlreadyExists" e >> return False
delay = 5 | 893 | false | true | 3 | 12 | 246 | 346 | 155 | 191 | null | null |
gspindles/mj-score-eval | src/Game/Mahjong/Static/Examples.hs | mit | threeConsecutiveTripletsEx :: Maybe Hand
threeConsecutiveTripletsEx = mkHand1
[ mkTriplet' Revealed k5
, mkTriplet' Revealed k6
, mkSequence' Concealed c2
, mkPair' Concealed dg
, mkTriplet' Revealed k7
]
[]
Nothing | 231 | threeConsecutiveTripletsEx :: Maybe Hand
threeConsecutiveTripletsEx = mkHand1
[ mkTriplet' Revealed k5
, mkTriplet' Revealed k6
, mkSequence' Concealed c2
, mkPair' Concealed dg
, mkTriplet' Revealed k7
]
[]
Nothing | 231 | threeConsecutiveTripletsEx = mkHand1
[ mkTriplet' Revealed k5
, mkTriplet' Revealed k6
, mkSequence' Concealed c2
, mkPair' Concealed dg
, mkTriplet' Revealed k7
]
[]
Nothing | 190 | false | true | 0 | 6 | 45 | 65 | 31 | 34 | null | null |
edgarklerks/document-indexer | RebuildSources.hs | bsd-2-clause | rebuild_man_pages :: [String] -> IO ()
rebuild_man_pages xs = shelly $ run_ "index_man_pages" (T.pack <$> xs) | 109 | rebuild_man_pages :: [String] -> IO ()
rebuild_man_pages xs = shelly $ run_ "index_man_pages" (T.pack <$> xs) | 109 | rebuild_man_pages xs = shelly $ run_ "index_man_pages" (T.pack <$> xs) | 70 | false | true | 0 | 9 | 15 | 48 | 23 | 25 | null | null |
jmitchell/Idris-dev | src/Idris/IdrisDoc.hs | bsd-3-clause | hasDoc _ = False | 29 | hasDoc _ = False | 29 | hasDoc _ = False | 29 | false | false | 0 | 5 | 16 | 9 | 4 | 5 | null | null |
petertseng/adventofcode-hs | bin/15_cookies.hs | apache-2.0 | main :: IO ()
main = do
s <- readInputFile
let ingredients = map parseIngredient (lines s)
sorted = sortOn (minimum . fst) ingredients
limit = limitOfFirst (repeat 0) 100 (map otherTraits sorted)
tries = case length ingredients of
4 -> [(a, b, c) | a <- [0..limit]
, b <- [0..limitOfFirst
(map (* a) (otherTraits (head sorted)))
(100 - a)
(map otherTraits (tail sorted))]
, c <- [0..(100-a-b)]]
3 -> [(a, b, 100 - a - b) | a <- [0..100], b <- [0..(100-a)]]
2 -> [(a, 100 - a, 0) | a <- [0..100]]
_ -> error "can't handle ingredient list of size other than 2 through 4."
cookies = mapMaybe (cookie sorted) tries
(cookies500, cookies') = partition ((== 500) . snd) cookies
best = maximum . map fst
print (best cookies')
print (best cookies500) | 976 | main :: IO ()
main = do
s <- readInputFile
let ingredients = map parseIngredient (lines s)
sorted = sortOn (minimum . fst) ingredients
limit = limitOfFirst (repeat 0) 100 (map otherTraits sorted)
tries = case length ingredients of
4 -> [(a, b, c) | a <- [0..limit]
, b <- [0..limitOfFirst
(map (* a) (otherTraits (head sorted)))
(100 - a)
(map otherTraits (tail sorted))]
, c <- [0..(100-a-b)]]
3 -> [(a, b, 100 - a - b) | a <- [0..100], b <- [0..(100-a)]]
2 -> [(a, 100 - a, 0) | a <- [0..100]]
_ -> error "can't handle ingredient list of size other than 2 through 4."
cookies = mapMaybe (cookie sorted) tries
(cookies500, cookies') = partition ((== 500) . snd) cookies
best = maximum . map fst
print (best cookies')
print (best cookies500) | 976 | main = do
s <- readInputFile
let ingredients = map parseIngredient (lines s)
sorted = sortOn (minimum . fst) ingredients
limit = limitOfFirst (repeat 0) 100 (map otherTraits sorted)
tries = case length ingredients of
4 -> [(a, b, c) | a <- [0..limit]
, b <- [0..limitOfFirst
(map (* a) (otherTraits (head sorted)))
(100 - a)
(map otherTraits (tail sorted))]
, c <- [0..(100-a-b)]]
3 -> [(a, b, 100 - a - b) | a <- [0..100], b <- [0..(100-a)]]
2 -> [(a, 100 - a, 0) | a <- [0..100]]
_ -> error "can't handle ingredient list of size other than 2 through 4."
cookies = mapMaybe (cookie sorted) tries
(cookies500, cookies') = partition ((== 500) . snd) cookies
best = maximum . map fst
print (best cookies')
print (best cookies500) | 962 | false | true | 0 | 23 | 371 | 401 | 210 | 191 | null | null |
xnning/TypeInfer | src/TypeCheck.hs | gpl-3.0 | bicheck p@(Pi bnd) Infer = do
(x, tau1, tau2) <- unpi p
checktype tau1 Star
ctxAddCstrVar x tau1
checktype tau2 Star
throwAfterVar x
return estar
-- AX | 163 | bicheck p@(Pi bnd) Infer = do
(x, tau1, tau2) <- unpi p
checktype tau1 Star
ctxAddCstrVar x tau1
checktype tau2 Star
throwAfterVar x
return estar
-- AX | 163 | bicheck p@(Pi bnd) Infer = do
(x, tau1, tau2) <- unpi p
checktype tau1 Star
ctxAddCstrVar x tau1
checktype tau2 Star
throwAfterVar x
return estar
-- AX | 163 | false | false | 0 | 8 | 38 | 80 | 34 | 46 | null | null |
kranich/haste-compiler | libraries/haste-lib/src/Haste/DOM.hs | bsd-3-clause | -- | Perform an IO action over the a list of elements matching a query
-- selector.
withElemsQS :: (IsElem e, MonadIO m)
=> e
-> QuerySelector
-> ([Elem] -> m a)
-> m a
withElemsQS el = J.withElemsQS el . toJSStr | 262 | withElemsQS :: (IsElem e, MonadIO m)
=> e
-> QuerySelector
-> ([Elem] -> m a)
-> m a
withElemsQS el = J.withElemsQS el . toJSStr | 176 | withElemsQS el = J.withElemsQS el . toJSStr | 43 | true | true | 0 | 11 | 91 | 68 | 35 | 33 | null | null |
apunktbau/co4 | src/CO4/Frontend/TH.hs | gpl-3.0 | parsePreprocessedTHDeclarations :: MonadUnique u => [TH.Dec] -> u Program
parsePreprocessedTHDeclarations decs = assert (check decs) $
preprocessDecs decs >>= return . parseTHDeclarations | 189 | parsePreprocessedTHDeclarations :: MonadUnique u => [TH.Dec] -> u Program
parsePreprocessedTHDeclarations decs = assert (check decs) $
preprocessDecs decs >>= return . parseTHDeclarations | 189 | parsePreprocessedTHDeclarations decs = assert (check decs) $
preprocessDecs decs >>= return . parseTHDeclarations | 115 | false | true | 2 | 8 | 23 | 59 | 28 | 31 | null | null |
ribag/ganeti-experiments | src/Ganeti/Constants.hs | gpl-2.0 | idiskAccess :: String
idiskAccess = "access" | 44 | idiskAccess :: String
idiskAccess = "access" | 44 | idiskAccess = "access" | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
crazymaik/ard-haskell | lib/ARD/Parser.hs | mit | pAmbientLight :: SceneParser ()
pAmbientLight = do
try $ pSymbol "ambientLight"
light <- pLightBlock
spaces
updateState $ \c -> c { ambientLight = Just light } | 167 | pAmbientLight :: SceneParser ()
pAmbientLight = do
try $ pSymbol "ambientLight"
light <- pLightBlock
spaces
updateState $ \c -> c { ambientLight = Just light } | 167 | pAmbientLight = do
try $ pSymbol "ambientLight"
light <- pLightBlock
spaces
updateState $ \c -> c { ambientLight = Just light } | 135 | false | true | 0 | 12 | 33 | 65 | 29 | 36 | null | null |
unisonweb/platform | unison-core/src/Unison/Names3.hs | mit | -- Finds all the constructors for the given type in the `Names0`
constructorsForType0 :: Reference -> Names0 -> [(Name,Referent)]
constructorsForType0 r ns = let
-- rather than searching all of names, we use the known possible forms
-- that the constructors can take
possibleDatas = [ Referent.Con r cid CT.Data | cid <- [0..] ]
possibleEffects = [ Referent.Con r cid CT.Effect | cid <- [0..] ]
trim [] = []
trim (h:t) = case R.lookupRan h (terms0 ns) of
s | Set.null s -> []
| otherwise -> [ (n,h) | n <- toList s ] ++ trim t
in trim possibleEffects ++ trim possibleDatas | 599 | constructorsForType0 :: Reference -> Names0 -> [(Name,Referent)]
constructorsForType0 r ns = let
-- rather than searching all of names, we use the known possible forms
-- that the constructors can take
possibleDatas = [ Referent.Con r cid CT.Data | cid <- [0..] ]
possibleEffects = [ Referent.Con r cid CT.Effect | cid <- [0..] ]
trim [] = []
trim (h:t) = case R.lookupRan h (terms0 ns) of
s | Set.null s -> []
| otherwise -> [ (n,h) | n <- toList s ] ++ trim t
in trim possibleEffects ++ trim possibleDatas | 534 | constructorsForType0 r ns = let
-- rather than searching all of names, we use the known possible forms
-- that the constructors can take
possibleDatas = [ Referent.Con r cid CT.Data | cid <- [0..] ]
possibleEffects = [ Referent.Con r cid CT.Effect | cid <- [0..] ]
trim [] = []
trim (h:t) = case R.lookupRan h (terms0 ns) of
s | Set.null s -> []
| otherwise -> [ (n,h) | n <- toList s ] ++ trim t
in trim possibleEffects ++ trim possibleDatas | 469 | true | true | 0 | 17 | 132 | 211 | 107 | 104 | null | null |
rueshyna/gogol | gogol-pubsub/gen/Network/Google/Resource/PubSub/Projects/Topics/Get.hs | mpl-2.0 | -- | OAuth bearer token.
ptgBearerToken :: Lens' ProjectsTopicsGet (Maybe Text)
ptgBearerToken
= lens _ptgBearerToken
(\ s a -> s{_ptgBearerToken = a}) | 159 | ptgBearerToken :: Lens' ProjectsTopicsGet (Maybe Text)
ptgBearerToken
= lens _ptgBearerToken
(\ s a -> s{_ptgBearerToken = a}) | 134 | ptgBearerToken
= lens _ptgBearerToken
(\ s a -> s{_ptgBearerToken = a}) | 79 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/phantoms/2017-07-dimensional-analysis-stephan-boyer/src/Lib.hs | unlicense | -- Example 1: Tracking units in types
-- calculate area of table
tableWidth :: Length
tableWidth = construct 1.5 | 115 | tableWidth :: Length
tableWidth = construct 1.5 | 48 | tableWidth = construct 1.5 | 27 | true | true | 0 | 5 | 21 | 16 | 9 | 7 | null | null |
nomeata/codeworld | funblocks-client/src/Blocks/Types.hs | apache-2.0 | cwMixed = standardFunction "cwMixed" "mixed" (Just "pot-mix.svg") [typeColor, typeColor, typeColor]
["COL1", "COL2"] colorColor "Two mix of two colors" | 164 | cwMixed = standardFunction "cwMixed" "mixed" (Just "pot-mix.svg") [typeColor, typeColor, typeColor]
["COL1", "COL2"] colorColor "Two mix of two colors" | 164 | cwMixed = standardFunction "cwMixed" "mixed" (Just "pot-mix.svg") [typeColor, typeColor, typeColor]
["COL1", "COL2"] colorColor "Two mix of two colors" | 164 | false | false | 0 | 7 | 30 | 42 | 23 | 19 | null | null |
danchoi/yahooQuote | web/Main.hs | mit | yahooHandler :: Snap ()
yahooHandler = do
param <- getParam "sym"
timeout' <- getParam "timeout"
let timeout :: Int
timeout = maybe (2000 :: Int) id (join . fmap (fmap fst . B.readInt) $ timeout')
freshSecs' <- (join . fmap (fmap fst . B.readInt)) `fmap` getParam "freshness"
let freshSecs = maybe (3600) id freshSecs'
maybe (writeBS help)
(\sym -> do
resp <- liftIO $
readProcess "yahooq-wrapper" [B.unpack sym, show timeout, show freshSecs] []
writeBS $ B.pack resp)
param | 575 | yahooHandler :: Snap ()
yahooHandler = do
param <- getParam "sym"
timeout' <- getParam "timeout"
let timeout :: Int
timeout = maybe (2000 :: Int) id (join . fmap (fmap fst . B.readInt) $ timeout')
freshSecs' <- (join . fmap (fmap fst . B.readInt)) `fmap` getParam "freshness"
let freshSecs = maybe (3600) id freshSecs'
maybe (writeBS help)
(\sym -> do
resp <- liftIO $
readProcess "yahooq-wrapper" [B.unpack sym, show timeout, show freshSecs] []
writeBS $ B.pack resp)
param | 575 | yahooHandler = do
param <- getParam "sym"
timeout' <- getParam "timeout"
let timeout :: Int
timeout = maybe (2000 :: Int) id (join . fmap (fmap fst . B.readInt) $ timeout')
freshSecs' <- (join . fmap (fmap fst . B.readInt)) `fmap` getParam "freshness"
let freshSecs = maybe (3600) id freshSecs'
maybe (writeBS help)
(\sym -> do
resp <- liftIO $
readProcess "yahooq-wrapper" [B.unpack sym, show timeout, show freshSecs] []
writeBS $ B.pack resp)
param | 551 | false | true | 0 | 17 | 178 | 222 | 107 | 115 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Options/All.hs | gpl-2.0 | possiblyRemoteRepo :: PrimDarcsOption (Maybe String)
possiblyRemoteRepo = singleStrArg [] ["repo"] F.WorkRepoUrl arg "URL"
"specify the repository URL"
where arg (F.WorkRepoUrl s) = Just s
arg _ = Nothing | 218 | possiblyRemoteRepo :: PrimDarcsOption (Maybe String)
possiblyRemoteRepo = singleStrArg [] ["repo"] F.WorkRepoUrl arg "URL"
"specify the repository URL"
where arg (F.WorkRepoUrl s) = Just s
arg _ = Nothing | 218 | possiblyRemoteRepo = singleStrArg [] ["repo"] F.WorkRepoUrl arg "URL"
"specify the repository URL"
where arg (F.WorkRepoUrl s) = Just s
arg _ = Nothing | 165 | false | true | 1 | 8 | 41 | 69 | 34 | 35 | null | null |
forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Gen2/Prim.hs | mit | genPrim _ _ EqStableNameOp [r] [s1,s2] = PrimInline [j| `r` = h$eqStableName(`s1`, `s2`); |] | 92 | genPrim _ _ EqStableNameOp [r] [s1,s2] = PrimInline [j| `r` = h$eqStableName(`s1`, `s2`); |] | 92 | genPrim _ _ EqStableNameOp [r] [s1,s2] = PrimInline [j| `r` = h$eqStableName(`s1`, `s2`); |] | 92 | false | false | 0 | 6 | 13 | 33 | 19 | 14 | null | null |
batterseapower/context-semantics | Language/ContextSemantics/LinearLambdaExplicit.hs | bsd-3-clause | semanticsExpr :: [(PortName, Route)] -> Expr
semanticsExpr named_routes = undefined | 83 | semanticsExpr :: [(PortName, Route)] -> Expr
semanticsExpr named_routes = undefined | 83 | semanticsExpr named_routes = undefined | 38 | false | true | 0 | 7 | 9 | 27 | 15 | 12 | null | null |
rednum/hmlk | examples/validation.hs | bsd-3-clause | tennis' = DataSet {_rows = fromList . zip [1..] $
[[Nominal "Sunny", Nominal "Hot", Nominal "Normal", Nominal "Strong", Missing],
[Nominal "Rain", Nominal "Cool", Nominal "High", Nominal "Strong", Missing],
[Nominal "Rain", Nominal "Mild", Nominal "High", Nominal "Weak", Missing],
[Nominal "Overcast", Nominal "Mild", Nominal "Normal", Nominal "Weak", Missing]],
_names' = ["Outlook", "Temperature", "Humidity", "Wind", "PlayTennis"]} | 529 | tennis' = DataSet {_rows = fromList . zip [1..] $
[[Nominal "Sunny", Nominal "Hot", Nominal "Normal", Nominal "Strong", Missing],
[Nominal "Rain", Nominal "Cool", Nominal "High", Nominal "Strong", Missing],
[Nominal "Rain", Nominal "Mild", Nominal "High", Nominal "Weak", Missing],
[Nominal "Overcast", Nominal "Mild", Nominal "Normal", Nominal "Weak", Missing]],
_names' = ["Outlook", "Temperature", "Humidity", "Wind", "PlayTennis"]} | 529 | tennis' = DataSet {_rows = fromList . zip [1..] $
[[Nominal "Sunny", Nominal "Hot", Nominal "Normal", Nominal "Strong", Missing],
[Nominal "Rain", Nominal "Cool", Nominal "High", Nominal "Strong", Missing],
[Nominal "Rain", Nominal "Mild", Nominal "High", Nominal "Weak", Missing],
[Nominal "Overcast", Nominal "Mild", Nominal "Normal", Nominal "Weak", Missing]],
_names' = ["Outlook", "Temperature", "Humidity", "Wind", "PlayTennis"]} | 529 | false | false | 1 | 11 | 146 | 176 | 94 | 82 | null | null |
xfchen/Monud | src/Main.hs | bsd-3-clause | main :: IO ()
main = session =<< execParser opts
where
opts = info (parseOptions <**> helper)
( fullDesc
<> progDesc "Monud -- A Mud client written in Haskell"
<> header "Thank you for using Monud") | 223 | main :: IO ()
main = session =<< execParser opts
where
opts = info (parseOptions <**> helper)
( fullDesc
<> progDesc "Monud -- A Mud client written in Haskell"
<> header "Thank you for using Monud") | 223 | main = session =<< execParser opts
where
opts = info (parseOptions <**> helper)
( fullDesc
<> progDesc "Monud -- A Mud client written in Haskell"
<> header "Thank you for using Monud") | 209 | false | true | 0 | 9 | 60 | 60 | 29 | 31 | null | null |
HIPERFIT/futhark | src/Futhark/Internalise/AccurateSizes.hs | isc | -- | Reshape the arguments to a function so that they fit the expected
-- shape declarations. Not used to change rank of arguments. Assumes
-- everything is otherwise type-correct.
ensureArgShapes ::
(Typed (TypeBase Shape u)) =>
ErrorMsg SubExp ->
SrcLoc ->
[VName] ->
[TypeBase Shape u] ->
[SubExp] ->
InternaliseM [SubExp]
ensureArgShapes msg loc shapes paramts args =
zipWithM ensureArgShape (expectedTypes shapes paramts args) args
where
ensureArgShape _ (Constant v) = return $ Constant v
ensureArgShape t (Var v)
| arrayRank t < 1 = return $ Var v
| otherwise =
ensureShape msg loc t (baseString v) $ Var v | 661 | ensureArgShapes ::
(Typed (TypeBase Shape u)) =>
ErrorMsg SubExp ->
SrcLoc ->
[VName] ->
[TypeBase Shape u] ->
[SubExp] ->
InternaliseM [SubExp]
ensureArgShapes msg loc shapes paramts args =
zipWithM ensureArgShape (expectedTypes shapes paramts args) args
where
ensureArgShape _ (Constant v) = return $ Constant v
ensureArgShape t (Var v)
| arrayRank t < 1 = return $ Var v
| otherwise =
ensureShape msg loc t (baseString v) $ Var v | 478 | ensureArgShapes msg loc shapes paramts args =
zipWithM ensureArgShape (expectedTypes shapes paramts args) args
where
ensureArgShape _ (Constant v) = return $ Constant v
ensureArgShape t (Var v)
| arrayRank t < 1 = return $ Var v
| otherwise =
ensureShape msg loc t (baseString v) $ Var v | 319 | true | true | 3 | 12 | 149 | 193 | 95 | 98 | null | null |
soupi/chip-8 | src/CPU/Emulate.hs | bsd-3-clause | -- |
-- Opcode 0x7vnn
-- Add the immediate value nn to the register v
-- changes the register v
addToRegister :: W.Word8 -> W.Word8 -> Instruction
addToRegister regNum value cpu =
setRegister regNum (value + vx) cpu
where vx = CPU.regVal regNum cpu
-- |
-- Opcode 0x8xy0
-- Sets the register x to the content of register y
-- changes the register x | 354 | addToRegister :: W.Word8 -> W.Word8 -> Instruction
addToRegister regNum value cpu =
setRegister regNum (value + vx) cpu
where vx = CPU.regVal regNum cpu
-- |
-- Opcode 0x8xy0
-- Sets the register x to the content of register y
-- changes the register x | 258 | addToRegister regNum value cpu =
setRegister regNum (value + vx) cpu
where vx = CPU.regVal regNum cpu
-- |
-- Opcode 0x8xy0
-- Sets the register x to the content of register y
-- changes the register x | 207 | true | true | 0 | 7 | 70 | 67 | 37 | 30 | null | null |
karamellpelle/grid | source/MEnv/Players/IOS.hs | gpl-3.0 | -- | try to play as a local player. the local player is handled with
-- playersHandleLocalPlayer, and may be called multiple times with
-- different players during the lifetime of calling program
playersAuthenticateLocalPlayer :: MEnv res ()
playersAuthenticateLocalPlayer = io $
ios_playersAuthenticateLocalPlayer | 324 | playersAuthenticateLocalPlayer :: MEnv res ()
playersAuthenticateLocalPlayer = io $
ios_playersAuthenticateLocalPlayer | 123 | playersAuthenticateLocalPlayer = io $
ios_playersAuthenticateLocalPlayer | 77 | true | true | 0 | 6 | 52 | 25 | 14 | 11 | null | null |
bacher09/darkplaces-demo | src/DarkPlaces/ProtocolConstants.hs | gpl-2.0 | su_weaponframe_bit :: Int
su_weaponframe_bit = 12 | 49 | su_weaponframe_bit :: Int
su_weaponframe_bit = 12 | 49 | su_weaponframe_bit = 12 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
bocuma/users-service | test/Helpers/Matcher.hs | mit | matchXTokenPresence :: MatchHeader
matchXTokenPresence = matchTokenPresence "X-Token" | 85 | matchXTokenPresence :: MatchHeader
matchXTokenPresence = matchTokenPresence "X-Token" | 85 | matchXTokenPresence = matchTokenPresence "X-Token" | 50 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
sdiehl/llvm-codegen | src/LLVM/Codegen/Tuple.hs | mit | mkPair :: Type -> Type
-> Operand -> Operand
-> Codegen Pair
mkPair aty bty a b = do
pair <- alloca $ tupleType aty bty
l <- inlPtr pair
r <- inrPtr pair
store l a
store r b
return $ Pair pair aty bty | 226 | mkPair :: Type -> Type
-> Operand -> Operand
-> Codegen Pair
mkPair aty bty a b = do
pair <- alloca $ tupleType aty bty
l <- inlPtr pair
r <- inrPtr pair
store l a
store r b
return $ Pair pair aty bty | 226 | mkPair aty bty a b = do
pair <- alloca $ tupleType aty bty
l <- inlPtr pair
r <- inrPtr pair
store l a
store r b
return $ Pair pair aty bty | 151 | false | true | 0 | 9 | 71 | 105 | 46 | 59 | null | null |
kaizhang/bioinformatics-toolkit | bioinformatics-toolkit/src/Bio/Motif/Alignment.hs | mit | l2 :: CombineFn
l2 = sqrt . mean . U.map (**2) | 46 | l2 :: CombineFn
l2 = sqrt . mean . U.map (**2) | 46 | l2 = sqrt . mean . U.map (**2) | 30 | false | true | 2 | 6 | 10 | 36 | 16 | 20 | null | null |
tjakway/ghcjvm | compiler/types/Coercion.hs | bsd-3-clause | ppr_axiom_rule_co :: CoAxiomRule -> [Coercion] -> SDoc
ppr_axiom_rule_co co ps = ppr (coaxrName co) <+> parens (interpp'SP ps) | 126 | ppr_axiom_rule_co :: CoAxiomRule -> [Coercion] -> SDoc
ppr_axiom_rule_co co ps = ppr (coaxrName co) <+> parens (interpp'SP ps) | 126 | ppr_axiom_rule_co co ps = ppr (coaxrName co) <+> parens (interpp'SP ps) | 71 | false | true | 0 | 8 | 17 | 54 | 25 | 29 | null | null |
pikajude/explain | src/Main.hs | mit | explainGAs :: GuardedAlts -> [Doc]
explainGAs (UnGuardedAlt e) = ["->", explain e] | 82 | explainGAs :: GuardedAlts -> [Doc]
explainGAs (UnGuardedAlt e) = ["->", explain e] | 82 | explainGAs (UnGuardedAlt e) = ["->", explain e] | 47 | false | true | 0 | 7 | 11 | 36 | 19 | 17 | null | null |
olsner/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | pprUserTypeCtxt GhciCtxt = text "a type in a GHCi command" | 67 | pprUserTypeCtxt GhciCtxt = text "a type in a GHCi command" | 67 | pprUserTypeCtxt GhciCtxt = text "a type in a GHCi command" | 67 | false | false | 0 | 5 | 18 | 12 | 5 | 7 | null | null |
michaelt/series | Series/Folding/ByteString.hs | bsd-3-clause | hGet :: Int -> IO.Handle -> Folding (Of ByteString) IO ()
hGet size h = Folding $ \construct wrap done ->
let go = do bs <- B.hGet h size
if B.null bs then return (done ())
else liftM (construct . (bs :>)) go
in wrap go | 266 | hGet :: Int -> IO.Handle -> Folding (Of ByteString) IO ()
hGet size h = Folding $ \construct wrap done ->
let go = do bs <- B.hGet h size
if B.null bs then return (done ())
else liftM (construct . (bs :>)) go
in wrap go | 266 | hGet size h = Folding $ \construct wrap done ->
let go = do bs <- B.hGet h size
if B.null bs then return (done ())
else liftM (construct . (bs :>)) go
in wrap go | 208 | false | true | 0 | 17 | 93 | 130 | 62 | 68 | null | null |
greydot/Peggy | Text/Peggy/Quote.hs | bsd-3-clause | genParser :: [(String, String)] -- ^ a list of pair of name of
-- quasi-quoter and its start nonterminal
-> Syntax -- ^ syntax
-> Q [Dec] -- ^ definitions of parsers and quasi-quoters
genParser qqs syn = do
qq <- mapM (genQQ syn) qqs
dec <- genDecs syn
return $ concat qq ++ dec
-- | 368 | genParser :: [(String, String)] -- ^ a list of pair of name of
-- quasi-quoter and its start nonterminal
-> Syntax -- ^ syntax
-> Q [Dec]
genParser qqs syn = do
qq <- mapM (genQQ syn) qqs
dec <- genDecs syn
return $ concat qq ++ dec
-- | 314 | genParser qqs syn = do
qq <- mapM (genQQ syn) qqs
dec <- genDecs syn
return $ concat qq ++ dec
-- | 107 | true | true | 0 | 10 | 142 | 91 | 45 | 46 | null | null |
Hodapp87/ivory | ivory/src/Ivory/Language/Proxy.hs | bsd-3-clause | -- | The integer associated with a type-nat.
fromTypeNat :: KnownNat i => proxy (i :: Nat) -> Integer
fromTypeNat = natVal | 123 | fromTypeNat :: KnownNat i => proxy (i :: Nat) -> Integer
fromTypeNat = natVal | 78 | fromTypeNat = natVal | 21 | true | true | 0 | 9 | 22 | 32 | 17 | 15 | null | null |
sol/hexpat | Text/XML/Expat/Internal/IO.hs | bsd-3-clause | wrapStartElementHandler :: Parser -> StartElementHandler -> CStartElementHandler
wrapStartElementHandler parser handler = h
where
h pp cname cattrs = do
cattrlist <- peekArray0 nullPtr cattrs
stillRunning <- handler pp cname (pairwise cattrlist)
unless stillRunning $ stopp parser
-- | Attach a StartElementHandler to a Parser. | 358 | wrapStartElementHandler :: Parser -> StartElementHandler -> CStartElementHandler
wrapStartElementHandler parser handler = h
where
h pp cname cattrs = do
cattrlist <- peekArray0 nullPtr cattrs
stillRunning <- handler pp cname (pairwise cattrlist)
unless stillRunning $ stopp parser
-- | Attach a StartElementHandler to a Parser. | 358 | wrapStartElementHandler parser handler = h
where
h pp cname cattrs = do
cattrlist <- peekArray0 nullPtr cattrs
stillRunning <- handler pp cname (pairwise cattrlist)
unless stillRunning $ stopp parser
-- | Attach a StartElementHandler to a Parser. | 277 | false | true | 0 | 10 | 74 | 85 | 39 | 46 | null | null |
tomwadeson/fpinhaskell | src/ErrorHandling/Option.hs | mit | -- Ex 4.2
variance :: [Double] -> Option Double
variance xs = flatMap variance' $ mean xs
where
variance' m = mean . P.map (\x -> (x-m)^2) $ xs | 149 | variance :: [Double] -> Option Double
variance xs = flatMap variance' $ mean xs
where
variance' m = mean . P.map (\x -> (x-m)^2) $ xs | 139 | variance xs = flatMap variance' $ mean xs
where
variance' m = mean . P.map (\x -> (x-m)^2) $ xs | 101 | true | true | 1 | 12 | 34 | 86 | 40 | 46 | null | null |
shouya/gximemo | GxiMemo/GxiMemo.hs | mit | simplifyGM (MPair ("token_omitted",xs)) =
MPair ("token_omitted", MAtom $ mToString xs) | 89 | simplifyGM (MPair ("token_omitted",xs)) =
MPair ("token_omitted", MAtom $ mToString xs) | 89 | simplifyGM (MPair ("token_omitted",xs)) =
MPair ("token_omitted", MAtom $ mToString xs) | 89 | false | false | 0 | 7 | 11 | 38 | 19 | 19 | null | null |
antalsz/hs-to-coq | examples/lambda/Lambda.hs | mit | fresh :: Expr -> Int
fresh e = 1 + maxVar e | 43 | fresh :: Expr -> Int
fresh e = 1 + maxVar e | 43 | fresh e = 1 + maxVar e | 22 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
TimRichter/Idris-dev | src/Idris/CaseSplit.hs | bsd-3-clause | findPats ist t = [Placeholder] | 30 | findPats ist t = [Placeholder] | 30 | findPats ist t = [Placeholder] | 30 | false | false | 1 | 5 | 4 | 18 | 7 | 11 | null | null |
rahulmutt/ghcvm | compiler/Eta/Types/TypeRep.hs | bsd-3-clause | tyVarsOfType :: Type -> VarSet
-- ^ NB: for type synonyms tyVarsOfType does /not/ expand the synonym
-- tyVarsOfType returns only the free variables of a type
-- For example, tyVarsOfType (a::k) returns {a}, not including the
-- kind variable {k}
tyVarsOfType ty = fvVarSet $ tyVarsOfTypeAcc ty | 294 | tyVarsOfType :: Type -> VarSet
tyVarsOfType ty = fvVarSet $ tyVarsOfTypeAcc ty | 78 | tyVarsOfType ty = fvVarSet $ tyVarsOfTypeAcc ty | 47 | true | true | 0 | 6 | 47 | 29 | 16 | 13 | null | null |
ksaveljev/vindinium-bot | Fao/Api.hs | mit | startUrl :: Text -> Fao Text
startUrl v = liftM (\x -> x <> "/api/" <> v) $ asks settingsUrl | 92 | startUrl :: Text -> Fao Text
startUrl v = liftM (\x -> x <> "/api/" <> v) $ asks settingsUrl | 92 | startUrl v = liftM (\x -> x <> "/api/" <> v) $ asks settingsUrl | 63 | false | true | 0 | 9 | 19 | 51 | 24 | 27 | null | null |
elbrujohalcon/wxhnotepad | src/Step3.hs | bsd-3-clause | restartTimer guiCtx@GUICtx{guiWin = win, guiTimer = refreshTimer} =
-- The user did something, we start our timer with a 1sec interval and
-- a one-shot type so it will run just once and then it will modify history
-- if the user doesn't do anything in that sec. If the user does another
-- thing, then the timer will be restarted again and so on so far until
-- the first sec of inactivity
do
started <- timerStart refreshTimer 1000 True
if started
then return ()
else do
errorDialog win "Error" "Can't start more timers"
wxcAppExit
-- We kill the timer till there's new notices | 705 | restartTimer guiCtx@GUICtx{guiWin = win, guiTimer = refreshTimer} =
-- The user did something, we start our timer with a 1sec interval and
-- a one-shot type so it will run just once and then it will modify history
-- if the user doesn't do anything in that sec. If the user does another
-- thing, then the timer will be restarted again and so on so far until
-- the first sec of inactivity
do
started <- timerStart refreshTimer 1000 True
if started
then return ()
else do
errorDialog win "Error" "Can't start more timers"
wxcAppExit
-- We kill the timer till there's new notices | 705 | restartTimer guiCtx@GUICtx{guiWin = win, guiTimer = refreshTimer} =
-- The user did something, we start our timer with a 1sec interval and
-- a one-shot type so it will run just once and then it will modify history
-- if the user doesn't do anything in that sec. If the user does another
-- thing, then the timer will be restarted again and so on so far until
-- the first sec of inactivity
do
started <- timerStart refreshTimer 1000 True
if started
then return ()
else do
errorDialog win "Error" "Can't start more timers"
wxcAppExit
-- We kill the timer till there's new notices | 705 | false | false | 0 | 10 | 230 | 76 | 40 | 36 | null | null |
Slowki/TinySrv | src/Web/TinySrv/Mime.hs | mit | getMime ".mpeg" = "video/mpeg" | 30 | getMime ".mpeg" = "video/mpeg" | 30 | getMime ".mpeg" = "video/mpeg" | 30 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
bergmark/haskell-opaleye | opaleye-sqlite/src/Opaleye/SQLite/Internal/HaskellDB/Sql/Print.hs | bsd-3-clause | ppDelete :: SqlDelete -> Doc
ppDelete (SqlDelete table criteria) =
text "DELETE FROM" <+> ppTable table $$ ppWhere criteria | 127 | ppDelete :: SqlDelete -> Doc
ppDelete (SqlDelete table criteria) =
text "DELETE FROM" <+> ppTable table $$ ppWhere criteria | 127 | ppDelete (SqlDelete table criteria) =
text "DELETE FROM" <+> ppTable table $$ ppWhere criteria | 98 | false | true | 0 | 7 | 22 | 43 | 20 | 23 | null | null |
DanielSchuessler/hstri | R3Immersions/Simplices.hs | gpl-3.0 | evalFlatTriangleImmersion
:: Vec3 -> Vec3 -> Vec3 -> FF Tup2 Tup3 Double
evalFlatTriangleImmersion a au av =
(\(Tup2 (u, v) :: Tup2 (AD s Double)) ->
((1-u-v) *^ liftVec3 a)
^+^
(u *^ liftVec3 au)
^+^
(v *^ liftVec3 av)
:: Tup3 (AD s Double)
) | 503 | evalFlatTriangleImmersion
:: Vec3 -> Vec3 -> Vec3 -> FF Tup2 Tup3 Double
evalFlatTriangleImmersion a au av =
(\(Tup2 (u, v) :: Tup2 (AD s Double)) ->
((1-u-v) *^ liftVec3 a)
^+^
(u *^ liftVec3 au)
^+^
(v *^ liftVec3 av)
:: Tup3 (AD s Double)
) | 503 | evalFlatTriangleImmersion a au av =
(\(Tup2 (u, v) :: Tup2 (AD s Double)) ->
((1-u-v) *^ liftVec3 a)
^+^
(u *^ liftVec3 au)
^+^
(v *^ liftVec3 av)
:: Tup3 (AD s Double)
) | 428 | false | true | 0 | 14 | 305 | 139 | 70 | 69 | null | null |
nevrenato/HetsAlloy | Syntax/ToXml.hs | gpl-2.0 | ghiding :: GlobalAnnos -> G_hiding -> Element
ghiding ga gm = case gm of
G_symb_list l -> unode "Hiding" $ gSymbItemList ga l
G_logic_projection lc -> add_attrs (logicCode lc)
$ unode "Logicprojection" () | 212 | ghiding :: GlobalAnnos -> G_hiding -> Element
ghiding ga gm = case gm of
G_symb_list l -> unode "Hiding" $ gSymbItemList ga l
G_logic_projection lc -> add_attrs (logicCode lc)
$ unode "Logicprojection" () | 212 | ghiding ga gm = case gm of
G_symb_list l -> unode "Hiding" $ gSymbItemList ga l
G_logic_projection lc -> add_attrs (logicCode lc)
$ unode "Logicprojection" () | 166 | false | true | 0 | 11 | 40 | 83 | 37 | 46 | null | null |
nevrenato/Hets_Fork | Temporal/Morphism.hs | gpl-2.0 | -- | Determines whether a morphism is valid
isLegalMorphism :: Morphism -> Result ()
isLegalMorphism pmor =
let psource = items $ source pmor
ptarget = items $ target pmor
pdom = Map.keysSet $ propMap pmor
pcodom = Set.map (applyMorphism pmor) $ psource
in if Set.isSubsetOf pcodom ptarget && Set.isSubsetOf pdom psource
then return () else fail "illegal Temporal morphism" | 413 | isLegalMorphism :: Morphism -> Result ()
isLegalMorphism pmor =
let psource = items $ source pmor
ptarget = items $ target pmor
pdom = Map.keysSet $ propMap pmor
pcodom = Set.map (applyMorphism pmor) $ psource
in if Set.isSubsetOf pcodom ptarget && Set.isSubsetOf pdom psource
then return () else fail "illegal Temporal morphism" | 369 | isLegalMorphism pmor =
let psource = items $ source pmor
ptarget = items $ target pmor
pdom = Map.keysSet $ propMap pmor
pcodom = Set.map (applyMorphism pmor) $ psource
in if Set.isSubsetOf pcodom ptarget && Set.isSubsetOf pdom psource
then return () else fail "illegal Temporal morphism" | 328 | true | true | 0 | 12 | 99 | 126 | 60 | 66 | null | null |
ezyang/ghc | testsuite/tests/typecheck/should_run/T1735_Help/Xml.hs | bsd-3-clause | constrFromElements :: forall t . Xml t
=> Constr -> [Element] -> Maybe ([Element], t)
constrFromElements c es
= do let st = ReadState { xmls = es }
m :: ReadM Maybe t
m = fromConstrM xmlProxy (readMXmlD dict) c
-- XXX Should we flip the result order?
(x, st') <- runStateT m st
return (xmls st', x) | 356 | constrFromElements :: forall t . Xml t
=> Constr -> [Element] -> Maybe ([Element], t)
constrFromElements c es
= do let st = ReadState { xmls = es }
m :: ReadM Maybe t
m = fromConstrM xmlProxy (readMXmlD dict) c
-- XXX Should we flip the result order?
(x, st') <- runStateT m st
return (xmls st', x) | 356 | constrFromElements c es
= do let st = ReadState { xmls = es }
m :: ReadM Maybe t
m = fromConstrM xmlProxy (readMXmlD dict) c
-- XXX Should we flip the result order?
(x, st') <- runStateT m st
return (xmls st', x) | 251 | false | true | 0 | 12 | 116 | 130 | 67 | 63 | null | null |
kryft/fsil | CharDumpParser.hs | gpl-2.0 | spaceOrSingleNewline = spaceBar <|> try ( eol >> notFollowedBy eol >> return '\n') | 82 | spaceOrSingleNewline = spaceBar <|> try ( eol >> notFollowedBy eol >> return '\n') | 82 | spaceOrSingleNewline = spaceBar <|> try ( eol >> notFollowedBy eol >> return '\n') | 82 | false | false | 1 | 10 | 12 | 33 | 14 | 19 | null | null |
ilya-yurtaev/hlog | src/Hlog.hs | mit | entryFmt = "%s%s%s\n" | 21 | entryFmt = "%s%s%s\n" | 21 | entryFmt = "%s%s%s\n" | 21 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.