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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
m3mitsuppe/haskell | exercises/Programming Haskell Book Exercises.hsproj/Kwon3.hs | unlicense | munge :: (x -> y) -> (y -> (w, z)) -> x -> w
munge xToy yTowz x = w
where (w, _) = yTowz (xToy x) | 101 | munge :: (x -> y) -> (y -> (w, z)) -> x -> w
munge xToy yTowz x = w
where (w, _) = yTowz (xToy x) | 101 | munge xToy yTowz x = w
where (w, _) = yTowz (xToy x) | 56 | false | true | 0 | 10 | 30 | 79 | 40 | 39 | null | null |
GaloisInc/halvm-ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isRigidEqPred :: TcLevel -> PredTree -> Bool
-- ^ True of all Nominal equalities that are solidly insoluble
-- This means all equalities *except*
-- * Meta-tv non-SigTv on LHS
-- * Meta-tv SigTv on LHS, tyvar on right
isRigidEqPred tc_lvl (EqPred NomEq ty1 _)
| Just tv1 <- tcGetTyVar_maybe ty1
= ASSERT2( isTcTyVar tv1, ppr tv1 )
not (isMetaTyVar tv1) || isTouchableMetaTyVar tc_lvl tv1
| otherwise -- LHS is not a tyvar
= True | 446 | isRigidEqPred :: TcLevel -> PredTree -> Bool
isRigidEqPred tc_lvl (EqPred NomEq ty1 _)
| Just tv1 <- tcGetTyVar_maybe ty1
= ASSERT2( isTcTyVar tv1, ppr tv1 )
not (isMetaTyVar tv1) || isTouchableMetaTyVar tc_lvl tv1
| otherwise -- LHS is not a tyvar
= True | 269 | isRigidEqPred tc_lvl (EqPred NomEq ty1 _)
| Just tv1 <- tcGetTyVar_maybe ty1
= ASSERT2( isTcTyVar tv1, ppr tv1 )
not (isMetaTyVar tv1) || isTouchableMetaTyVar tc_lvl tv1
| otherwise -- LHS is not a tyvar
= True | 224 | true | true | 0 | 9 | 92 | 108 | 50 | 58 | null | null |
Helium4Haskell/helium | src/Helium/Parser/ParseLibrary.hs | gpl-3.0 | qtycon = qName lexCon <?> Texts.parserTypeConstructor | 58 | qtycon = qName lexCon <?> Texts.parserTypeConstructor | 58 | qtycon = qName lexCon <?> Texts.parserTypeConstructor | 58 | false | false | 0 | 6 | 10 | 15 | 7 | 8 | null | null |
jstolarek/ghc | libraries/base/Text/Printf.hs | bsd-3-clause | uprintfs ('%':cs) us@(_:_) = fmt cs us | 38 | uprintfs ('%':cs) us@(_:_) = fmt cs us | 38 | uprintfs ('%':cs) us@(_:_) = fmt cs us | 38 | false | false | 0 | 8 | 6 | 33 | 17 | 16 | null | null |
brendanhay/gogol | gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs | mpl-2.0 | -- | Trims cells of whitespace (such as spaces, tabs, or new lines).
reqTrimWhitespace :: Lens' Request' (Maybe TrimWhitespaceRequest)
reqTrimWhitespace
= lens _reqTrimWhitespace
(\ s a -> s{_reqTrimWhitespace = a}) | 223 | reqTrimWhitespace :: Lens' Request' (Maybe TrimWhitespaceRequest)
reqTrimWhitespace
= lens _reqTrimWhitespace
(\ s a -> s{_reqTrimWhitespace = a}) | 154 | reqTrimWhitespace
= lens _reqTrimWhitespace
(\ s a -> s{_reqTrimWhitespace = a}) | 88 | true | true | 1 | 9 | 37 | 52 | 25 | 27 | null | null |
greydot/persistent | persistent-template/Database/Persist/TH.hs | mit | backendName :: Name
backendName = mkName "backend" | 50 | backendName :: Name
backendName = mkName "backend" | 50 | backendName = mkName "backend" | 30 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
trenttobler/hs-asteroids | src/Asteroids/Helpers.hs | bsd-3-clause | modularInterval :: Real a => (a, a) -> a -> a
modularInterval (lower,upper) x =
if between (lower,upper) x
then x
else ( (x - lower) `mod'` (upper - lower)) + lower | 174 | modularInterval :: Real a => (a, a) -> a -> a
modularInterval (lower,upper) x =
if between (lower,upper) x
then x
else ( (x - lower) `mod'` (upper - lower)) + lower | 173 | modularInterval (lower,upper) x =
if between (lower,upper) x
then x
else ( (x - lower) `mod'` (upper - lower)) + lower | 127 | false | true | 0 | 10 | 41 | 95 | 51 | 44 | null | null |
IreneKnapp/Faction | faction/Distribution/Client/Targets.hs | bsd-3-clause | reportUserTargetProblems :: [UserTargetProblem] -> IO ()
reportUserTargetProblems problems = do
case [ target | UserTargetUnrecognised target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognised target '" ++ name ++ "'."
| name <- target ]
++ "Targets can be:\n"
++ " - package names, e.g. 'pkgname', 'pkgname-1.0.1', 'pkgname < 2.0'\n"
++ " - the special 'world' target\n"
++ " - cabal files 'pkgname.cabal' or package directories 'pkgname/'\n"
++ " - package tarballs 'pkgname.tar.gz' or 'http://example.com/pkgname.tar.gz'"
case [ () | UserTargetBadWorldPkg <- problems ] of
[] -> return ()
_ -> die "The special 'world' target does not take any version."
case [ target | UserTargetNonexistantFile target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "The file does not exist '" ++ name ++ "'."
| name <- target ]
case [ target | UserTargetUnexpectedFile target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognised file target '" ++ name ++ "'."
| name <- target ]
++ "File targets can be either package tarballs 'pkgname.tar.gz' "
++ "or cabal files 'pkgname.cabal'."
case [ target | UserTargetUnexpectedUriScheme target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "URL target not supported '" ++ name ++ "'."
| name <- target ]
++ "Only 'http://' URLs are supported."
case [ target | UserTargetUnrecognisedUri target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognise URL target '" ++ name ++ "'."
| name <- target ]
-- ------------------------------------------------------------
-- * Resolving user targets to package specifiers
-- ------------------------------------------------------------
-- | Given a bunch of user-specified targets, try to resolve what it is they
-- refer to. They can either be specific packages (local dirs, tarballs etc)
-- or they can be named packages (with or without version info).
-- | 2,389 | reportUserTargetProblems :: [UserTargetProblem] -> IO ()
reportUserTargetProblems problems = do
case [ target | UserTargetUnrecognised target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognised target '" ++ name ++ "'."
| name <- target ]
++ "Targets can be:\n"
++ " - package names, e.g. 'pkgname', 'pkgname-1.0.1', 'pkgname < 2.0'\n"
++ " - the special 'world' target\n"
++ " - cabal files 'pkgname.cabal' or package directories 'pkgname/'\n"
++ " - package tarballs 'pkgname.tar.gz' or 'http://example.com/pkgname.tar.gz'"
case [ () | UserTargetBadWorldPkg <- problems ] of
[] -> return ()
_ -> die "The special 'world' target does not take any version."
case [ target | UserTargetNonexistantFile target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "The file does not exist '" ++ name ++ "'."
| name <- target ]
case [ target | UserTargetUnexpectedFile target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognised file target '" ++ name ++ "'."
| name <- target ]
++ "File targets can be either package tarballs 'pkgname.tar.gz' "
++ "or cabal files 'pkgname.cabal'."
case [ target | UserTargetUnexpectedUriScheme target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "URL target not supported '" ++ name ++ "'."
| name <- target ]
++ "Only 'http://' URLs are supported."
case [ target | UserTargetUnrecognisedUri target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognise URL target '" ++ name ++ "'."
| name <- target ]
-- ------------------------------------------------------------
-- * Resolving user targets to package specifiers
-- ------------------------------------------------------------
-- | Given a bunch of user-specified targets, try to resolve what it is they
-- refer to. They can either be specific packages (local dirs, tarballs etc)
-- or they can be named packages (with or without version info).
-- | 2,389 | reportUserTargetProblems problems = do
case [ target | UserTargetUnrecognised target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognised target '" ++ name ++ "'."
| name <- target ]
++ "Targets can be:\n"
++ " - package names, e.g. 'pkgname', 'pkgname-1.0.1', 'pkgname < 2.0'\n"
++ " - the special 'world' target\n"
++ " - cabal files 'pkgname.cabal' or package directories 'pkgname/'\n"
++ " - package tarballs 'pkgname.tar.gz' or 'http://example.com/pkgname.tar.gz'"
case [ () | UserTargetBadWorldPkg <- problems ] of
[] -> return ()
_ -> die "The special 'world' target does not take any version."
case [ target | UserTargetNonexistantFile target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "The file does not exist '" ++ name ++ "'."
| name <- target ]
case [ target | UserTargetUnexpectedFile target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognised file target '" ++ name ++ "'."
| name <- target ]
++ "File targets can be either package tarballs 'pkgname.tar.gz' "
++ "or cabal files 'pkgname.cabal'."
case [ target | UserTargetUnexpectedUriScheme target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "URL target not supported '" ++ name ++ "'."
| name <- target ]
++ "Only 'http://' URLs are supported."
case [ target | UserTargetUnrecognisedUri target <- problems ] of
[] -> return ()
target -> die
$ unlines
[ "Unrecognise URL target '" ++ name ++ "'."
| name <- target ]
-- ------------------------------------------------------------
-- * Resolving user targets to package specifiers
-- ------------------------------------------------------------
-- | Given a bunch of user-specified targets, try to resolve what it is they
-- refer to. They can either be specific packages (local dirs, tarballs etc)
-- or they can be named packages (with or without version info).
-- | 2,332 | false | true | 0 | 19 | 794 | 437 | 216 | 221 | null | null |
peterokagey/haskellOEIS | test/TableDifferences/A339010Spec.hs | apache-2.0 | spec :: Spec
spec = describe "A339010" $
it "correctly computes the first 20 elements" $
take 20 (map a339010 [1..]) `shouldBe` expectedValue where
expectedValue = [0,0,1,1,1,2,1,2,3,2,1,5,1,2,5,3,1,6,1,5] | 217 | spec :: Spec
spec = describe "A339010" $
it "correctly computes the first 20 elements" $
take 20 (map a339010 [1..]) `shouldBe` expectedValue where
expectedValue = [0,0,1,1,1,2,1,2,3,2,1,5,1,2,5,3,1,6,1,5] | 217 | spec = describe "A339010" $
it "correctly computes the first 20 elements" $
take 20 (map a339010 [1..]) `shouldBe` expectedValue where
expectedValue = [0,0,1,1,1,2,1,2,3,2,1,5,1,2,5,3,1,6,1,5] | 204 | false | true | 3 | 8 | 38 | 126 | 69 | 57 | null | null |
ganeti/htools | Ganeti/HTools/Instance.hs | gpl-2.0 | -- | Try to shrink the instance based on the reason why we can't
-- allocate it.
shrinkByType :: Instance -> T.FailMode -> T.Result Instance
shrinkByType inst T.FailMem = let v = mem inst - T.unitMem
in if v < T.unitMem
then T.Bad "out of memory"
else T.Ok inst { mem = v } | 369 | shrinkByType :: Instance -> T.FailMode -> T.Result Instance
shrinkByType inst T.FailMem = let v = mem inst - T.unitMem
in if v < T.unitMem
then T.Bad "out of memory"
else T.Ok inst { mem = v } | 288 | shrinkByType inst T.FailMem = let v = mem inst - T.unitMem
in if v < T.unitMem
then T.Bad "out of memory"
else T.Ok inst { mem = v } | 228 | true | true | 0 | 10 | 149 | 92 | 45 | 47 | null | null |
daherb/Haskell-Muste | muste-lib/Test/Muste.hs | artistic-2.0 | hunit_getSuggestions_test = -- TODO
-- The 'getSuggestions' function generates a list of similar trees given a tree and a position in the token list
-- getSuggestions :: Grammar -> Language -> [LinToken] -> MetaTTree -> Pos -> S.Set String
TestList [
] | 256 | hunit_getSuggestions_test = -- TODO
-- The 'getSuggestions' function generates a list of similar trees given a tree and a position in the token list
-- getSuggestions :: Grammar -> Language -> [LinToken] -> MetaTTree -> Pos -> S.Set String
TestList [
] | 256 | hunit_getSuggestions_test = -- TODO
-- The 'getSuggestions' function generates a list of similar trees given a tree and a position in the token list
-- getSuggestions :: Grammar -> Language -> [LinToken] -> MetaTTree -> Pos -> S.Set String
TestList [
] | 256 | false | false | 1 | 6 | 45 | 18 | 8 | 10 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSYS_SMALLICON_X :: Int
wxSYS_SMALLICON_X = 25 | 47 | wxSYS_SMALLICON_X :: Int
wxSYS_SMALLICON_X = 25 | 47 | wxSYS_SMALLICON_X = 25 | 22 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
Alxandr/Phidoc | test/FakeFileSystem.hs | bsd-3-clause | mergeDir :: [FilePath] -> String -> Maybe FakeEntry -> Maybe FakeEntry
mergeDir path content (Just e) = Just $ insertEntry path content e | 137 | mergeDir :: [FilePath] -> String -> Maybe FakeEntry -> Maybe FakeEntry
mergeDir path content (Just e) = Just $ insertEntry path content e | 137 | mergeDir path content (Just e) = Just $ insertEntry path content e | 66 | false | true | 0 | 8 | 22 | 56 | 27 | 29 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/enumFromTo_1.hs | mit | otherwise :: MyBool;
otherwise = MyTrue | 39 | otherwise :: MyBool
otherwise = MyTrue | 38 | otherwise = MyTrue | 18 | false | true | 0 | 4 | 5 | 12 | 7 | 5 | null | null |
HIPERFIT/futhark | src/Futhark/Pkg/Types.hs | isc | -- | Prettyprint a package manifest such that it can be written to a
-- @futhark.pkg@ file.
prettyPkgManifest :: PkgManifest -> T.Text
prettyPkgManifest (PkgManifest name required endcs) =
T.unlines $
concat
[ prettyComments name,
maybe [] (pure . ("package " <>) . (<> "\n")) $ commented name,
prettyComments required,
["require {"],
map ((" " <>) . prettyRequired) $ commented required,
["}"],
map prettyComment endcs
]
where
prettyComments = map prettyComment . comments
prettyComment = ("--" <>)
prettyRequired (Left c) = prettyComment c
prettyRequired (Right (Required p r h)) =
T.unwords $
catMaybes
[ Just p,
Just $ prettySemVer r,
("#" <>) <$> h
]
-- | The required packages listed in a package manifest. | 856 | prettyPkgManifest :: PkgManifest -> T.Text
prettyPkgManifest (PkgManifest name required endcs) =
T.unlines $
concat
[ prettyComments name,
maybe [] (pure . ("package " <>) . (<> "\n")) $ commented name,
prettyComments required,
["require {"],
map ((" " <>) . prettyRequired) $ commented required,
["}"],
map prettyComment endcs
]
where
prettyComments = map prettyComment . comments
prettyComment = ("--" <>)
prettyRequired (Left c) = prettyComment c
prettyRequired (Right (Required p r h)) =
T.unwords $
catMaybes
[ Just p,
Just $ prettySemVer r,
("#" <>) <$> h
]
-- | The required packages listed in a package manifest. | 764 | prettyPkgManifest (PkgManifest name required endcs) =
T.unlines $
concat
[ prettyComments name,
maybe [] (pure . ("package " <>) . (<> "\n")) $ commented name,
prettyComments required,
["require {"],
map ((" " <>) . prettyRequired) $ commented required,
["}"],
map prettyComment endcs
]
where
prettyComments = map prettyComment . comments
prettyComment = ("--" <>)
prettyRequired (Left c) = prettyComment c
prettyRequired (Right (Required p r h)) =
T.unwords $
catMaybes
[ Just p,
Just $ prettySemVer r,
("#" <>) <$> h
]
-- | The required packages listed in a package manifest. | 721 | true | true | 3 | 13 | 257 | 236 | 125 | 111 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Time.Calendar.Gregorian.hs | bsd-3-clause | -- | convert from proleptic Gregorian calendar. First argument is year, second month number (1-12), third day (1-31).
-- Invalid values will return Nothing
fromGregorianValid :: Integer -> Int -> Int -> Maybe Day
fromGregorianValid year month day = do
doy <- monthAndDayToDayOfYearValid (isLeapYear year) month day
fromOrdinalDateValid year doy
-- | show in ISO 8601 format (yyyy-mm-dd) | 395 | fromGregorianValid :: Integer -> Int -> Int -> Maybe Day
fromGregorianValid year month day = do
doy <- monthAndDayToDayOfYearValid (isLeapYear year) month day
fromOrdinalDateValid year doy
-- | show in ISO 8601 format (yyyy-mm-dd) | 239 | fromGregorianValid year month day = do
doy <- monthAndDayToDayOfYearValid (isLeapYear year) month day
fromOrdinalDateValid year doy
-- | show in ISO 8601 format (yyyy-mm-dd) | 182 | true | true | 0 | 11 | 66 | 69 | 32 | 37 | null | null |
brendanhay/gogol | gogol-dns/gen/Network/Google/Resource/DNS/ManagedZoneOperations/Get.hs | mpl-2.0 | -- | V1 error format.
mzogXgafv :: Lens' ManagedZoneOperationsGet (Maybe Xgafv)
mzogXgafv
= lens _mzogXgafv (\ s a -> s{_mzogXgafv = a}) | 138 | mzogXgafv :: Lens' ManagedZoneOperationsGet (Maybe Xgafv)
mzogXgafv
= lens _mzogXgafv (\ s a -> s{_mzogXgafv = a}) | 116 | mzogXgafv
= lens _mzogXgafv (\ s a -> s{_mzogXgafv = a}) | 58 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
athanclark/composition-extra | src/Data/Function/Slip.hs | bsd-3-clause | slipl4 :: (a -> b -> c -> d -> e) -> d -> a -> b -> c -> e
slipl4 f d a b c = f a b c d | 87 | slipl4 :: (a -> b -> c -> d -> e) -> d -> a -> b -> c -> e
slipl4 f d a b c = f a b c d | 87 | slipl4 f d a b c = f a b c d | 28 | false | true | 0 | 11 | 32 | 79 | 36 | 43 | null | null |
aaronc/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | pprintErr' i (UnknownImplicit n f) = annName n <+> text "is not an implicit argument of" <+> annName f | 102 | pprintErr' i (UnknownImplicit n f) = annName n <+> text "is not an implicit argument of" <+> annName f | 102 | pprintErr' i (UnknownImplicit n f) = annName n <+> text "is not an implicit argument of" <+> annName f | 102 | false | false | 0 | 7 | 18 | 38 | 16 | 22 | null | null |
tek/proteome | packages/test/test/Proteome/Test/ReplaceTest.hs | mit | file3Lines :: [Text]
file3Lines =
[
"delete me target 1",
"",
"keep me 1",
"",
"delete me target 2",
"",
"keep me 2",
"delete me target 3",
"keep me 3",
"",
"keep me 4",
"delete me target 4",
""
] | 252 | file3Lines :: [Text]
file3Lines =
[
"delete me target 1",
"",
"keep me 1",
"",
"delete me target 2",
"",
"keep me 2",
"delete me target 3",
"keep me 3",
"",
"keep me 4",
"delete me target 4",
""
] | 252 | file3Lines =
[
"delete me target 1",
"",
"keep me 1",
"",
"delete me target 2",
"",
"keep me 2",
"delete me target 3",
"keep me 3",
"",
"keep me 4",
"delete me target 4",
""
] | 231 | false | true | 0 | 5 | 95 | 53 | 34 | 19 | null | null |
tategakibunko/hml | Mahjong/Mentsu.hs | gpl-2.0 | isJunchanMentsu :: Mentsu -> Bool
isJunchanMentsu (Shuntsu p) = pnumOfPai p `elem` [1, 7] | 89 | isJunchanMentsu :: Mentsu -> Bool
isJunchanMentsu (Shuntsu p) = pnumOfPai p `elem` [1, 7] | 89 | isJunchanMentsu (Shuntsu p) = pnumOfPai p `elem` [1, 7] | 55 | false | true | 0 | 6 | 13 | 43 | 22 | 21 | null | null |
xu-hao/QueryArrow | QueryArrow-db-sql-common/src/QueryArrow/SQL/SQL.hs | bsd-3-clause | lookupTableVar :: String -> [Expr] -> TransMonad (Bool, SQLVar)
lookupTableVar tablename prikeyargs = do
ts <- get
case lookup (tablename, prikeyargs) (tablemap ts) of -- check if there already is a table with same primary key
Just v ->
return (False, v)
Nothing -> do
sqlvar2 <- freshSQLVar tablename
addTable tablename prikeyargs sqlvar2
return (True, sqlvar2) | 443 | lookupTableVar :: String -> [Expr] -> TransMonad (Bool, SQLVar)
lookupTableVar tablename prikeyargs = do
ts <- get
case lookup (tablename, prikeyargs) (tablemap ts) of -- check if there already is a table with same primary key
Just v ->
return (False, v)
Nothing -> do
sqlvar2 <- freshSQLVar tablename
addTable tablename prikeyargs sqlvar2
return (True, sqlvar2) | 442 | lookupTableVar tablename prikeyargs = do
ts <- get
case lookup (tablename, prikeyargs) (tablemap ts) of -- check if there already is a table with same primary key
Just v ->
return (False, v)
Nothing -> do
sqlvar2 <- freshSQLVar tablename
addTable tablename prikeyargs sqlvar2
return (True, sqlvar2) | 378 | false | true | 0 | 13 | 136 | 124 | 61 | 63 | null | null |
ku-fpg/ecc-ldpc | src/ECC/Code/LDPC/Zero.hs | bsd-3-clause | code :: Code
code = mkLDPC_Code "ldpc-zero" E.encoder decoder | 61 | code :: Code
code = mkLDPC_Code "ldpc-zero" E.encoder decoder | 61 | code = mkLDPC_Code "ldpc-zero" E.encoder decoder | 48 | false | true | 0 | 6 | 8 | 20 | 10 | 10 | null | null |
phischu/fragnix | tests/packages/scotty/Web.Scotty.Util.hs | bsd-3-clause | setStatus :: Status -> ScottyResponse -> ScottyResponse
setStatus s sr = sr { srStatus = s } | 92 | setStatus :: Status -> ScottyResponse -> ScottyResponse
setStatus s sr = sr { srStatus = s } | 92 | setStatus s sr = sr { srStatus = s } | 36 | false | true | 0 | 6 | 16 | 32 | 17 | 15 | null | null |
beni55/fay | examples/D3TreeSample.hs | bsd-3-clause | createJson :: Int -> JsonTree
createJson = unfoldTree (\n -> ([chr (n + ord 'a')], replicate n (n-1))) | 102 | createJson :: Int -> JsonTree
createJson = unfoldTree (\n -> ([chr (n + ord 'a')], replicate n (n-1))) | 102 | createJson = unfoldTree (\n -> ([chr (n + ord 'a')], replicate n (n-1))) | 72 | false | true | 0 | 13 | 17 | 60 | 32 | 28 | null | null |
aelve/guide | back/src/Guide/Database/Import.hs | bsd-3-clause | insertCategoryByRow
:: Category
-> "deleted" :! Bool
-> ExceptT DatabaseError Transaction ()
insertCategoryByRow category (arg #deleted -> deleted) = do
let categoryRow = categoryToRowCategory category (#deleted deleted)
insertCategoryWithCategoryRow categoryRow
-- | Insert item passing 'Item'. | 310 | insertCategoryByRow
:: Category
-> "deleted" :! Bool
-> ExceptT DatabaseError Transaction ()
insertCategoryByRow category (arg #deleted -> deleted) = do
let categoryRow = categoryToRowCategory category (#deleted deleted)
insertCategoryWithCategoryRow categoryRow
-- | Insert item passing 'Item'. | 310 | insertCategoryByRow category (arg #deleted -> deleted) = do
let categoryRow = categoryToRowCategory category (#deleted deleted)
insertCategoryWithCategoryRow categoryRow
-- | Insert item passing 'Item'. | 211 | false | true | 5 | 7 | 49 | 68 | 36 | 32 | null | null |
zrho/pylon | src/Language/Pylon/Core/Unify.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Unification Loop
--------------------------------------------------------------------------------
-- |
-- Main loop of the unification algorithm: tries to unify pending equations with
-- the `unifyStep` function until no more equations are pending or unification
-- of an equation failed.
unifyLoop :: Unify UnifyResult
unifyLoop = nextPending >>= \mp -> case mp of
Nothing -> unifyResult
Just equ -> unifyStep equ >>= \st -> case st of
SBlock -> blockEqu equ >> unifyLoop
SNext ps ss -> substEqus ss >> mapM_ pendingEqu ps >> unifyLoop
SFail e -> return $ UnifyFail equ e
-- |
-- Constructs a `UnifyResult` from the current unification state. Called by
-- `unifyLoop` when no more equations are pending.
--
-- Clears the twin variables in the resulting substitution to avoid leaking them
-- into non-unification code. Twin variables in the blocked equations must be
-- preserved for correct unification; this is not problematic, since expressions
-- in blocked equations should not be used in non-unification code anyway. | 1,144 | unifyLoop :: Unify UnifyResult
unifyLoop = nextPending >>= \mp -> case mp of
Nothing -> unifyResult
Just equ -> unifyStep equ >>= \st -> case st of
SBlock -> blockEqu equ >> unifyLoop
SNext ps ss -> substEqus ss >> mapM_ pendingEqu ps >> unifyLoop
SFail e -> return $ UnifyFail equ e
-- |
-- Constructs a `UnifyResult` from the current unification state. Called by
-- `unifyLoop` when no more equations are pending.
--
-- Clears the twin variables in the resulting substitution to avoid leaking them
-- into non-unification code. Twin variables in the blocked equations must be
-- preserved for correct unification; this is not problematic, since expressions
-- in blocked equations should not be used in non-unification code anyway. | 770 | unifyLoop = nextPending >>= \mp -> case mp of
Nothing -> unifyResult
Just equ -> unifyStep equ >>= \st -> case st of
SBlock -> blockEqu equ >> unifyLoop
SNext ps ss -> substEqus ss >> mapM_ pendingEqu ps >> unifyLoop
SFail e -> return $ UnifyFail equ e
-- |
-- Constructs a `UnifyResult` from the current unification state. Called by
-- `unifyLoop` when no more equations are pending.
--
-- Clears the twin variables in the resulting substitution to avoid leaking them
-- into non-unification code. Twin variables in the blocked equations must be
-- preserved for correct unification; this is not problematic, since expressions
-- in blocked equations should not be used in non-unification code anyway. | 739 | true | true | 2 | 16 | 197 | 138 | 72 | 66 | null | null |
mightymoose/liquidhaskell | benchmarks/containers-0.5.0.0/Data/Sequence.hs | bsd-3-clause | addDigits4 m1 (Two a b) c d e f (Three g h i) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node3 g h i) m2 | 114 | addDigits4 m1 (Two a b) c d e f (Three g h i) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node3 g h i) m2 | 114 | addDigits4 m1 (Two a b) c d e f (Three g h i) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node3 g h i) m2 | 114 | false | false | 0 | 7 | 33 | 87 | 40 | 47 | null | null |
samplecount/shake-language-c | src/Development/Shake/Language/C/Host/Windows.hs | apache-2.0 | getHostArch :: IO Arch
getHostArch = do
Stdout out <- cmd "wmic os get osarchitecture"
let spec = map trim . lines $ out
case map (map toLower) spec of
("osarchitecture":"32-bit":_) -> return $ X86 I686
("osarchitecture":"64-bit":_) -> return $ X86 X86_64
("osarchitecture":arch:_) -> error $ "Unknown host architecture " ++ arch
_ -> error $ "Couldn't determine host architecture from " ++ show spec | 444 | getHostArch :: IO Arch
getHostArch = do
Stdout out <- cmd "wmic os get osarchitecture"
let spec = map trim . lines $ out
case map (map toLower) spec of
("osarchitecture":"32-bit":_) -> return $ X86 I686
("osarchitecture":"64-bit":_) -> return $ X86 X86_64
("osarchitecture":arch:_) -> error $ "Unknown host architecture " ++ arch
_ -> error $ "Couldn't determine host architecture from " ++ show spec | 444 | getHostArch = do
Stdout out <- cmd "wmic os get osarchitecture"
let spec = map trim . lines $ out
case map (map toLower) spec of
("osarchitecture":"32-bit":_) -> return $ X86 I686
("osarchitecture":"64-bit":_) -> return $ X86 X86_64
("osarchitecture":arch:_) -> error $ "Unknown host architecture " ++ arch
_ -> error $ "Couldn't determine host architecture from " ++ show spec | 421 | false | true | 0 | 13 | 108 | 161 | 75 | 86 | null | null |
sdiehl/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | generalizeIndefUnitId :: IndefUnitId -> IndefUnitId
generalizeIndefUnitId IndefUnitId{ indefUnitIdComponentId = cid
, indefUnitIdInsts = insts } =
newIndefUnitId cid (map (\(m,_) -> (m, mkHoleModule m)) insts) | 246 | generalizeIndefUnitId :: IndefUnitId -> IndefUnitId
generalizeIndefUnitId IndefUnitId{ indefUnitIdComponentId = cid
, indefUnitIdInsts = insts } =
newIndefUnitId cid (map (\(m,_) -> (m, mkHoleModule m)) insts) | 246 | generalizeIndefUnitId IndefUnitId{ indefUnitIdComponentId = cid
, indefUnitIdInsts = insts } =
newIndefUnitId cid (map (\(m,_) -> (m, mkHoleModule m)) insts) | 194 | false | true | 1 | 11 | 61 | 80 | 40 | 40 | null | null |
josefs/autosar | ARSim/arsim/AUTOSAR/ARSim.hs | bsd-3-clause | hear conn (IRVW a v) (Irv b _) | a==b = Update $ Irv b v | 76 | hear conn (IRVW a v) (Irv b _) | a==b = Update $ Irv b v | 76 | hear conn (IRVW a v) (Irv b _) | a==b = Update $ Irv b v | 76 | false | false | 2 | 9 | 35 | 51 | 22 | 29 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Seq/BankersQueue.hs | mit | unzipWith3 = unzipWith3UsingLists | 33 | unzipWith3 = unzipWith3UsingLists | 33 | unzipWith3 = unzipWith3UsingLists | 33 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
meditans/documentator | src/Documentator/Parser.hs | gpl-3.0 | -- The parser may fail for the absence of the right extensions. A common trick,
-- used for example by hlint at
-- https://github.com/ndmitchell/hlint/blob/e1c22030721999d4505eb14b19e6f8560a87507a/src/Util.hs
-- is to import all possible reasonable extensions by default. This might be
-- changed in a future version.
defaultExtensions :: [Extension]
defaultExtensions = [e | e@EnableExtension{} <- knownExtensions] \\ map EnableExtension badExtensions | 453 | defaultExtensions :: [Extension]
defaultExtensions = [e | e@EnableExtension{} <- knownExtensions] \\ map EnableExtension badExtensions | 134 | defaultExtensions = [e | e@EnableExtension{} <- knownExtensions] \\ map EnableExtension badExtensions | 101 | true | true | 0 | 10 | 57 | 46 | 27 | 19 | null | null |
bos/bloomfilter | Data/BloomFilter/Hash.hs | bsd-3-clause | alignedHash2 :: Ptr a -> CSize -> Word64 -> IO Word64
alignedHash2 ptr bytes salt =
with (fromIntegral salt) $ \sp -> do
let p1 = castPtr sp
p2 = castPtr sp `plusPtr` 4
doubleHash ptr bytes p1 p2
peek sp | 235 | alignedHash2 :: Ptr a -> CSize -> Word64 -> IO Word64
alignedHash2 ptr bytes salt =
with (fromIntegral salt) $ \sp -> do
let p1 = castPtr sp
p2 = castPtr sp `plusPtr` 4
doubleHash ptr bytes p1 p2
peek sp | 235 | alignedHash2 ptr bytes salt =
with (fromIntegral salt) $ \sp -> do
let p1 = castPtr sp
p2 = castPtr sp `plusPtr` 4
doubleHash ptr bytes p1 p2
peek sp | 181 | false | true | 0 | 14 | 72 | 103 | 47 | 56 | null | null |
psandahl/big-engine | src/BigE/Program.hs | mit | linkShaders :: MonadIO m => [Shader] -> m (Either String Program)
linkShaders shaders = do
program@(Program handle) <- GLResources.createProgram
mapM_ (\(Shader shader) -> GL.glAttachShader handle shader) shaders
GL.glLinkProgram handle
status <- getShaderStatus $ GL.glGetProgramiv handle GL.GL_LINK_STATUS
if status == GL.GL_TRUE
then do
mapM_ (\(Shader shader) -> GL.glDetachShader handle shader) shaders
mapM_ GLResources.deleteShader shaders
return $ Right program
else do
errLog <- getInfoLog handle GL.glGetProgramInfoLog
mapM_ GLResources.deleteShader shaders
delete program
return $ Left errLog
-- | Set the shader source code. | 757 | linkShaders :: MonadIO m => [Shader] -> m (Either String Program)
linkShaders shaders = do
program@(Program handle) <- GLResources.createProgram
mapM_ (\(Shader shader) -> GL.glAttachShader handle shader) shaders
GL.glLinkProgram handle
status <- getShaderStatus $ GL.glGetProgramiv handle GL.GL_LINK_STATUS
if status == GL.GL_TRUE
then do
mapM_ (\(Shader shader) -> GL.glDetachShader handle shader) shaders
mapM_ GLResources.deleteShader shaders
return $ Right program
else do
errLog <- getInfoLog handle GL.glGetProgramInfoLog
mapM_ GLResources.deleteShader shaders
delete program
return $ Left errLog
-- | Set the shader source code. | 757 | linkShaders shaders = do
program@(Program handle) <- GLResources.createProgram
mapM_ (\(Shader shader) -> GL.glAttachShader handle shader) shaders
GL.glLinkProgram handle
status <- getShaderStatus $ GL.glGetProgramiv handle GL.GL_LINK_STATUS
if status == GL.GL_TRUE
then do
mapM_ (\(Shader shader) -> GL.glDetachShader handle shader) shaders
mapM_ GLResources.deleteShader shaders
return $ Right program
else do
errLog <- getInfoLog handle GL.glGetProgramInfoLog
mapM_ GLResources.deleteShader shaders
delete program
return $ Left errLog
-- | Set the shader source code. | 691 | false | true | 0 | 14 | 200 | 221 | 102 | 119 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'ReviewsReplyRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rrrReplyText'
reviewsReplyRequest
:: ReviewsReplyRequest
reviewsReplyRequest =
ReviewsReplyRequest'
{ _rrrReplyText = Nothing
} | 323 | reviewsReplyRequest
:: ReviewsReplyRequest
reviewsReplyRequest =
ReviewsReplyRequest'
{ _rrrReplyText = Nothing
} | 129 | reviewsReplyRequest =
ReviewsReplyRequest'
{ _rrrReplyText = Nothing
} | 82 | true | true | 1 | 7 | 60 | 31 | 17 | 14 | null | null |
jpotterm/manila-hs | src/Command/Categories.hs | cc0-1.0 | categoriesCommand :: [String] -> String -> IO ()
categoriesCommand (envelope:[]) flags = do
conn <- getDbConnection
envelopeId <- getEnvelopeId conn envelope
categoriesResult <- quickQuery'
conn
("SELECT category.name FROM category"
++ " INNER JOIN envelope_category ON category.id = envelope_category.category_id"
++ " WHERE envelope_category.envelope_id = ?")
[toSql envelopeId]
mapM_ (putStrLn . fromSql . head) categoriesResult
disconnect conn | 518 | categoriesCommand :: [String] -> String -> IO ()
categoriesCommand (envelope:[]) flags = do
conn <- getDbConnection
envelopeId <- getEnvelopeId conn envelope
categoriesResult <- quickQuery'
conn
("SELECT category.name FROM category"
++ " INNER JOIN envelope_category ON category.id = envelope_category.category_id"
++ " WHERE envelope_category.envelope_id = ?")
[toSql envelopeId]
mapM_ (putStrLn . fromSql . head) categoriesResult
disconnect conn | 518 | categoriesCommand (envelope:[]) flags = do
conn <- getDbConnection
envelopeId <- getEnvelopeId conn envelope
categoriesResult <- quickQuery'
conn
("SELECT category.name FROM category"
++ " INNER JOIN envelope_category ON category.id = envelope_category.category_id"
++ " WHERE envelope_category.envelope_id = ?")
[toSql envelopeId]
mapM_ (putStrLn . fromSql . head) categoriesResult
disconnect conn | 469 | false | true | 0 | 11 | 125 | 116 | 55 | 61 | null | null |
thade/haskellml | src/Util.hs | bsd-3-clause | mapOutputsVectorToTargetMatrix y = (targetYsMatrix,targets)
where
targets = nub $ toList $ flatten y
targetYsList = map (\t -> cond y t 0 1 0) (map scalar targets)
targetYsMatrix = fromBlocks [targetYsList] | 220 | mapOutputsVectorToTargetMatrix y = (targetYsMatrix,targets)
where
targets = nub $ toList $ flatten y
targetYsList = map (\t -> cond y t 0 1 0) (map scalar targets)
targetYsMatrix = fromBlocks [targetYsList] | 220 | mapOutputsVectorToTargetMatrix y = (targetYsMatrix,targets)
where
targets = nub $ toList $ flatten y
targetYsList = map (\t -> cond y t 0 1 0) (map scalar targets)
targetYsMatrix = fromBlocks [targetYsList] | 220 | false | false | 0 | 8 | 44 | 82 | 42 | 40 | null | null |
beni55/ghcjs | src/Gen2/Prim.hs | mit | genPrim _ _ Narrow8WordOp [r] [x] = PrimInline [j| `r` = (`x` & 0xFF) |] | 78 | genPrim _ _ Narrow8WordOp [r] [x] = PrimInline [j| `r` = (`x` & 0xFF) |] | 78 | genPrim _ _ Narrow8WordOp [r] [x] = PrimInline [j| `r` = (`x` & 0xFF) |] | 78 | false | false | 0 | 6 | 20 | 30 | 17 | 13 | null | null |
gseitz/oauth-provider-wai | src/Network/OAuth/Provider/OAuth1/Wai.hs | bsd-3-clause | query :: Request -> SimpleQueryText
query = fmap (second (fromMaybe "")) . queryToQueryText . queryString | 105 | query :: Request -> SimpleQueryText
query = fmap (second (fromMaybe "")) . queryToQueryText . queryString | 105 | query = fmap (second (fromMaybe "")) . queryToQueryText . queryString | 69 | false | true | 0 | 11 | 14 | 38 | 19 | 19 | null | null |
quchen/prettyprinter | prettyprinter/src-text/Data/Text.hs | bsd-2-clause | pack = id | 9 | pack = id | 9 | pack = id | 9 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
mpickering/HaRe | old/testing/introCase/SubPatternIn1AST.hs | bsd-3-clause | hd x = head x | 13 | hd x = head x | 13 | hd x = head x | 13 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M12/D27/Solution.hs | mit | ixArt2ixArt :: Index -> (DatedArticle a) -> IxValue (DatedArticle a)
ixArt2ixArt (Idx x) art = IxV x art | 104 | ixArt2ixArt :: Index -> (DatedArticle a) -> IxValue (DatedArticle a)
ixArt2ixArt (Idx x) art = IxV x art | 104 | ixArt2ixArt (Idx x) art = IxV x art | 35 | false | true | 0 | 9 | 17 | 54 | 25 | 29 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Compiler.hs | bsd-3-clause | compileProcedure (IterateW8W32E br iv bf) = do
b <- nextBind
let bb = RemBindI b
i <- nextBind
let bi = RemBindW8 i
j <- nextBind
let bj = RemBindW32 j
_ <- compileIterateProcedure Word8Type Word32Type b bb br i bi j bj iv bf
return bj | 267 | compileProcedure (IterateW8W32E br iv bf) = do
b <- nextBind
let bb = RemBindI b
i <- nextBind
let bi = RemBindW8 i
j <- nextBind
let bj = RemBindW32 j
_ <- compileIterateProcedure Word8Type Word32Type b bb br i bi j bj iv bf
return bj | 267 | compileProcedure (IterateW8W32E br iv bf) = do
b <- nextBind
let bb = RemBindI b
i <- nextBind
let bi = RemBindW8 i
j <- nextBind
let bj = RemBindW32 j
_ <- compileIterateProcedure Word8Type Word32Type b bb br i bi j bj iv bf
return bj | 267 | false | false | 0 | 10 | 78 | 112 | 49 | 63 | null | null |
jfischoff/opengl-eval | src/OpenGL/Evaluator/FunctionStruct.hs | bsd-3-clause | name_to_enum_option (_:enum_name) name = result where
result = caps_enum_name ++ "_" ++ caps_name
caps_enum_name = capitalize $ to_under_score enum_name
caps_name = capitalize $ to_under_score name | 209 | name_to_enum_option (_:enum_name) name = result where
result = caps_enum_name ++ "_" ++ caps_name
caps_enum_name = capitalize $ to_under_score enum_name
caps_name = capitalize $ to_under_score name | 209 | name_to_enum_option (_:enum_name) name = result where
result = caps_enum_name ++ "_" ++ caps_name
caps_enum_name = capitalize $ to_under_score enum_name
caps_name = capitalize $ to_under_score name | 209 | false | false | 0 | 8 | 36 | 57 | 29 | 28 | null | null |
meteogrid/sigym-core | src/SIGyM/Store/Registry.hs | bsd-3-clause | registerStores :: Registry -> [Store] -> Maybe Registry
registerStores = foldMaybes registerStore | 97 | registerStores :: Registry -> [Store] -> Maybe Registry
registerStores = foldMaybes registerStore | 97 | registerStores = foldMaybes registerStore | 41 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
MichaelXavier/vigilance | src/Utils/Vigilance/TableOps.hs | bsd-2-clause | sWatchWState :: (WatchStoreTag, S.N3)
sWatchWState = (WatchStoreTag, S.n3) | 74 | sWatchWState :: (WatchStoreTag, S.N3)
sWatchWState = (WatchStoreTag, S.n3) | 74 | sWatchWState = (WatchStoreTag, S.n3) | 36 | false | true | 0 | 6 | 7 | 27 | 16 | 11 | null | null |
alexander-at-github/eta | compiler/ETA/Interactive/ByteCodeAsm.hs | bsd-3-clause | -- | Finds external references. Remember to remove the names
-- defined by this group of BCOs themselves
bcoFreeNames :: UnlinkedBCO -> NameSet
bcoFreeNames bco
= bco_refs bco `minusNameSet` mkNameSet [unlinkedBCOName bco]
where
bco_refs (UnlinkedBCO _ _ _ _ nonptrs ptrs)
= unionNameSets (
mkNameSet [ n | BCOPtrName n <- ssElts ptrs ] :
mkNameSet [ n | BCONPtrItbl n <- ssElts nonptrs ] :
map bco_refs [ bco | BCOPtrBCO bco <- ssElts ptrs ]
) | 510 | bcoFreeNames :: UnlinkedBCO -> NameSet
bcoFreeNames bco
= bco_refs bco `minusNameSet` mkNameSet [unlinkedBCOName bco]
where
bco_refs (UnlinkedBCO _ _ _ _ nonptrs ptrs)
= unionNameSets (
mkNameSet [ n | BCOPtrName n <- ssElts ptrs ] :
mkNameSet [ n | BCONPtrItbl n <- ssElts nonptrs ] :
map bco_refs [ bco | BCOPtrBCO bco <- ssElts ptrs ]
) | 404 | bcoFreeNames bco
= bco_refs bco `minusNameSet` mkNameSet [unlinkedBCOName bco]
where
bco_refs (UnlinkedBCO _ _ _ _ nonptrs ptrs)
= unionNameSets (
mkNameSet [ n | BCOPtrName n <- ssElts ptrs ] :
mkNameSet [ n | BCONPtrItbl n <- ssElts nonptrs ] :
map bco_refs [ bco | BCOPtrBCO bco <- ssElts ptrs ]
) | 365 | true | true | 0 | 13 | 143 | 150 | 70 | 80 | null | null |
ys-nuem/project-euler | 004/004.hs | mit | main = putStrLn $ show problem4 | 31 | main = putStrLn $ show problem4 | 31 | main = putStrLn $ show problem4 | 31 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
anfelor/EasyMacros | src/Language/Haskell/TH/Macro.hs | bsd-3-clause | -- | Left-fold a list of expressions
foldExps :: Q Exp {-(b -> a -> b)-} -> Q Exp {- b -} -> [Exp] -> Q Exp
foldExps _ acc [] = acc | 131 | foldExps :: Q Exp {-(b -> a -> b)-} -> Q Exp {- b -} -> [Exp] -> Q Exp
foldExps _ acc [] = acc | 94 | foldExps _ acc [] = acc | 23 | true | true | 0 | 8 | 32 | 47 | 24 | 23 | null | null |
oisdk/Expr | src/Numeric/Expr/Parse.hs | bsd-3-clause | fltTable
:: (Monad m, TokenParsing m, ExprType e
,LitType e ~ n, Floating n)
=> [[Operator m e]]
fltTable =
[numFuncs ++ fltFuncs ++ signs, exps, mult ++ fracs, adds] | 177 | fltTable
:: (Monad m, TokenParsing m, ExprType e
,LitType e ~ n, Floating n)
=> [[Operator m e]]
fltTable =
[numFuncs ++ fltFuncs ++ signs, exps, mult ++ fracs, adds] | 177 | fltTable =
[numFuncs ++ fltFuncs ++ signs, exps, mult ++ fracs, adds] | 71 | false | true | 0 | 10 | 40 | 91 | 46 | 45 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HTTP.Types.Status.hs | bsd-3-clause | -- | Conflict 409
conflict409 :: Status
conflict409 = status409 | 63 | conflict409 :: Status
conflict409 = status409 | 45 | conflict409 = status409 | 23 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
rfranek/duckling | Duckling/Time/Types.hs | bsd-3-clause | toRFC3339 :: Time.ZonedTime -> Text
toRFC3339 (Time.ZonedTime (Time.LocalTime day (Time.TimeOfDay h m s)) tz) =
Text.concat
[ Text.pack $ Time.showGregorian day
, "T"
, pad 2 h
, ":"
, pad 2 m
, ":"
, pad 2 $ floor s
, "."
, pad 3 . round $ (s - realToFrac (floor s :: Integer)) * 1000
, timezoneOffset tz
] | 353 | toRFC3339 :: Time.ZonedTime -> Text
toRFC3339 (Time.ZonedTime (Time.LocalTime day (Time.TimeOfDay h m s)) tz) =
Text.concat
[ Text.pack $ Time.showGregorian day
, "T"
, pad 2 h
, ":"
, pad 2 m
, ":"
, pad 2 $ floor s
, "."
, pad 3 . round $ (s - realToFrac (floor s :: Integer)) * 1000
, timezoneOffset tz
] | 353 | toRFC3339 (Time.ZonedTime (Time.LocalTime day (Time.TimeOfDay h m s)) tz) =
Text.concat
[ Text.pack $ Time.showGregorian day
, "T"
, pad 2 h
, ":"
, pad 2 m
, ":"
, pad 2 $ floor s
, "."
, pad 3 . round $ (s - realToFrac (floor s :: Integer)) * 1000
, timezoneOffset tz
] | 317 | false | true | 0 | 13 | 107 | 155 | 79 | 76 | null | null |
tiqwab/md-parser | src/Text/Md/HtmlTags.hs | bsd-3-clause | hList items = createTag False "ul" $ concatMap (createTag False "li") items | 75 | hList items = createTag False "ul" $ concatMap (createTag False "li") items | 75 | hList items = createTag False "ul" $ concatMap (createTag False "li") items | 75 | false | false | 3 | 7 | 11 | 36 | 14 | 22 | null | null |
phischu/fragnix | tests/packages/scotty/Data.ByteString.Short.Internal.hs | bsd-3-clause | writeCharArray :: MBA s -> Int -> Char -> ST s ()
writeCharArray (MBA# mba#) (I# i#) (C# c#) =
ST $ \s -> case writeCharArray# mba# i# c# s of
s -> (# s, () #) | 176 | writeCharArray :: MBA s -> Int -> Char -> ST s ()
writeCharArray (MBA# mba#) (I# i#) (C# c#) =
ST $ \s -> case writeCharArray# mba# i# c# s of
s -> (# s, () #) | 176 | writeCharArray (MBA# mba#) (I# i#) (C# c#) =
ST $ \s -> case writeCharArray# mba# i# c# s of
s -> (# s, () #) | 126 | false | true | 2 | 11 | 53 | 95 | 46 | 49 | null | null |
rueshyna/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | An array of the dataset resources in the project. Each resource contains
-- basic information. For full information about a particular dataset
-- resource, use the Datasets: get method. This property is omitted when
-- there are no datasets in the project.
dslDataSets :: Lens' DataSetList [DataSetListDataSetsItem]
dslDataSets
= lens _dslDataSets (\ s a -> s{_dslDataSets = a}) .
_Default
. _Coerce | 418 | dslDataSets :: Lens' DataSetList [DataSetListDataSetsItem]
dslDataSets
= lens _dslDataSets (\ s a -> s{_dslDataSets = a}) .
_Default
. _Coerce | 156 | dslDataSets
= lens _dslDataSets (\ s a -> s{_dslDataSets = a}) .
_Default
. _Coerce | 97 | true | true | 0 | 11 | 77 | 56 | 31 | 25 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 1156805 = 2663 | 34 | getValueFromProduct 1156805 = 2663 | 34 | getValueFromProduct 1156805 = 2663 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Compute/Types/Product.hs | mpl-2.0 | -- | [Output Only] Quota limit for this metric.
qLimit :: Lens' Quota (Maybe Double)
qLimit
= lens _qLimit (\ s a -> s{_qLimit = a}) .
mapping _Coerce | 158 | qLimit :: Lens' Quota (Maybe Double)
qLimit
= lens _qLimit (\ s a -> s{_qLimit = a}) .
mapping _Coerce | 110 | qLimit
= lens _qLimit (\ s a -> s{_qLimit = a}) .
mapping _Coerce | 73 | true | true | 2 | 9 | 36 | 62 | 28 | 34 | null | null |
considerate/progp | Haskell/bio/molbio.hs | mit | fam2 = [("HNFA_Zfish","KQQLLVLVEWAKYIPAFCDLPLDDQVALLRAHAGEHLLLGAAKRSMMYLLGNDHIIPRVAVRILDELVLDLQIDDNEYACLKAIVFFDKGLSDPSIKRMYQVDYINDRQYQEF"),
("HNFA_Human","KEQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMVFLLGNDYIVPRVSIRILDELVLELQIDDNEYAYLKAIIFFDKGLSDPGIKRLSQVDYINDRQYQEF"),
("HNFA_Mouse","KEQLLVLVEWAKYIPAFCELLLDDQVALLRAHAGEHLLLGATKRSMVFLLGNDYIVPRVSIRILDELVLELQIDDNEYACLKAIIFFDKGLSDPGIKRLSQVDYINDRQYQEF"),
("HNFG_Human","KQQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMMYLLGNNYVIHRRVANRVLDELVEIQIDDNEYACLKAIVFFDKGLSDPVIKNMFQVDYINDRQYQEF"),
("HNFG_Mouse","KQQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMMYLLGNHYVIHRRVANRVLDELVEIQIDDNEYACLKAIVFFDKGLSDPVIKNMFQVDYINDRQYQEF"),
("HNF_Fly","KQQLLTLVEWAKQIPAFNELQLDDQVALLRAHAGEHLLLGLSRRSMHLLLSNNCVITRIGARIIDELVTDVGIDDTEFACIKALVFFDKGLNEPHIKSLHQIDYISDRQYQEF")] | 801 | fam2 = [("HNFA_Zfish","KQQLLVLVEWAKYIPAFCDLPLDDQVALLRAHAGEHLLLGAAKRSMMYLLGNDHIIPRVAVRILDELVLDLQIDDNEYACLKAIVFFDKGLSDPSIKRMYQVDYINDRQYQEF"),
("HNFA_Human","KEQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMVFLLGNDYIVPRVSIRILDELVLELQIDDNEYAYLKAIIFFDKGLSDPGIKRLSQVDYINDRQYQEF"),
("HNFA_Mouse","KEQLLVLVEWAKYIPAFCELLLDDQVALLRAHAGEHLLLGATKRSMVFLLGNDYIVPRVSIRILDELVLELQIDDNEYACLKAIIFFDKGLSDPGIKRLSQVDYINDRQYQEF"),
("HNFG_Human","KQQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMMYLLGNNYVIHRRVANRVLDELVEIQIDDNEYACLKAIVFFDKGLSDPVIKNMFQVDYINDRQYQEF"),
("HNFG_Mouse","KQQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMMYLLGNHYVIHRRVANRVLDELVEIQIDDNEYACLKAIVFFDKGLSDPVIKNMFQVDYINDRQYQEF"),
("HNF_Fly","KQQLLTLVEWAKQIPAFNELQLDDQVALLRAHAGEHLLLGLSRRSMHLLLSNNCVITRIGARIIDELVTDVGIDDTEFACIKALVFFDKGLNEPHIKSLHQIDYISDRQYQEF")] | 801 | fam2 = [("HNFA_Zfish","KQQLLVLVEWAKYIPAFCDLPLDDQVALLRAHAGEHLLLGAAKRSMMYLLGNDHIIPRVAVRILDELVLDLQIDDNEYACLKAIVFFDKGLSDPSIKRMYQVDYINDRQYQEF"),
("HNFA_Human","KEQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMVFLLGNDYIVPRVSIRILDELVLELQIDDNEYAYLKAIIFFDKGLSDPGIKRLSQVDYINDRQYQEF"),
("HNFA_Mouse","KEQLLVLVEWAKYIPAFCELLLDDQVALLRAHAGEHLLLGATKRSMVFLLGNDYIVPRVSIRILDELVLELQIDDNEYACLKAIIFFDKGLSDPGIKRLSQVDYINDRQYQEF"),
("HNFG_Human","KQQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMMYLLGNNYVIHRRVANRVLDELVEIQIDDNEYACLKAIVFFDKGLSDPVIKNMFQVDYINDRQYQEF"),
("HNFG_Mouse","KQQLLVLVEWAKYIPAFCELPLDDQVALLRAHAGEHLLLGATKRSMMYLLGNHYVIHRRVANRVLDELVEIQIDDNEYACLKAIVFFDKGLSDPVIKNMFQVDYINDRQYQEF"),
("HNF_Fly","KQQLLTLVEWAKQIPAFNELQLDDQVALLRAHAGEHLLLGLSRRSMHLLLSNNCVITRIGARIIDELVTDVGIDDTEFACIKALVFFDKGLNEPHIKSLHQIDYISDRQYQEF")] | 801 | false | false | 0 | 6 | 12 | 60 | 39 | 21 | null | null |
spechub/Hets | Common/Doc.hs | gpl-2.0 | dagger = symbol daggerS | 23 | dagger = symbol daggerS | 23 | dagger = symbol daggerS | 23 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
rdnetto/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | createPipe :: HostName -> PortID -> IO DB.Pipe
createPipe hostname port = DB.connect (DB.Host hostname port) | 108 | createPipe :: HostName -> PortID -> IO DB.Pipe
createPipe hostname port = DB.connect (DB.Host hostname port) | 108 | createPipe hostname port = DB.connect (DB.Host hostname port) | 61 | false | true | 0 | 8 | 15 | 44 | 21 | 23 | null | null |
music-suite/music-preludes | examples/time_signatures.hs | bsd-3-clause | music = id
$ title "Time signatures"
-- Try commenting out some of these lines
$ timeSignature (6/8)
$ timeSignature (3/4)
$ timeSignature (2/4)
$ timeSignature ((4+3)/8)
$ timeSignature ((3+4)/8)
$ scat [c,c',b,bb,a,as,g|*2,scat [f,e,d,b_]|/2,d|*2,c|*2]|/8 | 278 | music = id
$ title "Time signatures"
-- Try commenting out some of these lines
$ timeSignature (6/8)
$ timeSignature (3/4)
$ timeSignature (2/4)
$ timeSignature ((4+3)/8)
$ timeSignature ((3+4)/8)
$ scat [c,c',b,bb,a,as,g|*2,scat [f,e,d,b_]|/2,d|*2,c|*2]|/8 | 278 | music = id
$ title "Time signatures"
-- Try commenting out some of these lines
$ timeSignature (6/8)
$ timeSignature (3/4)
$ timeSignature (2/4)
$ timeSignature ((4+3)/8)
$ timeSignature ((3+4)/8)
$ scat [c,c',b,bb,a,as,g|*2,scat [f,e,d,b_]|/2,d|*2,c|*2]|/8 | 278 | false | false | 15 | 9 | 54 | 181 | 92 | 89 | null | null |
trbauer/gravity | src/Prim.hs | bsd-2-clause | ipShow :: InputSet -> String
ipShow = ("ipFromList "++) . show . ipToList | 73 | ipShow :: InputSet -> String
ipShow = ("ipFromList "++) . show . ipToList | 73 | ipShow = ("ipFromList "++) . show . ipToList | 44 | false | true | 0 | 7 | 12 | 27 | 15 | 12 | null | null |
oakfang/DemiLang | src/Demi/VM.hs | mit | getVar :: VarMap -> String -> VariableValue
getVar state id = case Map.lookup id state of Just x -> x
Nothing -> Nil | 162 | getVar :: VarMap -> String -> VariableValue
getVar state id = case Map.lookup id state of Just x -> x
Nothing -> Nil | 162 | getVar state id = case Map.lookup id state of Just x -> x
Nothing -> Nil | 118 | false | true | 0 | 8 | 68 | 50 | 24 | 26 | null | null |
ulricha/dsh | src/Database/DSH/SL/Render/Dot.hs | bsd-3-clause | renderColor DCSienna = text "sienna" | 42 | renderColor DCSienna = text "sienna" | 42 | renderColor DCSienna = text "sienna" | 42 | false | false | 0 | 5 | 10 | 13 | 5 | 8 | null | null |
seanparsons/worldbank | src/Data/WorldBank.hs | mit | parseAsInt _ = mzero | 29 | parseAsInt _ = mzero | 29 | parseAsInt _ = mzero | 29 | false | false | 0 | 4 | 12 | 10 | 4 | 6 | null | null |
Tombert/HGOL | src/Main.hs | gpl-3.0 | nonLivingFilter = filterAdjacent notElem | 40 | nonLivingFilter = filterAdjacent notElem | 40 | nonLivingFilter = filterAdjacent notElem | 40 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
vikraman/ghc | compiler/utils/Outputable.hs | bsd-3-clause | primWord64Suffix = text "L##" | 29 | primWord64Suffix = text "L##" | 29 | primWord64Suffix = text "L##" | 29 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
juodaspaulius/clafer-old-customBNFC | src/Language/Clafer/Intermediate/Desugarer.hs | mit | desugarElements (ElementsList _ es) = es >>= desugarElement | 60 | desugarElements (ElementsList _ es) = es >>= desugarElement | 60 | desugarElements (ElementsList _ es) = es >>= desugarElement | 60 | false | false | 0 | 7 | 8 | 21 | 10 | 11 | null | null |
GaloisInc/halvm-ghc | compiler/main/DriverPipeline.hs | bsd-3-clause | platformSupportsSavingLinkOpts :: OS -> Bool
platformSupportsSavingLinkOpts os
| os == OSSolaris2 = False -- see #5382
| otherwise = osElfTarget os | 158 | platformSupportsSavingLinkOpts :: OS -> Bool
platformSupportsSavingLinkOpts os
| os == OSSolaris2 = False -- see #5382
| otherwise = osElfTarget os | 158 | platformSupportsSavingLinkOpts os
| os == OSSolaris2 = False -- see #5382
| otherwise = osElfTarget os | 113 | false | true | 1 | 8 | 31 | 39 | 19 | 20 | null | null |
tensorflow/haskell | tensorflow-ops/tests/OpsTest.hs | apache-2.0 | testSaveRestore :: Test
testSaveRestore = testCase "testSaveRestore" $
withSystemTempDirectory "" $ \dirPath -> do
let path = B8.pack $ dirPath ++ "/checkpoint"
var :: TF.MonadBuild m => m (TF.Tensor TF.Ref Float)
var = TF.zeroInitializedVariable' (TF.opName .~ "a")
(TF.Shape [])
TF.runSession $ do
v <- var
TF.assign v 134 >>= TF.run_
TF.save path [v] >>= TF.run_
result <- TF.runSession $ do
v <- var
TF.restore path v >>= TF.run_
TF.run v
liftIO $ TF.Scalar 134 @=? result
-- | Test that 'placeholder' is not CSE'd. | 692 | testSaveRestore :: Test
testSaveRestore = testCase "testSaveRestore" $
withSystemTempDirectory "" $ \dirPath -> do
let path = B8.pack $ dirPath ++ "/checkpoint"
var :: TF.MonadBuild m => m (TF.Tensor TF.Ref Float)
var = TF.zeroInitializedVariable' (TF.opName .~ "a")
(TF.Shape [])
TF.runSession $ do
v <- var
TF.assign v 134 >>= TF.run_
TF.save path [v] >>= TF.run_
result <- TF.runSession $ do
v <- var
TF.restore path v >>= TF.run_
TF.run v
liftIO $ TF.Scalar 134 @=? result
-- | Test that 'placeholder' is not CSE'd. | 692 | testSaveRestore = testCase "testSaveRestore" $
withSystemTempDirectory "" $ \dirPath -> do
let path = B8.pack $ dirPath ++ "/checkpoint"
var :: TF.MonadBuild m => m (TF.Tensor TF.Ref Float)
var = TF.zeroInitializedVariable' (TF.opName .~ "a")
(TF.Shape [])
TF.runSession $ do
v <- var
TF.assign v 134 >>= TF.run_
TF.save path [v] >>= TF.run_
result <- TF.runSession $ do
v <- var
TF.restore path v >>= TF.run_
TF.run v
liftIO $ TF.Scalar 134 @=? result
-- | Test that 'placeholder' is not CSE'd. | 668 | false | true | 2 | 15 | 256 | 229 | 105 | 124 | null | null |
kevintvh/sodium | haskell/src/FRP/Sodium/Plain.hs | bsd-3-clause | -- | Transform an event with a generalized state loop (a mealy machine). The function
-- is passed the input and the old state and returns the new state and output value.
collectE :: (a -> s -> (b, s)) -> s -> Event a -> Reactive (Event b)
collectE = R.collectE | 261 | collectE :: (a -> s -> (b, s)) -> s -> Event a -> Reactive (Event b)
collectE = R.collectE | 90 | collectE = R.collectE | 21 | true | true | 0 | 10 | 51 | 56 | 30 | 26 | null | null |
chemist/highlighter | src/Text/Highlighter/Lexers/Python.hs | bsd-3-clause | nl' :: TokenMatcher
nl' =
[ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")
] | 91 | nl' :: TokenMatcher
nl' =
[ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")
] | 91 | nl' =
[ tok "\\n" (Arbitrary "Literal" :. Arbitrary "String")
] | 71 | false | true | 0 | 9 | 21 | 32 | 16 | 16 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Build.hs | bsd-3-clause | replComponent _ _ _ _
(CTest TestSuite { testInterface = TestSuiteUnsupported tt })
_ _ =
die $ "No support for building test suite type " ++ display tt | 184 | replComponent _ _ _ _
(CTest TestSuite { testInterface = TestSuiteUnsupported tt })
_ _ =
die $ "No support for building test suite type " ++ display tt | 184 | replComponent _ _ _ _
(CTest TestSuite { testInterface = TestSuiteUnsupported tt })
_ _ =
die $ "No support for building test suite type " ++ display tt | 184 | false | false | 0 | 11 | 60 | 50 | 24 | 26 | null | null |
DavidAlphaFox/ghc | libraries/containers/Data/Set/Base.hs | bsd-3-clause | merge l@(Bin sizeL x lx rx) r@(Bin sizeR y ly ry)
| delta*sizeL < sizeR = balanceL y (merge l ly) ry
| delta*sizeR < sizeL = balanceR x lx (merge rx r)
| otherwise = glue l r | 190 | merge l@(Bin sizeL x lx rx) r@(Bin sizeR y ly ry)
| delta*sizeL < sizeR = balanceL y (merge l ly) ry
| delta*sizeR < sizeL = balanceR x lx (merge rx r)
| otherwise = glue l r | 190 | merge l@(Bin sizeL x lx rx) r@(Bin sizeR y ly ry)
| delta*sizeL < sizeR = balanceL y (merge l ly) ry
| delta*sizeR < sizeL = balanceR x lx (merge rx r)
| otherwise = glue l r | 190 | false | false | 1 | 9 | 54 | 116 | 56 | 60 | null | null |
jwiegley/ghc-release | utils/haddock/src/Haddock/Backends/Xhtml/Decl.hs | gpl-3.0 | ppLKind :: Unicode -> Qualification -> LHsKind DocName -> Html
ppLKind unicode qual y = ppKind unicode qual (unLoc y) | 117 | ppLKind :: Unicode -> Qualification -> LHsKind DocName -> Html
ppLKind unicode qual y = ppKind unicode qual (unLoc y) | 117 | ppLKind unicode qual y = ppKind unicode qual (unLoc y) | 54 | false | true | 0 | 8 | 19 | 46 | 22 | 24 | null | null |
hsyl20/ViperVM | haskus-system/src/tests/Haskus/Tests/Arch/Linux/ErrorCode.hs | bsd-3-clause | testsErrorCode :: TestTree
testsErrorCode = testGroup "Error codes"
[ testProperty "ErrorCode's enum EBUSY"
(toCEnum (16 :: Word64) == EBUSY)
, testProperty "ErrorCode's enum EDOTDOT"
(toCEnum (73 :: Word64) == EDOTDOT)
, testProperty "ErrorCode's enum ENETDOWN"
(toCEnum (100 :: Word64) == ENETDOWN)
, testProperty "ErrorCode's enum EINPROGRESS"
(toCEnum (115 :: Word64) == EINPROGRESS)
, testProperty "ErrorCode's enum EHWPOISON"
(toCEnum (133 :: Word64) == EHWPOISON)
, testProperty "ErrorCode's enum EOTHER"
(toCEnum (150 :: Word64) == EOTHER 150)
] | 611 | testsErrorCode :: TestTree
testsErrorCode = testGroup "Error codes"
[ testProperty "ErrorCode's enum EBUSY"
(toCEnum (16 :: Word64) == EBUSY)
, testProperty "ErrorCode's enum EDOTDOT"
(toCEnum (73 :: Word64) == EDOTDOT)
, testProperty "ErrorCode's enum ENETDOWN"
(toCEnum (100 :: Word64) == ENETDOWN)
, testProperty "ErrorCode's enum EINPROGRESS"
(toCEnum (115 :: Word64) == EINPROGRESS)
, testProperty "ErrorCode's enum EHWPOISON"
(toCEnum (133 :: Word64) == EHWPOISON)
, testProperty "ErrorCode's enum EOTHER"
(toCEnum (150 :: Word64) == EOTHER 150)
] | 611 | testsErrorCode = testGroup "Error codes"
[ testProperty "ErrorCode's enum EBUSY"
(toCEnum (16 :: Word64) == EBUSY)
, testProperty "ErrorCode's enum EDOTDOT"
(toCEnum (73 :: Word64) == EDOTDOT)
, testProperty "ErrorCode's enum ENETDOWN"
(toCEnum (100 :: Word64) == ENETDOWN)
, testProperty "ErrorCode's enum EINPROGRESS"
(toCEnum (115 :: Word64) == EINPROGRESS)
, testProperty "ErrorCode's enum EHWPOISON"
(toCEnum (133 :: Word64) == EHWPOISON)
, testProperty "ErrorCode's enum EOTHER"
(toCEnum (150 :: Word64) == EOTHER 150)
] | 584 | false | true | 0 | 10 | 133 | 164 | 87 | 77 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Attoparsec.Time.hs | bsd-3-clause | -- | Parse a count of seconds, with the integer part being two digits
-- long.
seconds :: Parser Pico
seconds = do
real <- twoDigits
mc <- peekChar
case mc of
Just '.' -> do
t <- anyChar *> takeWhile1 isDigit
return $! parsePicos real t
_ -> return $! fromIntegral real
where
parsePicos a0 t = toPico (fromIntegral (t' * 10^n))
where T n t' = T.foldl' step (T 12 (fromIntegral a0)) t
step ma@(T m a) c
| m <= 0 = ma
| otherwise = T (m-1) (10 * a + fromIntegral (ord c) .&. 15)
-- | Parse a time zone, and return 'Nothing' if the offset from UTC is
-- zero. (This makes some speedups possible.) | 669 | seconds :: Parser Pico
seconds = do
real <- twoDigits
mc <- peekChar
case mc of
Just '.' -> do
t <- anyChar *> takeWhile1 isDigit
return $! parsePicos real t
_ -> return $! fromIntegral real
where
parsePicos a0 t = toPico (fromIntegral (t' * 10^n))
where T n t' = T.foldl' step (T 12 (fromIntegral a0)) t
step ma@(T m a) c
| m <= 0 = ma
| otherwise = T (m-1) (10 * a + fromIntegral (ord c) .&. 15)
-- | Parse a time zone, and return 'Nothing' if the offset from UTC is
-- zero. (This makes some speedups possible.) | 590 | seconds = do
real <- twoDigits
mc <- peekChar
case mc of
Just '.' -> do
t <- anyChar *> takeWhile1 isDigit
return $! parsePicos real t
_ -> return $! fromIntegral real
where
parsePicos a0 t = toPico (fromIntegral (t' * 10^n))
where T n t' = T.foldl' step (T 12 (fromIntegral a0)) t
step ma@(T m a) c
| m <= 0 = ma
| otherwise = T (m-1) (10 * a + fromIntegral (ord c) .&. 15)
-- | Parse a time zone, and return 'Nothing' if the offset from UTC is
-- zero. (This makes some speedups possible.) | 567 | true | true | 3 | 14 | 197 | 235 | 111 | 124 | null | null |
AkronCodeClub/edX-FP101x-Oct-2014 | sean_o/hw8.hs | mit | liftM5' f m = m >>= \a -> m >>= \b -> return (f a) | 50 | liftM5' f m = m >>= \a -> m >>= \b -> return (f a) | 50 | liftM5' f m = m >>= \a -> m >>= \b -> return (f a) | 50 | false | false | 0 | 11 | 14 | 38 | 19 | 19 | null | null |
david-caro/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkUnquotedExpansions3 = verify checkUnquotedExpansions "[ $(foo) == cow ]" | 82 | prop_checkUnquotedExpansions3 = verify checkUnquotedExpansions "[ $(foo) == cow ]" | 82 | prop_checkUnquotedExpansions3 = verify checkUnquotedExpansions "[ $(foo) == cow ]" | 82 | false | false | 0 | 5 | 8 | 11 | 5 | 6 | null | null |
sseefried/shady-gen | src/Shady/Language/GLSL.hs | agpl-3.0 | -- HACK: the type of the view matrix above is inferred to be vec4 instead of
-- mat4x4. This lie saves me from having to introduce matrices to
-- the representation. If I use them elswhere, get honest.
-- | @main@ in a shader program.
mainDef :: Statement -> Definition
mainDef = F Nothing "main" [] | 302 | mainDef :: Statement -> Definition
mainDef = F Nothing "main" [] | 64 | mainDef = F Nothing "main" [] | 29 | true | true | 0 | 6 | 58 | 28 | 16 | 12 | null | null |
threetreeslight/learning-haskell | practice/old/20150809.hs | mit | isLarge = (> 100) | 17 | isLarge = (> 100) | 17 | isLarge = (> 100) | 17 | false | false | 0 | 5 | 3 | 10 | 6 | 4 | null | null |
SKA-ScienceDataProcessor/RC | MS3/lib/DNA/DSL.hs | apache-2.0 | -- | Can be used to obtain the result from a 'Promise'. If the actor
-- didn't sent result yet, it will block until the value arrives.
await :: Serializable a => Promise a -> DNA a
await = DNA . singleton . Await | 212 | await :: Serializable a => Promise a -> DNA a
await = DNA . singleton . Await | 77 | await = DNA . singleton . Await | 31 | true | true | 0 | 7 | 43 | 38 | 19 | 19 | null | null |
mariefarrell/Hets | OWL2/ShipSyntax.hs | gpl-2.0 | topC :: Concept
topC = CName "T" | 32 | topC :: Concept
topC = CName "T" | 32 | topC = CName "T" | 16 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
tedkornish/stack | src/Stack/Types/Config.hs | bsd-3-clause | -- | Get the extra bin directories (for the PATH). Puts more local first
--
-- Bool indicates whether or not to include the locals
extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env)
=> m (Bool -> [Path Abs Dir])
extraBinDirs = do
deps <- installationRootDeps
local <- installationRootLocal
return $ \locals -> if locals
then [local </> bindirSuffix, deps </> bindirSuffix]
else [deps </> bindirSuffix]
-- | Get the minimal environment override, useful for just calling external
-- processes like git or ghc | 565 | extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env)
=> m (Bool -> [Path Abs Dir])
extraBinDirs = do
deps <- installationRootDeps
local <- installationRootLocal
return $ \locals -> if locals
then [local </> bindirSuffix, deps </> bindirSuffix]
else [deps </> bindirSuffix]
-- | Get the minimal environment override, useful for just calling external
-- processes like git or ghc | 434 | extraBinDirs = do
deps <- installationRootDeps
local <- installationRootLocal
return $ \locals -> if locals
then [local </> bindirSuffix, deps </> bindirSuffix]
else [deps </> bindirSuffix]
-- | Get the minimal environment override, useful for just calling external
-- processes like git or ghc | 323 | true | true | 0 | 11 | 126 | 112 | 61 | 51 | null | null |
oldmanmike/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal" | 74 | exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal" | 74 | exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal" | 74 | false | false | 0 | 6 | 14 | 20 | 9 | 11 | null | null |
MarcelineVQ/advent2016 | src/Day7.hs | bsd-3-clause | testTLSBad2 = "aaaa[qwer]tyui" | 30 | testTLSBad2 = "aaaa[qwer]tyui" | 30 | testTLSBad2 = "aaaa[qwer]tyui" | 30 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
nushio3/UFCORIN | test/FeaturePackSpec.hs | mit | testFSP :: FeatureSchemaPack
testFSP = FeatureSchemaPack
{ _fspSchemaDefinitions = Map.fromList
[("f35L", testFS1)]
, _fspFilenamePairs =
[("f35L", "/user/nushio/wavelet-features/haarC-2-S-0000-0000.txt")
,("f35L", "/user/nushio/wavelet-features/bsplC-301-S-0000-0000.txt")
,("f35L", "/user/shibayama/sdo/hmi/hmi_totalflux.txt")]} | 365 | testFSP :: FeatureSchemaPack
testFSP = FeatureSchemaPack
{ _fspSchemaDefinitions = Map.fromList
[("f35L", testFS1)]
, _fspFilenamePairs =
[("f35L", "/user/nushio/wavelet-features/haarC-2-S-0000-0000.txt")
,("f35L", "/user/nushio/wavelet-features/bsplC-301-S-0000-0000.txt")
,("f35L", "/user/shibayama/sdo/hmi/hmi_totalflux.txt")]} | 365 | testFSP = FeatureSchemaPack
{ _fspSchemaDefinitions = Map.fromList
[("f35L", testFS1)]
, _fspFilenamePairs =
[("f35L", "/user/nushio/wavelet-features/haarC-2-S-0000-0000.txt")
,("f35L", "/user/nushio/wavelet-features/bsplC-301-S-0000-0000.txt")
,("f35L", "/user/shibayama/sdo/hmi/hmi_totalflux.txt")]} | 336 | false | true | 0 | 10 | 55 | 70 | 42 | 28 | null | null |
m-alvarez/jhc | drift_processed/Ho/Type.hs | mit | choExternalNames_s v = choExternalNames_u (const v) | 53 | choExternalNames_s v = choExternalNames_u (const v) | 53 | choExternalNames_s v = choExternalNames_u (const v) | 53 | false | false | 0 | 7 | 7 | 18 | 8 | 10 | null | null |
wayofthepie/riverd | src/lib/Model/XmlGen.hs | bsd-3-clause | enXmlFile :: a -> PU a -> String -> IO [XmlTree]
genXmlFile togen pickler fileName =
runX ( constA togen >>> xpickleDocument pickler [withIndent yes] fileName)
| 164 | genXmlFile :: a -> PU a -> String -> IO [XmlTree]
genXmlFile togen pickler fileName =
runX ( constA togen >>> xpickleDocument pickler [withIndent yes] fileName) | 164 | genXmlFile togen pickler fileName =
runX ( constA togen >>> xpickleDocument pickler [withIndent yes] fileName) | 114 | false | true | 0 | 10 | 30 | 65 | 31 | 34 | null | null |
vektordev/GP | src/Frontend.hs | gpl-2.0 | cross :: Float -> Picture
cross axis = Pictures [Line [(-axis/2, -axis/2), (axis/2, axis/2)], Line [(axis/2, -axis/2), (-axis/2, axis/2)]] | 138 | cross :: Float -> Picture
cross axis = Pictures [Line [(-axis/2, -axis/2), (axis/2, axis/2)], Line [(axis/2, -axis/2), (-axis/2, axis/2)]] | 138 | cross axis = Pictures [Line [(-axis/2, -axis/2), (axis/2, axis/2)], Line [(axis/2, -axis/2), (-axis/2, axis/2)]] | 112 | false | true | 0 | 11 | 18 | 115 | 61 | 54 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\xF96C' = "\x585E" | 33 | decomposeChar '\xF96C' = "\x585E" | 33 | decomposeChar '\xF96C' = "\x585E" | 33 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
adamschoenemann/simple-frp | test/FRP/Generators.hs | mit | genOps :: Gen TestTerm -> Int -> Gen TestTerm
genOps termGen = go where
go n = do
m <- choose (0, n)
if (m == 0)
then termGen
else do
op <- elements [eq, (+), (-), (>.), (<.), (<==), (>==), (*), tmbinop Div]
left <- go (div n (m + 1))
right <- go (div n (m + 1))
return $ op left right | 339 | genOps :: Gen TestTerm -> Int -> Gen TestTerm
genOps termGen = go where
go n = do
m <- choose (0, n)
if (m == 0)
then termGen
else do
op <- elements [eq, (+), (-), (>.), (<.), (<==), (>==), (*), tmbinop Div]
left <- go (div n (m + 1))
right <- go (div n (m + 1))
return $ op left right | 339 | genOps termGen = go where
go n = do
m <- choose (0, n)
if (m == 0)
then termGen
else do
op <- elements [eq, (+), (-), (>.), (<.), (<==), (>==), (*), tmbinop Div]
left <- go (div n (m + 1))
right <- go (div n (m + 1))
return $ op left right | 293 | false | true | 0 | 15 | 118 | 187 | 102 | 85 | null | null |
ksaveljev/hake-2 | src/Game/GameFunc.hs | bsd-3-clause | doorToggle :: Int
doorToggle = 31 | 33 | doorToggle :: Int
doorToggle = 31 | 33 | doorToggle = 31 | 15 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F23.hs | bsd-3-clause | -- glRotatef -------------------------------------------------------------------
-- | Manual page for <https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml OpenGL 2.x>.
glRotatef
:: MonadIO m
=> GLfloat -- ^ @angle@.
-> GLfloat -- ^ @x@.
-> GLfloat -- ^ @y@.
-> GLfloat -- ^ @z@.
-> m ()
glRotatef v1 v2 v3 v4 = liftIO $ dyn52 ptr_glRotatef v1 v2 v3 v4 | 368 | glRotatef
:: MonadIO m
=> GLfloat -- ^ @angle@.
-> GLfloat -- ^ @x@.
-> GLfloat -- ^ @y@.
-> GLfloat -- ^ @z@.
-> m ()
glRotatef v1 v2 v3 v4 = liftIO $ dyn52 ptr_glRotatef v1 v2 v3 v4 | 195 | glRotatef v1 v2 v3 v4 = liftIO $ dyn52 ptr_glRotatef v1 v2 v3 v4 | 64 | true | true | 0 | 12 | 64 | 73 | 37 | 36 | null | null |
tvh/llvm-general-quote | src/LLVM/General/Quote/Parser/Monad.hs | bsd-3-clause | throw :: Exception e => e -> P a
throw e = P $ \_ -> Left (toException e) | 73 | throw :: Exception e => e -> P a
throw e = P $ \_ -> Left (toException e) | 73 | throw e = P $ \_ -> Left (toException e) | 40 | false | true | 0 | 9 | 18 | 49 | 23 | 26 | null | null |
uuhan/Idris-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | set_datatypes :: Ctxt TypeInfo -> Elab' aux ()
set_datatypes ds = do ES (p, a) logs prev <- get
put (ES (p { datatypes = ds }, a) logs prev) | 162 | set_datatypes :: Ctxt TypeInfo -> Elab' aux ()
set_datatypes ds = do ES (p, a) logs prev <- get
put (ES (p { datatypes = ds }, a) logs prev) | 162 | set_datatypes ds = do ES (p, a) logs prev <- get
put (ES (p { datatypes = ds }, a) logs prev) | 115 | false | true | 0 | 13 | 51 | 83 | 40 | 43 | null | null |
valderman/lambnyaa | Network/LambNyaa/Log/Core.hs | bsd-3-clause | fileLogger :: IOMode -> FilePath -> LogHandler
fileLogger mode file = do
h <- openFile file mode
t <- forkIO $ forever (threadDelay 60000000 >> hFlush h)
return (hPutStrLn h . formatLogItem, killThread t >> hClose h)
-- | Print log to a file. The log buffer is flushed once every minute. | 294 | fileLogger :: IOMode -> FilePath -> LogHandler
fileLogger mode file = do
h <- openFile file mode
t <- forkIO $ forever (threadDelay 60000000 >> hFlush h)
return (hPutStrLn h . formatLogItem, killThread t >> hClose h)
-- | Print log to a file. The log buffer is flushed once every minute. | 294 | fileLogger mode file = do
h <- openFile file mode
t <- forkIO $ forever (threadDelay 60000000 >> hFlush h)
return (hPutStrLn h . formatLogItem, killThread t >> hClose h)
-- | Print log to a file. The log buffer is flushed once every minute. | 247 | false | true | 0 | 13 | 58 | 99 | 44 | 55 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Compute/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'VPNTunnelList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'vtlNextPageToken'
--
-- * 'vtlKind'
--
-- * 'vtlItems'
--
-- * 'vtlSelfLink'
--
-- * 'vtlId'
vpnTunnelList
:: VPNTunnelList
vpnTunnelList =
VPNTunnelList'
{ _vtlNextPageToken = Nothing
, _vtlKind = "compute#vpnTunnelList"
, _vtlItems = Nothing
, _vtlSelfLink = Nothing
, _vtlId = Nothing
} | 495 | vpnTunnelList
:: VPNTunnelList
vpnTunnelList =
VPNTunnelList'
{ _vtlNextPageToken = Nothing
, _vtlKind = "compute#vpnTunnelList"
, _vtlItems = Nothing
, _vtlSelfLink = Nothing
, _vtlId = Nothing
} | 228 | vpnTunnelList =
VPNTunnelList'
{ _vtlNextPageToken = Nothing
, _vtlKind = "compute#vpnTunnelList"
, _vtlItems = Nothing
, _vtlSelfLink = Nothing
, _vtlId = Nothing
} | 193 | true | true | 0 | 7 | 108 | 66 | 42 | 24 | null | null |
thielema/gitit | gitit.hs | gpl-2.0 | main :: IO ()
main = do
-- parse options to get config file
args <- getArgs >>= parseArgs
-- sequence in Either monad gets first Left or all Rights
opts <- case sequence args of
Left Help -> putErr ExitSuccess =<< usageMessage
Left Version -> do
progname <- getProgName
putErr ExitSuccess (progname ++ " version " ++
showVersion version ++ compileInfo ++ copyrightMessage)
Left PrintDefaultConfig -> getDataFileName "data/default.conf" >>=
readFileUTF8 >>= B.putStrLn . fromString >> exitWith ExitSuccess
Right xs -> return xs
conf' <- case [f | ConfigFile f <- opts] of
(x:_) -> getConfigFromFile x
[] -> getDefaultConfig
let conf = foldl handleFlag conf' opts
-- check for external programs that are needed
let repoProg = case repositoryType conf of
Mercurial -> "hg"
Darcs -> "darcs"
Git -> "git"
let prereqs = ["grep", repoProg]
forM_ prereqs $ \prog ->
findExecutable prog >>= \mbFind ->
when (isNothing mbFind) $ error $
"Required program '" ++ prog ++ "' not found in system path."
-- set up logging
let level = if debugMode conf then DEBUG else logLevel conf
logFileHandler <- fileHandler (logFile conf) level
serverLogger <- getLogger "Happstack.Server.AccessLog.Combined"
gititLogger <- getLogger "gitit"
saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] serverLogger
saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] gititLogger
-- setup the page repository, template, and static files, if they don't exist
createRepoIfMissing conf
createStaticIfMissing conf
createTemplateIfMissing conf
-- initialize state
initializeGititState conf
let serverConf = nullConf { validator = Nothing, port = portNumber conf,
timeout = 20, logAccess = Nothing }
-- open the requested interface
sock <- socket AF_INET Stream defaultProtocol
setSocketOption sock ReuseAddr 1
device <- inet_addr (getListenOrDefault opts)
bindSocket sock (SockAddrInet (toEnum (portNumber conf)) device)
listen sock 10
-- start the server
simpleHTTPWithSocket sock serverConf $ msum [ wiki conf
, dir "_reloadTemplates" reloadTemplates
] | 2,391 | main :: IO ()
main = do
-- parse options to get config file
args <- getArgs >>= parseArgs
-- sequence in Either monad gets first Left or all Rights
opts <- case sequence args of
Left Help -> putErr ExitSuccess =<< usageMessage
Left Version -> do
progname <- getProgName
putErr ExitSuccess (progname ++ " version " ++
showVersion version ++ compileInfo ++ copyrightMessage)
Left PrintDefaultConfig -> getDataFileName "data/default.conf" >>=
readFileUTF8 >>= B.putStrLn . fromString >> exitWith ExitSuccess
Right xs -> return xs
conf' <- case [f | ConfigFile f <- opts] of
(x:_) -> getConfigFromFile x
[] -> getDefaultConfig
let conf = foldl handleFlag conf' opts
-- check for external programs that are needed
let repoProg = case repositoryType conf of
Mercurial -> "hg"
Darcs -> "darcs"
Git -> "git"
let prereqs = ["grep", repoProg]
forM_ prereqs $ \prog ->
findExecutable prog >>= \mbFind ->
when (isNothing mbFind) $ error $
"Required program '" ++ prog ++ "' not found in system path."
-- set up logging
let level = if debugMode conf then DEBUG else logLevel conf
logFileHandler <- fileHandler (logFile conf) level
serverLogger <- getLogger "Happstack.Server.AccessLog.Combined"
gititLogger <- getLogger "gitit"
saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] serverLogger
saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] gititLogger
-- setup the page repository, template, and static files, if they don't exist
createRepoIfMissing conf
createStaticIfMissing conf
createTemplateIfMissing conf
-- initialize state
initializeGititState conf
let serverConf = nullConf { validator = Nothing, port = portNumber conf,
timeout = 20, logAccess = Nothing }
-- open the requested interface
sock <- socket AF_INET Stream defaultProtocol
setSocketOption sock ReuseAddr 1
device <- inet_addr (getListenOrDefault opts)
bindSocket sock (SockAddrInet (toEnum (portNumber conf)) device)
listen sock 10
-- start the server
simpleHTTPWithSocket sock serverConf $ msum [ wiki conf
, dir "_reloadTemplates" reloadTemplates
] | 2,391 | main = do
-- parse options to get config file
args <- getArgs >>= parseArgs
-- sequence in Either monad gets first Left or all Rights
opts <- case sequence args of
Left Help -> putErr ExitSuccess =<< usageMessage
Left Version -> do
progname <- getProgName
putErr ExitSuccess (progname ++ " version " ++
showVersion version ++ compileInfo ++ copyrightMessage)
Left PrintDefaultConfig -> getDataFileName "data/default.conf" >>=
readFileUTF8 >>= B.putStrLn . fromString >> exitWith ExitSuccess
Right xs -> return xs
conf' <- case [f | ConfigFile f <- opts] of
(x:_) -> getConfigFromFile x
[] -> getDefaultConfig
let conf = foldl handleFlag conf' opts
-- check for external programs that are needed
let repoProg = case repositoryType conf of
Mercurial -> "hg"
Darcs -> "darcs"
Git -> "git"
let prereqs = ["grep", repoProg]
forM_ prereqs $ \prog ->
findExecutable prog >>= \mbFind ->
when (isNothing mbFind) $ error $
"Required program '" ++ prog ++ "' not found in system path."
-- set up logging
let level = if debugMode conf then DEBUG else logLevel conf
logFileHandler <- fileHandler (logFile conf) level
serverLogger <- getLogger "Happstack.Server.AccessLog.Combined"
gititLogger <- getLogger "gitit"
saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] serverLogger
saveGlobalLogger $ setLevel level $ setHandlers [logFileHandler] gititLogger
-- setup the page repository, template, and static files, if they don't exist
createRepoIfMissing conf
createStaticIfMissing conf
createTemplateIfMissing conf
-- initialize state
initializeGititState conf
let serverConf = nullConf { validator = Nothing, port = portNumber conf,
timeout = 20, logAccess = Nothing }
-- open the requested interface
sock <- socket AF_INET Stream defaultProtocol
setSocketOption sock ReuseAddr 1
device <- inet_addr (getListenOrDefault opts)
bindSocket sock (SockAddrInet (toEnum (portNumber conf)) device)
listen sock 10
-- start the server
simpleHTTPWithSocket sock serverConf $ msum [ wiki conf
, dir "_reloadTemplates" reloadTemplates
] | 2,377 | false | true | 1 | 19 | 650 | 598 | 278 | 320 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.