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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
frontrowed/stratosphere
|
library-gen/Stratosphere/Resources/CodeDeployApplication.hs
|
mit
|
codeDeployApplication
:: CodeDeployApplication
codeDeployApplication =
CodeDeployApplication
{ _codeDeployApplicationApplicationName = Nothing
, _codeDeployApplicationComputePlatform = Nothing
}
| 205 |
codeDeployApplication
:: CodeDeployApplication
codeDeployApplication =
CodeDeployApplication
{ _codeDeployApplicationApplicationName = Nothing
, _codeDeployApplicationComputePlatform = Nothing
}
| 205 |
codeDeployApplication =
CodeDeployApplication
{ _codeDeployApplicationApplicationName = Nothing
, _codeDeployApplicationComputePlatform = Nothing
}
| 156 | false | true | 1 | 7 | 25 | 32 | 16 | 16 | null | null |
ganeti-github-testing/ganeti-test-1
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
cvEnoderpc :: (String, String, String)
cvEnoderpc =
("node",
Types.cVErrorCodeToRaw CvENODERPC,
"Error during connection to the primary node of an instance")
| 165 |
cvEnoderpc :: (String, String, String)
cvEnoderpc =
("node",
Types.cVErrorCodeToRaw CvENODERPC,
"Error during connection to the primary node of an instance")
| 165 |
cvEnoderpc =
("node",
Types.cVErrorCodeToRaw CvENODERPC,
"Error during connection to the primary node of an instance")
| 126 | false | true | 0 | 7 | 27 | 34 | 20 | 14 | null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
2730 = 2729
| 11 |
2730 = 2729
| 11 |
2730 = 2729
| 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
ekalosak/haskell-practice
|
Pr32.hs
|
lgpl-3.0
|
g n 0 = n
| 9 |
g n 0 = n
| 9 |
g n 0 = n
| 9 | false | false | 0 | 4 | 4 | 13 | 5 | 8 | null | null |
brendanhay/gogol
|
gogol-translate/gen/Network/Google/Resource/Translate/Projects/Locations/BatchTranslateText.hs
|
mpl-2.0
|
-- | OAuth access token.
plbttAccessToken :: Lens' ProjectsLocationsBatchTranslateText (Maybe Text)
plbttAccessToken
= lens _plbttAccessToken
(\ s a -> s{_plbttAccessToken = a})
| 185 |
plbttAccessToken :: Lens' ProjectsLocationsBatchTranslateText (Maybe Text)
plbttAccessToken
= lens _plbttAccessToken
(\ s a -> s{_plbttAccessToken = a})
| 160 |
plbttAccessToken
= lens _plbttAccessToken
(\ s a -> s{_plbttAccessToken = a})
| 85 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
andyarvanitis/Idris-dev
|
src/Idris/REPL.hs
|
bsd-3-clause
|
process fn (MakeLemma updatefile l n)
= makeLemma fn updatefile l n
| 71 |
process fn (MakeLemma updatefile l n)
= makeLemma fn updatefile l n
| 71 |
process fn (MakeLemma updatefile l n)
= makeLemma fn updatefile l n
| 71 | false | false | 0 | 6 | 15 | 35 | 14 | 21 | null | null |
kazu-yamamoto/cab
|
Distribution/Cab/Sandbox.hs
|
bsd-3-clause
|
getPackageDbDir :: FilePath -> IO FilePath
getPackageDbDir sconf = do
-- Be strict to ensure that an error can be caught.
!path <- extractValue . parse <$> readFile sconf
return path
where
parse = head . filter ("package-db:" `isPrefixOf`) . lines
extractValue = fst . break isSpace . dropWhile isSpace . drop pkgDbKeyLen
----------------------------------------------------------------
-- | Generate GHC options for package db according to GHC version.
--
-- >>> getSandboxOpts Nothing
-- ""
-- >>> getSandboxOpts (Just "/path/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d")
-- "-package-db /path/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"
-- >>> getSandboxOpts (Just "/path/.cabal-sandbox/i386-osx-ghc-7.4.1-packages.conf.d")
-- "-package-conf /path/.cabal-sandbox/i386-osx-ghc-7.4.1-packages.conf.d"
| 838 |
getPackageDbDir :: FilePath -> IO FilePath
getPackageDbDir sconf = do
-- Be strict to ensure that an error can be caught.
!path <- extractValue . parse <$> readFile sconf
return path
where
parse = head . filter ("package-db:" `isPrefixOf`) . lines
extractValue = fst . break isSpace . dropWhile isSpace . drop pkgDbKeyLen
----------------------------------------------------------------
-- | Generate GHC options for package db according to GHC version.
--
-- >>> getSandboxOpts Nothing
-- ""
-- >>> getSandboxOpts (Just "/path/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d")
-- "-package-db /path/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"
-- >>> getSandboxOpts (Just "/path/.cabal-sandbox/i386-osx-ghc-7.4.1-packages.conf.d")
-- "-package-conf /path/.cabal-sandbox/i386-osx-ghc-7.4.1-packages.conf.d"
| 838 |
getPackageDbDir sconf = do
-- Be strict to ensure that an error can be caught.
!path <- extractValue . parse <$> readFile sconf
return path
where
parse = head . filter ("package-db:" `isPrefixOf`) . lines
extractValue = fst . break isSpace . dropWhile isSpace . drop pkgDbKeyLen
----------------------------------------------------------------
-- | Generate GHC options for package db according to GHC version.
--
-- >>> getSandboxOpts Nothing
-- ""
-- >>> getSandboxOpts (Just "/path/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d")
-- "-package-db /path/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d"
-- >>> getSandboxOpts (Just "/path/.cabal-sandbox/i386-osx-ghc-7.4.1-packages.conf.d")
-- "-package-conf /path/.cabal-sandbox/i386-osx-ghc-7.4.1-packages.conf.d"
| 795 | false | true | 1 | 11 | 112 | 109 | 56 | 53 | null | null |
sapek/pandoc
|
src/Text/Pandoc/Writers/HTML.hs
|
gpl-2.0
|
tableRowToHtml :: WriterOptions
-> [Alignment]
-> Int
-> [[Block]]
-> State WriterState Html
tableRowToHtml opts aligns rownum cols' = do
let mkcell = if rownum == 0 then H.th else H.td
let rowclass = case rownum of
0 -> "header"
x | x `rem` 2 == 1 -> "odd"
_ -> "even"
cols'' <- sequence $ zipWith
(\alignment item -> tableItemToHtml opts mkcell alignment item)
aligns cols'
return $ (H.tr ! A.class_ rowclass $ nl opts >> mconcat cols'')
>> nl opts
| 652 |
tableRowToHtml :: WriterOptions
-> [Alignment]
-> Int
-> [[Block]]
-> State WriterState Html
tableRowToHtml opts aligns rownum cols' = do
let mkcell = if rownum == 0 then H.th else H.td
let rowclass = case rownum of
0 -> "header"
x | x `rem` 2 == 1 -> "odd"
_ -> "even"
cols'' <- sequence $ zipWith
(\alignment item -> tableItemToHtml opts mkcell alignment item)
aligns cols'
return $ (H.tr ! A.class_ rowclass $ nl opts >> mconcat cols'')
>> nl opts
| 652 |
tableRowToHtml opts aligns rownum cols' = do
let mkcell = if rownum == 0 then H.th else H.td
let rowclass = case rownum of
0 -> "header"
x | x `rem` 2 == 1 -> "odd"
_ -> "even"
cols'' <- sequence $ zipWith
(\alignment item -> tableItemToHtml opts mkcell alignment item)
aligns cols'
return $ (H.tr ! A.class_ rowclass $ nl opts >> mconcat cols'')
>> nl opts
| 499 | false | true | 0 | 17 | 283 | 201 | 99 | 102 | null | null |
JadenGeller/Tart
|
Sources/DTLC.hs
|
mit
|
step (App (Lambda func) arg) = lunbind func $ \((varName, _), body) -> do
return $ subst varName arg body
| 109 |
step (App (Lambda func) arg) = lunbind func $ \((varName, _), body) -> do
return $ subst varName arg body
| 109 |
step (App (Lambda func) arg) = lunbind func $ \((varName, _), body) -> do
return $ subst varName arg body
| 109 | false | false | 0 | 10 | 23 | 62 | 31 | 31 | null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/topic/general/haskellforall/src/X_2012_06_09_why_free_monads_matter.hs
|
unlicense
|
-- try {subroutine}
-- catch (IncompleteException) {
-- bell
-- done
-- }
program :: Free (Toy Char) e
program = subroutine >> Free (Bell (Free Done))
| 159 |
program :: Free (Toy Char) e
program = subroutine >> Free (Bell (Free Done))
| 77 |
program = subroutine >> Free (Bell (Free Done))
| 48 | true | true | 4 | 9 | 35 | 54 | 25 | 29 | null | null |
ghcjs/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
remShortInt :: Int -> JExpr -> JExpr -> JExpr
remShortInt bits x y = (signed x .%. signed y) .&. mask
where
signed z = (z .<<. shift) .>>. shift
shift = e (32 - bits)
mask = e (((2::Integer) ^ bits) - 1)
| 218 |
remShortInt :: Int -> JExpr -> JExpr -> JExpr
remShortInt bits x y = (signed x .%. signed y) .&. mask
where
signed z = (z .<<. shift) .>>. shift
shift = e (32 - bits)
mask = e (((2::Integer) ^ bits) - 1)
| 218 |
remShortInt bits x y = (signed x .%. signed y) .&. mask
where
signed z = (z .<<. shift) .>>. shift
shift = e (32 - bits)
mask = e (((2::Integer) ^ bits) - 1)
| 172 | false | true | 0 | 10 | 58 | 112 | 58 | 54 | null | null |
uduki/hsQt
|
Qtc/Enums/Gui/QStyleOption.hs
|
bsd-2-clause
|
eSO_TabBarBase :: OptionType
eSO_TabBarBase
= ieOptionType $ 14
| 65 |
eSO_TabBarBase :: OptionType
eSO_TabBarBase
= ieOptionType $ 14
| 65 |
eSO_TabBarBase
= ieOptionType $ 14
| 36 | false | true | 2 | 6 | 9 | 23 | 9 | 14 | null | null |
qrilka/xlsx
|
src/Codec/Xlsx/Types/ConditionalFormatting.hs
|
mit
|
toNode :: ToElement a => Name -> a -> Node
toNode nm = NodeElement . toElement nm
| 81 |
toNode :: ToElement a => Name -> a -> Node
toNode nm = NodeElement . toElement nm
| 81 |
toNode nm = NodeElement . toElement nm
| 38 | false | true | 0 | 9 | 16 | 41 | 18 | 23 | null | null |
derekmcloughlin/BridgeBuddyServer
|
library/BridgeBuddy/Cards.hs
|
apache-2.0
|
-- Get the lenghts of each suit in a hand
suitLengths :: Hand -> [(Suit, Int)]
suitLengths hand = [(suit, suitLength suit hand) | suit <- [Clubs .. Spades]]
| 156 |
suitLengths :: Hand -> [(Suit, Int)]
suitLengths hand = [(suit, suitLength suit hand) | suit <- [Clubs .. Spades]]
| 114 |
suitLengths hand = [(suit, suitLength suit hand) | suit <- [Clubs .. Spades]]
| 77 | true | true | 0 | 9 | 28 | 62 | 33 | 29 | null | null |
avieth/diplomacy
|
Diplomacy/Province.hs
|
bsd-3-clause
|
pcProvince SpainSouth = Spain
| 29 |
pcProvince SpainSouth = Spain
| 29 |
pcProvince SpainSouth = Spain
| 29 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
TomMD/ghc
|
compiler/basicTypes/Name.hs
|
bsd-3-clause
|
isDataConName :: Name -> Bool
isDataConName name = isDataOcc (nameOccName name)
| 79 |
isDataConName :: Name -> Bool
isDataConName name = isDataOcc (nameOccName name)
| 79 |
isDataConName name = isDataOcc (nameOccName name)
| 49 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
thiry/DComp
|
src/Query.hs
|
gpl-2.0
|
ret v s = [(v,s)]
| 17 |
ret v s = [(v,s)]
| 17 |
ret v s = [(v,s)]
| 17 | false | false | 1 | 6 | 4 | 24 | 11 | 13 | null | null |
jgoerzen/dtmconv
|
HaXml-1.12/src/Text/XML/HaXml/Parse.hs
|
gpl-2.0
|
emptySTs :: SymTabs
emptySTs = (emptyST, emptyST)
| 49 |
emptySTs :: SymTabs
emptySTs = (emptyST, emptyST)
| 49 |
emptySTs = (emptyST, emptyST)
| 29 | false | true | 0 | 5 | 6 | 17 | 10 | 7 | null | null |
mettekou/ghc
|
compiler/types/TyCoRep.hs
|
bsd-3-clause
|
tyThingCategory :: TyThing -> String
tyThingCategory (ATyCon tc)
| isClassTyCon tc = "class"
| otherwise = "type constructor"
| 135 |
tyThingCategory :: TyThing -> String
tyThingCategory (ATyCon tc)
| isClassTyCon tc = "class"
| otherwise = "type constructor"
| 135 |
tyThingCategory (ATyCon tc)
| isClassTyCon tc = "class"
| otherwise = "type constructor"
| 98 | false | true | 1 | 8 | 27 | 41 | 19 | 22 | null | null |
diminishedprime/.org
|
reading-list/cis194/scheme.hs
|
mit
|
eval val@(Number _) = return val
| 32 |
eval val@(Number _) = return val
| 32 |
eval val@(Number _) = return val
| 32 | false | false | 1 | 8 | 5 | 25 | 10 | 15 | null | null |
paulp/unison
|
yaks/easytest/src/EasyTest.hs
|
mit
|
bool :: Test Bool
bool = random
| 31 |
bool :: Test Bool
bool = random
| 31 |
bool = random
| 13 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
fffej/HS-Poker
|
LookupPatternMatch.hs
|
bsd-3-clause
|
getValueFromProduct 2146981 = 2044
| 34 |
getValueFromProduct 2146981 = 2044
| 34 |
getValueFromProduct 2146981 = 2044
| 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
IxpertaSolutions/freer-effects
|
examples/src/Console.hs
|
bsd-3-clause
|
getLine' :: Member Console r => Eff r String
getLine' = send GetLine
| 69 |
getLine' :: Member Console r => Eff r String
getLine' = send GetLine
| 69 |
getLine' = send GetLine
| 23 | false | true | 0 | 6 | 13 | 28 | 13 | 15 | null | null |
brendanhay/gogol
|
gogol-partners/gen/Network/Google/Partners/Types/Product.hs
|
mpl-2.0
|
-- | If the user has edit access to multiple accounts, the user can choose
-- the preferred account and it is used when a personal account is needed.
-- Can be empty.
upfAdwordsManagerAccount :: Lens' UserProFile (Maybe Int64)
upfAdwordsManagerAccount
= lens _upfAdwordsManagerAccount
(\ s a -> s{_upfAdwordsManagerAccount = a})
. mapping _Coerce
| 360 |
upfAdwordsManagerAccount :: Lens' UserProFile (Maybe Int64)
upfAdwordsManagerAccount
= lens _upfAdwordsManagerAccount
(\ s a -> s{_upfAdwordsManagerAccount = a})
. mapping _Coerce
| 193 |
upfAdwordsManagerAccount
= lens _upfAdwordsManagerAccount
(\ s a -> s{_upfAdwordsManagerAccount = a})
. mapping _Coerce
| 133 | true | true | 0 | 10 | 66 | 57 | 30 | 27 | null | null |
Gurrt/software-testing
|
week-3/Lab3.hs
|
mit
|
--Exercise 2
--Our goal is to test this function
-- Precondition, string consists of digits,'(',')','*','+','-','==>','<=>'
-- parse :: String -> [Form]
-- parse s = [ f | (f,_) <- parseForm (lexer s) ]
-- Postcondition, list of Forms corresponding to the used strings
-- We took a well know function as starting point in order to generate random
-- formulas that generates an integer of n numbers, then it generates a random
-- formula with limit 5 for this case. In case of formulas with zero levels, it
-- generates an arbitrary number of indices. We make an arrangement for formulas
-- until 5 levels in order to fulfil some syntactic forms and then generate
-- random formulas with variable levels. Then we create the test function with
-- 50 random generated formulas showing the ones that pass the parsing test and
-- the ones that do not.
-- To execute the test, run
-- testParser
-- Generating random formulas
getRandomInt :: Int -> IO Int
getRandomInt n = getStdRandom (randomR (0,n))
| 998 |
getRandomInt :: Int -> IO Int
getRandomInt n = getStdRandom (randomR (0,n))
| 75 |
getRandomInt n = getStdRandom (randomR (0,n))
| 45 | true | true | 0 | 8 | 176 | 57 | 36 | 21 | null | null |
vinnymac/glot-www
|
Model/Language.hs
|
mit
|
languageLogo Swift = img_swift_svg
| 34 |
languageLogo Swift = img_swift_svg
| 34 |
languageLogo Swift = img_swift_svg
| 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
phadej/stack
|
src/Stack/Types/Config.hs
|
bsd-3-clause
|
-- | Render a GHC variant to a String suffix.
ghcVariantSuffix :: GHCVariant -> String
ghcVariantSuffix GHCStandard = ""
| 120 |
ghcVariantSuffix :: GHCVariant -> String
ghcVariantSuffix GHCStandard = ""
| 74 |
ghcVariantSuffix GHCStandard = ""
| 33 | true | true | 0 | 5 | 18 | 19 | 10 | 9 | null | null |
codygman/frames-diff
|
Frames/Time/CTime/UnixTS.hs
|
bsd-3-clause
|
daysAgo :: UnixTime -> Integer -> UnixTS
daysAgo now n = UnixTS $ now `addUnixDiffTime` daysAgo' n
| 98 |
daysAgo :: UnixTime -> Integer -> UnixTS
daysAgo now n = UnixTS $ now `addUnixDiffTime` daysAgo' n
| 98 |
daysAgo now n = UnixTS $ now `addUnixDiffTime` daysAgo' n
| 57 | false | true | 0 | 6 | 16 | 37 | 19 | 18 | null | null |
spechub/Hets
|
FreeCAD/Translator.hs
|
gpl-2.0
|
objQName :: QName
objQName = unqual "Object"
| 44 |
objQName :: QName
objQName = unqual "Object"
| 44 |
objQName = unqual "Object"
| 26 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
acowley/ghc
|
compiler/typecheck/FamInst.hs
|
bsd-3-clause
|
tcExtendLocalFamInstEnv :: [FamInst] -> TcM a -> TcM a
tcExtendLocalFamInstEnv fam_insts thing_inside
= do { env <- getGblEnv
; (inst_env', fam_insts') <- foldlM addLocalFamInst
(tcg_fam_inst_env env, tcg_fam_insts env)
fam_insts
; let env' = env { tcg_fam_insts = fam_insts'
, tcg_fam_inst_env = inst_env' }
; setGblEnv env' thing_inside
}
| 469 |
tcExtendLocalFamInstEnv :: [FamInst] -> TcM a -> TcM a
tcExtendLocalFamInstEnv fam_insts thing_inside
= do { env <- getGblEnv
; (inst_env', fam_insts') <- foldlM addLocalFamInst
(tcg_fam_inst_env env, tcg_fam_insts env)
fam_insts
; let env' = env { tcg_fam_insts = fam_insts'
, tcg_fam_inst_env = inst_env' }
; setGblEnv env' thing_inside
}
| 469 |
tcExtendLocalFamInstEnv fam_insts thing_inside
= do { env <- getGblEnv
; (inst_env', fam_insts') <- foldlM addLocalFamInst
(tcg_fam_inst_env env, tcg_fam_insts env)
fam_insts
; let env' = env { tcg_fam_insts = fam_insts'
, tcg_fam_inst_env = inst_env' }
; setGblEnv env' thing_inside
}
| 414 | false | true | 0 | 11 | 176 | 108 | 56 | 52 | null | null |
cmahon/mvc-service
|
library/MVC/EventHandler.hs
|
bsd-3-clause
|
putAppStateP :: s -> SomeEventHandlerP a b s ()
putAppStateP = SomeEventHandlerP . lift . lift . S.put
| 102 |
putAppStateP :: s -> SomeEventHandlerP a b s ()
putAppStateP = SomeEventHandlerP . lift . lift . S.put
| 102 |
putAppStateP = SomeEventHandlerP . lift . lift . S.put
| 54 | false | true | 0 | 7 | 17 | 40 | 20 | 20 | null | null |
nevrenato/HetsAlloy
|
CSMOF/Parser.hs
|
gpl-2.0
|
parseModels :: Element -> Metamodel -> Map.Map String String -> [Model]
parseModels el metamodel keyMap = foldr ((:) . createModel metamodel keyMap)
[] (findChildren modelK el)
| 177 |
parseModels :: Element -> Metamodel -> Map.Map String String -> [Model]
parseModels el metamodel keyMap = foldr ((:) . createModel metamodel keyMap)
[] (findChildren modelK el)
| 177 |
parseModels el metamodel keyMap = foldr ((:) . createModel metamodel keyMap)
[] (findChildren modelK el)
| 105 | false | true | 0 | 9 | 26 | 73 | 36 | 37 | null | null |
bgamari/shaking-up-ghc
|
src/CommandLine.hs
|
bsd-3-clause
|
-- | A type-indexed map containing Hadrian command line arguments to be passed
-- to Shake via 'shakeExtra'.
cmdLineArgsMap :: IO (Map.HashMap TypeRep Dynamic)
cmdLineArgsMap = do
(opts, _, _) <- getOpt Permute optDescrs <$> getArgs
let args = foldl (flip id) defaultCommandLineArgs (rights opts)
return $ insertExtra (progressColour args) -- Accessed by Hadrian.Utilities
$ insertExtra (progressInfo args) -- Accessed by Hadrian.Utilities
$ insertExtra (buildRoot args) -- Accessed by Hadrian.Utilities
$ insertExtra (testArgs args) -- Accessed by Settings.Builders.RunTest
$ insertExtra args Map.empty
| 672 |
cmdLineArgsMap :: IO (Map.HashMap TypeRep Dynamic)
cmdLineArgsMap = do
(opts, _, _) <- getOpt Permute optDescrs <$> getArgs
let args = foldl (flip id) defaultCommandLineArgs (rights opts)
return $ insertExtra (progressColour args) -- Accessed by Hadrian.Utilities
$ insertExtra (progressInfo args) -- Accessed by Hadrian.Utilities
$ insertExtra (buildRoot args) -- Accessed by Hadrian.Utilities
$ insertExtra (testArgs args) -- Accessed by Settings.Builders.RunTest
$ insertExtra args Map.empty
| 563 |
cmdLineArgsMap = do
(opts, _, _) <- getOpt Permute optDescrs <$> getArgs
let args = foldl (flip id) defaultCommandLineArgs (rights opts)
return $ insertExtra (progressColour args) -- Accessed by Hadrian.Utilities
$ insertExtra (progressInfo args) -- Accessed by Hadrian.Utilities
$ insertExtra (buildRoot args) -- Accessed by Hadrian.Utilities
$ insertExtra (testArgs args) -- Accessed by Settings.Builders.RunTest
$ insertExtra args Map.empty
| 512 | true | true | 2 | 15 | 150 | 156 | 74 | 82 | null | null |
graninas/The-Amoeba-World
|
src/Amoeba/Application/Game/Engine/Core.hs
|
gpl-3.0
|
loopGS' s input w = do
(delta, s') <- stepSession s
(eitherResult, w') <- stepWire w delta input
loopGS' s' eitherResult w'
-- AI Player Wire loop
| 159 |
loopGS' s input w = do
(delta, s') <- stepSession s
(eitherResult, w') <- stepWire w delta input
loopGS' s' eitherResult w'
-- AI Player Wire loop
| 159 |
loopGS' s input w = do
(delta, s') <- stepSession s
(eitherResult, w') <- stepWire w delta input
loopGS' s' eitherResult w'
-- AI Player Wire loop
| 159 | false | false | 1 | 9 | 39 | 66 | 29 | 37 | null | null |
brendanhay/gogol
|
gogol-docs/gen/Network/Google/Docs/Types/Product.hs
|
mpl-2.0
|
-- | The title of the document.
dTitle :: Lens' Document (Maybe Text)
dTitle = lens _dTitle (\ s a -> s{_dTitle = a})
| 117 |
dTitle :: Lens' Document (Maybe Text)
dTitle = lens _dTitle (\ s a -> s{_dTitle = a})
| 85 |
dTitle = lens _dTitle (\ s a -> s{_dTitle = a})
| 47 | true | true | 0 | 9 | 23 | 46 | 25 | 21 | null | null |
evanrinehart/mikmod
|
Sound/MikMod.hs
|
lgpl-3.0
|
-- | Returns True if and only if sound output is enabled.
mikmodActive :: IO Bool
mikmodActive = decodeBool <$> c_MikMod_Active
| 127 |
mikmodActive :: IO Bool
mikmodActive = decodeBool <$> c_MikMod_Active
| 69 |
mikmodActive = decodeBool <$> c_MikMod_Active
| 45 | true | true | 0 | 5 | 20 | 19 | 10 | 9 | null | null |
rglew/cis194
|
src/Week2/Tests.hs
|
mit
|
test2_3_4 = TestCase $ True @=? wordFitsTemplate "let" ['x','x'] "let"
| 70 |
test2_3_4 = TestCase $ True @=? wordFitsTemplate "let" ['x','x'] "let"
| 70 |
test2_3_4 = TestCase $ True @=? wordFitsTemplate "let" ['x','x'] "let"
| 70 | false | false | 3 | 7 | 9 | 31 | 14 | 17 | null | null |
JPMoresmau/HJVM
|
test/Language/Java/JVM/APITest.hs
|
bsd-3-clause
|
testEnd :: Test
testEnd=TestLabel "testEnd" (TestCase (do
withJava' True "" (do
liftIO $ assertBool "true" True
return ()
)
))
| 190 |
testEnd :: Test
testEnd=TestLabel "testEnd" (TestCase (do
withJava' True "" (do
liftIO $ assertBool "true" True
return ()
)
))
| 190 |
testEnd=TestLabel "testEnd" (TestCase (do
withJava' True "" (do
liftIO $ assertBool "true" True
return ()
)
))
| 174 | false | true | 0 | 16 | 83 | 64 | 28 | 36 | null | null |
mattias-lundell/timber-llvm
|
src/Type2.hs
|
bsd-3-clause
|
unif eqs = internalError0 ("Type2.unif\n" ++ render (nest 4 (vpr eqs)))
| 94 |
unif eqs = internalError0 ("Type2.unif\n" ++ render (nest 4 (vpr eqs)))
| 94 |
unif eqs = internalError0 ("Type2.unif\n" ++ render (nest 4 (vpr eqs)))
| 94 | false | false | 0 | 12 | 33 | 36 | 17 | 19 | null | null |
silky/ImplicitCAD
|
Graphics/Implicit/ExtOpenScad/Eval/Statement.hs
|
gpl-2.0
|
runStatementI :: StatementI -> StateC ()
runStatementI (StatementI lineN (pat := expr)) = do
val <- evalExpr expr
let posMatch = matchPat pat val
case (getErrors val, posMatch) of
(Just err, _ ) -> errorC lineN err
(_, Just match) -> modifyVarLookup $ Map.union match
(_, Nothing ) -> errorC lineN "pattern match failed in assignment"
| 374 |
runStatementI :: StatementI -> StateC ()
runStatementI (StatementI lineN (pat := expr)) = do
val <- evalExpr expr
let posMatch = matchPat pat val
case (getErrors val, posMatch) of
(Just err, _ ) -> errorC lineN err
(_, Just match) -> modifyVarLookup $ Map.union match
(_, Nothing ) -> errorC lineN "pattern match failed in assignment"
| 373 |
runStatementI (StatementI lineN (pat := expr)) = do
val <- evalExpr expr
let posMatch = matchPat pat val
case (getErrors val, posMatch) of
(Just err, _ ) -> errorC lineN err
(_, Just match) -> modifyVarLookup $ Map.union match
(_, Nothing ) -> errorC lineN "pattern match failed in assignment"
| 332 | false | true | 0 | 12 | 95 | 143 | 69 | 74 | null | null |
sdiehl/ghc
|
compiler/simplCore/SimplEnv.hs
|
bsd-3-clause
|
mkFloatBind :: SimplEnv -> OutBind -> (SimplFloats, SimplEnv)
-- Make a singleton SimplFloats, and
-- extend the incoming SimplEnv's in-scope set with its binders
-- These binders may already be in the in-scope set,
-- but may have by now been augmented with more IdInfo
mkFloatBind env bind
= (floats, env { seInScope = in_scope' })
where
floats
| isJoinBind bind
= SimplFloats { sfLetFloats = emptyLetFloats
, sfJoinFloats = unitJoinFloat bind
, sfInScope = in_scope' }
| otherwise
= SimplFloats { sfLetFloats = unitLetFloat bind
, sfJoinFloats = emptyJoinFloats
, sfInScope = in_scope' }
in_scope' = seInScope env `extendInScopeSetBind` bind
| 769 |
mkFloatBind :: SimplEnv -> OutBind -> (SimplFloats, SimplEnv)
mkFloatBind env bind
= (floats, env { seInScope = in_scope' })
where
floats
| isJoinBind bind
= SimplFloats { sfLetFloats = emptyLetFloats
, sfJoinFloats = unitJoinFloat bind
, sfInScope = in_scope' }
| otherwise
= SimplFloats { sfLetFloats = unitLetFloat bind
, sfJoinFloats = emptyJoinFloats
, sfInScope = in_scope' }
in_scope' = seInScope env `extendInScopeSetBind` bind
| 560 |
mkFloatBind env bind
= (floats, env { seInScope = in_scope' })
where
floats
| isJoinBind bind
= SimplFloats { sfLetFloats = emptyLetFloats
, sfJoinFloats = unitJoinFloat bind
, sfInScope = in_scope' }
| otherwise
= SimplFloats { sfLetFloats = unitLetFloat bind
, sfJoinFloats = emptyJoinFloats
, sfInScope = in_scope' }
in_scope' = seInScope env `extendInScopeSetBind` bind
| 498 | true | true | 1 | 10 | 225 | 135 | 76 | 59 | null | null |
nettok/culebra-hs
|
src/Game.hs
|
gpl-3.0
|
go pos Down = pos { posY = posY pos + 1 }
| 42 |
go pos Down = pos { posY = posY pos + 1 }
| 42 |
go pos Down = pos { posY = posY pos + 1 }
| 42 | false | false | 0 | 8 | 13 | 26 | 13 | 13 | null | null |
brendanhay/gogol
|
gogol-games/gen/Network/Google/Games/Types/Product.hs
|
mpl-2.0
|
-- | The base URL for the image that represents the player.
pAvatarImageURL :: Lens' Player (Maybe Text)
pAvatarImageURL
= lens _pAvatarImageURL
(\ s a -> s{_pAvatarImageURL = a})
| 187 |
pAvatarImageURL :: Lens' Player (Maybe Text)
pAvatarImageURL
= lens _pAvatarImageURL
(\ s a -> s{_pAvatarImageURL = a})
| 127 |
pAvatarImageURL
= lens _pAvatarImageURL
(\ s a -> s{_pAvatarImageURL = a})
| 82 | true | true | 0 | 9 | 36 | 48 | 25 | 23 | null | null |
rawlep/EQS
|
sourceCode/Prices.hs
|
mit
|
mkDate dd mm yyyy =
LocalTime (fromGregorian (fromIntegral yyyy) mm dd) midnight
| 84 |
mkDate dd mm yyyy =
LocalTime (fromGregorian (fromIntegral yyyy) mm dd) midnight
| 84 |
mkDate dd mm yyyy =
LocalTime (fromGregorian (fromIntegral yyyy) mm dd) midnight
| 84 | false | false | 1 | 9 | 15 | 40 | 16 | 24 | null | null |
jhp/sneathlane-haste
|
SneathLane/Widget.hs
|
bsd-2-clause
|
jsRemoveHref :: Elem -> IO ()
jsRemoveHref = ffi "(function(elem) { elem.removeAttribute('href'); })"
| 101 |
jsRemoveHref :: Elem -> IO ()
jsRemoveHref = ffi "(function(elem) { elem.removeAttribute('href'); })"
| 101 |
jsRemoveHref = ffi "(function(elem) { elem.removeAttribute('href'); })"
| 71 | false | true | 0 | 7 | 12 | 23 | 11 | 12 | null | null |
massysett/penny
|
penny/lib/Penny/Copper/Grammar.hs
|
bsd-3-clause
|
rPostingFields = record "PostingFields" [postingField, rPostingFieldP'Star]
| 75 |
rPostingFields = record "PostingFields" [postingField, rPostingFieldP'Star]
| 75 |
rPostingFields = record "PostingFields" [postingField, rPostingFieldP'Star]
| 75 | false | false | 0 | 6 | 5 | 17 | 9 | 8 | null | null |
alexlegg/wl-pprint
|
Text/PrettyPrint/Leijen.hs
|
bsd-2-clause
|
-- | The document @space@ contains a single space, \" \".
--
-- > x <+> y = x <> space <> y
space :: Doc
space = char ' '
| 133 |
space :: Doc
space = char ' '
| 39 |
space = char ' '
| 26 | true | true | 0 | 5 | 42 | 17 | 10 | 7 | null | null |
evansb/jasper
|
src/Language/Java/Parser/Core.hs
|
mit
|
-- | Stores valid keywords for field modifier.
fieldModifierTable :: S.HashSet String
fieldModifierTable = S.fromList
["public", "protected", "private", "static", "final", "transient",
"volatile"]
| 205 |
fieldModifierTable :: S.HashSet String
fieldModifierTable = S.fromList
["public", "protected", "private", "static", "final", "transient",
"volatile"]
| 158 |
fieldModifierTable = S.fromList
["public", "protected", "private", "static", "final", "transient",
"volatile"]
| 119 | true | true | 0 | 6 | 30 | 43 | 25 | 18 | null | null |
sdiehl/ghc
|
compiler/ghci/ByteCodeGen.hs
|
bsd-3-clause
|
bcView _ = Nothing
| 46 |
bcView _ = Nothing
| 46 |
bcView _ = Nothing
| 46 | false | false | 0 | 4 | 31 | 10 | 4 | 6 | null | null |
frerich/pandoc
|
src/Text/Pandoc/Writers/LaTeX.hs
|
gpl-2.0
|
blockToLaTeX (OrderedList _ []) = return empty
| 46 |
blockToLaTeX (OrderedList _ []) = return empty
| 46 |
blockToLaTeX (OrderedList _ []) = return empty
| 46 | false | false | 0 | 8 | 6 | 22 | 10 | 12 | null | null |
fmthoma/ghc
|
compiler/utils/Pretty.hs
|
bsd-3-clause
|
sep1 _ _ _ _ = panic "sep1: Unhandled case"
| 62 |
sep1 _ _ _ _ = panic "sep1: Unhandled case"
| 62 |
sep1 _ _ _ _ = panic "sep1: Unhandled case"
| 62 | false | false | 0 | 5 | 28 | 18 | 8 | 10 | null | null |
Cahu/krpc-hs
|
src/KRPCHS/SpaceCenter.hs
|
gpl-3.0
|
getContractFundsCompletionStream :: KRPCHS.SpaceCenter.Contract -> RPCContext (KRPCStream (Double))
getContractFundsCompletionStream thisArg = requestStream $ getContractFundsCompletionStreamReq thisArg
| 202 |
getContractFundsCompletionStream :: KRPCHS.SpaceCenter.Contract -> RPCContext (KRPCStream (Double))
getContractFundsCompletionStream thisArg = requestStream $ getContractFundsCompletionStreamReq thisArg
| 202 |
getContractFundsCompletionStream thisArg = requestStream $ getContractFundsCompletionStreamReq thisArg
| 102 | false | true | 0 | 9 | 13 | 43 | 21 | 22 | null | null |
alphalambda/codeworld
|
codeworld-api/src/CodeWorld/App.hs
|
apache-2.0
|
multiEventRule :: (Int -> Event -> state -> state) -> Rule state
multiEventRule = EventRule
| 91 |
multiEventRule :: (Int -> Event -> state -> state) -> Rule state
multiEventRule = EventRule
| 91 |
multiEventRule = EventRule
| 26 | false | true | 0 | 10 | 14 | 39 | 18 | 21 | null | null |
DavidAlphaFox/ghc
|
libraries/containers/Data/Map/Base.hs
|
bsd-3-clause
|
-- | /O(n)/. The function 'mapAccumWithKey' threads an accumulating
-- argument through the map in ascending order of keys.
--
-- > let f a k b = (a ++ " " ++ (show k) ++ "-" ++ b, b ++ "X")
-- > mapAccumWithKey f "Everything:" (fromList [(5,"a"), (3,"b")]) == ("Everything: 3-b 5-a", fromList [(3, "bX"), (5, "aX")])
mapAccumWithKey :: (a -> k -> b -> (a,c)) -> a -> Map k b -> (a,Map k c)
mapAccumWithKey f a t
= mapAccumL f a t
| 433 |
mapAccumWithKey :: (a -> k -> b -> (a,c)) -> a -> Map k b -> (a,Map k c)
mapAccumWithKey f a t
= mapAccumL f a t
| 114 |
mapAccumWithKey f a t
= mapAccumL f a t
| 41 | true | true | 0 | 11 | 89 | 87 | 44 | 43 | null | null |
xu-hao/QueryArrow
|
QueryArrow-ffi-genquery/src/QueryArrow/FFI/GenQuery/Parser.hs
|
bsd-3-clause
|
braces :: GenQueryParser a -> GenQueryParser a
braces = T.braces lexer
| 70 |
braces :: GenQueryParser a -> GenQueryParser a
braces = T.braces lexer
| 70 |
braces = T.braces lexer
| 23 | false | true | 0 | 7 | 10 | 31 | 13 | 18 | null | null |
lueck/standoff-tools
|
src/StandOff/TagSerializer.hs
|
gpl-3.0
|
serializeNsTag slizeAttrs prefix Empty a =
"<" ++ prefix ++ ":" ++ (snd qName)
++ " xmlns:" ++ prefix ++ "=\"" ++ (fst qName) ++ "\""
++ slizeAttrs a
++ "/>"
where qName = splitNamespaceName $ rangeType a
| 214 |
serializeNsTag slizeAttrs prefix Empty a =
"<" ++ prefix ++ ":" ++ (snd qName)
++ " xmlns:" ++ prefix ++ "=\"" ++ (fst qName) ++ "\""
++ slizeAttrs a
++ "/>"
where qName = splitNamespaceName $ rangeType a
| 214 |
serializeNsTag slizeAttrs prefix Empty a =
"<" ++ prefix ++ ":" ++ (snd qName)
++ " xmlns:" ++ prefix ++ "=\"" ++ (fst qName) ++ "\""
++ slizeAttrs a
++ "/>"
where qName = splitNamespaceName $ rangeType a
| 214 | false | false | 6 | 8 | 47 | 88 | 41 | 47 | null | null |
coghex/abridgefaraway
|
src/ABFA/Map.hs
|
bsd-3-clause
|
zoneCardinals :: Int -> Int -> [a] -> [a] -> [a] -> [a] -> [a] -> ([a], [a], [a], [a])
zoneCardinals zonew zoneh nb sb eb wb x = (nx, sx, ex, wx)
where nx = nb ++ (drop zonew x)
sx = (take ((zoneh-1)*zonew) x) ++ sb
ex = replaceEveryE zonew eb x
wx = replaceEveryWG zonew wb x
-- these helper functions are for the cardinal functions
| 365 |
zoneCardinals :: Int -> Int -> [a] -> [a] -> [a] -> [a] -> [a] -> ([a], [a], [a], [a])
zoneCardinals zonew zoneh nb sb eb wb x = (nx, sx, ex, wx)
where nx = nb ++ (drop zonew x)
sx = (take ((zoneh-1)*zonew) x) ++ sb
ex = replaceEveryE zonew eb x
wx = replaceEveryWG zonew wb x
-- these helper functions are for the cardinal functions
| 365 |
zoneCardinals zonew zoneh nb sb eb wb x = (nx, sx, ex, wx)
where nx = nb ++ (drop zonew x)
sx = (take ((zoneh-1)*zonew) x) ++ sb
ex = replaceEveryE zonew eb x
wx = replaceEveryWG zonew wb x
-- these helper functions are for the cardinal functions
| 278 | false | true | 5 | 15 | 100 | 195 | 102 | 93 | null | null |
eigengrau/hlint
|
data/Test.hs
|
bsd-3-clause
|
error = Prelude.readFile ==> bad
| 32 |
error = Prelude.readFile ==> bad
| 32 |
error = Prelude.readFile ==> bad
| 32 | false | false | 0 | 6 | 4 | 12 | 6 | 6 | null | null |
erantapaa/rakhana
|
Data/Rakhana/XRef.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
decodeByteString :: MonadError XRefException m
=> Maybe Filter
-> L.ByteString
-> m L.ByteString
decodeByteString (Just filt) bs
= case filt of
FlateDecode -> zlibDecompress bs
Filter_Unsupported x -> throwError $ UnsupportedFilter x
| 400 |
decodeByteString :: MonadError XRefException m
=> Maybe Filter
-> L.ByteString
-> m L.ByteString
decodeByteString (Just filt) bs
= case filt of
FlateDecode -> zlibDecompress bs
Filter_Unsupported x -> throwError $ UnsupportedFilter x
| 319 |
decodeByteString (Just filt) bs
= case filt of
FlateDecode -> zlibDecompress bs
Filter_Unsupported x -> throwError $ UnsupportedFilter x
| 171 | true | true | 0 | 11 | 118 | 83 | 38 | 45 | null | null |
intolerable/GroupProject
|
src/Emulator/Interpreter/THUMB.hs
|
bsd-2-clause
|
pushToStack :: IsSystem s m => RegisterName -> m ()
pushToStack r = do
currentStackPointer <- use (registers.sp)
registerValue <- use (registers.rn r)
writeAddressWord currentStackPointer registerValue
registers.sp -= 4
| 227 |
pushToStack :: IsSystem s m => RegisterName -> m ()
pushToStack r = do
currentStackPointer <- use (registers.sp)
registerValue <- use (registers.rn r)
writeAddressWord currentStackPointer registerValue
registers.sp -= 4
| 227 |
pushToStack r = do
currentStackPointer <- use (registers.sp)
registerValue <- use (registers.rn r)
writeAddressWord currentStackPointer registerValue
registers.sp -= 4
| 175 | false | true | 0 | 11 | 36 | 82 | 37 | 45 | null | null |
alexander-b/clac
|
src/Clac/CLI/REPL.hs
|
gpl-3.0
|
inlet :: Eq a => a -> [b] -> [(a, [b])] -> [(a, [b])]
-- | Insert a let into the given stack of lets. If the variable is already
-- bound, update it by 'unlet'ing it first, and then let it.
--
-- > #let a = 1 -- stack is [("a","1")], i.e. a bound to 1
-- > #let a = 2 -- stack is [("a","2")]
-- > #let b = a 1 + -- stack is [("a","2"), ("b","3")]
inlet k ns ls = case lookup k ls of
Just _ -> (k, ns) : unlet k ls
Nothing -> (k, ns) : ls
| 478 |
inlet :: Eq a => a -> [b] -> [(a, [b])] -> [(a, [b])]
inlet k ns ls = case lookup k ls of
Just _ -> (k, ns) : unlet k ls
Nothing -> (k, ns) : ls
| 177 |
inlet k ns ls = case lookup k ls of
Just _ -> (k, ns) : unlet k ls
Nothing -> (k, ns) : ls
| 123 | true | true | 0 | 11 | 146 | 119 | 67 | 52 | null | null |
olsner/ghc
|
compiler/simplCore/CSE.hs
|
bsd-3-clause
|
addBinder :: CSEnv -> Var -> (CSEnv, Var)
addBinder cse v = (cse { cs_subst = sub' }, v')
where
(sub', v') = substBndr (cs_subst cse) v
| 169 |
addBinder :: CSEnv -> Var -> (CSEnv, Var)
addBinder cse v = (cse { cs_subst = sub' }, v')
where
(sub', v') = substBndr (cs_subst cse) v
| 169 |
addBinder cse v = (cse { cs_subst = sub' }, v')
where
(sub', v') = substBndr (cs_subst cse) v
| 127 | false | true | 0 | 9 | 60 | 69 | 38 | 31 | null | null |
kajigor/uKanren_transformations
|
test/auto/Test/Embed.hs
|
bsd-3-clause
|
c = C ""
| 8 |
c = C ""
| 8 |
c = C ""
| 8 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
AlexanderPankiv/ghc
|
compiler/deSugar/Coverage.hs
|
bsd-3-clause
|
mkBinTickBoxHpc :: (Bool -> BoxLabel) -> SrcSpan -> LHsExpr Id
-> TM (LHsExpr Id)
mkBinTickBoxHpc boxLabel pos e =
TM $ \ env st ->
let meT = (pos,declPath env, [],boxLabel True)
meF = (pos,declPath env, [],boxLabel False)
meE = (pos,declPath env, [],ExpBox False)
c = tickBoxCount st
mes = mixEntries st
in
( L pos $ HsTick (HpcTick (this_mod env) c) $ L pos $ HsBinTick (c+1) (c+2) e
-- notice that F and T are reversed,
-- because we are building the list in
-- reverse...
, noFVs
, st {tickBoxCount=c+3 , mixEntries=meF:meT:meE:mes}
)
| 668 |
mkBinTickBoxHpc :: (Bool -> BoxLabel) -> SrcSpan -> LHsExpr Id
-> TM (LHsExpr Id)
mkBinTickBoxHpc boxLabel pos e =
TM $ \ env st ->
let meT = (pos,declPath env, [],boxLabel True)
meF = (pos,declPath env, [],boxLabel False)
meE = (pos,declPath env, [],ExpBox False)
c = tickBoxCount st
mes = mixEntries st
in
( L pos $ HsTick (HpcTick (this_mod env) c) $ L pos $ HsBinTick (c+1) (c+2) e
-- notice that F and T are reversed,
-- because we are building the list in
-- reverse...
, noFVs
, st {tickBoxCount=c+3 , mixEntries=meF:meT:meE:mes}
)
| 668 |
mkBinTickBoxHpc boxLabel pos e =
TM $ \ env st ->
let meT = (pos,declPath env, [],boxLabel True)
meF = (pos,declPath env, [],boxLabel False)
meE = (pos,declPath env, [],ExpBox False)
c = tickBoxCount st
mes = mixEntries st
in
( L pos $ HsTick (HpcTick (this_mod env) c) $ L pos $ HsBinTick (c+1) (c+2) e
-- notice that F and T are reversed,
-- because we are building the list in
-- reverse...
, noFVs
, st {tickBoxCount=c+3 , mixEntries=meF:meT:meE:mes}
)
| 570 | false | true | 2 | 17 | 225 | 261 | 136 | 125 | null | null |
LukaHorvat/Halt
|
src/Halt/Parsing/Indent.hs
|
mit
|
singleOrBlock :: Parser a -> Parser [a]
singleOrBlock p = (char '\n' *> block) <|> (return <$> p)
where block = indented $ catMaybes <$> many1 line
line = try (Just <$> withIndent p) <|> try (Nothing <$ (many (oneOf " \t") >> char '\n'))
| 252 |
singleOrBlock :: Parser a -> Parser [a]
singleOrBlock p = (char '\n' *> block) <|> (return <$> p)
where block = indented $ catMaybes <$> many1 line
line = try (Just <$> withIndent p) <|> try (Nothing <$ (many (oneOf " \t") >> char '\n'))
| 252 |
singleOrBlock p = (char '\n' *> block) <|> (return <$> p)
where block = indented $ catMaybes <$> many1 line
line = try (Just <$> withIndent p) <|> try (Nothing <$ (many (oneOf " \t") >> char '\n'))
| 212 | false | true | 2 | 13 | 59 | 128 | 59 | 69 | null | null |
thielema/gitit
|
Network/Gitit/Layout.hs
|
gpl-2.0
|
defaultRenderPage :: T.StringTemplate String -> PageLayout -> Html -> Handler
defaultRenderPage templ layout htmlContents = do
cfg <- getConfig
base' <- getWikiBase
ok . setContentType "text/html; charset=utf-8" . toResponse . T.render .
filledPageTemplate base' cfg layout htmlContents $ templ
-- | Returns a page template with gitit variables filled in.
| 369 |
defaultRenderPage :: T.StringTemplate String -> PageLayout -> Html -> Handler
defaultRenderPage templ layout htmlContents = do
cfg <- getConfig
base' <- getWikiBase
ok . setContentType "text/html; charset=utf-8" . toResponse . T.render .
filledPageTemplate base' cfg layout htmlContents $ templ
-- | Returns a page template with gitit variables filled in.
| 369 |
defaultRenderPage templ layout htmlContents = do
cfg <- getConfig
base' <- getWikiBase
ok . setContentType "text/html; charset=utf-8" . toResponse . T.render .
filledPageTemplate base' cfg layout htmlContents $ templ
-- | Returns a page template with gitit variables filled in.
| 291 | false | true | 0 | 12 | 63 | 87 | 41 | 46 | null | null |
reactormonk/hoauth2
|
example/Github/test.hs
|
bsd-3-clause
|
sToBS :: String -> BS.ByteString
sToBS = T.encodeUtf8 . T.pack
| 62 |
sToBS :: String -> BS.ByteString
sToBS = T.encodeUtf8 . T.pack
| 62 |
sToBS = T.encodeUtf8 . T.pack
| 29 | false | true | 0 | 8 | 9 | 32 | 14 | 18 | null | null |
beni55/http-types
|
Network/HTTP/Types/Status.hs
|
bsd-3-clause
|
-- | See Other 303
status303 :: Status
status303 = mkStatus 303 "See Other"
| 75 |
status303 :: Status
status303 = mkStatus 303 "See Other"
| 56 |
status303 = mkStatus 303 "See Other"
| 36 | true | true | 0 | 5 | 13 | 17 | 9 | 8 | null | null |
tittoassini/typed
|
src/ZM/AsValue.hs
|
bsd-3-clause
|
unWord7 :: MostSignificantFirst Word7 -> Word8
unWord7 (MostSignificantFirst (Word7 n)) = n
| 91 |
unWord7 :: MostSignificantFirst Word7 -> Word8
unWord7 (MostSignificantFirst (Word7 n)) = n
| 91 |
unWord7 (MostSignificantFirst (Word7 n)) = n
| 44 | false | true | 0 | 11 | 11 | 39 | 17 | 22 | null | null |
serokell/log-warper
|
src/System/Wlog/CanLog.hs
|
mit
|
logInfo = logMessage Info
| 28 |
logInfo = logMessage Info
| 28 |
logInfo = logMessage Info
| 28 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
jdavidberger/project-euler
|
prob99.hs
|
lgpl-3.0
|
prob99 input = show (maximum values )
where
exp [a,b] = a^b
mylines = lines input
mynumbers = map ((map toint).split ",") mylines
values = map exp mynumbers
| 184 |
prob99 input = show (maximum values )
where
exp [a,b] = a^b
mylines = lines input
mynumbers = map ((map toint).split ",") mylines
values = map exp mynumbers
| 184 |
prob99 input = show (maximum values )
where
exp [a,b] = a^b
mylines = lines input
mynumbers = map ((map toint).split ",") mylines
values = map exp mynumbers
| 184 | false | false | 6 | 10 | 55 | 99 | 40 | 59 | null | null |
Heather/hackport
|
Portage/Resolve.hs
|
gpl-3.0
|
resolveCategories :: Overlay.Overlay -> Cabal.PackageName -> [Portage.Category]
resolveCategories overlay pn =
[ cat
| (Portage.PackageName cat pn') <- Map.keys om
, Portage.normalizeCabalPackageName pn == pn'
]
where
om = Overlay.overlayMap overlay
| 264 |
resolveCategories :: Overlay.Overlay -> Cabal.PackageName -> [Portage.Category]
resolveCategories overlay pn =
[ cat
| (Portage.PackageName cat pn') <- Map.keys om
, Portage.normalizeCabalPackageName pn == pn'
]
where
om = Overlay.overlayMap overlay
| 264 |
resolveCategories overlay pn =
[ cat
| (Portage.PackageName cat pn') <- Map.keys om
, Portage.normalizeCabalPackageName pn == pn'
]
where
om = Overlay.overlayMap overlay
| 184 | false | true | 0 | 10 | 45 | 85 | 42 | 43 | null | null |
Cahu/krpc-hs
|
src/KRPCHS/UI.hs
|
gpl-3.0
|
setRectTransformAnchorMin :: KRPCHS.UI.RectTransform -> (Double, Double) -> RPCContext ()
setRectTransformAnchorMin thisArg valueArg = do
let r = makeRequest "UI" "RectTransform_set_AnchorMin" [makeArgument 0 thisArg, makeArgument 1 valueArg]
res <- sendRequest r
processResponse res
{-
- Position of the rectangles pivot point relative to the anchors.
-}
| 371 |
setRectTransformAnchorMin :: KRPCHS.UI.RectTransform -> (Double, Double) -> RPCContext ()
setRectTransformAnchorMin thisArg valueArg = do
let r = makeRequest "UI" "RectTransform_set_AnchorMin" [makeArgument 0 thisArg, makeArgument 1 valueArg]
res <- sendRequest r
processResponse res
{-
- Position of the rectangles pivot point relative to the anchors.
-}
| 371 |
setRectTransformAnchorMin thisArg valueArg = do
let r = makeRequest "UI" "RectTransform_set_AnchorMin" [makeArgument 0 thisArg, makeArgument 1 valueArg]
res <- sendRequest r
processResponse res
{-
- Position of the rectangles pivot point relative to the anchors.
-}
| 281 | false | true | 0 | 13 | 60 | 92 | 43 | 49 | null | null |
erithion/duo-memo
|
ParserTest.hs
|
mit
|
checkParser dict =
case (parse Parser.file "" (render $ dictDoc dict)) of
Left _ -> False
Right a -> True --dict == a
where types = dict :: [Row]
| 162 |
checkParser dict =
case (parse Parser.file "" (render $ dictDoc dict)) of
Left _ -> False
Right a -> True --dict == a
where types = dict :: [Row]
| 162 |
checkParser dict =
case (parse Parser.file "" (render $ dictDoc dict)) of
Left _ -> False
Right a -> True --dict == a
where types = dict :: [Row]
| 162 | false | false | 0 | 10 | 45 | 68 | 34 | 34 | null | null |
hvr/vector
|
Data/Vector/Fusion/Bundle/Monadic.hs
|
bsd-3-clause
|
foldl1' f = foldl1M' (\a b -> return (f a b))
| 45 |
foldl1' f = foldl1M' (\a b -> return (f a b))
| 45 |
foldl1' f = foldl1M' (\a b -> return (f a b))
| 45 | false | false | 0 | 10 | 10 | 33 | 16 | 17 | null | null |
imalsogreg/flycap
|
tests/videoTest.hs
|
bsd-3-clause
|
display :: TextureObject -> IO()
display tex = do
clear [ColorBuffer]
loadIdentity
textureBinding Texture2D $= Just tex
scale (1) (-1) (0 :: GLfloat)
renderPrimitive Quads $ do -- render/draw the image
texCoord (TexCoord2 0 (1::GLfloat))
vertex (Vertex3 (-1) 1 (0::GLfloat))
texCoord (TexCoord2 1 (1::GLfloat))
vertex (Vertex3 1 1 (0::GLfloat))
texCoord (TexCoord2 1 (0::GLfloat))
vertex (Vertex3 (1) (-1) (0::GLfloat))
texCoord (TexCoord2 0 (0::GLfloat))
vertex (Vertex3 (-1) (-1) (0::GLfloat))
flush
--loadTex :: JP.Image JPTypes.PixelRGB8 -> IO TextureObject (old system)
| 619 |
display :: TextureObject -> IO()
display tex = do
clear [ColorBuffer]
loadIdentity
textureBinding Texture2D $= Just tex
scale (1) (-1) (0 :: GLfloat)
renderPrimitive Quads $ do -- render/draw the image
texCoord (TexCoord2 0 (1::GLfloat))
vertex (Vertex3 (-1) 1 (0::GLfloat))
texCoord (TexCoord2 1 (1::GLfloat))
vertex (Vertex3 1 1 (0::GLfloat))
texCoord (TexCoord2 1 (0::GLfloat))
vertex (Vertex3 (1) (-1) (0::GLfloat))
texCoord (TexCoord2 0 (0::GLfloat))
vertex (Vertex3 (-1) (-1) (0::GLfloat))
flush
--loadTex :: JP.Image JPTypes.PixelRGB8 -> IO TextureObject (old system)
| 619 |
display tex = do
clear [ColorBuffer]
loadIdentity
textureBinding Texture2D $= Just tex
scale (1) (-1) (0 :: GLfloat)
renderPrimitive Quads $ do -- render/draw the image
texCoord (TexCoord2 0 (1::GLfloat))
vertex (Vertex3 (-1) 1 (0::GLfloat))
texCoord (TexCoord2 1 (1::GLfloat))
vertex (Vertex3 1 1 (0::GLfloat))
texCoord (TexCoord2 1 (0::GLfloat))
vertex (Vertex3 (1) (-1) (0::GLfloat))
texCoord (TexCoord2 0 (0::GLfloat))
vertex (Vertex3 (-1) (-1) (0::GLfloat))
flush
--loadTex :: JP.Image JPTypes.PixelRGB8 -> IO TextureObject (old system)
| 586 | false | true | 0 | 14 | 121 | 278 | 139 | 139 | null | null |
Bolt64/my_code
|
haskell/myprecious/Prettify.hs
|
mit
|
string :: String -> Doc
string str = undefined
| 46 |
string :: String -> Doc
string str = undefined
| 46 |
string str = undefined
| 22 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
mookerji/libsbp
|
haskell/test/Test/SwiftNav/SBP/Logging.hs
|
lgpl-3.0
|
testParse :: TestTree
testParse =
testGroup "Package tests"
[ testCase "Parsing tests" $ do
let filepath = "../spec/tests/yaml/swiftnav/sbp/test_logging.yaml"
moduleName = "sbp.logging"
val <- assertPackage filepath moduleName
assertBool "Fail" val
]
| 296 |
testParse :: TestTree
testParse =
testGroup "Package tests"
[ testCase "Parsing tests" $ do
let filepath = "../spec/tests/yaml/swiftnav/sbp/test_logging.yaml"
moduleName = "sbp.logging"
val <- assertPackage filepath moduleName
assertBool "Fail" val
]
| 296 |
testParse =
testGroup "Package tests"
[ testCase "Parsing tests" $ do
let filepath = "../spec/tests/yaml/swiftnav/sbp/test_logging.yaml"
moduleName = "sbp.logging"
val <- assertPackage filepath moduleName
assertBool "Fail" val
]
| 274 | false | true | 0 | 11 | 75 | 61 | 28 | 33 | null | null |
rubik/stack-hpc-coveralls
|
app/Main.hs
|
isc
|
main :: IO ()
main = do
args <- parseArgsOrExit patterns =<< getArgs
stackGood <- checkStackVersion
unless stackGood $ do
putStrLn "Error: at least Stack 0.1.7 is required"
exitFailure
conf <- getConfig args
coverallsJson <- generateCoverallsFromTix conf
if args `isPresent` longOption "dont-send"
then BSL.putStr $ encode coverallsJson
else do
response <- sendData conf urlApiV1 coverallsJson
case response of
PostSuccess u -> do
let apiUrl = u ++ ".json"
putStrLn $ "Job URL: " ++ apiUrl
when (fetchCoverage conf) $ do
-- wait 5 seconds until the page is available
threadDelay $ 5 * 1000 * 1000
coverageResult <- readCoverageResult apiUrl
case coverageResult of
Just totalCov -> putStrLn $ "Coverage: " ++ show totalCov
Nothing -> putStrLn "Failed to read total coverage"
PostFailure msg -> do
putStrLn $ "Error: " ++ msg
exitFailure
| 1,158 |
main :: IO ()
main = do
args <- parseArgsOrExit patterns =<< getArgs
stackGood <- checkStackVersion
unless stackGood $ do
putStrLn "Error: at least Stack 0.1.7 is required"
exitFailure
conf <- getConfig args
coverallsJson <- generateCoverallsFromTix conf
if args `isPresent` longOption "dont-send"
then BSL.putStr $ encode coverallsJson
else do
response <- sendData conf urlApiV1 coverallsJson
case response of
PostSuccess u -> do
let apiUrl = u ++ ".json"
putStrLn $ "Job URL: " ++ apiUrl
when (fetchCoverage conf) $ do
-- wait 5 seconds until the page is available
threadDelay $ 5 * 1000 * 1000
coverageResult <- readCoverageResult apiUrl
case coverageResult of
Just totalCov -> putStrLn $ "Coverage: " ++ show totalCov
Nothing -> putStrLn "Failed to read total coverage"
PostFailure msg -> do
putStrLn $ "Error: " ++ msg
exitFailure
| 1,158 |
main = do
args <- parseArgsOrExit patterns =<< getArgs
stackGood <- checkStackVersion
unless stackGood $ do
putStrLn "Error: at least Stack 0.1.7 is required"
exitFailure
conf <- getConfig args
coverallsJson <- generateCoverallsFromTix conf
if args `isPresent` longOption "dont-send"
then BSL.putStr $ encode coverallsJson
else do
response <- sendData conf urlApiV1 coverallsJson
case response of
PostSuccess u -> do
let apiUrl = u ++ ".json"
putStrLn $ "Job URL: " ++ apiUrl
when (fetchCoverage conf) $ do
-- wait 5 seconds until the page is available
threadDelay $ 5 * 1000 * 1000
coverageResult <- readCoverageResult apiUrl
case coverageResult of
Just totalCov -> putStrLn $ "Coverage: " ++ show totalCov
Nothing -> putStrLn "Failed to read total coverage"
PostFailure msg -> do
putStrLn $ "Error: " ++ msg
exitFailure
| 1,144 | false | true | 0 | 22 | 454 | 260 | 116 | 144 | null | null |
mmarx/jebediah
|
src/Jebediah/Counterpoint.hs
|
gpl-3.0
|
parallel :: (Note, Note) -> (Note, Note) -> Bool
parallel (prev, prev') (d, c) = interval prev d == interval prev' c
| 116 |
parallel :: (Note, Note) -> (Note, Note) -> Bool
parallel (prev, prev') (d, c) = interval prev d == interval prev' c
| 116 |
parallel (prev, prev') (d, c) = interval prev d == interval prev' c
| 67 | false | true | 0 | 9 | 21 | 67 | 35 | 32 | null | null |
dosenfrucht/mcasm
|
src/Main.hs
|
gpl-2.0
|
printHex :: [Word8] -> IO ()
printHex [] = return ()
| 56 |
printHex :: [Word8] -> IO ()
printHex [] = return ()
| 56 |
printHex [] = return ()
| 27 | false | true | 0 | 8 | 14 | 37 | 17 | 20 | null | null |
rueshyna/gogol
|
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
|
mpl-2.0
|
-- | The maximum number of results to return in a single page. If
-- unspecified, defaults to 1024.
scsrPageSize :: Lens' SearchCallSetsRequest (Maybe Int32)
scsrPageSize
= lens _scsrPageSize (\ s a -> s{_scsrPageSize = a})
. mapping _Coerce
| 249 |
scsrPageSize :: Lens' SearchCallSetsRequest (Maybe Int32)
scsrPageSize
= lens _scsrPageSize (\ s a -> s{_scsrPageSize = a})
. mapping _Coerce
| 149 |
scsrPageSize
= lens _scsrPageSize (\ s a -> s{_scsrPageSize = a})
. mapping _Coerce
| 91 | true | true | 0 | 10 | 46 | 56 | 29 | 27 | null | null |
conal/reification-rules
|
src/ReificationRules/MonoPrims.hs
|
bsd-3-clause
|
dDivide = DivideP :: Prim (Binop Double)
| 41 |
dDivide = DivideP :: Prim (Binop Double)
| 41 |
dDivide = DivideP :: Prim (Binop Double)
| 41 | false | false | 0 | 7 | 7 | 18 | 9 | 9 | null | null |
choener/bimaps
|
lib/Data/Bijection/Class.hs
|
bsd-3-clause
|
contR :: Bimap l r -> r
contR (Bimap l r) = r
| 45 |
contR :: Bimap l r -> r
contR (Bimap l r) = r
| 45 |
contR (Bimap l r) = r
| 21 | false | true | 0 | 7 | 12 | 31 | 15 | 16 | null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\xF933' = "\x76E7"
| 33 |
decomposeChar '\xF933' = "\x76E7"
| 33 |
decomposeChar '\xF933' = "\x76E7"
| 33 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
abakst/liquidhaskell
|
tests/todo/txrec0.hs
|
bsd-3-clause
|
filter'' b' (x:xs) = case compare b' x of
GT -> x : filter'' b' xs
LT -> x:xs
EQ -> xs
-- {- filter' :: (Ord a) => a -> OList a -> OList a @-}
| 216 |
filter'' b' (x:xs) = case compare b' x of
GT -> x : filter'' b' xs
LT -> x:xs
EQ -> xs
-- {- filter' :: (Ord a) => a -> OList a -> OList a @-}
| 216 |
filter'' b' (x:xs) = case compare b' x of
GT -> x : filter'' b' xs
LT -> x:xs
EQ -> xs
-- {- filter' :: (Ord a) => a -> OList a -> OList a @-}
| 216 | false | false | 0 | 9 | 110 | 59 | 29 | 30 | null | null |
sdiehl/ghc
|
testsuite/tests/pmcheck/should_compile/T11195.hs
|
bsd-3-clause
|
etaTyConAppCo_maybe = undefined
| 31 |
etaTyConAppCo_maybe = undefined
| 31 |
etaTyConAppCo_maybe = undefined
| 31 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
edgarklerks/dotfiles
|
.xmonad/xmonad.hs
|
bsd-2-clause
|
-- Search function
--
mySearchEngine = intelligent (wikipedia !> alpha !> mathworld !> hoogle !> hackage !> scholar !> prefixAware google)
| 139 |
mySearchEngine = intelligent (wikipedia !> alpha !> mathworld !> hoogle !> hackage !> scholar !> prefixAware google)
| 116 |
mySearchEngine = intelligent (wikipedia !> alpha !> mathworld !> hoogle !> hackage !> scholar !> prefixAware google)
| 116 | true | false | 1 | 12 | 21 | 45 | 21 | 24 | null | null |
vTurbine/ghc
|
compiler/simplCore/CallArity.hs
|
bsd-3-clause
|
-- In the result, find out the minimum arity and whether the variable is called
-- at most once.
lookupCallArityRes :: CallArityRes -> Var -> (Arity, Bool)
lookupCallArityRes (g, ae) v
= case lookupVarEnv ae v of
Just a -> (a, not (v `elemUnVarSet` (neighbors g v)))
Nothing -> (0, False)
| 308 |
lookupCallArityRes :: CallArityRes -> Var -> (Arity, Bool)
lookupCallArityRes (g, ae) v
= case lookupVarEnv ae v of
Just a -> (a, not (v `elemUnVarSet` (neighbors g v)))
Nothing -> (0, False)
| 211 |
lookupCallArityRes (g, ae) v
= case lookupVarEnv ae v of
Just a -> (a, not (v `elemUnVarSet` (neighbors g v)))
Nothing -> (0, False)
| 152 | true | true | 0 | 13 | 70 | 94 | 52 | 42 | null | null |
peterokagey/haskellOEIS
|
test/Delahaye/A338015Spec.hs
|
apache-2.0
|
main :: IO ()
main = hspec spec
| 31 |
main :: IO ()
main = hspec spec
| 31 |
main = hspec spec
| 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
jimstutt/Bistability
|
src/Main.hs
|
bsd-3-clause
|
kappa = 0.05
| 12 |
kappa = 0.05
| 12 |
kappa = 0.05
| 12 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
josefs/sbv
|
Data/SBV/Core/Kind.hs
|
bsd-3-clause
|
kindRank KUnbounded = Left 1
| 33 |
kindRank KUnbounded = Left 1
| 33 |
kindRank KUnbounded = Left 1
| 33 | false | false | 0 | 5 | 9 | 12 | 5 | 7 | null | null |
bergmark/purescript
|
src/Language/PureScript/ModuleDependencies.hs
|
mit
|
toModule (CyclicSCC ms) = Left $ "Cycle in module dependencies: " ++ show (map getModuleName ms)
| 96 |
toModule (CyclicSCC ms) = Left $ "Cycle in module dependencies: " ++ show (map getModuleName ms)
| 96 |
toModule (CyclicSCC ms) = Left $ "Cycle in module dependencies: " ++ show (map getModuleName ms)
| 96 | false | false | 0 | 8 | 15 | 35 | 16 | 19 | null | null |
keithodulaigh/Hets
|
LF/MorphParser.hs
|
gpl-2.0
|
parseDef :: CharParser st DEF
parseDef = do
pkeyword "Def"
skipChar '{'
pkeyword "getSym"
skipChar '='
sym <- parseSym
skipChar ','
pkeyword "getType"
skipChar '='
tp <- parseExp
skipChar ','
pkeyword "getValue"
skipChar '='
val <- (pkeyword "Nothing" >> return Nothing)
<|> do pkeyword "Just"
e <- parensP parseExp
return $ Just e
skipChar '}'
return $ Def sym tp val
| 481 |
parseDef :: CharParser st DEF
parseDef = do
pkeyword "Def"
skipChar '{'
pkeyword "getSym"
skipChar '='
sym <- parseSym
skipChar ','
pkeyword "getType"
skipChar '='
tp <- parseExp
skipChar ','
pkeyword "getValue"
skipChar '='
val <- (pkeyword "Nothing" >> return Nothing)
<|> do pkeyword "Just"
e <- parensP parseExp
return $ Just e
skipChar '}'
return $ Def sym tp val
| 481 |
parseDef = do
pkeyword "Def"
skipChar '{'
pkeyword "getSym"
skipChar '='
sym <- parseSym
skipChar ','
pkeyword "getType"
skipChar '='
tp <- parseExp
skipChar ','
pkeyword "getValue"
skipChar '='
val <- (pkeyword "Nothing" >> return Nothing)
<|> do pkeyword "Just"
e <- parensP parseExp
return $ Just e
skipChar '}'
return $ Def sym tp val
| 451 | false | true | 0 | 13 | 173 | 166 | 64 | 102 | null | null |
elieux/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
pprCtO (PArrSeqOrigin seq) = hsep [ptext (sLit "the parallel array sequence"), quotes (ppr seq)]
| 98 |
pprCtO (PArrSeqOrigin seq) = hsep [ptext (sLit "the parallel array sequence"), quotes (ppr seq)]
| 98 |
pprCtO (PArrSeqOrigin seq) = hsep [ptext (sLit "the parallel array sequence"), quotes (ppr seq)]
| 98 | false | false | 0 | 9 | 15 | 43 | 20 | 23 | null | null |
olsner/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
primInt64Suffix = text "L#"
| 28 |
primInt64Suffix = text "L#"
| 28 |
primInt64Suffix = text "L#"
| 28 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
javgh/mtgoxapi
|
Network/MtGoxAPI/TickerMonitor.hs
|
bsd-3-clause
|
getTickerStatus' :: MVar (Maybe TickerStatus) -> IO (Either String TickerStatus)
getTickerStatus' store = do
tickerStatusM <- readMVar store
case tickerStatusM of
Nothing -> return $ Left "No ticker data present"
Just tickerStatus -> do
now <- getCurrentTime
let age = diffUTCTime now (tsTimestamp tickerStatus)
return $ if age < maximumAgeInSeconds
then Right tickerStatus
else Left "Data stale"
-- | Update ticker with new data.
| 539 |
getTickerStatus' :: MVar (Maybe TickerStatus) -> IO (Either String TickerStatus)
getTickerStatus' store = do
tickerStatusM <- readMVar store
case tickerStatusM of
Nothing -> return $ Left "No ticker data present"
Just tickerStatus -> do
now <- getCurrentTime
let age = diffUTCTime now (tsTimestamp tickerStatus)
return $ if age < maximumAgeInSeconds
then Right tickerStatus
else Left "Data stale"
-- | Update ticker with new data.
| 539 |
getTickerStatus' store = do
tickerStatusM <- readMVar store
case tickerStatusM of
Nothing -> return $ Left "No ticker data present"
Just tickerStatus -> do
now <- getCurrentTime
let age = diffUTCTime now (tsTimestamp tickerStatus)
return $ if age < maximumAgeInSeconds
then Right tickerStatus
else Left "Data stale"
-- | Update ticker with new data.
| 458 | false | true | 0 | 19 | 172 | 136 | 61 | 75 | null | null |
pbl64k/WatLog
|
watlog.hs
|
bsd-2-clause
|
matchRule :: SimpleProposition -> Rule -> State -> States
matchRule p (Rule ph ps) (int, g) = unify p ph (int, ps ++ g)
| 119 |
matchRule :: SimpleProposition -> Rule -> State -> States
matchRule p (Rule ph ps) (int, g) = unify p ph (int, ps ++ g)
| 119 |
matchRule p (Rule ph ps) (int, g) = unify p ph (int, ps ++ g)
| 61 | false | true | 0 | 11 | 23 | 66 | 33 | 33 | null | null |
diku-dk/futhark
|
src/Futhark/IR/GPU/Simplify.hs
|
isc
|
simplifyLambda ::
(HasScope GPU m, MonadFreshNames m) =>
Lambda GPU ->
m (Lambda GPU)
simplifyLambda =
Simplify.simplifyLambda simpleGPU kernelRules Engine.noExtraHoistBlockers
| 184 |
simplifyLambda ::
(HasScope GPU m, MonadFreshNames m) =>
Lambda GPU ->
m (Lambda GPU)
simplifyLambda =
Simplify.simplifyLambda simpleGPU kernelRules Engine.noExtraHoistBlockers
| 184 |
simplifyLambda =
Simplify.simplifyLambda simpleGPU kernelRules Engine.noExtraHoistBlockers
| 92 | false | true | 0 | 9 | 27 | 55 | 27 | 28 | null | null |
awto/chr2sql
|
CHR2/Parser.hs
|
bsd-3-clause
|
mkBin n = \l r -> mkFtr (mkC n [l,r])
| 37 |
mkBin n = \l r -> mkFtr (mkC n [l,r])
| 37 |
mkBin n = \l r -> mkFtr (mkC n [l,r])
| 37 | false | false | 0 | 9 | 9 | 33 | 17 | 16 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.