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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aretoky/egison2
|
misc/peg4arr.hs
|
mit
|
char_str :: (Char->Bool) -> Env -> (NumAndFunc,Env)
char_str char_pat_f (num,plist) = (res, (num+1, plist++[res]))
where
res = (num+1, resf)
resf larr i=
if inRange (bounds larr) i then
if (char_pat_f (fst (larr!i))) then (Set.singleton (i+1)) else Set.empty
else
Set.empty
| 298
|
char_str :: (Char->Bool) -> Env -> (NumAndFunc,Env)
char_str char_pat_f (num,plist) = (res, (num+1, plist++[res]))
where
res = (num+1, resf)
resf larr i=
if inRange (bounds larr) i then
if (char_pat_f (fst (larr!i))) then (Set.singleton (i+1)) else Set.empty
else
Set.empty
| 298
|
char_str char_pat_f (num,plist) = (res, (num+1, plist++[res]))
where
res = (num+1, resf)
resf larr i=
if inRange (bounds larr) i then
if (char_pat_f (fst (larr!i))) then (Set.singleton (i+1)) else Set.empty
else
Set.empty
| 246
| false
| true
| 0
| 12
| 63
| 159
| 88
| 71
| null | null |
lesguillemets/fibonacci_word_fractal.hs
|
src/Main.hs
|
mit
|
draw ::
Flag "n" '["level"] "Int" "draws fib n" (Def "16" Int)
-> Flag "a" '["angle"] "Double" "Angle (/pi) to Turn." (Def "0.5" Double)
-> Flag "r" '["raw-radian"] "Bool"
"When given, the angle is treated as raw value in radians. When not, '-a x' is treated as pi*x radian."
Bool
-> Flag "c" '["with-color"] "Bool" "Use color?" Bool
-> Cmd "Draw Fibonacci Word Fractal" ()
draw n a r c =
let θ = if get r then get a else get a*pi
f = if get c then drawFibRainbow
else drawFibMonochrome
in
liftIO . f θ . fibWord $ get n
| 588
|
draw ::
Flag "n" '["level"] "Int" "draws fib n" (Def "16" Int)
-> Flag "a" '["angle"] "Double" "Angle (/pi) to Turn." (Def "0.5" Double)
-> Flag "r" '["raw-radian"] "Bool"
"When given, the angle is treated as raw value in radians. When not, '-a x' is treated as pi*x radian."
Bool
-> Flag "c" '["with-color"] "Bool" "Use color?" Bool
-> Cmd "Draw Fibonacci Word Fractal" ()
draw n a r c =
let θ = if get r then get a else get a*pi
f = if get c then drawFibRainbow
else drawFibMonochrome
in
liftIO . f θ . fibWord $ get n
| 587
|
draw n a r c =
let θ = if get r then get a else get a*pi
f = if get c then drawFibRainbow
else drawFibMonochrome
in
liftIO . f θ . fibWord $ get n
| 195
| false
| true
| 0
| 12
| 169
| 190
| 93
| 97
| null | null |
glguy/irc-core
|
lib/src/Irc/Identifier.hs
|
isc
|
-- | This indexing function exists to specialize the type
-- of 'BA.indexByteArray'.
indexWord8 :: ByteArray -> Int -> Word8
indexWord8 = BA.indexByteArray
| 155
|
indexWord8 :: ByteArray -> Int -> Word8
indexWord8 = BA.indexByteArray
| 70
|
indexWord8 = BA.indexByteArray
| 30
| true
| true
| 0
| 6
| 22
| 23
| 13
| 10
| null | null |
sinelaw/lamdu
|
Lamdu/GUI/ExpressionEdit/HoleEdit/Results.hs
|
gpl-3.0
|
mResultsListOf ::
HoleInfo m -> WidgetMaker m -> Widget.Id ->
[(ResultType, Sugar.HoleResult Sugar.Name m SugarExprPl)] ->
Maybe (ResultsList m)
mResultsListOf _ _ _ [] = Nothing
| 184
|
mResultsListOf ::
HoleInfo m -> WidgetMaker m -> Widget.Id ->
[(ResultType, Sugar.HoleResult Sugar.Name m SugarExprPl)] ->
Maybe (ResultsList m)
mResultsListOf _ _ _ [] = Nothing
| 184
|
mResultsListOf _ _ _ [] = Nothing
| 33
| false
| true
| 0
| 12
| 31
| 75
| 37
| 38
| null | null |
charlesrosenbauer/Bzo-Compiler
|
src/Tokens.hs
|
gpl-3.0
|
showTk (TkLambdaSym _) = ";"
| 32
|
showTk (TkLambdaSym _) = ";"
| 32
|
showTk (TkLambdaSym _) = ";"
| 32
| false
| false
| 0
| 6
| 8
| 16
| 7
| 9
| null | null |
skogsbaer/HTF
|
Test/Framework/HUnitWrapper.hs
|
lgpl-2.1
|
-- | Fail in some 'AssertM' monad if the two values of type @a@ are equal, supplying
-- an additional message.
-- Use if @a@ is an instance of 'Pretty'.
gassertNotEqualPrettyVerbose :: (Eq a, Pretty a, AssertM m, HasCallStack) => String -> a -> a -> m ()
gassertNotEqualPrettyVerbose = assertNotEqualPretty_ "gassertNotEqualPrettyVerbose"
| 338
|
gassertNotEqualPrettyVerbose :: (Eq a, Pretty a, AssertM m, HasCallStack) => String -> a -> a -> m ()
gassertNotEqualPrettyVerbose = assertNotEqualPretty_ "gassertNotEqualPrettyVerbose"
| 185
|
gassertNotEqualPrettyVerbose = assertNotEqualPretty_ "gassertNotEqualPrettyVerbose"
| 83
| true
| true
| 0
| 10
| 51
| 59
| 31
| 28
| null | null |
flyingfisch/haskell-fischbot
|
App/Commands.hs
|
gpl-2.0
|
infoContrib _ _ vars = do
privmsg $ "Know Haskell? Fork me! " ++ gitHubRepo
return $ junkVar vars
| 105
|
infoContrib _ _ vars = do
privmsg $ "Know Haskell? Fork me! " ++ gitHubRepo
return $ junkVar vars
| 105
|
infoContrib _ _ vars = do
privmsg $ "Know Haskell? Fork me! " ++ gitHubRepo
return $ junkVar vars
| 105
| false
| false
| 0
| 8
| 26
| 34
| 15
| 19
| null | null |
jordanemedlock/fungen
|
Graphics/UI/Fungen/Util.hs
|
bsd-3-clause
|
randFloat :: (Float,Float) -> IO Float
randFloat (a,b) = randomRIO (a,b)
| 73
|
randFloat :: (Float,Float) -> IO Float
randFloat (a,b) = randomRIO (a,b)
| 72
|
randFloat (a,b) = randomRIO (a,b)
| 33
| false
| true
| 0
| 6
| 11
| 46
| 24
| 22
| null | null |
mcschroeder/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
repSplitAppTy_maybe :: Type -> Maybe (Type,Type)
-- ^ Does the AppTy split as in 'splitAppTy_maybe', but assumes that
-- any Core view stuff is already done
repSplitAppTy_maybe (ForAllTy (Anon ty1) ty2)
= Just (TyConApp funTyCon [ty1], ty2)
| 278
|
repSplitAppTy_maybe :: Type -> Maybe (Type,Type)
repSplitAppTy_maybe (ForAllTy (Anon ty1) ty2)
= Just (TyConApp funTyCon [ty1], ty2)
| 170
|
repSplitAppTy_maybe (ForAllTy (Anon ty1) ty2)
= Just (TyConApp funTyCon [ty1], ty2)
| 121
| true
| true
| 0
| 8
| 74
| 64
| 33
| 31
| null | null |
brendanhay/gogol
|
gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Deployments/Delete.hs
|
mpl-2.0
|
-- | Sets the policy to use for deleting resources.
ddDeletePolicy :: Lens' DeploymentsDelete DeploymentsDeleteDeletePolicy
ddDeletePolicy
= lens _ddDeletePolicy
(\ s a -> s{_ddDeletePolicy = a})
| 203
|
ddDeletePolicy :: Lens' DeploymentsDelete DeploymentsDeleteDeletePolicy
ddDeletePolicy
= lens _ddDeletePolicy
(\ s a -> s{_ddDeletePolicy = a})
| 151
|
ddDeletePolicy
= lens _ddDeletePolicy
(\ s a -> s{_ddDeletePolicy = a})
| 79
| true
| true
| 0
| 9
| 33
| 42
| 22
| 20
| null | null |
travitch/dalvik
|
src/Dalvik/AccessFlags.hs
|
bsd-3-clause
|
codeFlag AMethod 0x00080 = ACC_VARARGS
| 38
|
codeFlag AMethod 0x00080 = ACC_VARARGS
| 38
|
codeFlag AMethod 0x00080 = ACC_VARARGS
| 38
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
triplepointfive/Youtan
|
src/Youtan/Compile/Codegen.hs
|
bsd-3-clause
|
define :: Type -> String -> [(Type, Name)] -> [BasicBlock] -> LLVM ()
define retty label argtys body = addDefn $
GlobalDefinition $ functionDefaults {
name = Name label
, parameters = ([Parameter ty nm [] | (ty, nm) <- argtys], False)
, returnType = retty
, basicBlocks = body
}
| 302
|
define :: Type -> String -> [(Type, Name)] -> [BasicBlock] -> LLVM ()
define retty label argtys body = addDefn $
GlobalDefinition $ functionDefaults {
name = Name label
, parameters = ([Parameter ty nm [] | (ty, nm) <- argtys], False)
, returnType = retty
, basicBlocks = body
}
| 302
|
define retty label argtys body = addDefn $
GlobalDefinition $ functionDefaults {
name = Name label
, parameters = ([Parameter ty nm [] | (ty, nm) <- argtys], False)
, returnType = retty
, basicBlocks = body
}
| 231
| false
| true
| 0
| 13
| 74
| 128
| 69
| 59
| null | null |
aslatter/blog
|
Blog/Users/Core.hs
|
gpl-3.0
|
userById :: UserId -> Query Users (Maybe User)
userById ident = asks $ H.lookup ident . users_by_id
| 99
|
userById :: UserId -> Query Users (Maybe User)
userById ident = asks $ H.lookup ident . users_by_id
| 99
|
userById ident = asks $ H.lookup ident . users_by_id
| 52
| false
| true
| 0
| 9
| 16
| 47
| 21
| 26
| null | null |
TomasBarry/DistroProject
|
SampleProject/src/Lib.hs
|
mit
|
withMongoDbConnection :: Action IO a -> IO a
withMongoDbConnection act = do
ip <- mongoDbIp
port <- mongoDbPort
database <- mongoDbDatabase
pipe <- connect (host ip)
ret <- runResourceT $ liftIO $ access pipe master (pack database) act
close pipe
return ret
-- | helper method to ensure we force extraction of all results
-- note how it is defined recursively - meaning that draincursor' calls itself.
-- the purpose is to iterate through all documents returned if the connection is
-- returning the documents in batch mode, meaning in batches of retruned results with more
-- to come on each call. The function recurses until there are no results left, building an
-- array of returned [Document]
| 713
|
withMongoDbConnection :: Action IO a -> IO a
withMongoDbConnection act = do
ip <- mongoDbIp
port <- mongoDbPort
database <- mongoDbDatabase
pipe <- connect (host ip)
ret <- runResourceT $ liftIO $ access pipe master (pack database) act
close pipe
return ret
-- | helper method to ensure we force extraction of all results
-- note how it is defined recursively - meaning that draincursor' calls itself.
-- the purpose is to iterate through all documents returned if the connection is
-- returning the documents in batch mode, meaning in batches of retruned results with more
-- to come on each call. The function recurses until there are no results left, building an
-- array of returned [Document]
| 713
|
withMongoDbConnection act = do
ip <- mongoDbIp
port <- mongoDbPort
database <- mongoDbDatabase
pipe <- connect (host ip)
ret <- runResourceT $ liftIO $ access pipe master (pack database) act
close pipe
return ret
-- | helper method to ensure we force extraction of all results
-- note how it is defined recursively - meaning that draincursor' calls itself.
-- the purpose is to iterate through all documents returned if the connection is
-- returning the documents in batch mode, meaning in batches of retruned results with more
-- to come on each call. The function recurses until there are no results left, building an
-- array of returned [Document]
| 668
| false
| true
| 0
| 11
| 133
| 111
| 52
| 59
| null | null |
brianshourd/adventOfCode2016
|
test/AssembunnySpec.hs
|
mit
|
spec :: Spec
spec = do
describe "parseInput" $ do
it "parses sample input 1 properly" $ do
parseInput sampleInput1 `shouldBe` sampleParsed1
it "parses sample input 2 properly" $ do
parseInput sampleInput2 `shouldBe` sampleParsed2
describe "evaluate" $ do
it "processes sample input 1 to find 3 in register a, when a starts at 7" $ do
let initial = writeRegister 'a' 7 $ start sampleParsed1
readRegister 'a' (evaluate initial) `shouldBe` 3
it "processes sample input 2 to find 42 in register a" $ do
let initial = start sampleParsed2
readRegister 'a' (evaluate initial) `shouldBe` 42
-- it "works on actual input" $ do
-- actualInput <- readFile "inputs/day23.txt"
-- day23 actualInput `shouldBe` 317993
| 843
|
spec :: Spec
spec = do
describe "parseInput" $ do
it "parses sample input 1 properly" $ do
parseInput sampleInput1 `shouldBe` sampleParsed1
it "parses sample input 2 properly" $ do
parseInput sampleInput2 `shouldBe` sampleParsed2
describe "evaluate" $ do
it "processes sample input 1 to find 3 in register a, when a starts at 7" $ do
let initial = writeRegister 'a' 7 $ start sampleParsed1
readRegister 'a' (evaluate initial) `shouldBe` 3
it "processes sample input 2 to find 42 in register a" $ do
let initial = start sampleParsed2
readRegister 'a' (evaluate initial) `shouldBe` 42
-- it "works on actual input" $ do
-- actualInput <- readFile "inputs/day23.txt"
-- day23 actualInput `shouldBe` 317993
| 843
|
spec = do
describe "parseInput" $ do
it "parses sample input 1 properly" $ do
parseInput sampleInput1 `shouldBe` sampleParsed1
it "parses sample input 2 properly" $ do
parseInput sampleInput2 `shouldBe` sampleParsed2
describe "evaluate" $ do
it "processes sample input 1 to find 3 in register a, when a starts at 7" $ do
let initial = writeRegister 'a' 7 $ start sampleParsed1
readRegister 'a' (evaluate initial) `shouldBe` 3
it "processes sample input 2 to find 42 in register a" $ do
let initial = start sampleParsed2
readRegister 'a' (evaluate initial) `shouldBe` 42
-- it "works on actual input" $ do
-- actualInput <- readFile "inputs/day23.txt"
-- day23 actualInput `shouldBe` 317993
| 830
| false
| true
| 0
| 17
| 253
| 178
| 80
| 98
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT50.hs
|
gpl-3.0
|
qfac (S x) acc = qfac x (S x * acc)
| 35
|
qfac (S x) acc = qfac x (S x * acc)
| 35
|
qfac (S x) acc = qfac x (S x * acc)
| 35
| false
| false
| 0
| 8
| 10
| 32
| 15
| 17
| null | null |
rueshyna/gogol
|
gogol-servicemanagement/gen/Network/Google/Resource/ServiceManagement/Services/Rollouts/List.hs
|
mpl-2.0
|
-- | JSONP
srlCallback :: Lens' ServicesRolloutsList (Maybe Text)
srlCallback
= lens _srlCallback (\ s a -> s{_srlCallback = a})
| 130
|
srlCallback :: Lens' ServicesRolloutsList (Maybe Text)
srlCallback
= lens _srlCallback (\ s a -> s{_srlCallback = a})
| 119
|
srlCallback
= lens _srlCallback (\ s a -> s{_srlCallback = a})
| 64
| true
| true
| 1
| 9
| 21
| 50
| 25
| 25
| null | null |
vTurbine/ghc
|
compiler/types/InstEnv.hs
|
bsd-3-clause
|
extendInstEnvList :: InstEnv -> [ClsInst] -> InstEnv
extendInstEnvList inst_env ispecs = foldl extendInstEnv inst_env ispecs
| 124
|
extendInstEnvList :: InstEnv -> [ClsInst] -> InstEnv
extendInstEnvList inst_env ispecs = foldl extendInstEnv inst_env ispecs
| 124
|
extendInstEnvList inst_env ispecs = foldl extendInstEnv inst_env ispecs
| 71
| false
| true
| 0
| 7
| 14
| 34
| 17
| 17
| null | null |
ihc/futhark
|
src/Futhark/Optimise/InPlaceLowering.hs
|
isc
|
isOptimisable :: VName -> ForwardingM Bool
isOptimisable name = do
res <- asks $ fmap entryOptimisable . M.lookup name . topDownTable
case res of Just b -> return b
Nothing -> fail $ "isOptimisable: variable " ++
pretty name ++ " not found."
| 285
|
isOptimisable :: VName -> ForwardingM Bool
isOptimisable name = do
res <- asks $ fmap entryOptimisable . M.lookup name . topDownTable
case res of Just b -> return b
Nothing -> fail $ "isOptimisable: variable " ++
pretty name ++ " not found."
| 285
|
isOptimisable name = do
res <- asks $ fmap entryOptimisable . M.lookup name . topDownTable
case res of Just b -> return b
Nothing -> fail $ "isOptimisable: variable " ++
pretty name ++ " not found."
| 242
| false
| true
| 0
| 12
| 86
| 88
| 40
| 48
| null | null |
seereason/wl-pprint-text
|
Text/PrettyPrint/Leijen/Text.hs
|
bsd-3-clause
|
text' :: (Show a) => a -> Doc
text' = text . T.pack . show
| 58
|
text' :: (Show a) => a -> Doc
text' = text . T.pack . show
| 58
|
text' = text . T.pack . show
| 28
| false
| true
| 0
| 8
| 14
| 41
| 19
| 22
| null | null |
tuura/process-mining
|
src/Tuura/Macro.hs
|
bsd-3-clause
|
chain as begin tr = map (maximumBy $ comparing evaluate) (transpose chains)
where
chains = [ tail $ scanl' append (MacroEvent x y begin (begin - 1) 0 0) tr
| x <- as, y <- as, x < y ]
append (MacroEvent x y begin end s w) e
| e == x || e == y = MacroEvent x y begin (end + 1) s (w + duration e)
| otherwise = MacroEvent x y begin (end + 1) (s + duration e) w
| 412
|
chain as begin tr = map (maximumBy $ comparing evaluate) (transpose chains)
where
chains = [ tail $ scanl' append (MacroEvent x y begin (begin - 1) 0 0) tr
| x <- as, y <- as, x < y ]
append (MacroEvent x y begin end s w) e
| e == x || e == y = MacroEvent x y begin (end + 1) s (w + duration e)
| otherwise = MacroEvent x y begin (end + 1) (s + duration e) w
| 412
|
chain as begin tr = map (maximumBy $ comparing evaluate) (transpose chains)
where
chains = [ tail $ scanl' append (MacroEvent x y begin (begin - 1) 0 0) tr
| x <- as, y <- as, x < y ]
append (MacroEvent x y begin end s w) e
| e == x || e == y = MacroEvent x y begin (end + 1) s (w + duration e)
| otherwise = MacroEvent x y begin (end + 1) (s + duration e) w
| 412
| false
| false
| 4
| 15
| 139
| 213
| 106
| 107
| null | null |
garetxe/cabal
|
cabal-install/Distribution/Client/Configure.hs
|
bsd-3-clause
|
-- | Choose the Cabal version such that the setup scripts compiled against this
-- version will support the given command-line flags.
chooseCabalVersion :: ConfigFlags -> Maybe Version -> VersionRange
chooseCabalVersion configFlags maybeVersion =
maybe defaultVersionRange thisVersion maybeVersion
where
-- Cabal < 1.19.2 doesn't support '--exact-configuration' which is needed
-- for '--allow-newer' to work.
allowNewer = isAllowNewer
(fromMaybe AllowNewerNone $ configAllowNewer configFlags)
defaultVersionRange = if allowNewer
then orLaterVersion (Version [1,19,2] [])
else anyVersion
-- | Configure the package found in the local directory
| 734
|
chooseCabalVersion :: ConfigFlags -> Maybe Version -> VersionRange
chooseCabalVersion configFlags maybeVersion =
maybe defaultVersionRange thisVersion maybeVersion
where
-- Cabal < 1.19.2 doesn't support '--exact-configuration' which is needed
-- for '--allow-newer' to work.
allowNewer = isAllowNewer
(fromMaybe AllowNewerNone $ configAllowNewer configFlags)
defaultVersionRange = if allowNewer
then orLaterVersion (Version [1,19,2] [])
else anyVersion
-- | Configure the package found in the local directory
| 600
|
chooseCabalVersion configFlags maybeVersion =
maybe defaultVersionRange thisVersion maybeVersion
where
-- Cabal < 1.19.2 doesn't support '--exact-configuration' which is needed
-- for '--allow-newer' to work.
allowNewer = isAllowNewer
(fromMaybe AllowNewerNone $ configAllowNewer configFlags)
defaultVersionRange = if allowNewer
then orLaterVersion (Version [1,19,2] [])
else anyVersion
-- | Configure the package found in the local directory
| 533
| true
| true
| 1
| 9
| 173
| 106
| 53
| 53
| null | null |
jsavatgy/xroads-game
|
code/blue-vectors.hs
|
gpl-2.0
|
normal (Vector dx dy) =
Vector (-dy) dx
| 42
|
normal (Vector dx dy) =
Vector (-dy) dx
| 42
|
normal (Vector dx dy) =
Vector (-dy) dx
| 42
| false
| false
| 0
| 7
| 10
| 28
| 13
| 15
| null | null |
mcmaniac/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
addOptl f = alterSettings (\s -> s { sOpt_l = f : sOpt_l s})
| 64
|
addOptl f = alterSettings (\s -> s { sOpt_l = f : sOpt_l s})
| 64
|
addOptl f = alterSettings (\s -> s { sOpt_l = f : sOpt_l s})
| 64
| false
| false
| 0
| 11
| 17
| 35
| 18
| 17
| null | null |
mariefarrell/Hets
|
Propositional/Analysis.hs
|
gpl-2.0
|
makeFormulas ::
AS_BASIC.BASIC_SPEC
-> Sign.Sign
-> [DIAG_FORM]
makeFormulas (AS_BASIC.Basic_spec bspec) sig =
List.foldl (\ xs bs -> retrieveFormulaItem xs bs sig) [] bspec
| 189
|
makeFormulas ::
AS_BASIC.BASIC_SPEC
-> Sign.Sign
-> [DIAG_FORM]
makeFormulas (AS_BASIC.Basic_spec bspec) sig =
List.foldl (\ xs bs -> retrieveFormulaItem xs bs sig) [] bspec
| 189
|
makeFormulas (AS_BASIC.Basic_spec bspec) sig =
List.foldl (\ xs bs -> retrieveFormulaItem xs bs sig) [] bspec
| 113
| false
| true
| 0
| 8
| 38
| 67
| 34
| 33
| null | null |
wilbowma/accelerate
|
Data/Array/Accelerate/Interpreter.hs
|
bsd-3-clause
|
evalChr :: Int -> Char
evalChr = chr
| 36
|
evalChr :: Int -> Char
evalChr = chr
| 36
|
evalChr = chr
| 13
| false
| true
| 0
| 7
| 7
| 22
| 9
| 13
| null | null |
ananthakumaran/webify
|
src/Webify.hs
|
mit
|
changeExtension :: FilePath -> FilePath -> FilePath
changeExtension ext = flip addExtension ext . dropExtension
| 111
|
changeExtension :: FilePath -> FilePath -> FilePath
changeExtension ext = flip addExtension ext . dropExtension
| 111
|
changeExtension ext = flip addExtension ext . dropExtension
| 59
| false
| true
| 0
| 6
| 14
| 31
| 15
| 16
| null | null |
epsilonhalbe/VocabuLambda
|
Database.hs
|
bsd-3-clause
|
lookupFrequency :: Int -> Query LearntList Frequency
lookupFrequency n = do LearntList lst <- ask
return $ fst (lst !! n)
| 146
|
lookupFrequency :: Int -> Query LearntList Frequency
lookupFrequency n = do LearntList lst <- ask
return $ fst (lst !! n)
| 146
|
lookupFrequency n = do LearntList lst <- ask
return $ fst (lst !! n)
| 93
| false
| true
| 0
| 10
| 45
| 54
| 24
| 30
| null | null |
brodyberg/Notes
|
ProjectRosalind.hsproj/LearnHaskell/lib/ProjectRosalind/Motif/FunctionsAndTypesForParsing.hs
|
mit
|
regularParse :: Parser a -> String -> Either ParseError a
regularParse p = parse p ""
| 85
|
regularParse :: Parser a -> String -> Either ParseError a
regularParse p = parse p ""
| 85
|
regularParse p = parse p ""
| 27
| false
| true
| 0
| 7
| 15
| 35
| 16
| 19
| null | null |
jwiegley/ghc-release
|
utils/haddock/src/Haddock/Backends/Hoogle.hs
|
gpl-3.0
|
asInline (TagPre xs) = [TagInline "pre" xs]
| 43
|
asInline (TagPre xs) = [TagInline "pre" xs]
| 43
|
asInline (TagPre xs) = [TagInline "pre" xs]
| 43
| false
| false
| 0
| 7
| 6
| 23
| 11
| 12
| null | null |
mapinguari/SC_HS_Proxy
|
src/Proxy/PotentialFields/NEW.hs
|
mit
|
allSame :: (Eq b) => (a-> b) -> [a] -> Bool
allSame f [] = True
| 63
|
allSame :: (Eq b) => (a-> b) -> [a] -> Bool
allSame f [] = True
| 63
|
allSame f [] = True
| 19
| false
| true
| 0
| 8
| 15
| 45
| 24
| 21
| null | null |
derekmcloughlin/BridgeBuddyServer
|
library/BridgeBuddy/OpeningResponses.hs
|
apache-2.0
|
-- Go through the hands from North, East, South, West to find the
-- first biddable one, then make that North.
-- This allows us to look for responses where East is weak
-- and South can possibly respond.
keepFindingBiddableHand :: TableHands -> Maybe TableHands
keepFindingBiddableHand table = innerFind 0 table
where
innerFind :: Int -> TableHands -> Maybe TableHands
innerFind num_rotations tbl
| num_rotations == 4 = Nothing -- Passed out
| otherwise = do
let (northsBid, _) = openingBid $ north tbl
case northsBid of
Pass -> innerFind (num_rotations + 1) $ rotate tbl
_ -> Just tbl
-- Get the response to an opening bid.
-- bid = North's opening bid.
-- hand = South's hand
-- Return value is South's response
| 853
|
keepFindingBiddableHand :: TableHands -> Maybe TableHands
keepFindingBiddableHand table = innerFind 0 table
where
innerFind :: Int -> TableHands -> Maybe TableHands
innerFind num_rotations tbl
| num_rotations == 4 = Nothing -- Passed out
| otherwise = do
let (northsBid, _) = openingBid $ north tbl
case northsBid of
Pass -> innerFind (num_rotations + 1) $ rotate tbl
_ -> Just tbl
-- Get the response to an opening bid.
-- bid = North's opening bid.
-- hand = South's hand
-- Return value is South's response
| 648
|
keepFindingBiddableHand table = innerFind 0 table
where
innerFind :: Int -> TableHands -> Maybe TableHands
innerFind num_rotations tbl
| num_rotations == 4 = Nothing -- Passed out
| otherwise = do
let (northsBid, _) = openingBid $ north tbl
case northsBid of
Pass -> innerFind (num_rotations + 1) $ rotate tbl
_ -> Just tbl
-- Get the response to an opening bid.
-- bid = North's opening bid.
-- hand = South's hand
-- Return value is South's response
| 590
| true
| true
| 3
| 14
| 263
| 144
| 72
| 72
| null | null |
apauley/parallel-frequency
|
src/Shared.hs
|
mit
|
printTimeSince :: UTCTime -> String -> IO ()
printTimeSince t0 desc = do
t1 <- getCurrentTime
putStr desc
printf " Time since start of program: %.2fs\n" (realToFrac (diffUTCTime t1 t0) :: Double)
| 201
|
printTimeSince :: UTCTime -> String -> IO ()
printTimeSince t0 desc = do
t1 <- getCurrentTime
putStr desc
printf " Time since start of program: %.2fs\n" (realToFrac (diffUTCTime t1 t0) :: Double)
| 201
|
printTimeSince t0 desc = do
t1 <- getCurrentTime
putStr desc
printf " Time since start of program: %.2fs\n" (realToFrac (diffUTCTime t1 t0) :: Double)
| 156
| false
| true
| 0
| 12
| 37
| 72
| 32
| 40
| null | null |
pauldoo/scratch
|
RealWorldHaskell/ch05/mypretty/PrettyJSON.hs
|
isc
|
punctuate p [d] = [d]
| 21
|
punctuate p [d] = [d]
| 21
|
punctuate p [d] = [d]
| 21
| false
| false
| 0
| 6
| 4
| 17
| 9
| 8
| null | null |
rodrigo-machado/verigraph
|
src/library/Abstract/Rewriting/DPO.hs
|
gpl-3.0
|
findProduction :: String -> Grammar morph -> Maybe (Production morph)
findProduction name grammar = lookup name (productions grammar)
| 133
|
findProduction :: String -> Grammar morph -> Maybe (Production morph)
findProduction name grammar = lookup name (productions grammar)
| 133
|
findProduction name grammar = lookup name (productions grammar)
| 63
| false
| true
| 0
| 10
| 17
| 51
| 23
| 28
| null | null |
nshepperd/funn
|
AI/Funn/CL/Tensor.hs
|
mit
|
split :: forall a b. (KnownNat a, KnownNat b)
=> Tensor '[a+b] -> (Tensor '[a], Tensor '[b])
split (Tensor buf) = (Tensor (MemSub.slice 0 a buf),
Tensor (MemSub.slice a b buf))
where
[a,b] = dimVal (Proxy @ '[a,b])
| 248
|
split :: forall a b. (KnownNat a, KnownNat b)
=> Tensor '[a+b] -> (Tensor '[a], Tensor '[b])
split (Tensor buf) = (Tensor (MemSub.slice 0 a buf),
Tensor (MemSub.slice a b buf))
where
[a,b] = dimVal (Proxy @ '[a,b])
| 248
|
split (Tensor buf) = (Tensor (MemSub.slice 0 a buf),
Tensor (MemSub.slice a b buf))
where
[a,b] = dimVal (Proxy @ '[a,b])
| 149
| false
| true
| 0
| 13
| 71
| 155
| 79
| 76
| null | null |
effectfully/hoppy-cpp
|
src/Main.hs
|
bsd-3-clause
|
toQtahDecl :: Bool -> FunDecl -> [String]
toQtahDecl overloaded1 (FunDecl result params isConst) = surrAllParams qtahParams where
qtahParams = toQtahParams params
surrParams overloaded2 = surroundParams (overloaded1 || overloaded2) suffix result isConst where
suffix = if overloaded2 then "All" else ""
surrAllParams = map (uncurry surrParams) . zip [False, True]
| 373
|
toQtahDecl :: Bool -> FunDecl -> [String]
toQtahDecl overloaded1 (FunDecl result params isConst) = surrAllParams qtahParams where
qtahParams = toQtahParams params
surrParams overloaded2 = surroundParams (overloaded1 || overloaded2) suffix result isConst where
suffix = if overloaded2 then "All" else ""
surrAllParams = map (uncurry surrParams) . zip [False, True]
| 373
|
toQtahDecl overloaded1 (FunDecl result params isConst) = surrAllParams qtahParams where
qtahParams = toQtahParams params
surrParams overloaded2 = surroundParams (overloaded1 || overloaded2) suffix result isConst where
suffix = if overloaded2 then "All" else ""
surrAllParams = map (uncurry surrParams) . zip [False, True]
| 331
| false
| true
| 0
| 10
| 58
| 120
| 61
| 59
| null | null |
apunktbau/co4
|
src/CO4/Frontend/TH.hs
|
gpl-3.0
|
parseTHDeclarations :: [TH.Dec] -> Program
parseTHDeclarations = programFromDeclarations . map parseTHDeclaration
| 113
|
parseTHDeclarations :: [TH.Dec] -> Program
parseTHDeclarations = programFromDeclarations . map parseTHDeclaration
| 113
|
parseTHDeclarations = programFromDeclarations . map parseTHDeclaration
| 70
| false
| true
| 0
| 8
| 10
| 33
| 15
| 18
| null | null |
Teaspot-Studio/Urho3D-Haskell
|
src/Graphics/Urho3D/Input/InputConstants.hs
|
mit
|
keyF3 :: Int
keyF3 = fromIntegral $ [C.pure| int {KEY_F3} |]
| 60
|
keyF3 :: Int
keyF3 = fromIntegral $ [C.pure| int {KEY_F3} |]
| 60
|
keyF3 = fromIntegral $ [C.pure| int {KEY_F3} |]
| 47
| false
| true
| 0
| 6
| 10
| 21
| 13
| 8
| null | null |
ancientlanguage/haskell-analysis
|
greek-script/src/Grammar/Greek/Script/Rounds/UnicodeSymbol.hs
|
mit
|
symbolToChar :: Symbol -> Char
symbolToChar S_Α = 'Α'
| 53
|
symbolToChar :: Symbol -> Char
symbolToChar S_Α = 'Α'
| 53
|
symbolToChar S_Α = 'Α'
| 22
| false
| true
| 0
| 5
| 8
| 20
| 10
| 10
| null | null |
brendanhay/gogol
|
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/DicomStores/Delete.hs
|
mpl-2.0
|
-- | Creates a value of 'ProjectsLocationsDataSetsDicomStoresDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pXgafv'
--
-- * 'pUploadProtocol'
--
-- * 'pAccessToken'
--
-- * 'pUploadType'
--
-- * 'pName'
--
-- * 'pCallback'
projectsLocationsDataSetsDicomStoresDelete
:: Text -- ^ 'pName'
-> ProjectsLocationsDataSetsDicomStoresDelete
projectsLocationsDataSetsDicomStoresDelete pPName_ =
ProjectsLocationsDataSetsDicomStoresDelete'
{ _pXgafv = Nothing
, _pUploadProtocol = Nothing
, _pAccessToken = Nothing
, _pUploadType = Nothing
, _pName = pPName_
, _pCallback = Nothing
}
| 706
|
projectsLocationsDataSetsDicomStoresDelete
:: Text -- ^ 'pName'
-> ProjectsLocationsDataSetsDicomStoresDelete
projectsLocationsDataSetsDicomStoresDelete pPName_ =
ProjectsLocationsDataSetsDicomStoresDelete'
{ _pXgafv = Nothing
, _pUploadProtocol = Nothing
, _pAccessToken = Nothing
, _pUploadType = Nothing
, _pName = pPName_
, _pCallback = Nothing
}
| 388
|
projectsLocationsDataSetsDicomStoresDelete pPName_ =
ProjectsLocationsDataSetsDicomStoresDelete'
{ _pXgafv = Nothing
, _pUploadProtocol = Nothing
, _pAccessToken = Nothing
, _pUploadType = Nothing
, _pName = pPName_
, _pCallback = Nothing
}
| 270
| true
| true
| 0
| 7
| 128
| 81
| 52
| 29
| null | null |
svenssonjoel/GCDObsidian
|
Obsidian/Coordination/Array.hs
|
bsd-3-clause
|
allocImm (GlobalArray id) s=
" int* dinput"++ show id ++ ";\n" ++
" cudaMalloc((void**)&dinput" ++ show id ++ ", sizeof(int) * "++ show s ++ ");\n"
| 155
|
allocImm (GlobalArray id) s=
" int* dinput"++ show id ++ ";\n" ++
" cudaMalloc((void**)&dinput" ++ show id ++ ", sizeof(int) * "++ show s ++ ");\n"
| 155
|
allocImm (GlobalArray id) s=
" int* dinput"++ show id ++ ";\n" ++
" cudaMalloc((void**)&dinput" ++ show id ++ ", sizeof(int) * "++ show s ++ ");\n"
| 155
| false
| false
| 0
| 12
| 33
| 54
| 25
| 29
| null | null |
mainland/nikola
|
examples/common/GUI/Commands.hs
|
bsd-3-clause
|
glutKeyToKey (GLUT.SpecialKey GLUT.KeyF8) = SpecialKey KeyF8
| 76
|
glutKeyToKey (GLUT.SpecialKey GLUT.KeyF8) = SpecialKey KeyF8
| 76
|
glutKeyToKey (GLUT.SpecialKey GLUT.KeyF8) = SpecialKey KeyF8
| 76
| false
| false
| 0
| 8
| 21
| 22
| 10
| 12
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/base/Foreign/C/Error.hs
|
bsd-3-clause
|
-- | as 'throwErrnoIfNull', but exceptions include the given path when
-- appropriate.
--
throwErrnoPathIfNull :: String -> FilePath -> IO (Ptr a) -> IO (Ptr a)
throwErrnoPathIfNull = throwErrnoPathIf (== nullPtr)
| 216
|
throwErrnoPathIfNull :: String -> FilePath -> IO (Ptr a) -> IO (Ptr a)
throwErrnoPathIfNull = throwErrnoPathIf (== nullPtr)
| 124
|
throwErrnoPathIfNull = throwErrnoPathIf (== nullPtr)
| 53
| true
| true
| 0
| 10
| 34
| 51
| 27
| 24
| null | null |
fserb/ccs
|
Cache.hs
|
bsd-3-clause
|
getContentTypeFromHeader :: Data -> Maybe String
getContentTypeFromHeader (Data bl) =
let s = replace "\NUL" "\n" bl
ct = s =~ "^Content-Type: ([^; \n]*)" :: [[BL8.ByteString]]
in case ct of
[_,s]:xs -> Just $ BL8.unpack s
[] -> Nothing
where replace a b = BL8.map (\x -> case x of
'\NUL' -> '\n'
c -> c)
| 408
|
getContentTypeFromHeader :: Data -> Maybe String
getContentTypeFromHeader (Data bl) =
let s = replace "\NUL" "\n" bl
ct = s =~ "^Content-Type: ([^; \n]*)" :: [[BL8.ByteString]]
in case ct of
[_,s]:xs -> Just $ BL8.unpack s
[] -> Nothing
where replace a b = BL8.map (\x -> case x of
'\NUL' -> '\n'
c -> c)
| 408
|
getContentTypeFromHeader (Data bl) =
let s = replace "\NUL" "\n" bl
ct = s =~ "^Content-Type: ([^; \n]*)" :: [[BL8.ByteString]]
in case ct of
[_,s]:xs -> Just $ BL8.unpack s
[] -> Nothing
where replace a b = BL8.map (\x -> case x of
'\NUL' -> '\n'
c -> c)
| 359
| false
| true
| 1
| 12
| 159
| 152
| 74
| 78
| null | null |
fredokun/piccolo
|
src/Backend/SeqASTUtils.hs
|
gpl-3.0
|
-- | Getting the register of a process by value
getRegister :: BExpr -> BExpr
getRegister thread = FunCall $ GetRegister thread
| 127
|
getRegister :: BExpr -> BExpr
getRegister thread = FunCall $ GetRegister thread
| 79
|
getRegister thread = FunCall $ GetRegister thread
| 49
| true
| true
| 0
| 6
| 21
| 26
| 13
| 13
| null | null |
prophet-on-that/exchange
|
src/ExchangeSim/Book.hs
|
bsd-3-clause
|
writeTVar :: MonadBase STM m => TVar a -> a -> m ()
writeTVar tVar a
= liftBase $ STM.writeTVar tVar a
| 104
|
writeTVar :: MonadBase STM m => TVar a -> a -> m ()
writeTVar tVar a
= liftBase $ STM.writeTVar tVar a
| 104
|
writeTVar tVar a
= liftBase $ STM.writeTVar tVar a
| 52
| false
| true
| 0
| 9
| 23
| 52
| 24
| 28
| null | null |
armoredsoftware/protocol
|
demos/PaulPractice/deBruijnSimpleLambdaTyped.hs
|
bsd-3-clause
|
sub:: (T,T) ->T
sub ((Abst _ x), y) = subHelper (x,y) 0
| 55
|
sub:: (T,T) ->T
sub ((Abst _ x), y) = subHelper (x,y) 0
| 55
|
sub ((Abst _ x), y) = subHelper (x,y) 0
| 39
| false
| true
| 0
| 8
| 11
| 49
| 27
| 22
| null | null |
lierdakil/pandoc-crossref
|
lib-internal/Text/Pandoc/CrossRef/References/Refs.hs
|
gpl-2.0
|
replaceRefsLatex' :: T.Text -> Options -> [Citation] -> WS [Inline]
replaceRefsLatex' prefix opts cits =
return $ p [texcit]
where
texcit =
RawInline (Format "tex") $
if cref opts then
cref'<>"{"<>listLabels prefix "" "," "" cits<>"}"
else
listLabels prefix "\\ref{" ", " "}" cits
suppressAuthor = all ((==SuppressAuthor) . citationMode) cits
noPrefix = all (null . citationPrefix) cits
p | cref opts = id
| suppressAuthor
= id
| noPrefix
= getRefPrefix opts prefix cap (length cits - 1)
| otherwise = ((citationPrefix (head cits) <> [Space]) <>)
cap = maybe False isFirstUpper $ getLabelPrefix . citationId . head $ cits
cref' | suppressAuthor = "\\labelcref"
| cap = "\\Cref"
| otherwise = "\\cref"
| 816
|
replaceRefsLatex' :: T.Text -> Options -> [Citation] -> WS [Inline]
replaceRefsLatex' prefix opts cits =
return $ p [texcit]
where
texcit =
RawInline (Format "tex") $
if cref opts then
cref'<>"{"<>listLabels prefix "" "," "" cits<>"}"
else
listLabels prefix "\\ref{" ", " "}" cits
suppressAuthor = all ((==SuppressAuthor) . citationMode) cits
noPrefix = all (null . citationPrefix) cits
p | cref opts = id
| suppressAuthor
= id
| noPrefix
= getRefPrefix opts prefix cap (length cits - 1)
| otherwise = ((citationPrefix (head cits) <> [Space]) <>)
cap = maybe False isFirstUpper $ getLabelPrefix . citationId . head $ cits
cref' | suppressAuthor = "\\labelcref"
| cap = "\\Cref"
| otherwise = "\\cref"
| 816
|
replaceRefsLatex' prefix opts cits =
return $ p [texcit]
where
texcit =
RawInline (Format "tex") $
if cref opts then
cref'<>"{"<>listLabels prefix "" "," "" cits<>"}"
else
listLabels prefix "\\ref{" ", " "}" cits
suppressAuthor = all ((==SuppressAuthor) . citationMode) cits
noPrefix = all (null . citationPrefix) cits
p | cref opts = id
| suppressAuthor
= id
| noPrefix
= getRefPrefix opts prefix cap (length cits - 1)
| otherwise = ((citationPrefix (head cits) <> [Space]) <>)
cap = maybe False isFirstUpper $ getLabelPrefix . citationId . head $ cits
cref' | suppressAuthor = "\\labelcref"
| cap = "\\Cref"
| otherwise = "\\cref"
| 748
| false
| true
| 17
| 17
| 229
| 285
| 145
| 140
| null | null |
olorin/amazonka
|
amazonka-rds/gen/Network/AWS/RDS/DescribeReservedDBInstancesOfferings.hs
|
mpl-2.0
|
-- | Creates a value of 'DescribeReservedDBInstancesOfferingsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'drdiorsMarker'
--
-- * 'drdiorsReservedDBInstancesOfferings'
--
-- * 'drdiorsResponseStatus'
describeReservedDBInstancesOfferingsResponse
:: Int -- ^ 'drdiorsResponseStatus'
-> DescribeReservedDBInstancesOfferingsResponse
describeReservedDBInstancesOfferingsResponse pResponseStatus_ =
DescribeReservedDBInstancesOfferingsResponse'
{ _drdiorsMarker = Nothing
, _drdiorsReservedDBInstancesOfferings = Nothing
, _drdiorsResponseStatus = pResponseStatus_
}
| 686
|
describeReservedDBInstancesOfferingsResponse
:: Int -- ^ 'drdiorsResponseStatus'
-> DescribeReservedDBInstancesOfferingsResponse
describeReservedDBInstancesOfferingsResponse pResponseStatus_ =
DescribeReservedDBInstancesOfferingsResponse'
{ _drdiorsMarker = Nothing
, _drdiorsReservedDBInstancesOfferings = Nothing
, _drdiorsResponseStatus = pResponseStatus_
}
| 388
|
describeReservedDBInstancesOfferingsResponse pResponseStatus_ =
DescribeReservedDBInstancesOfferingsResponse'
{ _drdiorsMarker = Nothing
, _drdiorsReservedDBInstancesOfferings = Nothing
, _drdiorsResponseStatus = pResponseStatus_
}
| 251
| true
| true
| 0
| 6
| 94
| 48
| 32
| 16
| null | null |
romanb/amazonka
|
amazonka-importexport/gen/Network/AWS/ImportExport/GetShippingLabel.hs
|
mpl-2.0
|
gslStreet1 :: Lens' GetShippingLabel (Maybe Text)
gslStreet1 = lens _gslStreet1 (\s a -> s { _gslStreet1 = a })
| 111
|
gslStreet1 :: Lens' GetShippingLabel (Maybe Text)
gslStreet1 = lens _gslStreet1 (\s a -> s { _gslStreet1 = a })
| 111
|
gslStreet1 = lens _gslStreet1 (\s a -> s { _gslStreet1 = a })
| 61
| false
| true
| 0
| 9
| 18
| 45
| 24
| 21
| null | null |
kazu-yamamoto/network-uri
|
tests/uri001.hs
|
bsd-3-clause
|
testURIRef047 = testURIRef RelRf "."
| 36
|
testURIRef047 = testURIRef RelRf "."
| 36
|
testURIRef047 = testURIRef RelRf "."
| 36
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
edwardwas/euler
|
shared/src/Shared.hs
|
mit
|
numDigits :: (Integral a, Integral b) => a -> b
numDigits n = ceiling $ log (fromIntegral $ n+1) / log 10
| 105
|
numDigits :: (Integral a, Integral b) => a -> b
numDigits n = ceiling $ log (fromIntegral $ n+1) / log 10
| 105
|
numDigits n = ceiling $ log (fromIntegral $ n+1) / log 10
| 57
| false
| true
| 0
| 10
| 21
| 58
| 29
| 29
| null | null |
tuturto/space-privateers
|
GameDefinition/Content/ModeKind.hs
|
bsd-3-clause
|
-- TODO
rosterPvP = rosterSkirmish
| 35
|
rosterPvP = rosterSkirmish
| 26
|
rosterPvP = rosterSkirmish
| 26
| true
| false
| 0
| 4
| 5
| 7
| 4
| 3
| null | null |
elieux/ghc
|
compiler/deSugar/Coverage.hs
|
bsd-3-clause
|
addTickHsIPBinds :: HsIPBinds Id -> TM (HsIPBinds Id)
addTickHsIPBinds (IPBinds ipbinds dictbinds) =
liftM2 IPBinds
(mapM (liftL (addTickIPBind)) ipbinds)
(return dictbinds)
| 213
|
addTickHsIPBinds :: HsIPBinds Id -> TM (HsIPBinds Id)
addTickHsIPBinds (IPBinds ipbinds dictbinds) =
liftM2 IPBinds
(mapM (liftL (addTickIPBind)) ipbinds)
(return dictbinds)
| 213
|
addTickHsIPBinds (IPBinds ipbinds dictbinds) =
liftM2 IPBinds
(mapM (liftL (addTickIPBind)) ipbinds)
(return dictbinds)
| 159
| false
| true
| 0
| 10
| 60
| 68
| 33
| 35
| null | null |
HenningTonko/Carrie-Programming-Language
|
Old Compiler Stuff/ParseCarrie.hs
|
unlicense
|
semi = Token.semi lexer
| 35
|
semi = Token.semi lexer
| 35
|
semi = Token.semi lexer
| 35
| false
| false
| 1
| 6
| 15
| 14
| 5
| 9
| null | null |
roelvandijk/aeson
|
Data/Aeson/Parser/Internal.hs
|
bsd-3-clause
|
objectValues :: Parser Text -> Parser Value -> Parser (H.HashMap Text Value)
objectValues str val = do
skipSpace
w <- A.peekWord8'
if w == CLOSE_CURLY
then A.anyWord8 >> return H.empty
else loop H.empty
where
loop m0 = do
k <- str <* skipSpace <* char ':'
v <- val <* skipSpace
let !m = H.insert k v m0
ch <- A.satisfy $ \w -> w == COMMA || w == CLOSE_CURLY
if ch == COMMA
then skipSpace >> loop m
else return m
| 461
|
objectValues :: Parser Text -> Parser Value -> Parser (H.HashMap Text Value)
objectValues str val = do
skipSpace
w <- A.peekWord8'
if w == CLOSE_CURLY
then A.anyWord8 >> return H.empty
else loop H.empty
where
loop m0 = do
k <- str <* skipSpace <* char ':'
v <- val <* skipSpace
let !m = H.insert k v m0
ch <- A.satisfy $ \w -> w == COMMA || w == CLOSE_CURLY
if ch == COMMA
then skipSpace >> loop m
else return m
| 461
|
objectValues str val = do
skipSpace
w <- A.peekWord8'
if w == CLOSE_CURLY
then A.anyWord8 >> return H.empty
else loop H.empty
where
loop m0 = do
k <- str <* skipSpace <* char ':'
v <- val <* skipSpace
let !m = H.insert k v m0
ch <- A.satisfy $ \w -> w == COMMA || w == CLOSE_CURLY
if ch == COMMA
then skipSpace >> loop m
else return m
| 384
| false
| true
| 0
| 12
| 132
| 201
| 93
| 108
| null | null |
trbecker/liftio
|
src/LiftIO/Prelude.hs
|
mit
|
readFileM :: MonadIO m => FilePath -> m String
readFileM = liftIO . readFile
| 76
|
readFileM :: MonadIO m => FilePath -> m String
readFileM = liftIO . readFile
| 76
|
readFileM = liftIO . readFile
| 29
| false
| true
| 1
| 8
| 13
| 36
| 15
| 21
| null | null |
int-e/hint
|
generate/mk_extensions_mod.hs
|
bsd-3-clause
|
-- punctuateL p [d1, ..., dn] = [d1, p <> d2, ..., p <> dn]
punctuateL :: Doc -> [Doc] -> [Doc]
punctuateL _ [] = []
| 120
|
punctuateL :: Doc -> [Doc] -> [Doc]
punctuateL _ [] = []
| 60
|
punctuateL _ [] = []
| 24
| true
| true
| 0
| 9
| 30
| 41
| 20
| 21
| null | null |
TK009/loyly
|
Mixins.hs
|
mit
|
themeBackground = rgba 235 235 235 1
| 36
|
themeBackground = rgba 235 235 235 1
| 36
|
themeBackground = rgba 235 235 235 1
| 36
| false
| false
| 0
| 5
| 6
| 15
| 7
| 8
| null | null |
Gurmeet-Singh/Zeno
|
src/Zeno/Evaluation.hs
|
mit
|
evaluateExpr expr@(Cse id lhs alts) = do
lhs' <- liftM derivingTerm $ evaluateExpr lhs
facts <- asks (map equalityToPair)
let lhs'' = fromMaybe lhs' (lookup lhs' facts)
expr' = simplify (Cse id lhs'' alts)
if isConstructorTerm lhs''
then evaluateExpr expr'
else return [expr']
| 298
|
evaluateExpr expr@(Cse id lhs alts) = do
lhs' <- liftM derivingTerm $ evaluateExpr lhs
facts <- asks (map equalityToPair)
let lhs'' = fromMaybe lhs' (lookup lhs' facts)
expr' = simplify (Cse id lhs'' alts)
if isConstructorTerm lhs''
then evaluateExpr expr'
else return [expr']
| 298
|
evaluateExpr expr@(Cse id lhs alts) = do
lhs' <- liftM derivingTerm $ evaluateExpr lhs
facts <- asks (map equalityToPair)
let lhs'' = fromMaybe lhs' (lookup lhs' facts)
expr' = simplify (Cse id lhs'' alts)
if isConstructorTerm lhs''
then evaluateExpr expr'
else return [expr']
| 298
| false
| false
| 0
| 12
| 64
| 118
| 55
| 63
| null | null |
brendanhay/gogol
|
gogol-admin-directory/gen/Network/Google/Resource/Directory/Schemas/Get.hs
|
mpl-2.0
|
-- | JSONP
sgCallback :: Lens' SchemasGet (Maybe Text)
sgCallback
= lens _sgCallback (\ s a -> s{_sgCallback = a})
| 116
|
sgCallback :: Lens' SchemasGet (Maybe Text)
sgCallback
= lens _sgCallback (\ s a -> s{_sgCallback = a})
| 105
|
sgCallback
= lens _sgCallback (\ s a -> s{_sgCallback = a})
| 61
| true
| true
| 0
| 9
| 21
| 48
| 25
| 23
| null | null |
alephcloud/hs-configuration-tools
|
src/Configuration/Utils/Monoid.hs
|
mit
|
pLeftMonoidalUpdate ∷ Monoid a ⇒ O.Parser a → MParser a
pLeftMonoidalUpdate pElement = mappend ∘ mconcat ∘ reverse <$> many pElement
| 132
|
pLeftMonoidalUpdate ∷ Monoid a ⇒ O.Parser a → MParser a
pLeftMonoidalUpdate pElement = mappend ∘ mconcat ∘ reverse <$> many pElement
| 132
|
pLeftMonoidalUpdate pElement = mappend ∘ mconcat ∘ reverse <$> many pElement
| 76
| false
| true
| 0
| 8
| 20
| 48
| 22
| 26
| null | null |
oldmanmike/ghc
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
basicBlockCodeGen
:: CmmBlock
-> NatM ( [NatBasicBlock Instr]
, [NatCmmDecl (Alignment, CmmStatics) Instr])
basicBlockCodeGen block = do
let (_, nodes, tail) = blockSplit block
id = entryLabel block
stmts = blockToList nodes
-- Generate location directive
dbg <- getDebugBlock (entryLabel block)
loc_instrs <- case dblSourceTick =<< dbg of
Just (SourceNote span name)
-> do fileId <- getFileId (srcSpanFile span)
let line = srcSpanStartLine span; col = srcSpanStartCol span
return $ unitOL $ LOCATION fileId line col name
_ -> return nilOL
mid_instrs <- stmtsToInstrs stmts
tail_instrs <- stmtToInstrs tail
let instrs = loc_instrs `appOL` mid_instrs `appOL` tail_instrs
-- code generation may introduce new basic block boundaries, which
-- are indicated by the NEWBLOCK instruction. We must split up the
-- instruction stream into basic blocks again. Also, we extract
-- LDATAs here too.
let
(top,other_blocks,statics) = foldrOL mkBlocks ([],[],[]) instrs
mkBlocks (NEWBLOCK id) (instrs,blocks,statics)
= ([], BasicBlock id instrs : blocks, statics)
mkBlocks (LDATA sec dat) (instrs,blocks,statics)
= (instrs, blocks, CmmData sec dat:statics)
mkBlocks instr (instrs,blocks,statics)
= (instr:instrs, blocks, statics)
return (BasicBlock id top : other_blocks, statics)
| 1,441
|
basicBlockCodeGen
:: CmmBlock
-> NatM ( [NatBasicBlock Instr]
, [NatCmmDecl (Alignment, CmmStatics) Instr])
basicBlockCodeGen block = do
let (_, nodes, tail) = blockSplit block
id = entryLabel block
stmts = blockToList nodes
-- Generate location directive
dbg <- getDebugBlock (entryLabel block)
loc_instrs <- case dblSourceTick =<< dbg of
Just (SourceNote span name)
-> do fileId <- getFileId (srcSpanFile span)
let line = srcSpanStartLine span; col = srcSpanStartCol span
return $ unitOL $ LOCATION fileId line col name
_ -> return nilOL
mid_instrs <- stmtsToInstrs stmts
tail_instrs <- stmtToInstrs tail
let instrs = loc_instrs `appOL` mid_instrs `appOL` tail_instrs
-- code generation may introduce new basic block boundaries, which
-- are indicated by the NEWBLOCK instruction. We must split up the
-- instruction stream into basic blocks again. Also, we extract
-- LDATAs here too.
let
(top,other_blocks,statics) = foldrOL mkBlocks ([],[],[]) instrs
mkBlocks (NEWBLOCK id) (instrs,blocks,statics)
= ([], BasicBlock id instrs : blocks, statics)
mkBlocks (LDATA sec dat) (instrs,blocks,statics)
= (instrs, blocks, CmmData sec dat:statics)
mkBlocks instr (instrs,blocks,statics)
= (instr:instrs, blocks, statics)
return (BasicBlock id top : other_blocks, statics)
| 1,440
|
basicBlockCodeGen block = do
let (_, nodes, tail) = blockSplit block
id = entryLabel block
stmts = blockToList nodes
-- Generate location directive
dbg <- getDebugBlock (entryLabel block)
loc_instrs <- case dblSourceTick =<< dbg of
Just (SourceNote span name)
-> do fileId <- getFileId (srcSpanFile span)
let line = srcSpanStartLine span; col = srcSpanStartCol span
return $ unitOL $ LOCATION fileId line col name
_ -> return nilOL
mid_instrs <- stmtsToInstrs stmts
tail_instrs <- stmtToInstrs tail
let instrs = loc_instrs `appOL` mid_instrs `appOL` tail_instrs
-- code generation may introduce new basic block boundaries, which
-- are indicated by the NEWBLOCK instruction. We must split up the
-- instruction stream into basic blocks again. Also, we extract
-- LDATAs here too.
let
(top,other_blocks,statics) = foldrOL mkBlocks ([],[],[]) instrs
mkBlocks (NEWBLOCK id) (instrs,blocks,statics)
= ([], BasicBlock id instrs : blocks, statics)
mkBlocks (LDATA sec dat) (instrs,blocks,statics)
= (instrs, blocks, CmmData sec dat:statics)
mkBlocks instr (instrs,blocks,statics)
= (instr:instrs, blocks, statics)
return (BasicBlock id top : other_blocks, statics)
| 1,300
| false
| true
| 0
| 17
| 351
| 434
| 223
| 211
| null | null |
TomMD/ghc
|
compiler/rename/RnTypes.hs
|
bsd-3-clause
|
badInstTy :: LHsType RdrName -> SDoc
badInstTy ty = ptext (sLit "Malformed instance:") <+> ppr ty
| 97
|
badInstTy :: LHsType RdrName -> SDoc
badInstTy ty = ptext (sLit "Malformed instance:") <+> ppr ty
| 97
|
badInstTy ty = ptext (sLit "Malformed instance:") <+> ppr ty
| 60
| false
| true
| 0
| 8
| 15
| 37
| 17
| 20
| null | null |
KarimxD/Evolverbetert
|
src/Parameters.hs
|
mit
|
-- scales with number of loci in genome FIX: scale with genes
pTfbsDup = 2e-5 :: Prob
| 88
|
pTfbsDup = 2e-5 :: Prob
| 26
|
pTfbsDup = 2e-5 :: Prob
| 26
| true
| false
| 0
| 4
| 19
| 10
| 6
| 4
| null | null |
advancedtelematic/quickcheck-state-machine-model
|
test/RQlite.hs
|
bsd-3-clause
|
semantics :: MVar Int -> At Cmd Concrete -> IO (At Resp Concrete)
semantics counter (At cmd) = At . Resp <$> case cmd of
Insert node p -> do
_ <- insertQuery (httpHost $ cn $ concrete node) p
return $ Right Unit
Get node lvl -> do
res <- selectQuery lvl $ httpHost $ cn $ concrete node
return $ case res of
GetResult p -> Right $ Got p
GetError e -> Left $ SomeError $ show e
Spawn n t elt join -> do
putStrLnM $ "Starting at " ++ show n ++ " joining " ++ show join
c <- modifyMVar counter $ \m -> return (m + 1, m)
bracketOnError (mkNodeTime c n t elt join)
stopNode
$ \rqNode -> do
threadDelay 500000
_ <- retryUntilAlive $ httpHost n
_ <- createQuery $ httpHost n
return $ Right $ Spawned $ reference rqNode
ReSpawn n _ t elt join -> do
putStrLnM $ "Restarting at " ++ show n ++ " joining " ++ show join
c <- modifyMVar counter $ \m -> return (m + 1, m)
bracketOnError (mkNodeTime c n t elt join)
stopNode
$ \rqNode -> do
threadDelay 500000
_ <- retryUntilAlive $ httpHost n
return $ Right $ Spawned $ reference rqNode
Stop node -> do
putStrLnM $ "Stopping at " ++ show (cport $ concrete node)
stopNode $ concrete node
return $ Right Unit
Disconnect node -> do
disconnectNode $ nodeName $ concrete node
return $ Right Unit
Connect node -> do
connectNode $ concrete node
_ <- retryUntilAlive $ httpHost $ cn $ concrete node
return $ Right Unit
Pause node -> do
pauseNode $ concrete node
return $ Right Unit
UnPause node -> do
unPauseNode $ concrete node
return $ Right Unit
Delay n -> do
threadDelay n
return $ Right Unit
| 2,028
|
semantics :: MVar Int -> At Cmd Concrete -> IO (At Resp Concrete)
semantics counter (At cmd) = At . Resp <$> case cmd of
Insert node p -> do
_ <- insertQuery (httpHost $ cn $ concrete node) p
return $ Right Unit
Get node lvl -> do
res <- selectQuery lvl $ httpHost $ cn $ concrete node
return $ case res of
GetResult p -> Right $ Got p
GetError e -> Left $ SomeError $ show e
Spawn n t elt join -> do
putStrLnM $ "Starting at " ++ show n ++ " joining " ++ show join
c <- modifyMVar counter $ \m -> return (m + 1, m)
bracketOnError (mkNodeTime c n t elt join)
stopNode
$ \rqNode -> do
threadDelay 500000
_ <- retryUntilAlive $ httpHost n
_ <- createQuery $ httpHost n
return $ Right $ Spawned $ reference rqNode
ReSpawn n _ t elt join -> do
putStrLnM $ "Restarting at " ++ show n ++ " joining " ++ show join
c <- modifyMVar counter $ \m -> return (m + 1, m)
bracketOnError (mkNodeTime c n t elt join)
stopNode
$ \rqNode -> do
threadDelay 500000
_ <- retryUntilAlive $ httpHost n
return $ Right $ Spawned $ reference rqNode
Stop node -> do
putStrLnM $ "Stopping at " ++ show (cport $ concrete node)
stopNode $ concrete node
return $ Right Unit
Disconnect node -> do
disconnectNode $ nodeName $ concrete node
return $ Right Unit
Connect node -> do
connectNode $ concrete node
_ <- retryUntilAlive $ httpHost $ cn $ concrete node
return $ Right Unit
Pause node -> do
pauseNode $ concrete node
return $ Right Unit
UnPause node -> do
unPauseNode $ concrete node
return $ Right Unit
Delay n -> do
threadDelay n
return $ Right Unit
| 2,028
|
semantics counter (At cmd) = At . Resp <$> case cmd of
Insert node p -> do
_ <- insertQuery (httpHost $ cn $ concrete node) p
return $ Right Unit
Get node lvl -> do
res <- selectQuery lvl $ httpHost $ cn $ concrete node
return $ case res of
GetResult p -> Right $ Got p
GetError e -> Left $ SomeError $ show e
Spawn n t elt join -> do
putStrLnM $ "Starting at " ++ show n ++ " joining " ++ show join
c <- modifyMVar counter $ \m -> return (m + 1, m)
bracketOnError (mkNodeTime c n t elt join)
stopNode
$ \rqNode -> do
threadDelay 500000
_ <- retryUntilAlive $ httpHost n
_ <- createQuery $ httpHost n
return $ Right $ Spawned $ reference rqNode
ReSpawn n _ t elt join -> do
putStrLnM $ "Restarting at " ++ show n ++ " joining " ++ show join
c <- modifyMVar counter $ \m -> return (m + 1, m)
bracketOnError (mkNodeTime c n t elt join)
stopNode
$ \rqNode -> do
threadDelay 500000
_ <- retryUntilAlive $ httpHost n
return $ Right $ Spawned $ reference rqNode
Stop node -> do
putStrLnM $ "Stopping at " ++ show (cport $ concrete node)
stopNode $ concrete node
return $ Right Unit
Disconnect node -> do
disconnectNode $ nodeName $ concrete node
return $ Right Unit
Connect node -> do
connectNode $ concrete node
_ <- retryUntilAlive $ httpHost $ cn $ concrete node
return $ Right Unit
Pause node -> do
pauseNode $ concrete node
return $ Right Unit
UnPause node -> do
unPauseNode $ concrete node
return $ Right Unit
Delay n -> do
threadDelay n
return $ Right Unit
| 1,962
| false
| true
| 10
| 13
| 809
| 719
| 317
| 402
| null | null |
yliu120/K3
|
src/Language/K3/Codegen/CPP/Materialization.hs
|
apache-2.0
|
getProvenance :: K3 Expression -> K3 Provenance
getProvenance e = let EProvenance p = fromMaybe (error "No provenance on expression.")
(e @~ \case { EProvenance _ -> True; _ -> False}) in p
| 227
|
getProvenance :: K3 Expression -> K3 Provenance
getProvenance e = let EProvenance p = fromMaybe (error "No provenance on expression.")
(e @~ \case { EProvenance _ -> True; _ -> False}) in p
| 227
|
getProvenance e = let EProvenance p = fromMaybe (error "No provenance on expression.")
(e @~ \case { EProvenance _ -> True; _ -> False}) in p
| 179
| false
| true
| 0
| 15
| 70
| 82
| 38
| 44
| null | null |
shmuga/99-haskell-problems
|
src/Utils/Helpers.hs
|
gpl-3.0
|
elementAt :: [a] -> Int -> a
elementAt [] _ = error "Cant pop empty list"
| 73
|
elementAt :: [a] -> Int -> a
elementAt [] _ = error "Cant pop empty list"
| 73
|
elementAt [] _ = error "Cant pop empty list"
| 44
| false
| true
| 0
| 9
| 15
| 37
| 17
| 20
| null | null |
jozefg/f2js
|
src/Language/F2JS/Lift.hs
|
mit
|
-- | Propogate bindings in record fields up a level. This is slow and
-- stupid now but it's simple *shrug*.
mergeRecord :: [(Name, Expr)] -> Expr
mergeRecord rs =
let l = length rs
newRec = zip (map fst rs) (map Var [0..])
binds = map (Bind Nothing . succExpr l . snd) rs
in LetRec binds (Record newRec)
| 320
|
mergeRecord :: [(Name, Expr)] -> Expr
mergeRecord rs =
let l = length rs
newRec = zip (map fst rs) (map Var [0..])
binds = map (Bind Nothing . succExpr l . snd) rs
in LetRec binds (Record newRec)
| 211
|
mergeRecord rs =
let l = length rs
newRec = zip (map fst rs) (map Var [0..])
binds = map (Bind Nothing . succExpr l . snd) rs
in LetRec binds (Record newRec)
| 173
| true
| true
| 0
| 13
| 75
| 110
| 56
| 54
| null | null |
kim/amazonka
|
amazonka-cloudsearch-domains/gen/Network/AWS/CloudSearchDomains/Search.hs
|
mpl-2.0
|
-- | Specifies the field and expression values to include in the response.
-- Multiple fields or expressions are specified as a comma-separated list. By
-- default, a search response includes all return enabled fields ('_all_fields').
-- To return only the document IDs for the matching documents, specify '_no_fields'
-- . To retrieve the relevance score calculated for each document, specify '_score'
-- .
s1Return :: Lens' Search (Maybe Text)
s1Return = lens _s1Return (\s a -> s { _s1Return = a })
| 501
|
s1Return :: Lens' Search (Maybe Text)
s1Return = lens _s1Return (\s a -> s { _s1Return = a })
| 93
|
s1Return = lens _s1Return (\s a -> s { _s1Return = a })
| 55
| true
| true
| 0
| 9
| 82
| 51
| 30
| 21
| null | null |
nayosx/postgrest
|
test/SpecHelper.hs
|
mit
|
testPool :: IO(H.Pool P.Postgres)
testPool = H.acquirePool pgSettings testPoolOpts
| 82
|
testPool :: IO(H.Pool P.Postgres)
testPool = H.acquirePool pgSettings testPoolOpts
| 82
|
testPool = H.acquirePool pgSettings testPoolOpts
| 48
| false
| true
| 2
| 7
| 8
| 39
| 15
| 24
| null | null |
shadwstalkr/sqlite-admin
|
Sqlite/Types.hs
|
gpl-3.0
|
convertSqlValue :: SqliteValType -> SqlValue -> SqliteValue
convertSqlValue _ SqlNull = SqliteNull
| 98
|
convertSqlValue :: SqliteValType -> SqlValue -> SqliteValue
convertSqlValue _ SqlNull = SqliteNull
| 98
|
convertSqlValue _ SqlNull = SqliteNull
| 38
| false
| true
| 0
| 6
| 11
| 24
| 12
| 12
| null | null |
nevrenato/HetsAlloy
|
Logic/Grothendieck.hs
|
gpl-2.0
|
logicOfGsign :: G_sign -> AnyLogic
logicOfGsign (G_sign lid _ _) = Logic lid
| 76
|
logicOfGsign :: G_sign -> AnyLogic
logicOfGsign (G_sign lid _ _) = Logic lid
| 76
|
logicOfGsign (G_sign lid _ _) = Logic lid
| 41
| false
| true
| 0
| 7
| 12
| 31
| 15
| 16
| null | null |
alexander-at-github/eta
|
compiler/ETA/Utils/Outputable.hs
|
bsd-3-clause
|
colCoerc :: PprColour
colCoerc = PprColour "\27[34m"
| 52
|
colCoerc :: PprColour
colCoerc = PprColour "\27[34m"
| 52
|
colCoerc = PprColour "\27[34m"
| 30
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
olsner/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
kindTyConName = thTc (fsLit "Kind") kindTyConKey
| 67
|
kindTyConName = thTc (fsLit "Kind") kindTyConKey
| 67
|
kindTyConName = thTc (fsLit "Kind") kindTyConKey
| 67
| false
| false
| 0
| 7
| 24
| 17
| 8
| 9
| null | null |
the-real-blackh/hexpat
|
test/suite/Text/XML/Expat/Proc/Tests.hs
|
bsd-3-clause
|
prop_filterElements1 :: TNode -> Bool
prop_filterElements1 n@(Text _) = filterElements isText n == [n]
| 110
|
prop_filterElements1 :: TNode -> Bool
prop_filterElements1 n@(Text _) = filterElements isText n == [n]
| 110
|
prop_filterElements1 n@(Text _) = filterElements isText n == [n]
| 72
| false
| true
| 0
| 8
| 21
| 39
| 20
| 19
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/Document.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/Document.body Mozilla Document.body documentation>
getBody ::
(MonadDOM m, IsDocument self) => self -> m (Maybe HTMLElement)
getBody self
= liftDOM (((toDocument self) ^. js "body") >>= fromJSVal)
| 262
|
getBody ::
(MonadDOM m, IsDocument self) => self -> m (Maybe HTMLElement)
getBody self
= liftDOM (((toDocument self) ^. js "body") >>= fromJSVal)
| 155
|
getBody self
= liftDOM (((toDocument self) ^. js "body") >>= fromJSVal)
| 73
| true
| true
| 0
| 11
| 39
| 69
| 35
| 34
| null | null |
sboosali/commands-frontend-DragonNaturallySpeaking
|
sources/Commands/Mixins/DNS13OSX9/Frontend.hs
|
bsd-3-clause
|
unVoidDNSRHS :: DNSRHS t Void -> DNSRHS t n
unVoidDNSRHS = second (\case)
| 73
|
unVoidDNSRHS :: DNSRHS t Void -> DNSRHS t n
unVoidDNSRHS = second (\case)
| 73
|
unVoidDNSRHS = second (\case)
| 29
| false
| true
| 2
| 6
| 12
| 36
| 17
| 19
| null | null |
LambdaHack/LambdaHack
|
engine-src/Game/LambdaHack/Client/UI/EffectDescription.hs
|
bsd-3-clause
|
describeCrafting :: [(Int, GroupName ItemKind)]
-> [(Int, GroupName ItemKind)]
-> Effect
-> (Text, Text, Text)
describeCrafting tools raw eff =
let unCreate (CreateItem (Just k) _ grp _) = [(k, grp)]
unCreate (SeqEffect effs) = concatMap unCreate effs
unCreate _ = []
grpsCreate = unCreate eff
tcraft = makePhrase $
"of crafting"
: (if null grpsCreate
then ["nothing"]
else [describeTools grpsCreate])
traw = makePhrase $
if null raw
then []
else ["from", describeTools raw]
ttools = makePhrase $
if null tools
then []
else ["using", describeTools tools]
in (tcraft, traw, ttools)
| 757
|
describeCrafting :: [(Int, GroupName ItemKind)]
-> [(Int, GroupName ItemKind)]
-> Effect
-> (Text, Text, Text)
describeCrafting tools raw eff =
let unCreate (CreateItem (Just k) _ grp _) = [(k, grp)]
unCreate (SeqEffect effs) = concatMap unCreate effs
unCreate _ = []
grpsCreate = unCreate eff
tcraft = makePhrase $
"of crafting"
: (if null grpsCreate
then ["nothing"]
else [describeTools grpsCreate])
traw = makePhrase $
if null raw
then []
else ["from", describeTools raw]
ttools = makePhrase $
if null tools
then []
else ["using", describeTools tools]
in (tcraft, traw, ttools)
| 757
|
describeCrafting tools raw eff =
let unCreate (CreateItem (Just k) _ grp _) = [(k, grp)]
unCreate (SeqEffect effs) = concatMap unCreate effs
unCreate _ = []
grpsCreate = unCreate eff
tcraft = makePhrase $
"of crafting"
: (if null grpsCreate
then ["nothing"]
else [describeTools grpsCreate])
traw = makePhrase $
if null raw
then []
else ["from", describeTools raw]
ttools = makePhrase $
if null tools
then []
else ["using", describeTools tools]
in (tcraft, traw, ttools)
| 595
| false
| true
| 0
| 13
| 267
| 248
| 134
| 114
| null | null |
buckie/scheme48
|
src/Scheme48/Env.hs
|
mit
|
setVar :: Env -> String -> LispVal -> IOThrowsError LispVal
setVar envRef var value = do
env <- liftIO $ readIORef envRef
maybe (throwError $ UnboundVar "Setting an unbound variable" var)
(liftIO . (flip writeIORef value))
(lookup var env)
return value
| 274
|
setVar :: Env -> String -> LispVal -> IOThrowsError LispVal
setVar envRef var value = do
env <- liftIO $ readIORef envRef
maybe (throwError $ UnboundVar "Setting an unbound variable" var)
(liftIO . (flip writeIORef value))
(lookup var env)
return value
| 274
|
setVar envRef var value = do
env <- liftIO $ readIORef envRef
maybe (throwError $ UnboundVar "Setting an unbound variable" var)
(liftIO . (flip writeIORef value))
(lookup var env)
return value
| 214
| false
| true
| 0
| 12
| 62
| 103
| 47
| 56
| null | null |
zepto-lang/zepto-js
|
src/Zepto/Primitives/ListPrimitives.hs
|
gpl-2.0
|
allExtend v@[List _, _] = listExtend v
| 38
|
allExtend v@[List _, _] = listExtend v
| 38
|
allExtend v@[List _, _] = listExtend v
| 38
| false
| false
| 0
| 8
| 6
| 24
| 12
| 12
| null | null |
sedillard/Vec
|
examples/Examples.hs
|
bsd-2-clause
|
--t7 is Vec4 Float
--get the determinant of a matrix
t8 = det m3
| 65
|
t8 = det m3
| 11
|
t8 = det m3
| 11
| true
| false
| 1
| 5
| 14
| 14
| 6
| 8
| null | null |
CDSoft/pp
|
src/Preprocessor.hs
|
gpl-3.0
|
-- !comment[(title)](text) ignores title and text (just comments, no preprocessing)
comment :: Macro
comment = Macro "comment" []
"`!comment(TEXT)` considers `TEXT` as well as any additional parameters as comment. Nothing is preprocessed or returned."
(\env _ -> return (env, ""))
| 288
|
comment :: Macro
comment = Macro "comment" []
"`!comment(TEXT)` considers `TEXT` as well as any additional parameters as comment. Nothing is preprocessed or returned."
(\env _ -> return (env, ""))
| 204
|
comment = Macro "comment" []
"`!comment(TEXT)` considers `TEXT` as well as any additional parameters as comment. Nothing is preprocessed or returned."
(\env _ -> return (env, ""))
| 187
| true
| true
| 0
| 9
| 47
| 52
| 24
| 28
| null | null |
blockapps/mgit
|
src/Main.hs
|
bsd-3-clause
|
onlyIfChanged "push" = True
| 27
|
onlyIfChanged "push" = True
| 27
|
onlyIfChanged "push" = True
| 27
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
alexander-at-github/eta
|
compiler/ETA/DeSugar/Coverage.hs
|
bsd-3-clause
|
tickSameFileOnly :: TickishType -> Bool
tickSameFileOnly HpcTicks = True
| 72
|
tickSameFileOnly :: TickishType -> Bool
tickSameFileOnly HpcTicks = True
| 72
|
tickSameFileOnly HpcTicks = True
| 32
| false
| true
| 0
| 7
| 8
| 24
| 10
| 14
| null | null |
david415/tails
|
wiki/src/promote/slides/Tails-SIT_conference-201206/pandoc-filters/mpastell_com.hs
|
gpl-3.0
|
main = interact $ jsonFilter $ bottomUp mpastell
| 48
|
main = interact $ jsonFilter $ bottomUp mpastell
| 48
|
main = interact $ jsonFilter $ bottomUp mpastell
| 48
| false
| false
| 3
| 6
| 7
| 21
| 8
| 13
| null | null |
GaloisInc/halvm-ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
-- | Create a machine word literal expression of type @Word#@ from a @Word@.
-- If you want an expression of type @Word@ use 'MkCore.mkWordExpr'
mkWordLitWord :: DynFlags -> Word -> Expr b
mkWordLit dflags w = Lit (mkMachWord dflags w)
| 241
|
mkWordLitWord :: DynFlags -> Word -> Expr b
mkWordLit dflags w = Lit (mkMachWord dflags w)
| 94
|
mkWordLit dflags w = Lit (mkMachWord dflags w)
| 50
| true
| true
| 0
| 8
| 46
| 45
| 21
| 24
| null | null |
wujf/yesod
|
yesod-static/Yesod/Static.hs
|
mit
|
base64md5File :: Prelude.FilePath -> IO String
base64md5File = fmap (base64 . encode) . hashFile
where encode d = Byteable.toBytes (d :: Digest MD5)
| 152
|
base64md5File :: Prelude.FilePath -> IO String
base64md5File = fmap (base64 . encode) . hashFile
where encode d = Byteable.toBytes (d :: Digest MD5)
| 152
|
base64md5File = fmap (base64 . encode) . hashFile
where encode d = Byteable.toBytes (d :: Digest MD5)
| 105
| false
| true
| 1
| 7
| 26
| 67
| 30
| 37
| null | null |
haslab/SecreC
|
src/Language/SecreC/Transformation/Dafny.hs
|
gpl-3.0
|
builtinToDafny isLVal isQExpr annK (Typed l ret) n es = do
ppannK <- lift $ pp annK
ppret <- lift $ pp ret
ppn <- lift $ pp n
ppes <- lift $ pp es
genError l $ text "builtinToDafny: unexpected" <+> ppannK <+> ppret <+> ppn <+> ppes
| 251
|
builtinToDafny isLVal isQExpr annK (Typed l ret) n es = do
ppannK <- lift $ pp annK
ppret <- lift $ pp ret
ppn <- lift $ pp n
ppes <- lift $ pp es
genError l $ text "builtinToDafny: unexpected" <+> ppannK <+> ppret <+> ppn <+> ppes
| 251
|
builtinToDafny isLVal isQExpr annK (Typed l ret) n es = do
ppannK <- lift $ pp annK
ppret <- lift $ pp ret
ppn <- lift $ pp n
ppes <- lift $ pp es
genError l $ text "builtinToDafny: unexpected" <+> ppannK <+> ppret <+> ppn <+> ppes
| 251
| false
| false
| 0
| 12
| 68
| 112
| 50
| 62
| null | null |
snoyberg/ghc
|
compiler/basicTypes/Name.hs
|
bsd-3-clause
|
nameSrcSpan name = n_loc name
| 30
|
nameSrcSpan name = n_loc name
| 30
|
nameSrcSpan name = n_loc name
| 30
| false
| false
| 0
| 5
| 5
| 12
| 5
| 7
| null | null |
jstolarek/ghc
|
compiler/nativeGen/X86/Ppr.hs
|
bsd-3-clause
|
pprInstr :: Instr -> SDoc
pprInstr (COMMENT _) = empty
| 55
|
pprInstr :: Instr -> SDoc
pprInstr (COMMENT _) = empty
| 54
|
pprInstr (COMMENT _) = empty
| 28
| false
| true
| 0
| 7
| 10
| 24
| 12
| 12
| null | null |
hbasold/Sandbox
|
OTTTests/DecideEquiv.hs
|
mit
|
reduceCheck d t@(In _ _) p = return t
| 37
|
reduceCheck d t@(In _ _) p = return t
| 37
|
reduceCheck d t@(In _ _) p = return t
| 37
| false
| false
| 1
| 7
| 8
| 35
| 13
| 22
| null | null |
jrclogic/SMCDEL
|
src/SMCDEL/Symbolic/S5.hs
|
gpl-2.0
|
boolEvalViaBdd :: [Prp] -> Form -> Bool
boolEvalViaBdd truths = bddEval truths . boolBddOf
| 90
|
boolEvalViaBdd :: [Prp] -> Form -> Bool
boolEvalViaBdd truths = bddEval truths . boolBddOf
| 90
|
boolEvalViaBdd truths = bddEval truths . boolBddOf
| 50
| false
| true
| 0
| 6
| 13
| 32
| 16
| 16
| null | null |
baalbek/ns3473beam
|
src/NS3473Beam/System.hs
|
gpl-3.0
|
calcXiFactor :: CL.Main -> IO ()
calcXiFactor opts =
let eeFn | (CL.lt opts) == True = M.eeLt
| otherwise = M.ee
beam = createBeam opts
xi = B.xiFact eeFn beam in
putStrLn (show beam) >>
printf "\nXi factor %.8f\n" xi >>
return ()
| 277
|
calcXiFactor :: CL.Main -> IO ()
calcXiFactor opts =
let eeFn | (CL.lt opts) == True = M.eeLt
| otherwise = M.ee
beam = createBeam opts
xi = B.xiFact eeFn beam in
putStrLn (show beam) >>
printf "\nXi factor %.8f\n" xi >>
return ()
| 277
|
calcXiFactor opts =
let eeFn | (CL.lt opts) == True = M.eeLt
| otherwise = M.ee
beam = createBeam opts
xi = B.xiFact eeFn beam in
putStrLn (show beam) >>
printf "\nXi factor %.8f\n" xi >>
return ()
| 244
| false
| true
| 0
| 15
| 90
| 114
| 53
| 61
| null | null |
arnizamani/aiw
|
AliceLib.hs
|
gpl-2.0
|
-- [[0]]
satisfy concepts values 1 _ = length (nub' values) >= (if concepts > 2 then 3 else 2)
| 96
|
satisfy concepts values 1 _ = length (nub' values) >= (if concepts > 2 then 3 else 2)
| 86
|
satisfy concepts values 1 _ = length (nub' values) >= (if concepts > 2 then 3 else 2)
| 86
| true
| false
| 0
| 8
| 21
| 48
| 23
| 25
| null | null |
kazu-yamamoto/llrbtree
|
Data/Set/LLRBTree.hs
|
bsd-3-clause
|
turnB' :: RBTree a -> RBTree a
turnB' Leaf = Leaf
| 61
|
turnB' :: RBTree a -> RBTree a
turnB' Leaf = Leaf
| 61
|
turnB' Leaf = Leaf
| 30
| false
| true
| 0
| 7
| 22
| 29
| 12
| 17
| null | null |
sonyandy/fd
|
src/Control/Monad/FD/Internal.hs
|
bsd-3-clause
|
retainRange (Dom x) dom' = do
dom'' <- readDomain x
return $! prunedFromTo dom' $ Dom.intersection dom' dom''
| 113
|
retainRange (Dom x) dom' = do
dom'' <- readDomain x
return $! prunedFromTo dom' $ Dom.intersection dom' dom''
| 113
|
retainRange (Dom x) dom' = do
dom'' <- readDomain x
return $! prunedFromTo dom' $ Dom.intersection dom' dom''
| 113
| false
| false
| 0
| 9
| 21
| 48
| 21
| 27
| null | null |
hpacheco/jasminv
|
src/Language/Jasmin/TypeChecker.hs
|
gpl-3.0
|
tt_lvalue_r l (PLParens e) = do
e' <- mapM (tt_lvalue) e
let tys = map locTy' e'
t <- if all isJust tys
then liftM Just $ tt_concat_types l (map fromJust tys)
else return Nothing
return (PLParens e',t)
| 233
|
tt_lvalue_r l (PLParens e) = do
e' <- mapM (tt_lvalue) e
let tys = map locTy' e'
t <- if all isJust tys
then liftM Just $ tt_concat_types l (map fromJust tys)
else return Nothing
return (PLParens e',t)
| 233
|
tt_lvalue_r l (PLParens e) = do
e' <- mapM (tt_lvalue) e
let tys = map locTy' e'
t <- if all isJust tys
then liftM Just $ tt_concat_types l (map fromJust tys)
else return Nothing
return (PLParens e',t)
| 233
| false
| false
| 0
| 12
| 69
| 104
| 48
| 56
| null | null |
phischu/fragnix
|
tests/packages/scotty/Data.Time.Format.Locale.hs
|
bsd-3-clause
|
{- | Construct format string according to <http://en.wikipedia.org/wiki/ISO_8601 ISO-8601>.
The @Maybe String@ argument allows to supply an optional time specification. E.g.:
@
'iso8601DateFormat' Nothing == "%Y-%m-%d" -- i.e. @/YYYY-MM-DD/@
'iso8601DateFormat' (Just "%H:%M:%S") == "%Y-%m-%dT%H:%M:%S" -- i.e. @/YYYY-MM-DD/T/HH:MM:SS/@
@
-}
iso8601DateFormat :: Maybe String -> String
iso8601DateFormat mTimeFmt =
"%Y-%m-%d" ++ case mTimeFmt of
Nothing -> ""
Just fmt -> 'T' : fmt
-- | Format string according to <http://tools.ietf.org/html/rfc822#section-5 RFC822>.
| 625
|
iso8601DateFormat :: Maybe String -> String
iso8601DateFormat mTimeFmt =
"%Y-%m-%d" ++ case mTimeFmt of
Nothing -> ""
Just fmt -> 'T' : fmt
-- | Format string according to <http://tools.ietf.org/html/rfc822#section-5 RFC822>.
| 257
|
iso8601DateFormat mTimeFmt =
"%Y-%m-%d" ++ case mTimeFmt of
Nothing -> ""
Just fmt -> 'T' : fmt
-- | Format string according to <http://tools.ietf.org/html/rfc822#section-5 RFC822>.
| 213
| true
| true
| 0
| 9
| 127
| 50
| 25
| 25
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.