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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nevrenato/HetsAlloy | CASL/Freeness.hs | gpl-2.0 | free_formula f = f | 18 | free_formula f = f | 18 | free_formula f = f | 18 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
jvranish/TheExperiment | src/Language/TheExperiment/Parser/Type.hs | bsd-3-clause | aTypeVariable :: EParser ParsedType
aTypeVariable = liftMtp TypeVariable lowerIdent | 83 | aTypeVariable :: EParser ParsedType
aTypeVariable = liftMtp TypeVariable lowerIdent | 83 | aTypeVariable = liftMtp TypeVariable lowerIdent | 47 | false | true | 0 | 5 | 8 | 19 | 9 | 10 | null | null |
urbanslug/ghc | testsuite/tests/gadt/gadt23.hs | bsd-3-clause | main = return () | 16 | main = return () | 16 | main = return () | 16 | false | false | 1 | 6 | 3 | 15 | 5 | 10 | null | null |
colinba/tip-toi-reveng | src/BakedVector.hs | mit | intString :: QuasiQuoter
intString = bakedString intHost | 56 | intString :: QuasiQuoter
intString = bakedString intHost | 56 | intString = bakedString intHost | 31 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
kmels/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | -- parsing
-- -- | A query restricting the account(s) to be shown in the sidebar, if any.
-- -- Just looks at the first query option.
-- showAccountMatcher :: [QueryOpt] -> Maybe Query
-- showAccountMatcher (QueryOptInAcctSubsOnly a:_) = Just $ Acct True $ accountNameToAccountRegex a
-- showAccountMatcher _ = Nothing
-- | Convert a query expression containing zero or more space-separated
-- terms to a query and zero or more query options. A query term is either:
--
-- 1. a search pattern, which matches on one or more fields, eg:
--
-- acct:REGEXP - match the account name with a regular expression
-- desc:REGEXP - match the transaction description
-- date:PERIODEXP - match the date with a period expression
--
-- The prefix indicates the field to match, or if there is no prefix
-- account name is assumed.
--
-- 2. a query option, which modifies the reporting behaviour in some
-- way. There is currently one of these, which may appear only once:
--
-- inacct:FULLACCTNAME
--
-- The usual shell quoting rules are assumed. When a pattern contains
-- whitespace, it (or the whole term including prefix) should be enclosed
-- in single or double quotes.
--
-- Period expressions may contain relative dates, so a reference date is
-- required to fully parse these.
--
-- Multiple terms are combined as follows:
-- 1. multiple account patterns are OR'd together
-- 2. multiple description patterns are OR'd together
-- 3. then all terms are AND'd together
parseQuery :: Day -> String -> (Query,[QueryOpt])
parseQuery d s = (q, opts)
where
terms = words'' prefixes s
(pats, opts) = partitionEithers $ map (parseQueryTerm d) terms
(descpats, pats') = partition queryIsDesc pats
(acctpats, otherpats) = partition queryIsAcct pats'
q = simplifyQuery $ And $ [Or acctpats, Or descpats] ++ otherpats | 1,860 | parseQuery :: Day -> String -> (Query,[QueryOpt])
parseQuery d s = (q, opts)
where
terms = words'' prefixes s
(pats, opts) = partitionEithers $ map (parseQueryTerm d) terms
(descpats, pats') = partition queryIsDesc pats
(acctpats, otherpats) = partition queryIsAcct pats'
q = simplifyQuery $ And $ [Or acctpats, Or descpats] ++ otherpats | 359 | parseQuery d s = (q, opts)
where
terms = words'' prefixes s
(pats, opts) = partitionEithers $ map (parseQueryTerm d) terms
(descpats, pats') = partition queryIsDesc pats
(acctpats, otherpats) = partition queryIsAcct pats'
q = simplifyQuery $ And $ [Or acctpats, Or descpats] ++ otherpats | 309 | true | true | 6 | 10 | 366 | 190 | 110 | 80 | null | null |
snapframework/snap-core | src/Snap/Internal/Http/Types.hs | bsd-3-clause | rspBodyToEnum (SendFile fp Nothing) = \out ->
Streams.withFileAsInput fp $ \is -> do
is' <- Streams.mapM (return . byteString) is
Streams.connect is' out
return out | 192 | rspBodyToEnum (SendFile fp Nothing) = \out ->
Streams.withFileAsInput fp $ \is -> do
is' <- Streams.mapM (return . byteString) is
Streams.connect is' out
return out | 192 | rspBodyToEnum (SendFile fp Nothing) = \out ->
Streams.withFileAsInput fp $ \is -> do
is' <- Streams.mapM (return . byteString) is
Streams.connect is' out
return out | 192 | false | false | 0 | 13 | 52 | 73 | 34 | 39 | null | null |
SimSaladin/rnfssp | tests/gatest.hs | bsd-3-clause | main = gitSource "/home/media/anime" ["annex", "find"] $$ CL.mapM_ print | 72 | main = gitSource "/home/media/anime" ["annex", "find"] $$ CL.mapM_ print | 72 | main = gitSource "/home/media/anime" ["annex", "find"] $$ CL.mapM_ print | 72 | false | false | 1 | 7 | 8 | 30 | 13 | 17 | null | null |
DanielG/kvm-in-a-box | src/Utils.hs | agpl-3.0 | pro_ (cmd:args) = do
res <- callProcess Nothing cmd args
case res of
ExitSuccess -> return ()
ExitFailure rv ->
hPutStrLn stderr $ "command failed '" ++ intercalate " " (map prettyShow $ cmd:args) ++ "' (exit code "++ show rv ++")" | 251 | pro_ (cmd:args) = do
res <- callProcess Nothing cmd args
case res of
ExitSuccess -> return ()
ExitFailure rv ->
hPutStrLn stderr $ "command failed '" ++ intercalate " " (map prettyShow $ cmd:args) ++ "' (exit code "++ show rv ++")" | 251 | pro_ (cmd:args) = do
res <- callProcess Nothing cmd args
case res of
ExitSuccess -> return ()
ExitFailure rv ->
hPutStrLn stderr $ "command failed '" ++ intercalate " " (map prettyShow $ cmd:args) ++ "' (exit code "++ show rv ++")" | 251 | false | false | 0 | 18 | 61 | 103 | 47 | 56 | null | null |
cirquit/Personal-Repository | Haskell/GeneticAlgorithms/ga-testing/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/Paths_ga_testing.hs | mit | libexecdir = "/home/rewrite/Documents/Personal-Repository/Haskell/GeneticAlgorithms/ga-testing/.stack-work/install/x86_64-linux/lts-3.14/7.10.2/libexec" | 152 | libexecdir = "/home/rewrite/Documents/Personal-Repository/Haskell/GeneticAlgorithms/ga-testing/.stack-work/install/x86_64-linux/lts-3.14/7.10.2/libexec" | 152 | libexecdir = "/home/rewrite/Documents/Personal-Repository/Haskell/GeneticAlgorithms/ga-testing/.stack-work/install/x86_64-linux/lts-3.14/7.10.2/libexec" | 152 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
arirahikkala/straylight-divergence | src/RenderObject.hs | gpl-3.0 | rubbleColour = const $ Yellow | 29 | rubbleColour = const $ Yellow | 29 | rubbleColour = const $ Yellow | 29 | false | false | 1 | 5 | 4 | 13 | 5 | 8 | null | null |
Daniel-Diaz/wavy | Data/Sound/Core/Chunked.hs | bsd-3-clause | everseChunked _ = Empty
| 24 | reverseChunked _ = Empty | 24 | reverseChunked _ = Empty | 24 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
christiaanb/ghc | compiler/main/HscTypes.hs | bsd-3-clause | ms_mod_name :: ModSummary -> ModuleName
ms_mod_name = moduleName . ms_mod | 73 | ms_mod_name :: ModSummary -> ModuleName
ms_mod_name = moduleName . ms_mod | 73 | ms_mod_name = moduleName . ms_mod | 33 | false | true | 1 | 7 | 9 | 27 | 11 | 16 | null | null |
timjb/diagrams-rubiks-cube | examples/OrbitLength.hs | mit | solvedRubiksCube :: RubiksCube Int
solvedRubiksCube = RubiksCube (Cube f b l r u d)
where
f = pure 1
b = pure 2
l = pure 3
r = pure 4
u = pure 5
d = pure 6 | 181 | solvedRubiksCube :: RubiksCube Int
solvedRubiksCube = RubiksCube (Cube f b l r u d)
where
f = pure 1
b = pure 2
l = pure 3
r = pure 4
u = pure 5
d = pure 6 | 181 | solvedRubiksCube = RubiksCube (Cube f b l r u d)
where
f = pure 1
b = pure 2
l = pure 3
r = pure 4
u = pure 5
d = pure 6 | 146 | false | true | 5 | 7 | 64 | 84 | 41 | 43 | null | null |
scolobb/fgl | test/benchmark.hs | bsd-3-clause | gmapAVL :: Int -> AVL.Gr Int ()
gmapAVL n
= let g = insNodeAVL n
g' = gmap f g
f (ps, v, _, ss) = (ps, v, v, ss)
in
g' | 157 | gmapAVL :: Int -> AVL.Gr Int ()
gmapAVL n
= let g = insNodeAVL n
g' = gmap f g
f (ps, v, _, ss) = (ps, v, v, ss)
in
g' | 157 | gmapAVL n
= let g = insNodeAVL n
g' = gmap f g
f (ps, v, _, ss) = (ps, v, v, ss)
in
g' | 125 | false | true | 0 | 10 | 70 | 88 | 45 | 43 | null | null |
passy/ltxbot | src/Web/Twitter/LtxBot.hs | mit | showStatus ::
TL.AsStatus s =>
s ->
T.Text
showStatus s = T.concat [ s ^. TL.user . TL.userScreenName
, ": "
, s ^. TL.text
] | 209 | showStatus ::
TL.AsStatus s =>
s ->
T.Text
showStatus s = T.concat [ s ^. TL.user . TL.userScreenName
, ": "
, s ^. TL.text
] | 209 | showStatus s = T.concat [ s ^. TL.user . TL.userScreenName
, ": "
, s ^. TL.text
] | 154 | false | true | 0 | 9 | 109 | 61 | 31 | 30 | null | null |
necrobious/hS3 | Tests.hs | bsd-3-clause | testSourceTemplate = S3Object testBucket "hS3-object-source" "text/plain"
[] (L.pack "testing") | 120 | testSourceTemplate = S3Object testBucket "hS3-object-source" "text/plain"
[] (L.pack "testing") | 120 | testSourceTemplate = S3Object testBucket "hS3-object-source" "text/plain"
[] (L.pack "testing") | 120 | false | false | 0 | 8 | 33 | 27 | 13 | 14 | null | null |
pparkkin/eta | compiler/ETA/DeSugar/DsGRHSs.hs | bsd-3-clause | matchGuards (LetStmt binds : stmts) ctx rhs rhs_ty = do
match_result <- matchGuards stmts ctx rhs rhs_ty
return (adjustMatchResultDs (dsLocalBinds binds) match_result)
-- NB the dsLet occurs inside the match_result
-- Reason: dsLet takes the body expression as its argument
-- so we can't desugar the bindings without the
-- body expression in hand | 404 | matchGuards (LetStmt binds : stmts) ctx rhs rhs_ty = do
match_result <- matchGuards stmts ctx rhs rhs_ty
return (adjustMatchResultDs (dsLocalBinds binds) match_result)
-- NB the dsLet occurs inside the match_result
-- Reason: dsLet takes the body expression as its argument
-- so we can't desugar the bindings without the
-- body expression in hand | 404 | matchGuards (LetStmt binds : stmts) ctx rhs rhs_ty = do
match_result <- matchGuards stmts ctx rhs rhs_ty
return (adjustMatchResultDs (dsLocalBinds binds) match_result)
-- NB the dsLet occurs inside the match_result
-- Reason: dsLet takes the body expression as its argument
-- so we can't desugar the bindings without the
-- body expression in hand | 404 | false | false | 1 | 12 | 109 | 68 | 32 | 36 | null | null |
uduki/hsQt | Qtc/Classes/Types.hs | bsd-2-clause | fromCInt :: CInt -> Int
fromCInt ci = fromIntegral ci | 53 | fromCInt :: CInt -> Int
fromCInt ci = fromIntegral ci | 53 | fromCInt ci = fromIntegral ci | 29 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
runjak/projectEuler | src/Problem89.hs | mit | digits :: IO [[RomanDigit]]
digits = fmap (fmap readDigits) input | 65 | digits :: IO [[RomanDigit]]
digits = fmap (fmap readDigits) input | 65 | digits = fmap (fmap readDigits) input | 37 | false | true | 0 | 8 | 9 | 38 | 17 | 21 | null | null |
vikraman/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | -----------------------
tcEqKind :: TcKind -> TcKind -> Bool
tcEqKind = tcEqType | 80 | tcEqKind :: TcKind -> TcKind -> Bool
tcEqKind = tcEqType | 56 | tcEqKind = tcEqType | 19 | true | true | 0 | 8 | 10 | 27 | 12 | 15 | null | null |
timthelion/fenfire | Fenfire/Irc2Notetaker.hs | gpl-2.0 | handle :: [String] -> String ->
String -> (ClockTime, Maybe Integer) -> IO ()
handle channels root line time = do
let query = irc2notetaker channels time (parse line)
maybe (return ()) (\xs -> rawSystem "curl" ["--data",build xs,root] >> return ()) query | 274 | handle :: [String] -> String ->
String -> (ClockTime, Maybe Integer) -> IO ()
handle channels root line time = do
let query = irc2notetaker channels time (parse line)
maybe (return ()) (\xs -> rawSystem "curl" ["--data",build xs,root] >> return ()) query | 274 | handle channels root line time = do
let query = irc2notetaker channels time (parse line)
maybe (return ()) (\xs -> rawSystem "curl" ["--data",build xs,root] >> return ()) query | 185 | false | true | 0 | 14 | 61 | 132 | 64 | 68 | null | null |
mainland/nikola | src/Data/Vector/CUDA/Storable/Mutable.hs | bsd-3-clause | read = G.read | 13 | read = G.read | 13 | read = G.read | 13 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
JoeyEremondi/utrecht-apa-p1 | src/Parse/Expression.hs | bsd-3-clause | negative :: IParser Source.Expr'
negative = do
(start, nTerm, end) <-
located (try (char '-' >> notFollowedBy (char '.' <|> char '-')) >> term)
let loc e = Annotation.at start end e
return (E.Binop (Var.Raw "-") (loc $ E.Literal (L.IntNum 0)) nTerm)
-------- Complex Terms -------- | 297 | negative :: IParser Source.Expr'
negative = do
(start, nTerm, end) <-
located (try (char '-' >> notFollowedBy (char '.' <|> char '-')) >> term)
let loc e = Annotation.at start end e
return (E.Binop (Var.Raw "-") (loc $ E.Literal (L.IntNum 0)) nTerm)
-------- Complex Terms -------- | 297 | negative = do
(start, nTerm, end) <-
located (try (char '-' >> notFollowedBy (char '.' <|> char '-')) >> term)
let loc e = Annotation.at start end e
return (E.Binop (Var.Raw "-") (loc $ E.Literal (L.IntNum 0)) nTerm)
-------- Complex Terms -------- | 264 | false | true | 1 | 18 | 61 | 143 | 67 | 76 | null | null |
sdiehl/ghc | includes/CodeGen.Platform.hs | bsd-3-clause | callerSaves (FloatReg 3) = True | 36 | callerSaves (FloatReg 3) = True | 36 | callerSaves (FloatReg 3) = True | 36 | false | false | 0 | 7 | 9 | 15 | 7 | 8 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/TypeSystem.hs | mit | {- o
t1s' <- mapM (getIfThenElseType uidIClaferMap' t2) t1s
return $ case catMaybes t1s' of
[] -> Nothing
[t] -> Just t
t1s'' -> Just $ TUnion t1s'' -}
getIfThenElseType _ {-uidIClaferMap'-} {-t1@-}(TClafer _) (TUnion _{-t2s-}) = undefined | 257 | getIfThenElseType _ {-uidIClaferMap'-} {-t1@-}(TClafer _) (TUnion _{-t2s-}) = undefined | 88 | getIfThenElseType _ {-uidIClaferMap'-} {-t1@-}(TClafer _) (TUnion _{-t2s-}) = undefined | 88 | true | false | 0 | 7 | 55 | 29 | 16 | 13 | null | null |
ony/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | queryIsStartDateOnly _ _ = False | 32 | queryIsStartDateOnly _ _ = False | 32 | queryIsStartDateOnly _ _ = False | 32 | false | false | 1 | 5 | 4 | 12 | 5 | 7 | null | null |
aurapm/aura | aura/exec/aura.hs | gpl-3.0 | execute :: Env -> Program -> IO (Either (Doc AnsiStyle) ())
execute env p = first f <$> try (runRIO env . execOpts $ _operation p)
where
f (Failure fl) = fl $ langOf (settings env) | 186 | execute :: Env -> Program -> IO (Either (Doc AnsiStyle) ())
execute env p = first f <$> try (runRIO env . execOpts $ _operation p)
where
f (Failure fl) = fl $ langOf (settings env) | 186 | execute env p = first f <$> try (runRIO env . execOpts $ _operation p)
where
f (Failure fl) = fl $ langOf (settings env) | 126 | false | true | 0 | 11 | 41 | 100 | 47 | 53 | null | null |
scolobb/fgl | Data/Graph/Inductive/Example.hs | bsd-3-clause | -- just three nodes
e' = mkGraphM (zip [1..2] "ab") [(1,2,())] | 65 | e' = mkGraphM (zip [1..2] "ab") [(1,2,())] | 45 | e' = mkGraphM (zip [1..2] "ab") [(1,2,())] | 45 | true | false | 1 | 7 | 13 | 43 | 22 | 21 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | -- font styles
-- enum wxFontStyle
wxFONTSTYLE_NORMAL :: Int
wxFONTSTYLE_NORMAL = wxNORMAL | 90 | wxFONTSTYLE_NORMAL :: Int
wxFONTSTYLE_NORMAL = wxNORMAL | 55 | wxFONTSTYLE_NORMAL = wxNORMAL | 29 | true | true | 0 | 4 | 11 | 13 | 8 | 5 | null | null |
lhoghu/yahoo-portfolio-manager | ypm-cli/Data/YahooPortfolioManager/Cli/Main.hs | mit | headers :: [String]
headers = ["Alloc", "Price", "Cost", "Current", "Chg", "(%)", "Divs", "PnL", "(%)"] | 103 | headers :: [String]
headers = ["Alloc", "Price", "Cost", "Current", "Chg", "(%)", "Divs", "PnL", "(%)"] | 103 | headers = ["Alloc", "Price", "Cost", "Current", "Chg", "(%)", "Divs", "PnL", "(%)"] | 83 | false | true | 0 | 7 | 13 | 48 | 27 | 21 | null | null |
rueshyna/gogol | gogol-partners/gen/Network/Google/Partners/Types/Product.hs | mpl-2.0 | -- | The type of rank.
rType :: Lens' Rank (Maybe Text)
rType = lens _rType (\ s a -> s{_rType = a}) | 100 | rType :: Lens' Rank (Maybe Text)
rType = lens _rType (\ s a -> s{_rType = a}) | 77 | rType = lens _rType (\ s a -> s{_rType = a}) | 44 | true | true | 2 | 9 | 22 | 55 | 25 | 30 | null | null |
rsasse/tamarin-prover | lib/theory/src/Theory/Constraint/Solver/ProofMethod.hs | gpl-3.0 | ------------------------------------------------------------------------------
-- Utilities
------------------------------------------------------------------------------
-- | @uniqueListBy eq changes xs@ zips the @changes@ with all sequences equal
-- elements in the list.
--
-- > uniqueListBy compare id (const [ (++ show i) | i <- [1..] ]) ["a","b","a"] =
-- > ["a1","b","a2"]
--
uniqueListBy :: (a -> a -> Ordering) -> (a -> a) -> (Int -> [a -> a]) -> [a] -> [a]
uniqueListBy ord single distinguish xs0 =
map fst
$ sortBy (comparing snd)
$ concat $ map uniquify $ groupBy (\x y -> ord (fst x) (fst y) == EQ)
$ sortBy (ord `on` fst)
$ zip xs0 [(0::Int)..]
where
uniquify [] = error "impossible"
uniquify [(x,i)] = [(single x, i)]
uniquify xs = zipWith (\f (x,i) -> (f x, i)) dist xs
where
dist = distinguish $ length xs
------------------------------------------------------------------------------
-- Proof Methods
------------------------------------------------------------------------------
-- | Every case in a proof is uniquely named. | 1,107 | uniqueListBy :: (a -> a -> Ordering) -> (a -> a) -> (Int -> [a -> a]) -> [a] -> [a]
uniqueListBy ord single distinguish xs0 =
map fst
$ sortBy (comparing snd)
$ concat $ map uniquify $ groupBy (\x y -> ord (fst x) (fst y) == EQ)
$ sortBy (ord `on` fst)
$ zip xs0 [(0::Int)..]
where
uniquify [] = error "impossible"
uniquify [(x,i)] = [(single x, i)]
uniquify xs = zipWith (\f (x,i) -> (f x, i)) dist xs
where
dist = distinguish $ length xs
------------------------------------------------------------------------------
-- Proof Methods
------------------------------------------------------------------------------
-- | Every case in a proof is uniquely named. | 723 | uniqueListBy ord single distinguish xs0 =
map fst
$ sortBy (comparing snd)
$ concat $ map uniquify $ groupBy (\x y -> ord (fst x) (fst y) == EQ)
$ sortBy (ord `on` fst)
$ zip xs0 [(0::Int)..]
where
uniquify [] = error "impossible"
uniquify [(x,i)] = [(single x, i)]
uniquify xs = zipWith (\f (x,i) -> (f x, i)) dist xs
where
dist = distinguish $ length xs
------------------------------------------------------------------------------
-- Proof Methods
------------------------------------------------------------------------------
-- | Every case in a proof is uniquely named. | 639 | true | true | 13 | 12 | 212 | 307 | 157 | 150 | null | null |
xu-hao/QueryArrow | QueryArrow-common/src/QueryArrow/Config.hs | bsd-3-clause | getConfig :: FromJSON a => String -> IO a
getConfig filepath = do
d <- decodeFileEither filepath
case d of
Left err -> error ("getConfig: " ++ filepath ++ " " ++ show err)
Right ps -> return ps | 225 | getConfig :: FromJSON a => String -> IO a
getConfig filepath = do
d <- decodeFileEither filepath
case d of
Left err -> error ("getConfig: " ++ filepath ++ " " ++ show err)
Right ps -> return ps | 225 | getConfig filepath = do
d <- decodeFileEither filepath
case d of
Left err -> error ("getConfig: " ++ filepath ++ " " ++ show err)
Right ps -> return ps | 183 | false | true | 0 | 14 | 70 | 87 | 39 | 48 | null | null |
taruti/haskell-hex | Data/Hex.hs | bsd-3-clause | c 'F' = return 15 | 17 | c 'F' = return 15 | 17 | c 'F' = return 15 | 17 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
kazu-yamamoto/http2 | bench-priority/Main.hs | bsd-3-clause | createAIO ((k,w):xs) !q = do
let !ent = AIO.newEntry k w
n <- AIO.enqueue ent q
ns <- createAIO xs q
return $ n : ns
---------------------------------------------------------------- | 198 | createAIO ((k,w):xs) !q = do
let !ent = AIO.newEntry k w
n <- AIO.enqueue ent q
ns <- createAIO xs q
return $ n : ns
---------------------------------------------------------------- | 198 | createAIO ((k,w):xs) !q = do
let !ent = AIO.newEntry k w
n <- AIO.enqueue ent q
ns <- createAIO xs q
return $ n : ns
---------------------------------------------------------------- | 198 | false | false | 0 | 11 | 43 | 83 | 37 | 46 | null | null |
formrre/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Motion.hs | gpl-2.0 | moveBackwardB unit = repeat $ moveB unit Backward | 49 | moveBackwardB unit = repeat $ moveB unit Backward | 49 | moveBackwardB unit = repeat $ moveB unit Backward | 49 | false | false | 3 | 5 | 7 | 22 | 8 | 14 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Constraint/Split.hs | bsd-3-clause | rsplitW _ (RProp _ (RHole _))
= panic Nothing "Constrains: rsplitW for RProp _ (RHole _)" | 91 | rsplitW _ (RProp _ (RHole _))
= panic Nothing "Constrains: rsplitW for RProp _ (RHole _)" | 91 | rsplitW _ (RProp _ (RHole _))
= panic Nothing "Constrains: rsplitW for RProp _ (RHole _)" | 91 | false | false | 0 | 9 | 17 | 30 | 14 | 16 | null | null |
alanz/haskell-token-utils | src/Language/Haskell/TokenUtils/Utils.hs | unlicense | drawEntry (Node (Entry sspan lay _toks) ts0) = ((showForestSpan sspan) ++ (showLayout lay)): drawSubTrees ts0
where
drawSubTrees [] = []
drawSubTrees [t] =
"|" : shft "`- " " " (drawEntry t)
drawSubTrees (t:ts) =
"|" : shft "+- " "| " (drawEntry t) ++ drawSubTrees ts
shft first other = zipWith (++) (first : repeat other) | 360 | drawEntry (Node (Entry sspan lay _toks) ts0) = ((showForestSpan sspan) ++ (showLayout lay)): drawSubTrees ts0
where
drawSubTrees [] = []
drawSubTrees [t] =
"|" : shft "`- " " " (drawEntry t)
drawSubTrees (t:ts) =
"|" : shft "+- " "| " (drawEntry t) ++ drawSubTrees ts
shft first other = zipWith (++) (first : repeat other) | 360 | drawEntry (Node (Entry sspan lay _toks) ts0) = ((showForestSpan sspan) ++ (showLayout lay)): drawSubTrees ts0
where
drawSubTrees [] = []
drawSubTrees [t] =
"|" : shft "`- " " " (drawEntry t)
drawSubTrees (t:ts) =
"|" : shft "+- " "| " (drawEntry t) ++ drawSubTrees ts
shft first other = zipWith (++) (first : repeat other) | 360 | false | false | 4 | 9 | 94 | 166 | 80 | 86 | null | null |
urbit/urbit | pkg/hs/proto/lib/Untyped/Parser.hs | mit | runeNE :: (NonEmpty a -> b) -> Parser a -> Parser b
runeNE node elem = node <$> parseRune tall wide
where tall = do
let elems = term <|> elemAnd
elemAnd = do x <- elem; gap; xs <- elems; pure (x:xs)
term = string "==" *> pure []
fst <- gap *> elem
rst <- gap *> elems
pure (fst :| rst)
wide = mzero -- No wide form for cores
-- Irregular Syntax ------------------------------------------------------------ | 489 | runeNE :: (NonEmpty a -> b) -> Parser a -> Parser b
runeNE node elem = node <$> parseRune tall wide
where tall = do
let elems = term <|> elemAnd
elemAnd = do x <- elem; gap; xs <- elems; pure (x:xs)
term = string "==" *> pure []
fst <- gap *> elem
rst <- gap *> elems
pure (fst :| rst)
wide = mzero -- No wide form for cores
-- Irregular Syntax ------------------------------------------------------------ | 489 | runeNE node elem = node <$> parseRune tall wide
where tall = do
let elems = term <|> elemAnd
elemAnd = do x <- elem; gap; xs <- elems; pure (x:xs)
term = string "==" *> pure []
fst <- gap *> elem
rst <- gap *> elems
pure (fst :| rst)
wide = mzero -- No wide form for cores
-- Irregular Syntax ------------------------------------------------------------ | 437 | false | true | 1 | 15 | 160 | 169 | 81 | 88 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Util/XSelection.hs | bsd-2-clause | safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection | 81 | safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection | 81 | safePromptSelection app = join $ io $ liftM (safeSpawn app . return) getSelection | 81 | false | false | 0 | 9 | 12 | 32 | 15 | 17 | null | null |
svenssonjoel/ObsidianGFX | Obsidian/Library.hs | bsd-3-clause | -- | Sequential concatenation of a Pull of Push.
sConcat :: ASize l => Pull l (SPush t a) -> Push t l a
sConcat arr =
mkPush (n * fromIntegral rn) $ \wf ->
do
seqFor (sizeConv n) $ \bix ->
let p = arr ! bix -- (Push _ p) = arr ! bix
wf' a ix = wf a (bix * sizeConv rn + ix)
in p <: wf'
where
n = len arr
rn = len $ arr ! 0
-- | Variant of sConcat. | 404 | sConcat :: ASize l => Pull l (SPush t a) -> Push t l a
sConcat arr =
mkPush (n * fromIntegral rn) $ \wf ->
do
seqFor (sizeConv n) $ \bix ->
let p = arr ! bix -- (Push _ p) = arr ! bix
wf' a ix = wf a (bix * sizeConv rn + ix)
in p <: wf'
where
n = len arr
rn = len $ arr ! 0
-- | Variant of sConcat. | 355 | sConcat arr =
mkPush (n * fromIntegral rn) $ \wf ->
do
seqFor (sizeConv n) $ \bix ->
let p = arr ! bix -- (Push _ p) = arr ! bix
wf' a ix = wf a (bix * sizeConv rn + ix)
in p <: wf'
where
n = len arr
rn = len $ arr ! 0
-- | Variant of sConcat. | 300 | true | true | 0 | 19 | 145 | 163 | 80 | 83 | null | null |
daleooo/barrelfish | tools/mackerel/Attr.hs | mit | attr_is_readable :: Attr -> Bool
attr_is_readable RO = True | 59 | attr_is_readable :: Attr -> Bool
attr_is_readable RO = True | 59 | attr_is_readable RO = True | 26 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Link to previous page for this filter collection.
fPreviousLink :: Lens' Filters (Maybe Text)
fPreviousLink
= lens _fPreviousLink
(\ s a -> s{_fPreviousLink = a}) | 175 | fPreviousLink :: Lens' Filters (Maybe Text)
fPreviousLink
= lens _fPreviousLink
(\ s a -> s{_fPreviousLink = a}) | 120 | fPreviousLink
= lens _fPreviousLink
(\ s a -> s{_fPreviousLink = a}) | 76 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
forste/haReFork | refactorer/RefacSimplify.hs | bsd-3-clause | patToExp (Pat (HsPLit s l)) = (Exp (HsLit s l)) | 47 | patToExp (Pat (HsPLit s l)) = (Exp (HsLit s l)) | 47 | patToExp (Pat (HsPLit s l)) = (Exp (HsLit s l)) | 47 | false | false | 0 | 9 | 9 | 37 | 18 | 19 | null | null |
dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/CreateStack.hs | mpl-2.0 | -- | A string that contains user-defined, custom JSON. It is used to override the
-- corresponding default stack configuration JSON values. The string should be
-- in the following format and must escape characters such as '"'.:
--
-- '"{\"key1\": \"value1\", \"key2\": \"value2\",...}"'
--
-- For more information on custom JSON, see <http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html Use Custom JSON to Modify the StackConfiguration JSON>.
csCustomJson :: Lens' CreateStack (Maybe Text)
csCustomJson = lens _csCustomJson (\s a -> s { _csCustomJson = a }) | 583 | csCustomJson :: Lens' CreateStack (Maybe Text)
csCustomJson = lens _csCustomJson (\s a -> s { _csCustomJson = a }) | 114 | csCustomJson = lens _csCustomJson (\s a -> s { _csCustomJson = a }) | 67 | true | true | 0 | 9 | 80 | 52 | 31 | 21 | null | null |
snowleopard/alga | test/Algebra/Graph/Test/RewriteRules.hs | mit | bindP, bindPR ::
b -> (a -> b) -> (b -> b -> b) -> (b -> b -> b) -> (c -> Graph a) -> Graph c -> b
bindP e v o c f g = foldg e v o c (g >>= f) | 145 | bindP, bindPR ::
b -> (a -> b) -> (b -> b -> b) -> (b -> b -> b) -> (c -> Graph a) -> Graph c -> b
bindP e v o c f g = foldg e v o c (g >>= f) | 145 | bindP e v o c f g = foldg e v o c (g >>= f) | 44 | false | true | 2 | 13 | 48 | 116 | 57 | 59 | null | null |
CanvasHS/Canvas.hs | canvashs-module/CanvasHs/Colors.hs | lgpl-2.1 | forestgreen = (34, 139, 34, 1.0) | 32 | forestgreen = (34, 139, 34, 1.0) | 32 | forestgreen = (34, 139, 34, 1.0) | 32 | false | false | 0 | 5 | 5 | 18 | 11 | 7 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/PurchaseReservedInstancesOffering.hs | mpl-2.0 | -- | Creates a value of 'PurchaseReservedInstancesOffering' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'prioLimitPrice'
--
-- * 'prioDryRun'
--
-- * 'prioReservedInstancesOfferingId'
--
-- * 'prioInstanceCount'
purchaseReservedInstancesOffering
:: Text -- ^ 'prioReservedInstancesOfferingId'
-> Int -- ^ 'prioInstanceCount'
-> PurchaseReservedInstancesOffering
purchaseReservedInstancesOffering pReservedInstancesOfferingId_ pInstanceCount_ =
PurchaseReservedInstancesOffering'
{ _prioLimitPrice = Nothing
, _prioDryRun = Nothing
, _prioReservedInstancesOfferingId = pReservedInstancesOfferingId_
, _prioInstanceCount = pInstanceCount_
} | 763 | purchaseReservedInstancesOffering
:: Text -- ^ 'prioReservedInstancesOfferingId'
-> Int -- ^ 'prioInstanceCount'
-> PurchaseReservedInstancesOffering
purchaseReservedInstancesOffering pReservedInstancesOfferingId_ pInstanceCount_ =
PurchaseReservedInstancesOffering'
{ _prioLimitPrice = Nothing
, _prioDryRun = Nothing
, _prioReservedInstancesOfferingId = pReservedInstancesOfferingId_
, _prioInstanceCount = pInstanceCount_
} | 462 | purchaseReservedInstancesOffering pReservedInstancesOfferingId_ pInstanceCount_ =
PurchaseReservedInstancesOffering'
{ _prioLimitPrice = Nothing
, _prioDryRun = Nothing
, _prioReservedInstancesOfferingId = pReservedInstancesOfferingId_
, _prioInstanceCount = pInstanceCount_
} | 300 | true | true | 0 | 6 | 116 | 63 | 42 | 21 | null | null |
ganeti-github-testing/ganeti-test-1 | src/Ganeti/Constants.hs | bsd-2-clause | rapi :: String
rapi = Runtime.daemonName GanetiRapi | 51 | rapi :: String
rapi = Runtime.daemonName GanetiRapi | 51 | rapi = Runtime.daemonName GanetiRapi | 36 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Gen2/Prim.hs | mit | genPrim _ _ DoubleCoshOp [r] [x] = PrimInline [j| `r` = (Math.exp(`x`)+Math.exp(`jneg x`))/2 |] | 102 | genPrim _ _ DoubleCoshOp [r] [x] = PrimInline [j| `r` = (Math.exp(`x`)+Math.exp(`jneg x`))/2 |] | 102 | genPrim _ _ DoubleCoshOp [r] [x] = PrimInline [j| `r` = (Math.exp(`x`)+Math.exp(`jneg x`))/2 |] | 102 | false | false | 0 | 6 | 20 | 30 | 17 | 13 | null | null |
DATx02-16-14/Hastings | src/Views/Common.hs | bsd-3-clause | createTable :: String -- ^The id of the table
-> Int -- ^The height of the table in pixels
-> [String] -- ^The different headers in the table
-> Client (Elem, Elem) -- ^The created table and the body
createTable identifier height headers = do
tableDiv <- newElem "div" `with`
[
attr "id" =: identifier,
style "max-height" =: (show height ++ "px"),
style "overflow" =: "auto"
]
table <- newElem "table" `with`
[
attr "class" =: "table table-striped"
]
thead <- newElem "thead"
tr <- newElem "tr"
mapM_ (thcreate tr) headers
tbody <- newElem "tbody" `with`
[
prop "id" =: (identifier ++ "-table-body")
]
appendChild thead tr
addChildrenToParent' table [thead, tbody]
appendChild tableDiv table
return (tableDiv, tbody)
where
thcreate :: Elem -> String -> Client ()
thcreate parent value = do
th <- newElem "th" `with`
[
attr "colspan" =: "2"
]
thText <- newTextElem value
appendChild th thText
appendChild parent th | 1,117 | createTable :: String -- ^The id of the table
-> Int -- ^The height of the table in pixels
-> [String] -- ^The different headers in the table
-> Client (Elem, Elem)
createTable identifier height headers = do
tableDiv <- newElem "div" `with`
[
attr "id" =: identifier,
style "max-height" =: (show height ++ "px"),
style "overflow" =: "auto"
]
table <- newElem "table" `with`
[
attr "class" =: "table table-striped"
]
thead <- newElem "thead"
tr <- newElem "tr"
mapM_ (thcreate tr) headers
tbody <- newElem "tbody" `with`
[
prop "id" =: (identifier ++ "-table-body")
]
appendChild thead tr
addChildrenToParent' table [thead, tbody]
appendChild tableDiv table
return (tableDiv, tbody)
where
thcreate :: Elem -> String -> Client ()
thcreate parent value = do
th <- newElem "th" `with`
[
attr "colspan" =: "2"
]
thText <- newTextElem value
appendChild th thText
appendChild parent th | 1,081 | createTable identifier height headers = do
tableDiv <- newElem "div" `with`
[
attr "id" =: identifier,
style "max-height" =: (show height ++ "px"),
style "overflow" =: "auto"
]
table <- newElem "table" `with`
[
attr "class" =: "table table-striped"
]
thead <- newElem "thead"
tr <- newElem "tr"
mapM_ (thcreate tr) headers
tbody <- newElem "tbody" `with`
[
prop "id" =: (identifier ++ "-table-body")
]
appendChild thead tr
addChildrenToParent' table [thead, tbody]
appendChild tableDiv table
return (tableDiv, tbody)
where
thcreate :: Elem -> String -> Client ()
thcreate parent value = do
th <- newElem "th" `with`
[
attr "colspan" =: "2"
]
thText <- newTextElem value
appendChild th thText
appendChild parent th | 861 | true | true | 3 | 13 | 355 | 319 | 155 | 164 | null | null |
andorp/hs-bluesnap | src/Bluesnap/API/Request.hs | gpl-3.0 | elementPermitted_future_charges :: XMLParser Xsd.Boolean
elementPermitted_future_charges = parseSchemaType "permitted-future-charges" | 133 | elementPermitted_future_charges :: XMLParser Xsd.Boolean
elementPermitted_future_charges = parseSchemaType "permitted-future-charges" | 133 | elementPermitted_future_charges = parseSchemaType "permitted-future-charges" | 76 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
wangwangwar/cis194 | src/ch12/Ch12.hs | bsd-3-clause | parseInt :: Parser Int
parseInt = fromInteger <$> spacesWith posInt | 67 | parseInt :: Parser Int
parseInt = fromInteger <$> spacesWith posInt | 67 | parseInt = fromInteger <$> spacesWith posInt | 44 | false | true | 1 | 6 | 9 | 24 | 10 | 14 | null | null |
RaphMad/LogParser | src/test/LogParserSpec.hs | mit | main :: IO ()
main = hspec $ do
describe "date parser" $ do
it "succeeds on correct date" $
date `succeedsOn` "04.01.2016"
it "fails on wrong date" $
date `failsOn` "04.error.2016"
describe "time parser" $ do
it "succeeds on correct time" $
time `succeedsOn` "04:04:54,407"
it "fails on wrong time" $
time `failsOn` "04:04error,407"
it "parses milliseconds exactly" $
let checkMilli = all (\ms -> flip check (ms :: Int) . parseInput . input $ ms)
input = BS.pack . ("04:04:54," ++) . show
parseInput = fromRight . parseOnly time
check = ((==) . (`rem` 1000) . truncate . (* 1000) . todSec)
in [0..999] `shouldSatisfy` checkMilli
describe "timeStamp parser" $ do
it "succeeds on correct dateTime" $
dateTime `succeedsOn` "04.01.2016 04:04:54,407"
it "succeeds on correct dateTime with appendix" $
dateTime `succeedsOn` "04.01.2016 04:04:54,407appendix"
it "fails on wrong dateTime" $
dateTime `failsOn` "04.01.2016error 04:04:54,407" | 1,121 | main :: IO ()
main = hspec $ do
describe "date parser" $ do
it "succeeds on correct date" $
date `succeedsOn` "04.01.2016"
it "fails on wrong date" $
date `failsOn` "04.error.2016"
describe "time parser" $ do
it "succeeds on correct time" $
time `succeedsOn` "04:04:54,407"
it "fails on wrong time" $
time `failsOn` "04:04error,407"
it "parses milliseconds exactly" $
let checkMilli = all (\ms -> flip check (ms :: Int) . parseInput . input $ ms)
input = BS.pack . ("04:04:54," ++) . show
parseInput = fromRight . parseOnly time
check = ((==) . (`rem` 1000) . truncate . (* 1000) . todSec)
in [0..999] `shouldSatisfy` checkMilli
describe "timeStamp parser" $ do
it "succeeds on correct dateTime" $
dateTime `succeedsOn` "04.01.2016 04:04:54,407"
it "succeeds on correct dateTime with appendix" $
dateTime `succeedsOn` "04.01.2016 04:04:54,407appendix"
it "fails on wrong dateTime" $
dateTime `failsOn` "04.01.2016error 04:04:54,407" | 1,121 | main = hspec $ do
describe "date parser" $ do
it "succeeds on correct date" $
date `succeedsOn` "04.01.2016"
it "fails on wrong date" $
date `failsOn` "04.error.2016"
describe "time parser" $ do
it "succeeds on correct time" $
time `succeedsOn` "04:04:54,407"
it "fails on wrong time" $
time `failsOn` "04:04error,407"
it "parses milliseconds exactly" $
let checkMilli = all (\ms -> flip check (ms :: Int) . parseInput . input $ ms)
input = BS.pack . ("04:04:54," ++) . show
parseInput = fromRight . parseOnly time
check = ((==) . (`rem` 1000) . truncate . (* 1000) . todSec)
in [0..999] `shouldSatisfy` checkMilli
describe "timeStamp parser" $ do
it "succeeds on correct dateTime" $
dateTime `succeedsOn` "04.01.2016 04:04:54,407"
it "succeeds on correct dateTime with appendix" $
dateTime `succeedsOn` "04.01.2016 04:04:54,407appendix"
it "fails on wrong dateTime" $
dateTime `failsOn` "04.01.2016error 04:04:54,407" | 1,107 | false | true | 0 | 23 | 333 | 295 | 152 | 143 | null | null |
psandahl/big-engine | src/BigE/Mesh.hs | mit | update :: (Storable a, MonadIO m) => Vector a -> Vector GLuint -> Mesh -> m Mesh
update vertices indices' mesh = do
unless (Vector.null vertices) $ do
let Buffer handle = vbo mesh
GL.glBindBuffer GL.GL_ARRAY_BUFFER handle
let first = Vector.head vertices
itemSize = sizeOf first
totalSize = itemSize * Vector.length vertices
liftIO $ Vector.unsafeWith vertices $
GL.glBufferSubData GL.GL_ARRAY_BUFFER 0 (fromIntegral totalSize)
GL.glBindBuffer GL.GL_ARRAY_BUFFER 0
return $ mesh { indices = indices' }
-- | Enable the mesh's 'VertexArray'. | 627 | update :: (Storable a, MonadIO m) => Vector a -> Vector GLuint -> Mesh -> m Mesh
update vertices indices' mesh = do
unless (Vector.null vertices) $ do
let Buffer handle = vbo mesh
GL.glBindBuffer GL.GL_ARRAY_BUFFER handle
let first = Vector.head vertices
itemSize = sizeOf first
totalSize = itemSize * Vector.length vertices
liftIO $ Vector.unsafeWith vertices $
GL.glBufferSubData GL.GL_ARRAY_BUFFER 0 (fromIntegral totalSize)
GL.glBindBuffer GL.GL_ARRAY_BUFFER 0
return $ mesh { indices = indices' }
-- | Enable the mesh's 'VertexArray'. | 627 | update vertices indices' mesh = do
unless (Vector.null vertices) $ do
let Buffer handle = vbo mesh
GL.glBindBuffer GL.GL_ARRAY_BUFFER handle
let first = Vector.head vertices
itemSize = sizeOf first
totalSize = itemSize * Vector.length vertices
liftIO $ Vector.unsafeWith vertices $
GL.glBufferSubData GL.GL_ARRAY_BUFFER 0 (fromIntegral totalSize)
GL.glBindBuffer GL.GL_ARRAY_BUFFER 0
return $ mesh { indices = indices' }
-- | Enable the mesh's 'VertexArray'. | 546 | false | true | 0 | 15 | 166 | 197 | 91 | 106 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Macro.hs | mit | {- Given input, determine if that input matches any rules
@return Transformed code, or Nil if no rules match -}
matchRule :: [Env] -> Env -> Env -> Bool -> LispVal -> Env -> Env -> Env -> LispVal -> LispVal -> String -> IOThrowsError LispVal
matchRule defEnv outerEnv divertEnv dim identifiers localEnv renameEnv cleanupEnv (List [pattern, template]) (List inputVar) esym = do
let is = tail inputVar
let p = case pattern of
DottedList ds d -> case ds of
-- Fix for Issue #44 - detect when pattern's match should
-- be modified from a pair to an ellipsis
(Atom l : ls) -> (List [Atom l, DottedList ls d], True)
_ -> (pattern, False)
_ -> (pattern, False)
case p of
((List (Atom _ : ps)), flag) -> do
match <- checkPattern ps is flag
case match of
Bool False -> return $ Nil ""
_ -> do
transformRule defEnv outerEnv divertEnv localEnv renameEnv cleanupEnv dim identifiers esym 0 [] (List []) template
_ -> throwError $ BadSpecialForm "Malformed rule in syntax-rules" $ String $ show p
where
-- A pair at the outmost level must be transformed to use the ellipsis,
-- or else its nary match will not work properly during pattern matching.
checkPattern ps@(DottedList ds d : _) is True = do
case is of
(DottedList _ _ : _) -> do
loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers
(List $ ds ++ [d, Atom esym])
(List is)
0 []
(flagDottedLists [] (False, False) $ 0 + (length $ filter (filterEsym esym) ds)) -- Mark any ellipsis we are passing over
esym
(List _ : _) -> do
loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers
(List $ ds ++ [d, Atom esym])
(List is)
0 []
(flagDottedLists [] (True, False) $ 0 + (length $ filter (filterEsym esym) ds)) -- Mark any ellipsis we are passing over
esym
_ -> loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers (List ps) (List is) 0 [] [] esym
-- No pair, immediately begin matching
checkPattern ps is _ = loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers (List ps) (List is) 0 [] [] esym | 2,637 | matchRule :: [Env] -> Env -> Env -> Bool -> LispVal -> Env -> Env -> Env -> LispVal -> LispVal -> String -> IOThrowsError LispVal
matchRule defEnv outerEnv divertEnv dim identifiers localEnv renameEnv cleanupEnv (List [pattern, template]) (List inputVar) esym = do
let is = tail inputVar
let p = case pattern of
DottedList ds d -> case ds of
-- Fix for Issue #44 - detect when pattern's match should
-- be modified from a pair to an ellipsis
(Atom l : ls) -> (List [Atom l, DottedList ls d], True)
_ -> (pattern, False)
_ -> (pattern, False)
case p of
((List (Atom _ : ps)), flag) -> do
match <- checkPattern ps is flag
case match of
Bool False -> return $ Nil ""
_ -> do
transformRule defEnv outerEnv divertEnv localEnv renameEnv cleanupEnv dim identifiers esym 0 [] (List []) template
_ -> throwError $ BadSpecialForm "Malformed rule in syntax-rules" $ String $ show p
where
-- A pair at the outmost level must be transformed to use the ellipsis,
-- or else its nary match will not work properly during pattern matching.
checkPattern ps@(DottedList ds d : _) is True = do
case is of
(DottedList _ _ : _) -> do
loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers
(List $ ds ++ [d, Atom esym])
(List is)
0 []
(flagDottedLists [] (False, False) $ 0 + (length $ filter (filterEsym esym) ds)) -- Mark any ellipsis we are passing over
esym
(List _ : _) -> do
loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers
(List $ ds ++ [d, Atom esym])
(List is)
0 []
(flagDottedLists [] (True, False) $ 0 + (length $ filter (filterEsym esym) ds)) -- Mark any ellipsis we are passing over
esym
_ -> loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers (List ps) (List is) 0 [] [] esym
-- No pair, immediately begin matching
checkPattern ps is _ = loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers (List ps) (List is) 0 [] [] esym | 2,525 | matchRule defEnv outerEnv divertEnv dim identifiers localEnv renameEnv cleanupEnv (List [pattern, template]) (List inputVar) esym = do
let is = tail inputVar
let p = case pattern of
DottedList ds d -> case ds of
-- Fix for Issue #44 - detect when pattern's match should
-- be modified from a pair to an ellipsis
(Atom l : ls) -> (List [Atom l, DottedList ls d], True)
_ -> (pattern, False)
_ -> (pattern, False)
case p of
((List (Atom _ : ps)), flag) -> do
match <- checkPattern ps is flag
case match of
Bool False -> return $ Nil ""
_ -> do
transformRule defEnv outerEnv divertEnv localEnv renameEnv cleanupEnv dim identifiers esym 0 [] (List []) template
_ -> throwError $ BadSpecialForm "Malformed rule in syntax-rules" $ String $ show p
where
-- A pair at the outmost level must be transformed to use the ellipsis,
-- or else its nary match will not work properly during pattern matching.
checkPattern ps@(DottedList ds d : _) is True = do
case is of
(DottedList _ _ : _) -> do
loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers
(List $ ds ++ [d, Atom esym])
(List is)
0 []
(flagDottedLists [] (False, False) $ 0 + (length $ filter (filterEsym esym) ds)) -- Mark any ellipsis we are passing over
esym
(List _ : _) -> do
loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers
(List $ ds ++ [d, Atom esym])
(List is)
0 []
(flagDottedLists [] (True, False) $ 0 + (length $ filter (filterEsym esym) ds)) -- Mark any ellipsis we are passing over
esym
_ -> loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers (List ps) (List is) 0 [] [] esym
-- No pair, immediately begin matching
checkPattern ps is _ = loadLocal defEnv outerEnv divertEnv localEnv renameEnv identifiers (List ps) (List is) 0 [] [] esym | 2,395 | true | true | 1 | 20 | 1,007 | 721 | 363 | 358 | null | null |
beni55/snap-server | test/suite/Data/Concurrent/HashMap/Tests.hs | bsd-3-clause | testUpdate :: Test
testUpdate = testProperty "HashMap/update" $
monadicIO $ forAllM arbitrary prop
where
prop :: [(ByteString,ByteString)] -> PropertyM IO ()
prop l' = do
pre (not $ null l')
let h = head l'
let l = filter ((/= (fst h)) . fst) $ tail l'
ht <- run $ H.fromList H.hashBS (h:l)
e1 <- run $ H.update (fst h) "qqq" ht
v1 <- run $ H.lookup (fst h) ht
run $ H.delete (fst h) ht
v2 <- run $ H.lookup (fst h) ht
e2 <- run $ H.update (fst h) "zzz" ht
v3 <- run $ H.lookup (fst h) ht
assert e1
assert $ v1 == Just "qqq"
assert $ v2 == Nothing
assert $ not e2
assert $ v3 == Just "zzz" | 736 | testUpdate :: Test
testUpdate = testProperty "HashMap/update" $
monadicIO $ forAllM arbitrary prop
where
prop :: [(ByteString,ByteString)] -> PropertyM IO ()
prop l' = do
pre (not $ null l')
let h = head l'
let l = filter ((/= (fst h)) . fst) $ tail l'
ht <- run $ H.fromList H.hashBS (h:l)
e1 <- run $ H.update (fst h) "qqq" ht
v1 <- run $ H.lookup (fst h) ht
run $ H.delete (fst h) ht
v2 <- run $ H.lookup (fst h) ht
e2 <- run $ H.update (fst h) "zzz" ht
v3 <- run $ H.lookup (fst h) ht
assert e1
assert $ v1 == Just "qqq"
assert $ v2 == Nothing
assert $ not e2
assert $ v3 == Just "zzz" | 736 | testUpdate = testProperty "HashMap/update" $
monadicIO $ forAllM arbitrary prop
where
prop :: [(ByteString,ByteString)] -> PropertyM IO ()
prop l' = do
pre (not $ null l')
let h = head l'
let l = filter ((/= (fst h)) . fst) $ tail l'
ht <- run $ H.fromList H.hashBS (h:l)
e1 <- run $ H.update (fst h) "qqq" ht
v1 <- run $ H.lookup (fst h) ht
run $ H.delete (fst h) ht
v2 <- run $ H.lookup (fst h) ht
e2 <- run $ H.update (fst h) "zzz" ht
v3 <- run $ H.lookup (fst h) ht
assert e1
assert $ v1 == Just "qqq"
assert $ v2 == Nothing
assert $ not e2
assert $ v3 == Just "zzz" | 717 | false | true | 2 | 17 | 271 | 366 | 166 | 200 | null | null |
vTurbine/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | tickishFloatable :: Tickish id -> Bool
tickishFloatable t = t `tickishScopesLike` SoftScope && not (tickishCounts t) | 116 | tickishFloatable :: Tickish id -> Bool
tickishFloatable t = t `tickishScopesLike` SoftScope && not (tickishCounts t) | 116 | tickishFloatable t = t `tickishScopesLike` SoftScope && not (tickishCounts t) | 77 | false | true | 0 | 8 | 15 | 40 | 20 | 20 | null | null |
danr/hipspec | examples/old-examples/hip/Tricky.hs | gpl-3.0 | prop_all_lists_finite :: [a] -> Prop Bool
prop_all_lists_finite xs = finite xs =:= True | 87 | prop_all_lists_finite :: [a] -> Prop Bool
prop_all_lists_finite xs = finite xs =:= True | 87 | prop_all_lists_finite xs = finite xs =:= True | 45 | false | true | 0 | 6 | 12 | 31 | 15 | 16 | null | null |
pikajude/game | src/Game/Color.hs | gpl-3.0 | gradient :: Color -> Color -> Int -> [Color]
gradient c1 c2 r = c1 :
[ makeColor (r1 + rD * f) (g1 + gD * f) (b1 + bD * f) (a1 + aD * f)
| x <- [1..r - 1], let f :: Float; f = fromIntegral x / (fromIntegral r - 1) ] where
(r1, g1, b1, a1) = rgbaOfColor c1
(r2, g2, b2, a2) = rgbaOfColor c2
(rD, gD, bD, aD) = ( r2 - r1
, g2 - g1
, b2 - b1
, a2 - a1 ) | 439 | gradient :: Color -> Color -> Int -> [Color]
gradient c1 c2 r = c1 :
[ makeColor (r1 + rD * f) (g1 + gD * f) (b1 + bD * f) (a1 + aD * f)
| x <- [1..r - 1], let f :: Float; f = fromIntegral x / (fromIntegral r - 1) ] where
(r1, g1, b1, a1) = rgbaOfColor c1
(r2, g2, b2, a2) = rgbaOfColor c2
(rD, gD, bD, aD) = ( r2 - r1
, g2 - g1
, b2 - b1
, a2 - a1 ) | 439 | gradient c1 c2 r = c1 :
[ makeColor (r1 + rD * f) (g1 + gD * f) (b1 + bD * f) (a1 + aD * f)
| x <- [1..r - 1], let f :: Float; f = fromIntegral x / (fromIntegral r - 1) ] where
(r1, g1, b1, a1) = rgbaOfColor c1
(r2, g2, b2, a2) = rgbaOfColor c2
(rD, gD, bD, aD) = ( r2 - r1
, g2 - g1
, b2 - b1
, a2 - a1 ) | 394 | false | true | 0 | 14 | 183 | 239 | 128 | 111 | null | null |
keitax/lupo | src/Lupo/URLMapper.hs | lgpl-3.0 | cssPath :: BS.ByteString -> Getter URLMapper Path
cssPath css = to $ \self ->
_cssPath self css | 97 | cssPath :: BS.ByteString -> Getter URLMapper Path
cssPath css = to $ \self ->
_cssPath self css | 97 | cssPath css = to $ \self ->
_cssPath self css | 47 | false | true | 0 | 7 | 18 | 39 | 19 | 20 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Commands.hs | gpl-2.0 | amNotInRepository :: [DarcsFlag] -> IO (Either String ())
amNotInRepository fs = R.amNotInRepository (workRepo fs) | 114 | amNotInRepository :: [DarcsFlag] -> IO (Either String ())
amNotInRepository fs = R.amNotInRepository (workRepo fs) | 114 | amNotInRepository fs = R.amNotInRepository (workRepo fs) | 56 | false | true | 0 | 9 | 13 | 45 | 22 | 23 | null | null |
exercism/xhaskell | exercises/practice/word-count/.meta/examples/success-simple/src/WordCount.hs | mit | stripQuote s = s | 16 | stripQuote s = s | 16 | stripQuote s = s | 16 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
onponomarev/ganeti | test/hs/Test/Ganeti/TestCommon.hs | bsd-2-clause | genPrintableAsciiChar :: Gen Char
genPrintableAsciiChar = choose ('\x20', '\x7e') | 81 | genPrintableAsciiChar :: Gen Char
genPrintableAsciiChar = choose ('\x20', '\x7e') | 81 | genPrintableAsciiChar = choose ('\x20', '\x7e') | 47 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
Mokosha/ggj14-Refined-Palette | Board.hs | mit | isPrimaryColor _ = False | 24 | isPrimaryColor _ = False | 24 | isPrimaryColor _ = False | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
noteed/tcc | Language/TCC.hs | bsd-3-clause | tcc_OUTPUT_DLL :: OutputType
tcc_OUTPUT_DLL = 2 | 61 | tcc_OUTPUT_DLL :: OutputType
tcc_OUTPUT_DLL = 2 | 61 | tcc_OUTPUT_DLL = 2 | 25 | false | true | 0 | 4 | 19 | 11 | 6 | 5 | null | null |
tdidriksen/copatterns | src/findus/test/TypeCheckerTests.hs | mit | negativeDefTest :: Defi -> CheckEnv -> TypeError -> Assertion
negativeDefTest e (eEnv, tEnv) err =
case checkDef eEnv tEnv e of
Right te -> assertFailure ("Expected error: " ++ (show err) ++ ", but type checking was successful and resulted in " ++ (show te))
Left aerr -> assertEqual "Resulting error equality" err aerr | 330 | negativeDefTest :: Defi -> CheckEnv -> TypeError -> Assertion
negativeDefTest e (eEnv, tEnv) err =
case checkDef eEnv tEnv e of
Right te -> assertFailure ("Expected error: " ++ (show err) ++ ", but type checking was successful and resulted in " ++ (show te))
Left aerr -> assertEqual "Resulting error equality" err aerr | 330 | negativeDefTest e (eEnv, tEnv) err =
case checkDef eEnv tEnv e of
Right te -> assertFailure ("Expected error: " ++ (show err) ++ ", but type checking was successful and resulted in " ++ (show te))
Left aerr -> assertEqual "Resulting error equality" err aerr | 268 | false | true | 0 | 14 | 64 | 102 | 50 | 52 | null | null |
tjakway/ghcjvm | compiler/iface/IfaceEnv.hs | bsd-3-clause | initOrigNames :: [Name] -> OrigNameCache
initOrigNames names = foldl extendOrigNameCache emptyModuleEnv names | 109 | initOrigNames :: [Name] -> OrigNameCache
initOrigNames names = foldl extendOrigNameCache emptyModuleEnv names | 109 | initOrigNames names = foldl extendOrigNameCache emptyModuleEnv names | 68 | false | true | 0 | 7 | 11 | 34 | 15 | 19 | null | null |
brendanhay/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Projects/AlertPolicies/List.hs | mpl-2.0 | -- | Required. The project
-- (https:\/\/cloud.google.com\/monitoring\/api\/v3#project_name) whose
-- alert policies are to be listed. The format is:
-- projects\/[PROJECT_ID_OR_NUMBER] Note that this field names the parent
-- container in which the alerting policies to be listed are stored. To
-- retrieve a single alerting policy by name, use the GetAlertPolicy
-- operation, instead.
paplName :: Lens' ProjectsAlertPoliciesList Text
paplName = lens _paplName (\ s a -> s{_paplName = a}) | 490 | paplName :: Lens' ProjectsAlertPoliciesList Text
paplName = lens _paplName (\ s a -> s{_paplName = a}) | 102 | paplName = lens _paplName (\ s a -> s{_paplName = a}) | 53 | true | true | 0 | 9 | 69 | 46 | 28 | 18 | null | null |
li-zhirui/JSAnalyzer | JSAnalyzer.hs | mit | analyzeExpression record env expr = eval env expr | 49 | analyzeExpression record env expr = eval env expr | 49 | analyzeExpression record env expr = eval env expr | 49 | false | false | 0 | 5 | 7 | 18 | 8 | 10 | null | null |
ghc-android/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | emptyRecStmt' :: forall idL idR body.
PostTc idR Type -> StmtLR idL idR body
emptyRecStmt' tyVal =
RecStmt
{ recS_stmts = [], recS_later_ids = []
, recS_rec_ids = []
, recS_ret_fn = noSyntaxExpr
, recS_mfix_fn = noSyntaxExpr
, recS_bind_fn = noSyntaxExpr, recS_later_rets = []
, recS_rec_rets = [], recS_ret_ty = tyVal } | 376 | emptyRecStmt' :: forall idL idR body.
PostTc idR Type -> StmtLR idL idR body
emptyRecStmt' tyVal =
RecStmt
{ recS_stmts = [], recS_later_ids = []
, recS_rec_ids = []
, recS_ret_fn = noSyntaxExpr
, recS_mfix_fn = noSyntaxExpr
, recS_bind_fn = noSyntaxExpr, recS_later_rets = []
, recS_rec_rets = [], recS_ret_ty = tyVal } | 376 | emptyRecStmt' tyVal =
RecStmt
{ recS_stmts = [], recS_later_ids = []
, recS_rec_ids = []
, recS_ret_fn = noSyntaxExpr
, recS_mfix_fn = noSyntaxExpr
, recS_bind_fn = noSyntaxExpr, recS_later_rets = []
, recS_rec_rets = [], recS_ret_ty = tyVal } | 276 | false | true | 0 | 8 | 107 | 111 | 63 | 48 | null | null |
dmbarbour/Sirea | src/Sirea/Internal/Choke.hs | bsd-3-clause | - update initiated by chokeFlush, runs in update phase
chokeFlushUpdate :: Choke z -> IO ()
chokeFlushUpdate ck =
readIORef (ck_data ck) >>= \ ckd ->
readIORef (ck_cycle ck) >>= \ cycSt ->
assert (ckd_flush ckd) $
let ckd' = ckd { ckd_flush = False } in
let bDone = not (ckdActive ckd') in
let bDeliver = bDone || cycDetected cycSt in
writeIORef (ck_data ck) ckd' >>
when bDone (writeIORef (ck_cycle ck) CycUntested) >>
when bDeliver (chokeDeliver ck)
| 489 | chokeFlushUpdate :: Choke z -> IO ()
chokeFlushUpdate ck =
readIORef (ck_data ck) >>= \ ckd ->
readIORef (ck_cycle ck) >>= \ cycSt ->
assert (ckd_flush ckd) $
let ckd' = ckd { ckd_flush = False } in
let bDone = not (ckdActive ckd') in
let bDeliver = bDone || cycDetected cycSt in
writeIORef (ck_data ck) ckd' >>
when bDone (writeIORef (ck_cycle ck) CycUntested) >>
when bDeliver (chokeDeliver ck) | 433 | chokeFlushUpdate ck =
readIORef (ck_data ck) >>= \ ckd ->
readIORef (ck_cycle ck) >>= \ cycSt ->
assert (ckd_flush ckd) $
let ckd' = ckd { ckd_flush = False } in
let bDone = not (ckdActive ckd') in
let bDeliver = bDone || cycDetected cycSt in
writeIORef (ck_data ck) ckd' >>
when bDone (writeIORef (ck_cycle ck) CycUntested) >>
when bDeliver (chokeDeliver ck) | 396 | true | true | 4 | 15 | 115 | 204 | 96 | 108 | null | null |
siddhanathan/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | -- These two are the basic constructors
mkRdrUnqual :: OccName -> RdrName
mkRdrUnqual occ = Unqual occ | 102 | mkRdrUnqual :: OccName -> RdrName
mkRdrUnqual occ = Unqual occ | 62 | mkRdrUnqual occ = Unqual occ | 28 | true | true | 0 | 5 | 16 | 22 | 11 | 11 | null | null |
mikeizbicki/homoiconic | old/Algebra4.hs | bsd-3-clause | goB (Bd e1 e2) = goB e1<>goB e2 | 31 | goB (Bd e1 e2) = goB e1<>goB e2 | 31 | goB (Bd e1 e2) = goB e1<>goB e2 | 31 | false | false | 0 | 6 | 7 | 28 | 12 | 16 | null | null |
ion1/swtor-ui | src/SWTOR/UIProfile/Layout.hs | mit | elementSize SocialCenter{..} = scaleBy elemScale (300, 25) | 58 | elementSize SocialCenter{..} = scaleBy elemScale (300, 25) | 58 | elementSize SocialCenter{..} = scaleBy elemScale (300, 25) | 58 | false | false | 0 | 7 | 6 | 26 | 13 | 13 | null | null |
grnet/snf-ganeti | src/Ganeti/Utils.hs | bsd-2-clause | -- | `isSubsequenceOf a b`: Checks if a is a subsequence of b.
isSubsequenceOf :: (Eq a) => [a] -> [a] -> Bool
isSubsequenceOf [] _ = True | 160 | isSubsequenceOf :: (Eq a) => [a] -> [a] -> Bool
isSubsequenceOf [] _ = True | 97 | isSubsequenceOf [] _ = True | 49 | true | true | 0 | 8 | 49 | 42 | 23 | 19 | null | null |
mdsteele/fallback | src/Fallback/Scenario/Script/Other.hs | gpl-3.0 | degradeMonstersSummonedBy :: (FromAreaEffect f) =>
Either CharacterNumber (Grid.Key Monster)
-> Script f ()
degradeMonstersSummonedBy summoner = do
monsters <- areaGet arsMonsters
forM_ (Grid.entries monsters) $ \entry -> do
let monst = Grid.geValue entry
maybeM (monstSummoning monst) $ \ms -> do
when (msSummmoner ms == summoner) $ do
let frames' = (msRemainingFrames ms) * 3 `ceilDiv` 4
emitAreaEffect $ EffReplaceMonster (Grid.geKey entry) $ Just monst
{ monstSummoning = Just ms { msRemainingFrames = frames' } }
-- | Call this once per town step to reduce the remaining frames of all
-- summoned monsters by one round. | 724 | degradeMonstersSummonedBy :: (FromAreaEffect f) =>
Either CharacterNumber (Grid.Key Monster)
-> Script f ()
degradeMonstersSummonedBy summoner = do
monsters <- areaGet arsMonsters
forM_ (Grid.entries monsters) $ \entry -> do
let monst = Grid.geValue entry
maybeM (monstSummoning monst) $ \ms -> do
when (msSummmoner ms == summoner) $ do
let frames' = (msRemainingFrames ms) * 3 `ceilDiv` 4
emitAreaEffect $ EffReplaceMonster (Grid.geKey entry) $ Just monst
{ monstSummoning = Just ms { msRemainingFrames = frames' } }
-- | Call this once per town step to reduce the remaining frames of all
-- summoned monsters by one round. | 724 | degradeMonstersSummonedBy summoner = do
monsters <- areaGet arsMonsters
forM_ (Grid.entries monsters) $ \entry -> do
let monst = Grid.geValue entry
maybeM (monstSummoning monst) $ \ms -> do
when (msSummmoner ms == summoner) $ do
let frames' = (msRemainingFrames ms) * 3 `ceilDiv` 4
emitAreaEffect $ EffReplaceMonster (Grid.geKey entry) $ Just monst
{ monstSummoning = Just ms { msRemainingFrames = frames' } }
-- | Call this once per town step to reduce the remaining frames of all
-- summoned monsters by one round. | 561 | false | true | 0 | 24 | 195 | 206 | 100 | 106 | null | null |
heathweiss/Tricad | src/Tests/MathPolarTest.hs | gpl-2.0 | slopeForXYAngleAndYslopeTestXPos10YPos1XY100 = TestCase $ assertEqual
"slopeForXYAngleAndYslopeTestY80"
(PosSlope 10.02172570778901)
(slopeAdjustedForVerticalAngle (PosXSlope 10) (PosYSlope 1) (Angle 100) ) | 214 | slopeForXYAngleAndYslopeTestXPos10YPos1XY100 = TestCase $ assertEqual
"slopeForXYAngleAndYslopeTestY80"
(PosSlope 10.02172570778901)
(slopeAdjustedForVerticalAngle (PosXSlope 10) (PosYSlope 1) (Angle 100) ) | 214 | slopeForXYAngleAndYslopeTestXPos10YPos1XY100 = TestCase $ assertEqual
"slopeForXYAngleAndYslopeTestY80"
(PosSlope 10.02172570778901)
(slopeAdjustedForVerticalAngle (PosXSlope 10) (PosYSlope 1) (Angle 100) ) | 214 | false | false | 0 | 8 | 23 | 53 | 25 | 28 | null | null |
shockkolate/containers | Data/Map/Base.hs | bsd-3-clause | merge :: Map k a -> Map k a -> Map k a
merge Tip r = r | 56 | merge :: Map k a -> Map k a -> Map k a
merge Tip r = r | 56 | merge Tip r = r | 17 | false | true | 0 | 7 | 19 | 44 | 19 | 25 | null | null |
lukexi/ghc-7.8-arm64 | compiler/main/DynFlags.hs | bsd-3-clause | setHcSuf f d = d{ hcSuf = f} | 42 | setHcSuf f d = d{ hcSuf = f} | 42 | setHcSuf f d = d{ hcSuf = f} | 42 | false | false | 0 | 6 | 21 | 19 | 10 | 9 | null | null |
michalkonecny/aern2 | aern2-fnreps/main/fnreps-bounds.hs | bsd-3-clause | ---------------------------------------------------------------------
-- UNIVARIATE GLOBAL OPTIMISATION
-- |sin x - (x - x^3/6 + x^5/120 - x^7/5040)| <= eps
sine_name :: String -> String
sine_name label =
"sine deg-7 single-precision Taylor series " ++ label | 262 | sine_name :: String -> String
sine_name label =
"sine deg-7 single-precision Taylor series " ++ label | 104 | sine_name label =
"sine deg-7 single-precision Taylor series " ++ label | 74 | true | true | 0 | 5 | 37 | 25 | 14 | 11 | null | null |
dcreager/cabal | Distribution/Simple/SrcDist.hs | bsd-3-clause | snapshotPackage :: CalendarTime -> PackageDescription -> PackageDescription
snapshotPackage date pkg =
pkg {
package = pkgid { pkgVersion = snapshotVersion date (pkgVersion pkgid) }
}
where pkgid = packageId pkg
-- | Modifies a 'Version' by appending a snapshot number corresponding
-- to the given date.
-- | 318 | snapshotPackage :: CalendarTime -> PackageDescription -> PackageDescription
snapshotPackage date pkg =
pkg {
package = pkgid { pkgVersion = snapshotVersion date (pkgVersion pkgid) }
}
where pkgid = packageId pkg
-- | Modifies a 'Version' by appending a snapshot number corresponding
-- to the given date.
-- | 318 | snapshotPackage date pkg =
pkg {
package = pkgid { pkgVersion = snapshotVersion date (pkgVersion pkgid) }
}
where pkgid = packageId pkg
-- | Modifies a 'Version' by appending a snapshot number corresponding
-- to the given date.
-- | 242 | false | true | 0 | 11 | 57 | 65 | 35 | 30 | null | null |
dimara/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pNodeUuid :: Field
pNodeUuid =
withDoc "A node UUID (for single-node LUs)" .
optionalField $ simpleField "node_uuid" [t| NonEmptyString |] | 142 | pNodeUuid :: Field
pNodeUuid =
withDoc "A node UUID (for single-node LUs)" .
optionalField $ simpleField "node_uuid" [t| NonEmptyString |] | 142 | pNodeUuid =
withDoc "A node UUID (for single-node LUs)" .
optionalField $ simpleField "node_uuid" [t| NonEmptyString |] | 123 | false | true | 0 | 7 | 23 | 31 | 17 | 14 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs | mpl-2.0 | -- | The energy efficiency class as defined in EU directive 2010\/30\/EU.
prorMaxEnergyEfficiencyClass :: Lens' Product (Maybe Text)
prorMaxEnergyEfficiencyClass
= lens _prorMaxEnergyEfficiencyClass
(\ s a -> s{_prorMaxEnergyEfficiencyClass = a}) | 254 | prorMaxEnergyEfficiencyClass :: Lens' Product (Maybe Text)
prorMaxEnergyEfficiencyClass
= lens _prorMaxEnergyEfficiencyClass
(\ s a -> s{_prorMaxEnergyEfficiencyClass = a}) | 180 | prorMaxEnergyEfficiencyClass
= lens _prorMaxEnergyEfficiencyClass
(\ s a -> s{_prorMaxEnergyEfficiencyClass = a}) | 121 | true | true | 0 | 9 | 36 | 48 | 25 | 23 | null | null |
Erdwolf/autotool-bonn | src/JVM/Make.hs | gpl-2.0 | make :: Make
make = M.make $ C.Config
{ C.name = "JVM"
, C.conditions = []
, C.arity = 2
, C.op = read "x1 * x2"
, C.num_args = 10
, C.max_arg = 20
, C.cut = 1000
, C.checks = [ Builtins $ mkSet [ Add, Sub, Mul ] ]
, C.start = JVM.Example.student
} | 300 | make :: Make
make = M.make $ C.Config
{ C.name = "JVM"
, C.conditions = []
, C.arity = 2
, C.op = read "x1 * x2"
, C.num_args = 10
, C.max_arg = 20
, C.cut = 1000
, C.checks = [ Builtins $ mkSet [ Add, Sub, Mul ] ]
, C.start = JVM.Example.student
} | 300 | make = M.make $ C.Config
{ C.name = "JVM"
, C.conditions = []
, C.arity = 2
, C.op = read "x1 * x2"
, C.num_args = 10
, C.max_arg = 20
, C.cut = 1000
, C.checks = [ Builtins $ mkSet [ Add, Sub, Mul ] ]
, C.start = JVM.Example.student
} | 287 | false | true | 0 | 11 | 108 | 120 | 71 | 49 | null | null |
jwiegley/ghc-release | libraries/base/GHC/MVar.hs | gpl-3.0 | newMVar :: a -> IO (MVar a)
newMVar value =
newEmptyMVar >>= \ mvar ->
putMVar mvar value >>
return mvar | 124 | newMVar :: a -> IO (MVar a)
newMVar value =
newEmptyMVar >>= \ mvar ->
putMVar mvar value >>
return mvar | 124 | newMVar value =
newEmptyMVar >>= \ mvar ->
putMVar mvar value >>
return mvar | 96 | false | true | 4 | 9 | 40 | 57 | 25 | 32 | null | null |
KaneTW/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | getFile _ = Nothing | 19 | getFile _ = Nothing | 19 | getFile _ = Nothing | 19 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
fmapfmapfmap/amazonka | amazonka-sns/gen/Network/AWS/SNS/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'MessageAttributeValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mavBinaryValue'
--
-- * 'mavStringValue'
--
-- * 'mavDataType'
messageAttributeValue
:: Text -- ^ 'mavDataType'
-> MessageAttributeValue
messageAttributeValue pDataType_ =
MessageAttributeValue'
{ _mavBinaryValue = Nothing
, _mavStringValue = Nothing
, _mavDataType = pDataType_
} | 490 | messageAttributeValue
:: Text -- ^ 'mavDataType'
-> MessageAttributeValue
messageAttributeValue pDataType_ =
MessageAttributeValue'
{ _mavBinaryValue = Nothing
, _mavStringValue = Nothing
, _mavDataType = pDataType_
} | 245 | messageAttributeValue pDataType_ =
MessageAttributeValue'
{ _mavBinaryValue = Nothing
, _mavStringValue = Nothing
, _mavDataType = pDataType_
} | 163 | true | true | 0 | 7 | 94 | 57 | 34 | 23 | null | null |
xcthulhu/lambda-geda | Geda/Hierarchical.hs | gpl-3.0 | makeHCompGraphical obj = obj | 28 | makeHCompGraphical obj = obj | 28 | makeHCompGraphical obj = obj | 28 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
garetxe/cabal | cabal-install/Main.hs | bsd-3-clause | execAction :: ExecFlags -> [String] -> Action
execAction execFlags extraArgs globalFlags = do
let verbosity = fromFlag (execVerbosity execFlags)
(useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags
let configFlags = savedConfigureFlags config
(comp, platform, conf) <- getPersistOrConfigCompiler configFlags
exec verbosity useSandbox comp platform conf extraArgs | 391 | execAction :: ExecFlags -> [String] -> Action
execAction execFlags extraArgs globalFlags = do
let verbosity = fromFlag (execVerbosity execFlags)
(useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags
let configFlags = savedConfigureFlags config
(comp, platform, conf) <- getPersistOrConfigCompiler configFlags
exec verbosity useSandbox comp platform conf extraArgs | 391 | execAction execFlags extraArgs globalFlags = do
let verbosity = fromFlag (execVerbosity execFlags)
(useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags
let configFlags = savedConfigureFlags config
(comp, platform, conf) <- getPersistOrConfigCompiler configFlags
exec verbosity useSandbox comp platform conf extraArgs | 345 | false | true | 0 | 12 | 52 | 112 | 54 | 58 | null | null |
miguelpagano/equ | Equ/Proof.hs | gpl-3.0 | -- | Esta función verifica si dos pruebas prueban lo mismo, aunque no sean la misma prueba.
-- Esto es, que tengan las mismas expresiones inicial y final, y la misma relacion. Podrían
-- tener diferentes contextos.
-- Si se verifica, retorna Right (), caso contrario Left error.
sameProof :: Proof -> Proof -> PM ()
sameProof p1 p2 =
getStart p1 >>= \p1st -> getEnd p1 >>= \p1end ->
getRel p1 >>= \rel1 -> getStart p2 >>= \p2st ->
getEnd p2 >>= \p2end ->
getRel p2 >>= \rel2 ->
whenPM' (p1st==p2st && p1end==p2end && rel1==rel2) (errProofPlace (InductionError IncorrectSubProof)) | 607 | sameProof :: Proof -> Proof -> PM ()
sameProof p1 p2 =
getStart p1 >>= \p1st -> getEnd p1 >>= \p1end ->
getRel p1 >>= \rel1 -> getStart p2 >>= \p2st ->
getEnd p2 >>= \p2end ->
getRel p2 >>= \rel2 ->
whenPM' (p1st==p2st && p1end==p2end && rel1==rel2) (errProofPlace (InductionError IncorrectSubProof)) | 322 | sameProof p1 p2 =
getStart p1 >>= \p1st -> getEnd p1 >>= \p1end ->
getRel p1 >>= \rel1 -> getStart p2 >>= \p2st ->
getEnd p2 >>= \p2end ->
getRel p2 >>= \rel2 ->
whenPM' (p1st==p2st && p1end==p2end && rel1==rel2) (errProofPlace (InductionError IncorrectSubProof)) | 285 | true | true | 0 | 23 | 126 | 145 | 74 | 71 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcTypeNats.hs | bsd-3-clause | interactInertExp _ _ _ _ = [] | 29 | interactInertExp _ _ _ _ = [] | 29 | interactInertExp _ _ _ _ = [] | 29 | false | false | 1 | 6 | 6 | 17 | 7 | 10 | null | null |
sisirkoppaka/brick | src/Brick/Widgets/Edit.hs | bsd-3-clause | editor :: Name
-- ^ The editor's name (must be unique)
-> ([String] -> Widget)
-- ^ The content rendering function
-> Maybe Int
-- ^ The limit on the number of lines in the editor ('Nothing'
-- means no limit)
-> String
-- ^ The initial content
-> Editor
editor name draw limit s = Editor (Z.stringZipper [s] limit) draw name | 388 | editor :: Name
-- ^ The editor's name (must be unique)
-> ([String] -> Widget)
-- ^ The content rendering function
-> Maybe Int
-- ^ The limit on the number of lines in the editor ('Nothing'
-- means no limit)
-> String
-- ^ The initial content
-> Editor
editor name draw limit s = Editor (Z.stringZipper [s] limit) draw name | 388 | editor name draw limit s = Editor (Z.stringZipper [s] limit) draw name | 70 | false | true | 0 | 9 | 124 | 74 | 40 | 34 | null | null |
bravit/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | updateNs ns t = mapPT updateRef t
where updateRef (PRef fc fcs f) = PRef fc fcs (updateN ns f)
updateRef t = t
-- updateDNs :: [(Name, Name)] -> PDecl -> PDecl
-- updateDNs [] t = t
-- updateDNs ns (PTy s f n t) | Just n' <- lookup n ns = PTy s f n' t
-- updateDNs ns (PClauses f n c) | Just n' <- lookup n ns = PClauses f n' (map updateCNs c)
-- where updateCNs ns (PClause n l ts r ds)
-- = PClause (updateN ns n) (fmap (updateNs ns) l)
-- (map (fmap (updateNs ns)) ts)
-- (fmap (updateNs ns) r)
-- (map (updateDNs ns) ds)
-- updateDNs ns c = c | 685 | updateNs ns t = mapPT updateRef t
where updateRef (PRef fc fcs f) = PRef fc fcs (updateN ns f)
updateRef t = t
-- updateDNs :: [(Name, Name)] -> PDecl -> PDecl
-- updateDNs [] t = t
-- updateDNs ns (PTy s f n t) | Just n' <- lookup n ns = PTy s f n' t
-- updateDNs ns (PClauses f n c) | Just n' <- lookup n ns = PClauses f n' (map updateCNs c)
-- where updateCNs ns (PClause n l ts r ds)
-- = PClause (updateN ns n) (fmap (updateNs ns) l)
-- (map (fmap (updateNs ns)) ts)
-- (fmap (updateNs ns) r)
-- (map (updateDNs ns) ds)
-- updateDNs ns c = c | 685 | updateNs ns t = mapPT updateRef t
where updateRef (PRef fc fcs f) = PRef fc fcs (updateN ns f)
updateRef t = t
-- updateDNs :: [(Name, Name)] -> PDecl -> PDecl
-- updateDNs [] t = t
-- updateDNs ns (PTy s f n t) | Just n' <- lookup n ns = PTy s f n' t
-- updateDNs ns (PClauses f n c) | Just n' <- lookup n ns = PClauses f n' (map updateCNs c)
-- where updateCNs ns (PClause n l ts r ds)
-- = PClause (updateN ns n) (fmap (updateNs ns) l)
-- (map (fmap (updateNs ns)) ts)
-- (fmap (updateNs ns) r)
-- (map (updateDNs ns) ds)
-- updateDNs ns c = c | 685 | false | false | 2 | 7 | 261 | 80 | 38 | 42 | null | null |
michalkonecny/aern2 | aern2-real/attic/EffortConcept1.hs | bsd-3-clause | mergeSFG ::
(HasUEffort enclA) =>
(effort -> (enclA, s) -> (enclB, s)) -> (UEffort -> effort) -> ((enclA, s) -> (enclB, s))
mergeSFG f g (x,s) =
f (g $ getUEffort x) (x,s) | 177 | mergeSFG ::
(HasUEffort enclA) =>
(effort -> (enclA, s) -> (enclB, s)) -> (UEffort -> effort) -> ((enclA, s) -> (enclB, s))
mergeSFG f g (x,s) =
f (g $ getUEffort x) (x,s) | 177 | mergeSFG f g (x,s) =
f (g $ getUEffort x) (x,s) | 49 | false | true | 0 | 10 | 38 | 118 | 64 | 54 | null | null |
clample/lamdabtc | backend/test/BitcoinCore/KeysTest.hs | bsd-3-clause | publicKeyInvertible = testProperty
"Public key should be invertible when serialized then deserialized"
prop_publicKeyInvertible | 131 | publicKeyInvertible = testProperty
"Public key should be invertible when serialized then deserialized"
prop_publicKeyInvertible | 131 | publicKeyInvertible = testProperty
"Public key should be invertible when serialized then deserialized"
prop_publicKeyInvertible | 131 | false | false | 1 | 5 | 16 | 16 | 5 | 11 | null | null |
ocramz/petsc-hs | examples/Test2.hs | gpl-3.0 | -- PetscErrorCode VecCreateMPI(MPI_Comm comm, int m, int M, Vec* x)
vecCreateMPI' comm m1' m2' p = [C.exp|int{VecCreateMPI($(int c), $(int m1), $(int m2), $(Vec *p))}|]
where c = unComm comm
m1 = fromIntegral m1'
m2 = fromIntegral m2' | 253 | vecCreateMPI' comm m1' m2' p = [C.exp|int{VecCreateMPI($(int c), $(int m1), $(int m2), $(Vec *p))}|]
where c = unComm comm
m1 = fromIntegral m1'
m2 = fromIntegral m2' | 185 | vecCreateMPI' comm m1' m2' p = [C.exp|int{VecCreateMPI($(int c), $(int m1), $(int m2), $(Vec *p))}|]
where c = unComm comm
m1 = fromIntegral m1'
m2 = fromIntegral m2' | 185 | true | false | 2 | 5 | 55 | 49 | 26 | 23 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/OpParams.hs | gpl-2.0 | pIgnoreErrors :: Field
pIgnoreErrors =
withDoc "List of error codes that should be treated as warnings" .
defaultField [| emptyListSet |] $
simpleField "ignore_errors" [t| ListSet CVErrorCode |] | 200 | pIgnoreErrors :: Field
pIgnoreErrors =
withDoc "List of error codes that should be treated as warnings" .
defaultField [| emptyListSet |] $
simpleField "ignore_errors" [t| ListSet CVErrorCode |] | 200 | pIgnoreErrors =
withDoc "List of error codes that should be treated as warnings" .
defaultField [| emptyListSet |] $
simpleField "ignore_errors" [t| ListSet CVErrorCode |] | 177 | false | true | 0 | 7 | 33 | 37 | 21 | 16 | null | null |
obgs/utils | src/Obgs/Utils/Ord.hs | mit | -- | Successively applies the given comparison functions to the given values,
-- until one returns an 'Ordering' that is different from 'EQ'.
--
-- Returns the result of the last function applied.
mkComparator :: [a -> a -> Ordering] -> a -> a -> Ordering
mkComparator fs x y = foldr ((<>) . ($ (x, y)) . uncurry) EQ fs | 319 | mkComparator :: [a -> a -> Ordering] -> a -> a -> Ordering
mkComparator fs x y = foldr ((<>) . ($ (x, y)) . uncurry) EQ fs | 122 | mkComparator fs x y = foldr ((<>) . ($ (x, y)) . uncurry) EQ fs | 63 | true | true | 0 | 10 | 60 | 80 | 44 | 36 | null | null |
google-code/bkil-open | volatile/calc/maxmin.hs | gpl-2.0 | fixMetnet xs = xs | 17 | fixMetnet xs = xs | 17 | fixMetnet xs = xs | 17 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.