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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ingemaradahl/bilder
|
src/TypeChecker/Renamer/Utils.hs
|
lgpl-3.0
|
popAlias ∷ TCM ()
popAlias = modify (\st → st { aliases = tail (aliases st)})
| 77
|
popAlias ∷ TCM ()
popAlias = modify (\st → st { aliases = tail (aliases st)})
| 77
|
popAlias = modify (\st → st { aliases = tail (aliases st)})
| 59
| false
| true
| 0
| 12
| 15
| 50
| 24
| 26
| null | null |
PipocaQuemada/ermine
|
src/Ermine/Console/Command.hs
|
bsd-2-clause
|
procArgs :: [String] -> NonEmpty (String, a) -> a
procArgs args (x :| xs) = foldl f (snd x) args
where
m = x:xs
f r s | Just a <- lookup s m = a
| otherwise = r
| 181
|
procArgs :: [String] -> NonEmpty (String, a) -> a
procArgs args (x :| xs) = foldl f (snd x) args
where
m = x:xs
f r s | Just a <- lookup s m = a
| otherwise = r
| 181
|
procArgs args (x :| xs) = foldl f (snd x) args
where
m = x:xs
f r s | Just a <- lookup s m = a
| otherwise = r
| 131
| false
| true
| 4
| 10
| 60
| 118
| 53
| 65
| null | null |
na4zagin3/uhim-dict
|
src/Language/UHIM/Japanese/Verb.hs
|
gpl-3.0
|
conjEnding StemN "a" = NonChange "な"
| 36
|
conjEnding StemN "a" = NonChange "な"
| 36
|
conjEnding StemN "a" = NonChange "な"
| 36
| false
| false
| 0
| 5
| 5
| 14
| 6
| 8
| null | null |
beni55/texmath
|
src/Text/TeXMath/Readers/TeX/Macros.hs
|
gpl-2.0
|
apply _ "" = ""
| 15
|
apply _ "" = ""
| 15
|
apply _ "" = ""
| 15
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
thoughtpolice/cabal
|
Cabal/Distribution/PackageDescription/Check.hs
|
bsd-3-clause
|
--TODO: check location looks like a URL for some repo types.
checkGhcOptions :: PackageDescription -> [PackageCheck]
checkGhcOptions pkg =
catMaybes [
checkFlags ["-fasm"] $
PackageDistInexcusable $
"'ghc-options: -fasm' is unnecessary and will not work on CPU "
++ "architectures other than x86, x86-64, ppc or sparc."
, checkFlags ["-fvia-C"] $
PackageDistSuspicious $
"'ghc-options: -fvia-C' is usually unnecessary. If your package "
++ "needs -via-C for correctness rather than performance then it "
++ "is using the FFI incorrectly and will probably not work with GHC "
++ "6.10 or later."
, checkFlags ["-fhpc"] $
PackageDistInexcusable $
"'ghc-options: -fhpc' is not not necessary. Use the configure flag "
++ " --enable-coverage instead."
, checkFlags ["-prof"] $
PackageBuildWarning $
"'ghc-options: -prof' is not necessary and will lead to problems "
++ "when used on a library. Use the configure flag "
++ "--enable-library-profiling and/or --enable-executable-profiling."
, checkFlags ["-o"] $
PackageBuildWarning $
"'ghc-options: -o' is not needed. "
++ "The output files are named automatically."
, checkFlags ["-hide-package"] $
PackageBuildWarning $
"'ghc-options: -hide-package' is never needed. "
++ "Cabal hides all packages."
, checkFlags ["--make"] $
PackageBuildWarning $
"'ghc-options: --make' is never needed. Cabal uses this automatically."
, checkFlags ["-main-is"] $
PackageDistSuspicious $
"'ghc-options: -main-is' is not portable."
, checkFlags ["-O0", "-Onot"] $
PackageDistSuspicious $
"'ghc-options: -O0' is not needed. "
++ "Use the --disable-optimization configure flag."
, checkFlags [ "-O", "-O1"] $
PackageDistInexcusable $
"'ghc-options: -O' is not needed. "
++ "Cabal automatically adds the '-O' flag. "
++ "Setting it yourself interferes with the --disable-optimization flag."
, checkFlags ["-O2"] $
PackageDistSuspiciousWarn $
"'ghc-options: -O2' is rarely needed. "
++ "Check that it is giving a real benefit "
++ "and not just imposing longer compile times on your users."
, checkFlags ["-split-objs"] $
PackageBuildWarning $
"'ghc-options: -split-objs' is not needed. "
++ "Use the --enable-split-objs configure flag."
, checkFlags ["-optl-Wl,-s", "-optl-s"] $
PackageDistInexcusable $
"'ghc-options: -optl-Wl,-s' is not needed and is not portable to all"
++ " operating systems. Cabal 1.4 and later automatically strip"
++ " executables. Cabal also has a flag --disable-executable-stripping"
++ " which is necessary when building packages for some Linux"
++ " distributions and using '-optl-Wl,-s' prevents that from working."
, checkFlags ["-fglasgow-exts"] $
PackageDistSuspicious $
"Instead of 'ghc-options: -fglasgow-exts' it is preferable to use "
++ "the 'extensions' field."
, check ("-threaded" `elem` lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -threaded' has no effect for libraries. It should "
++ "only be used for executables."
, check ("-rtsopts" `elem` lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -rtsopts' has no effect for libraries. It should "
++ "only be used for executables."
, check (any (\opt -> "-with-rtsopts" `isPrefixOf` opt) lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -with-rtsopts' has no effect for libraries. It "
++ "should only be used for executables."
, checkAlternatives "ghc-options" "extensions"
[ (flag, display extension) | flag <- all_ghc_options
, Just extension <- [ghcExtension flag] ]
, checkAlternatives "ghc-options" "extensions"
[ (flag, extension) | flag@('-':'X':extension) <- all_ghc_options ]
, checkAlternatives "ghc-options" "cpp-options" $
[ (flag, flag) | flag@('-':'D':_) <- all_ghc_options ]
++ [ (flag, flag) | flag@('-':'U':_) <- all_ghc_options ]
, checkAlternatives "ghc-options" "include-dirs"
[ (flag, dir) | flag@('-':'I':dir) <- all_ghc_options ]
, checkAlternatives "ghc-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ghc_options ]
, checkAlternatives "ghc-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ghc_options ]
]
where
all_ghc_options = concatMap get_ghc_options (allBuildInfo pkg)
lib_ghc_options = maybe [] (get_ghc_options . libBuildInfo) (library pkg)
get_ghc_options bi = hcOptions GHC bi ++ hcProfOptions GHC bi
checkFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkFlags flags = check (any (`elem` flags) all_ghc_options)
ghcExtension ('-':'f':name) = case name of
"allow-overlapping-instances" -> enable OverlappingInstances
"no-allow-overlapping-instances" -> disable OverlappingInstances
"th" -> enable TemplateHaskell
"no-th" -> disable TemplateHaskell
"ffi" -> enable ForeignFunctionInterface
"no-ffi" -> disable ForeignFunctionInterface
"fi" -> enable ForeignFunctionInterface
"no-fi" -> disable ForeignFunctionInterface
"monomorphism-restriction" -> enable MonomorphismRestriction
"no-monomorphism-restriction" -> disable MonomorphismRestriction
"mono-pat-binds" -> enable MonoPatBinds
"no-mono-pat-binds" -> disable MonoPatBinds
"allow-undecidable-instances" -> enable UndecidableInstances
"no-allow-undecidable-instances" -> disable UndecidableInstances
"allow-incoherent-instances" -> enable IncoherentInstances
"no-allow-incoherent-instances" -> disable IncoherentInstances
"arrows" -> enable Arrows
"no-arrows" -> disable Arrows
"generics" -> enable Generics
"no-generics" -> disable Generics
"implicit-prelude" -> enable ImplicitPrelude
"no-implicit-prelude" -> disable ImplicitPrelude
"implicit-params" -> enable ImplicitParams
"no-implicit-params" -> disable ImplicitParams
"bang-patterns" -> enable BangPatterns
"no-bang-patterns" -> disable BangPatterns
"scoped-type-variables" -> enable ScopedTypeVariables
"no-scoped-type-variables" -> disable ScopedTypeVariables
"extended-default-rules" -> enable ExtendedDefaultRules
"no-extended-default-rules" -> disable ExtendedDefaultRules
_ -> Nothing
ghcExtension "-cpp" = enable CPP
ghcExtension _ = Nothing
enable e = Just (EnableExtension e)
disable e = Just (DisableExtension e)
| 7,259
|
checkGhcOptions :: PackageDescription -> [PackageCheck]
checkGhcOptions pkg =
catMaybes [
checkFlags ["-fasm"] $
PackageDistInexcusable $
"'ghc-options: -fasm' is unnecessary and will not work on CPU "
++ "architectures other than x86, x86-64, ppc or sparc."
, checkFlags ["-fvia-C"] $
PackageDistSuspicious $
"'ghc-options: -fvia-C' is usually unnecessary. If your package "
++ "needs -via-C for correctness rather than performance then it "
++ "is using the FFI incorrectly and will probably not work with GHC "
++ "6.10 or later."
, checkFlags ["-fhpc"] $
PackageDistInexcusable $
"'ghc-options: -fhpc' is not not necessary. Use the configure flag "
++ " --enable-coverage instead."
, checkFlags ["-prof"] $
PackageBuildWarning $
"'ghc-options: -prof' is not necessary and will lead to problems "
++ "when used on a library. Use the configure flag "
++ "--enable-library-profiling and/or --enable-executable-profiling."
, checkFlags ["-o"] $
PackageBuildWarning $
"'ghc-options: -o' is not needed. "
++ "The output files are named automatically."
, checkFlags ["-hide-package"] $
PackageBuildWarning $
"'ghc-options: -hide-package' is never needed. "
++ "Cabal hides all packages."
, checkFlags ["--make"] $
PackageBuildWarning $
"'ghc-options: --make' is never needed. Cabal uses this automatically."
, checkFlags ["-main-is"] $
PackageDistSuspicious $
"'ghc-options: -main-is' is not portable."
, checkFlags ["-O0", "-Onot"] $
PackageDistSuspicious $
"'ghc-options: -O0' is not needed. "
++ "Use the --disable-optimization configure flag."
, checkFlags [ "-O", "-O1"] $
PackageDistInexcusable $
"'ghc-options: -O' is not needed. "
++ "Cabal automatically adds the '-O' flag. "
++ "Setting it yourself interferes with the --disable-optimization flag."
, checkFlags ["-O2"] $
PackageDistSuspiciousWarn $
"'ghc-options: -O2' is rarely needed. "
++ "Check that it is giving a real benefit "
++ "and not just imposing longer compile times on your users."
, checkFlags ["-split-objs"] $
PackageBuildWarning $
"'ghc-options: -split-objs' is not needed. "
++ "Use the --enable-split-objs configure flag."
, checkFlags ["-optl-Wl,-s", "-optl-s"] $
PackageDistInexcusable $
"'ghc-options: -optl-Wl,-s' is not needed and is not portable to all"
++ " operating systems. Cabal 1.4 and later automatically strip"
++ " executables. Cabal also has a flag --disable-executable-stripping"
++ " which is necessary when building packages for some Linux"
++ " distributions and using '-optl-Wl,-s' prevents that from working."
, checkFlags ["-fglasgow-exts"] $
PackageDistSuspicious $
"Instead of 'ghc-options: -fglasgow-exts' it is preferable to use "
++ "the 'extensions' field."
, check ("-threaded" `elem` lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -threaded' has no effect for libraries. It should "
++ "only be used for executables."
, check ("-rtsopts" `elem` lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -rtsopts' has no effect for libraries. It should "
++ "only be used for executables."
, check (any (\opt -> "-with-rtsopts" `isPrefixOf` opt) lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -with-rtsopts' has no effect for libraries. It "
++ "should only be used for executables."
, checkAlternatives "ghc-options" "extensions"
[ (flag, display extension) | flag <- all_ghc_options
, Just extension <- [ghcExtension flag] ]
, checkAlternatives "ghc-options" "extensions"
[ (flag, extension) | flag@('-':'X':extension) <- all_ghc_options ]
, checkAlternatives "ghc-options" "cpp-options" $
[ (flag, flag) | flag@('-':'D':_) <- all_ghc_options ]
++ [ (flag, flag) | flag@('-':'U':_) <- all_ghc_options ]
, checkAlternatives "ghc-options" "include-dirs"
[ (flag, dir) | flag@('-':'I':dir) <- all_ghc_options ]
, checkAlternatives "ghc-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ghc_options ]
, checkAlternatives "ghc-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ghc_options ]
]
where
all_ghc_options = concatMap get_ghc_options (allBuildInfo pkg)
lib_ghc_options = maybe [] (get_ghc_options . libBuildInfo) (library pkg)
get_ghc_options bi = hcOptions GHC bi ++ hcProfOptions GHC bi
checkFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkFlags flags = check (any (`elem` flags) all_ghc_options)
ghcExtension ('-':'f':name) = case name of
"allow-overlapping-instances" -> enable OverlappingInstances
"no-allow-overlapping-instances" -> disable OverlappingInstances
"th" -> enable TemplateHaskell
"no-th" -> disable TemplateHaskell
"ffi" -> enable ForeignFunctionInterface
"no-ffi" -> disable ForeignFunctionInterface
"fi" -> enable ForeignFunctionInterface
"no-fi" -> disable ForeignFunctionInterface
"monomorphism-restriction" -> enable MonomorphismRestriction
"no-monomorphism-restriction" -> disable MonomorphismRestriction
"mono-pat-binds" -> enable MonoPatBinds
"no-mono-pat-binds" -> disable MonoPatBinds
"allow-undecidable-instances" -> enable UndecidableInstances
"no-allow-undecidable-instances" -> disable UndecidableInstances
"allow-incoherent-instances" -> enable IncoherentInstances
"no-allow-incoherent-instances" -> disable IncoherentInstances
"arrows" -> enable Arrows
"no-arrows" -> disable Arrows
"generics" -> enable Generics
"no-generics" -> disable Generics
"implicit-prelude" -> enable ImplicitPrelude
"no-implicit-prelude" -> disable ImplicitPrelude
"implicit-params" -> enable ImplicitParams
"no-implicit-params" -> disable ImplicitParams
"bang-patterns" -> enable BangPatterns
"no-bang-patterns" -> disable BangPatterns
"scoped-type-variables" -> enable ScopedTypeVariables
"no-scoped-type-variables" -> disable ScopedTypeVariables
"extended-default-rules" -> enable ExtendedDefaultRules
"no-extended-default-rules" -> disable ExtendedDefaultRules
_ -> Nothing
ghcExtension "-cpp" = enable CPP
ghcExtension _ = Nothing
enable e = Just (EnableExtension e)
disable e = Just (DisableExtension e)
| 7,197
|
checkGhcOptions pkg =
catMaybes [
checkFlags ["-fasm"] $
PackageDistInexcusable $
"'ghc-options: -fasm' is unnecessary and will not work on CPU "
++ "architectures other than x86, x86-64, ppc or sparc."
, checkFlags ["-fvia-C"] $
PackageDistSuspicious $
"'ghc-options: -fvia-C' is usually unnecessary. If your package "
++ "needs -via-C for correctness rather than performance then it "
++ "is using the FFI incorrectly and will probably not work with GHC "
++ "6.10 or later."
, checkFlags ["-fhpc"] $
PackageDistInexcusable $
"'ghc-options: -fhpc' is not not necessary. Use the configure flag "
++ " --enable-coverage instead."
, checkFlags ["-prof"] $
PackageBuildWarning $
"'ghc-options: -prof' is not necessary and will lead to problems "
++ "when used on a library. Use the configure flag "
++ "--enable-library-profiling and/or --enable-executable-profiling."
, checkFlags ["-o"] $
PackageBuildWarning $
"'ghc-options: -o' is not needed. "
++ "The output files are named automatically."
, checkFlags ["-hide-package"] $
PackageBuildWarning $
"'ghc-options: -hide-package' is never needed. "
++ "Cabal hides all packages."
, checkFlags ["--make"] $
PackageBuildWarning $
"'ghc-options: --make' is never needed. Cabal uses this automatically."
, checkFlags ["-main-is"] $
PackageDistSuspicious $
"'ghc-options: -main-is' is not portable."
, checkFlags ["-O0", "-Onot"] $
PackageDistSuspicious $
"'ghc-options: -O0' is not needed. "
++ "Use the --disable-optimization configure flag."
, checkFlags [ "-O", "-O1"] $
PackageDistInexcusable $
"'ghc-options: -O' is not needed. "
++ "Cabal automatically adds the '-O' flag. "
++ "Setting it yourself interferes with the --disable-optimization flag."
, checkFlags ["-O2"] $
PackageDistSuspiciousWarn $
"'ghc-options: -O2' is rarely needed. "
++ "Check that it is giving a real benefit "
++ "and not just imposing longer compile times on your users."
, checkFlags ["-split-objs"] $
PackageBuildWarning $
"'ghc-options: -split-objs' is not needed. "
++ "Use the --enable-split-objs configure flag."
, checkFlags ["-optl-Wl,-s", "-optl-s"] $
PackageDistInexcusable $
"'ghc-options: -optl-Wl,-s' is not needed and is not portable to all"
++ " operating systems. Cabal 1.4 and later automatically strip"
++ " executables. Cabal also has a flag --disable-executable-stripping"
++ " which is necessary when building packages for some Linux"
++ " distributions and using '-optl-Wl,-s' prevents that from working."
, checkFlags ["-fglasgow-exts"] $
PackageDistSuspicious $
"Instead of 'ghc-options: -fglasgow-exts' it is preferable to use "
++ "the 'extensions' field."
, check ("-threaded" `elem` lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -threaded' has no effect for libraries. It should "
++ "only be used for executables."
, check ("-rtsopts" `elem` lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -rtsopts' has no effect for libraries. It should "
++ "only be used for executables."
, check (any (\opt -> "-with-rtsopts" `isPrefixOf` opt) lib_ghc_options) $
PackageBuildWarning $
"'ghc-options: -with-rtsopts' has no effect for libraries. It "
++ "should only be used for executables."
, checkAlternatives "ghc-options" "extensions"
[ (flag, display extension) | flag <- all_ghc_options
, Just extension <- [ghcExtension flag] ]
, checkAlternatives "ghc-options" "extensions"
[ (flag, extension) | flag@('-':'X':extension) <- all_ghc_options ]
, checkAlternatives "ghc-options" "cpp-options" $
[ (flag, flag) | flag@('-':'D':_) <- all_ghc_options ]
++ [ (flag, flag) | flag@('-':'U':_) <- all_ghc_options ]
, checkAlternatives "ghc-options" "include-dirs"
[ (flag, dir) | flag@('-':'I':dir) <- all_ghc_options ]
, checkAlternatives "ghc-options" "extra-libraries"
[ (flag, lib) | flag@('-':'l':lib) <- all_ghc_options ]
, checkAlternatives "ghc-options" "extra-lib-dirs"
[ (flag, dir) | flag@('-':'L':dir) <- all_ghc_options ]
]
where
all_ghc_options = concatMap get_ghc_options (allBuildInfo pkg)
lib_ghc_options = maybe [] (get_ghc_options . libBuildInfo) (library pkg)
get_ghc_options bi = hcOptions GHC bi ++ hcProfOptions GHC bi
checkFlags :: [String] -> PackageCheck -> Maybe PackageCheck
checkFlags flags = check (any (`elem` flags) all_ghc_options)
ghcExtension ('-':'f':name) = case name of
"allow-overlapping-instances" -> enable OverlappingInstances
"no-allow-overlapping-instances" -> disable OverlappingInstances
"th" -> enable TemplateHaskell
"no-th" -> disable TemplateHaskell
"ffi" -> enable ForeignFunctionInterface
"no-ffi" -> disable ForeignFunctionInterface
"fi" -> enable ForeignFunctionInterface
"no-fi" -> disable ForeignFunctionInterface
"monomorphism-restriction" -> enable MonomorphismRestriction
"no-monomorphism-restriction" -> disable MonomorphismRestriction
"mono-pat-binds" -> enable MonoPatBinds
"no-mono-pat-binds" -> disable MonoPatBinds
"allow-undecidable-instances" -> enable UndecidableInstances
"no-allow-undecidable-instances" -> disable UndecidableInstances
"allow-incoherent-instances" -> enable IncoherentInstances
"no-allow-incoherent-instances" -> disable IncoherentInstances
"arrows" -> enable Arrows
"no-arrows" -> disable Arrows
"generics" -> enable Generics
"no-generics" -> disable Generics
"implicit-prelude" -> enable ImplicitPrelude
"no-implicit-prelude" -> disable ImplicitPrelude
"implicit-params" -> enable ImplicitParams
"no-implicit-params" -> disable ImplicitParams
"bang-patterns" -> enable BangPatterns
"no-bang-patterns" -> disable BangPatterns
"scoped-type-variables" -> enable ScopedTypeVariables
"no-scoped-type-variables" -> disable ScopedTypeVariables
"extended-default-rules" -> enable ExtendedDefaultRules
"no-extended-default-rules" -> disable ExtendedDefaultRules
_ -> Nothing
ghcExtension "-cpp" = enable CPP
ghcExtension _ = Nothing
enable e = Just (EnableExtension e)
disable e = Just (DisableExtension e)
| 7,141
| true
| true
| 32
| 15
| 2,038
| 1,228
| 614
| 614
| null | null |
Philonous/pontarius-xmpp
|
source/Network/Xmpp/Sasl/Common.hs
|
bsd-3-clause
|
-- | Pull the next element and check that it is success.
pullSuccess :: ErrorT AuthFailure (StateT StreamState IO) (Maybe Text.Text)
pullSuccess = do
e <- pullSaslElement
case e of
SaslSuccess x -> return x
_ -> throwError $ AuthOtherFailure -- TODO: Log
-- | Pull the next element. When it's success, return it's payload.
-- If it's a challenge, send an empty response and pull success.
| 412
|
pullSuccess :: ErrorT AuthFailure (StateT StreamState IO) (Maybe Text.Text)
pullSuccess = do
e <- pullSaslElement
case e of
SaslSuccess x -> return x
_ -> throwError $ AuthOtherFailure -- TODO: Log
-- | Pull the next element. When it's success, return it's payload.
-- If it's a challenge, send an empty response and pull success.
| 355
|
pullSuccess = do
e <- pullSaslElement
case e of
SaslSuccess x -> return x
_ -> throwError $ AuthOtherFailure -- TODO: Log
-- | Pull the next element. When it's success, return it's payload.
-- If it's a challenge, send an empty response and pull success.
| 279
| true
| true
| 0
| 10
| 91
| 74
| 37
| 37
| null | null |
mcmaniac/ghc
|
compiler/nativeGen/SPARC/CodeGen/CCall.hs
|
bsd-3-clause
|
move_final :: [Reg] -> [Reg] -> Int -> [Instr]
-- all args done
move_final [] _ _
= []
| 95
|
move_final :: [Reg] -> [Reg] -> Int -> [Instr]
move_final [] _ _
= []
| 77
|
move_final [] _ _
= []
| 30
| true
| true
| 0
| 8
| 27
| 44
| 24
| 20
| null | null |
elieux/ghc
|
compiler/deSugar/DsUtils.hs
|
bsd-3-clause
|
wrapBind :: Var -> Var -> CoreExpr -> CoreExpr
wrapBind new old body -- NB: this function must deal with term
| new==old = body -- variables, type variables or coercion variables
| otherwise = Let (NonRec new (varToCoreExpr old)) body
| 246
|
wrapBind :: Var -> Var -> CoreExpr -> CoreExpr
wrapBind new old body -- NB: this function must deal with term
| new==old = body -- variables, type variables or coercion variables
| otherwise = Let (NonRec new (varToCoreExpr old)) body
| 246
|
wrapBind new old body -- NB: this function must deal with term
| new==old = body -- variables, type variables or coercion variables
| otherwise = Let (NonRec new (varToCoreExpr old)) body
| 199
| false
| true
| 0
| 9
| 52
| 78
| 36
| 42
| null | null |
ucsd-progsys/nanomaly
|
src/NanoML/Classify.hs
|
bsd-3-clause
|
tis_lit_int :: TExpr -> Double
tis_lit_int e = case e of
T_Lit _ (LI {}) -> 1
_ -> 0
| 102
|
tis_lit_int :: TExpr -> Double
tis_lit_int e = case e of
T_Lit _ (LI {}) -> 1
_ -> 0
| 102
|
tis_lit_int e = case e of
T_Lit _ (LI {}) -> 1
_ -> 0
| 71
| false
| true
| 0
| 10
| 37
| 52
| 24
| 28
| null | null |
nickbart1980/pandoc-citeproc
|
src/Text/CSL/Util.hs
|
bsd-3-clause
|
headInline :: [Inline] -> String
headInline = take 1 . stringify
| 64
|
headInline :: [Inline] -> String
headInline = take 1 . stringify
| 64
|
headInline = take 1 . stringify
| 31
| false
| true
| 1
| 7
| 10
| 33
| 14
| 19
| null | null |
MaxDaten/yage
|
src/Yage/Rendering/Mesh.hs
|
mit
|
meshIndexRanges :: Getter (Mesh v) [(Int, Int)]
meshIndexRanges = meshComponents.to ranges where
ranges compMap = snd $ mapAccumL (\pos len -> (pos+len, (pos, pos+len-1))) 0 $
filter (>0) $ compMap^..traverse.componentIndexBuffer.to VS.length
| 271
|
meshIndexRanges :: Getter (Mesh v) [(Int, Int)]
meshIndexRanges = meshComponents.to ranges where
ranges compMap = snd $ mapAccumL (\pos len -> (pos+len, (pos, pos+len-1))) 0 $
filter (>0) $ compMap^..traverse.componentIndexBuffer.to VS.length
| 271
|
meshIndexRanges = meshComponents.to ranges where
ranges compMap = snd $ mapAccumL (\pos len -> (pos+len, (pos, pos+len-1))) 0 $
filter (>0) $ compMap^..traverse.componentIndexBuffer.to VS.length
| 223
| false
| true
| 0
| 17
| 59
| 117
| 62
| 55
| null | null |
scottgw/eiffel-typecheck
|
Language/Eiffel/TypeCheck/Class.hs
|
bsd-3-clause
|
contract :: Contract Expr -> TypingBody body (Contract T.TExpr)
contract (Contract inher cs) = Contract inher `fmap` mapM clause cs
| 131
|
contract :: Contract Expr -> TypingBody body (Contract T.TExpr)
contract (Contract inher cs) = Contract inher `fmap` mapM clause cs
| 131
|
contract (Contract inher cs) = Contract inher `fmap` mapM clause cs
| 67
| false
| true
| 0
| 9
| 19
| 56
| 27
| 29
| null | null |
FranklinChen/hugs98-plus-Sep2006
|
packages/GLUT/examples/Misc/Triangulate.hs
|
bsd-3-clause
|
tri :: ComplexContour DontCare
tri = ComplexContour [
AnnotatedVertex (Vertex3 75 75 0) 0,
AnnotatedVertex (Vertex3 125 175 0) 0,
AnnotatedVertex (Vertex3 175 75 0) 0 ]
| 180
|
tri :: ComplexContour DontCare
tri = ComplexContour [
AnnotatedVertex (Vertex3 75 75 0) 0,
AnnotatedVertex (Vertex3 125 175 0) 0,
AnnotatedVertex (Vertex3 175 75 0) 0 ]
| 180
|
tri = ComplexContour [
AnnotatedVertex (Vertex3 75 75 0) 0,
AnnotatedVertex (Vertex3 125 175 0) 0,
AnnotatedVertex (Vertex3 175 75 0) 0 ]
| 149
| false
| true
| 0
| 9
| 38
| 71
| 35
| 36
| null | null |
iemxblog/sivi-haskell
|
tests/Sivi/BacklashSpec.hs
|
gpl-2.0
|
withProbe :: IR
withProbe = IR [
Move (V3 5 4 0) Rapid
, Move (V3 5 3 0) Rapid
, Move (V3 6 6 0) Rapid
, Move (V3 4 6 0) (Probe 10)
, DefCurPos (V3 0 0 0)
, Move (V3 1 1 0) Rapid
, Move (V3 3 1 0) (Probe 10)
, DefCurPos (V3 0 0 0)
, Move (V3 (-2) 2 0) Rapid
]
| 339
|
withProbe :: IR
withProbe = IR [
Move (V3 5 4 0) Rapid
, Move (V3 5 3 0) Rapid
, Move (V3 6 6 0) Rapid
, Move (V3 4 6 0) (Probe 10)
, DefCurPos (V3 0 0 0)
, Move (V3 1 1 0) Rapid
, Move (V3 3 1 0) (Probe 10)
, DefCurPos (V3 0 0 0)
, Move (V3 (-2) 2 0) Rapid
]
| 339
|
withProbe = IR [
Move (V3 5 4 0) Rapid
, Move (V3 5 3 0) Rapid
, Move (V3 6 6 0) Rapid
, Move (V3 4 6 0) (Probe 10)
, DefCurPos (V3 0 0 0)
, Move (V3 1 1 0) Rapid
, Move (V3 3 1 0) (Probe 10)
, DefCurPos (V3 0 0 0)
, Move (V3 (-2) 2 0) Rapid
]
| 323
| false
| true
| 0
| 11
| 149
| 189
| 95
| 94
| null | null |
ekmett/wxHaskell
|
samples/contrib/Camels.hs
|
lgpl-2.1
|
) 0 f (_:bs) = f : bs
(|
| 24
|
(|>) 0 f (_:bs) = f : bs
| 24
|
(|>) 0 f (_:bs) = f : bs
| 24
| false
| false
| 2
| 7
| 8
| 28
| 14
| 14
| null | null |
diffusionkinetics/open
|
parfoldl/src/Control/Parallel/Foldl.hs
|
mit
|
product :: Num a => Fold a a
product = Fold (*) 1 id (*)
| 56
|
product :: Num a => Fold a a
product = Fold (*) 1 id (*)
| 56
|
product = Fold (*) 1 id (*)
| 27
| false
| true
| 0
| 7
| 14
| 45
| 20
| 25
| null | null |
tmcdonell/vector-parallel
|
Data/Vector/Parallel.hs
|
bsd-3-clause
|
map :: (a -> b) -> Vector a -> Vector b
map = G.map
| 51
|
map :: (a -> b) -> Vector a -> Vector b
map = G.map
| 51
|
map = G.map
| 11
| false
| true
| 0
| 8
| 13
| 40
| 18
| 22
| null | null |
Lythimus/lptv
|
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Parsing.hs
|
gpl-2.0
|
-- Parse a grid table: starts with row of '-' on top, then header
-- (which may be grid), then the rows,
-- which may be grid, separated by blank lines, and
-- ending with a footer (dashed line followed by blank line).
gridTableWith :: GenParser Char ParserState Block -- ^ Block parser
-> GenParser Char ParserState [Inline] -- ^ Caption parser
-> Bool -- ^ Headerless table
-> GenParser Char ParserState Block
gridTableWith block tableCaption headless =
tableWith (gridTableHeader headless block) (gridTableRow block) (gridTableSep '-') gridTableFooter tableCaption
| 646
|
gridTableWith :: GenParser Char ParserState Block -- ^ Block parser
-> GenParser Char ParserState [Inline] -- ^ Caption parser
-> Bool -- ^ Headerless table
-> GenParser Char ParserState Block
gridTableWith block tableCaption headless =
tableWith (gridTableHeader headless block) (gridTableRow block) (gridTableSep '-') gridTableFooter tableCaption
| 426
|
gridTableWith block tableCaption headless =
tableWith (gridTableHeader headless block) (gridTableRow block) (gridTableSep '-') gridTableFooter tableCaption
| 157
| true
| true
| 0
| 8
| 166
| 92
| 48
| 44
| null | null |
mstksg/ghcjs-websockets
|
src/JavaScript/WebSockets/Internal.hs
|
mit
|
openConnectionImmediate :: Text -> IO (MVar Connection)
openConnectionImmediate url = do
queue <- newArray
waiters <- newArray
socket <- ws_newSocket (toJSString url) queue waiters
closed <- newIORef Nothing
block <- newMVar ()
let conn = Connection socket queue waiters url closed block
outp <- newEmptyMVar
_ <- forkIO $ handleClose conn outp
-- TODO: Opening errors
_ <- forkIO $ handleOpen conn outp
return outp
| 480
|
openConnectionImmediate :: Text -> IO (MVar Connection)
openConnectionImmediate url = do
queue <- newArray
waiters <- newArray
socket <- ws_newSocket (toJSString url) queue waiters
closed <- newIORef Nothing
block <- newMVar ()
let conn = Connection socket queue waiters url closed block
outp <- newEmptyMVar
_ <- forkIO $ handleClose conn outp
-- TODO: Opening errors
_ <- forkIO $ handleOpen conn outp
return outp
| 480
|
openConnectionImmediate url = do
queue <- newArray
waiters <- newArray
socket <- ws_newSocket (toJSString url) queue waiters
closed <- newIORef Nothing
block <- newMVar ()
let conn = Connection socket queue waiters url closed block
outp <- newEmptyMVar
_ <- forkIO $ handleClose conn outp
-- TODO: Opening errors
_ <- forkIO $ handleOpen conn outp
return outp
| 424
| false
| true
| 0
| 10
| 129
| 151
| 67
| 84
| null | null |
frontrowed/stratosphere
|
library-gen/Stratosphere/Resources/ConfigDeliveryChannel.hs
|
mit
|
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-deliverychannel.html#cfn-config-deliverychannel-configsnapshotdeliveryproperties
cdcConfigSnapshotDeliveryProperties :: Lens' ConfigDeliveryChannel (Maybe ConfigDeliveryChannelConfigSnapshotDeliveryProperties)
cdcConfigSnapshotDeliveryProperties = lens _configDeliveryChannelConfigSnapshotDeliveryProperties (\s a -> s { _configDeliveryChannelConfigSnapshotDeliveryProperties = a })
| 469
|
cdcConfigSnapshotDeliveryProperties :: Lens' ConfigDeliveryChannel (Maybe ConfigDeliveryChannelConfigSnapshotDeliveryProperties)
cdcConfigSnapshotDeliveryProperties = lens _configDeliveryChannelConfigSnapshotDeliveryProperties (\s a -> s { _configDeliveryChannelConfigSnapshotDeliveryProperties = a })
| 301
|
cdcConfigSnapshotDeliveryProperties = lens _configDeliveryChannelConfigSnapshotDeliveryProperties (\s a -> s { _configDeliveryChannelConfigSnapshotDeliveryProperties = a })
| 172
| true
| true
| 0
| 9
| 21
| 46
| 25
| 21
| null | null |
timjb/protocol-buffers
|
Text/ProtocolBuffers/WireMessage.hs
|
apache-2.0
|
toWireType 13 = 0
| 18
|
toWireType 13 = 0
| 18
|
toWireType 13 = 0
| 18
| false
| false
| 1
| 5
| 4
| 13
| 4
| 9
| null | null |
arquitecturas-concurrentes/stm-samples-haskell
|
1_broken_accounts/src/Main.hs
|
mit
|
update f (Account n) = Account (f n)
| 36
|
update f (Account n) = Account (f n)
| 36
|
update f (Account n) = Account (f n)
| 36
| false
| false
| 0
| 7
| 7
| 26
| 12
| 14
| null | null |
gnn/Hets
|
Driver/WriteFn.hs
|
gpl-2.0
|
writeSpecFiles :: HetcatsOpts -> FilePath -> LibEnv -> LibName -> DGraph
-> IO ()
writeSpecFiles opts file lenv ln dg = do
let gctx = globalEnv dg
gns = Map.keys gctx
mns = map $ \ t -> Map.findWithDefault (simpleIdToIRI t) (tokStr t)
$ Map.fromList $ map (\ i -> (iriToStringShortUnsecure i, i)) gns
ga = globalAnnos dg
ns = mns $ specNames opts
vs = mns $ viewNames opts
filePrefix = snd $ getFilePrefix opts file
outTypes = outtypes opts
specOutTypes = filter ( \ ot -> case ot of
ThyFile -> True
DfgFile _ -> True
TPTPFile -> True
XmlOut -> True
JsonOut -> True
OmdocOut -> True
TheoryFile _ -> True
SigFile _ -> True
OWLOut _ -> True
CLIFOut -> True
KIFOut -> True
FreeCADOut -> True
HaskellOut -> True
ComptableXml -> True
MedusaJson -> True
SymXml -> True
_ -> False) outTypes
allSpecs = null ns
noViews = null vs
ignore = null specOutTypes && modelSparQ opts == ""
mapM_ (writeLibEnv opts filePrefix lenv ln) $
if null $ dumpOpts opts then outTypes else EnvOut : outTypes
mapM_ ( \ i -> case Map.lookup i gctx of
Just (SpecEntry (ExtGenSig _ (NodeSig n _))) ->
writeTheoryFiles opts specOutTypes filePrefix lenv ga ln i n
_ -> unless allSpecs
$ putIfVerbose opts 0 $ "Unknown spec name: " ++ show i
) $ if ignore then [] else
if allSpecs then gns else ns
unless noViews $
mapM_ ( \ i -> case Map.lookup i gctx of
Just (ViewOrStructEntry _ (ExtViewSig _ (GMorphism cid _ _ m _) _)) ->
writeVerbFile opts (filePrefix ++ "_" ++ show i ++ ".view")
$ shows (pretty $ Map.toList $ symmap_of (targetLogic cid) m) "\n"
_ -> putIfVerbose opts 0 $ "Unknown view name: " ++ show i
) vs
mapM_ ( \ n ->
writeTheoryFiles opts specOutTypes filePrefix lenv ga ln
(simpleIdToIRI $ genToken $ 'n' : show n) n)
$ if ignore || not allSpecs then [] else
nodesDG dg
\\ Map.fold ( \ e l -> case e of
SpecEntry (ExtGenSig _ (NodeSig n _)) -> n : l
_ -> l) [] gctx
doDump opts "GlobalAnnos" $ putStrLn $ showGlobalDoc ga ga ""
doDump opts "PrintStat" $ putStrLn $ printStatistics dg
doDump opts "DGraph" $ putStrLn $ showDoc dg ""
doDump opts "DuplicateDefEdges" $ let es = duplicateDefEdges dg in
unless (null es) $ print es
doDump opts "LibEnv" $ writeVerbFile opts (filePrefix ++ ".lenv")
$ shows (DG.prettyLibEnv lenv) "\n"
| 2,757
|
writeSpecFiles :: HetcatsOpts -> FilePath -> LibEnv -> LibName -> DGraph
-> IO ()
writeSpecFiles opts file lenv ln dg = do
let gctx = globalEnv dg
gns = Map.keys gctx
mns = map $ \ t -> Map.findWithDefault (simpleIdToIRI t) (tokStr t)
$ Map.fromList $ map (\ i -> (iriToStringShortUnsecure i, i)) gns
ga = globalAnnos dg
ns = mns $ specNames opts
vs = mns $ viewNames opts
filePrefix = snd $ getFilePrefix opts file
outTypes = outtypes opts
specOutTypes = filter ( \ ot -> case ot of
ThyFile -> True
DfgFile _ -> True
TPTPFile -> True
XmlOut -> True
JsonOut -> True
OmdocOut -> True
TheoryFile _ -> True
SigFile _ -> True
OWLOut _ -> True
CLIFOut -> True
KIFOut -> True
FreeCADOut -> True
HaskellOut -> True
ComptableXml -> True
MedusaJson -> True
SymXml -> True
_ -> False) outTypes
allSpecs = null ns
noViews = null vs
ignore = null specOutTypes && modelSparQ opts == ""
mapM_ (writeLibEnv opts filePrefix lenv ln) $
if null $ dumpOpts opts then outTypes else EnvOut : outTypes
mapM_ ( \ i -> case Map.lookup i gctx of
Just (SpecEntry (ExtGenSig _ (NodeSig n _))) ->
writeTheoryFiles opts specOutTypes filePrefix lenv ga ln i n
_ -> unless allSpecs
$ putIfVerbose opts 0 $ "Unknown spec name: " ++ show i
) $ if ignore then [] else
if allSpecs then gns else ns
unless noViews $
mapM_ ( \ i -> case Map.lookup i gctx of
Just (ViewOrStructEntry _ (ExtViewSig _ (GMorphism cid _ _ m _) _)) ->
writeVerbFile opts (filePrefix ++ "_" ++ show i ++ ".view")
$ shows (pretty $ Map.toList $ symmap_of (targetLogic cid) m) "\n"
_ -> putIfVerbose opts 0 $ "Unknown view name: " ++ show i
) vs
mapM_ ( \ n ->
writeTheoryFiles opts specOutTypes filePrefix lenv ga ln
(simpleIdToIRI $ genToken $ 'n' : show n) n)
$ if ignore || not allSpecs then [] else
nodesDG dg
\\ Map.fold ( \ e l -> case e of
SpecEntry (ExtGenSig _ (NodeSig n _)) -> n : l
_ -> l) [] gctx
doDump opts "GlobalAnnos" $ putStrLn $ showGlobalDoc ga ga ""
doDump opts "PrintStat" $ putStrLn $ printStatistics dg
doDump opts "DGraph" $ putStrLn $ showDoc dg ""
doDump opts "DuplicateDefEdges" $ let es = duplicateDefEdges dg in
unless (null es) $ print es
doDump opts "LibEnv" $ writeVerbFile opts (filePrefix ++ ".lenv")
$ shows (DG.prettyLibEnv lenv) "\n"
| 2,757
|
writeSpecFiles opts file lenv ln dg = do
let gctx = globalEnv dg
gns = Map.keys gctx
mns = map $ \ t -> Map.findWithDefault (simpleIdToIRI t) (tokStr t)
$ Map.fromList $ map (\ i -> (iriToStringShortUnsecure i, i)) gns
ga = globalAnnos dg
ns = mns $ specNames opts
vs = mns $ viewNames opts
filePrefix = snd $ getFilePrefix opts file
outTypes = outtypes opts
specOutTypes = filter ( \ ot -> case ot of
ThyFile -> True
DfgFile _ -> True
TPTPFile -> True
XmlOut -> True
JsonOut -> True
OmdocOut -> True
TheoryFile _ -> True
SigFile _ -> True
OWLOut _ -> True
CLIFOut -> True
KIFOut -> True
FreeCADOut -> True
HaskellOut -> True
ComptableXml -> True
MedusaJson -> True
SymXml -> True
_ -> False) outTypes
allSpecs = null ns
noViews = null vs
ignore = null specOutTypes && modelSparQ opts == ""
mapM_ (writeLibEnv opts filePrefix lenv ln) $
if null $ dumpOpts opts then outTypes else EnvOut : outTypes
mapM_ ( \ i -> case Map.lookup i gctx of
Just (SpecEntry (ExtGenSig _ (NodeSig n _))) ->
writeTheoryFiles opts specOutTypes filePrefix lenv ga ln i n
_ -> unless allSpecs
$ putIfVerbose opts 0 $ "Unknown spec name: " ++ show i
) $ if ignore then [] else
if allSpecs then gns else ns
unless noViews $
mapM_ ( \ i -> case Map.lookup i gctx of
Just (ViewOrStructEntry _ (ExtViewSig _ (GMorphism cid _ _ m _) _)) ->
writeVerbFile opts (filePrefix ++ "_" ++ show i ++ ".view")
$ shows (pretty $ Map.toList $ symmap_of (targetLogic cid) m) "\n"
_ -> putIfVerbose opts 0 $ "Unknown view name: " ++ show i
) vs
mapM_ ( \ n ->
writeTheoryFiles opts specOutTypes filePrefix lenv ga ln
(simpleIdToIRI $ genToken $ 'n' : show n) n)
$ if ignore || not allSpecs then [] else
nodesDG dg
\\ Map.fold ( \ e l -> case e of
SpecEntry (ExtGenSig _ (NodeSig n _)) -> n : l
_ -> l) [] gctx
doDump opts "GlobalAnnos" $ putStrLn $ showGlobalDoc ga ga ""
doDump opts "PrintStat" $ putStrLn $ printStatistics dg
doDump opts "DGraph" $ putStrLn $ showDoc dg ""
doDump opts "DuplicateDefEdges" $ let es = duplicateDefEdges dg in
unless (null es) $ print es
doDump opts "LibEnv" $ writeVerbFile opts (filePrefix ++ ".lenv")
$ shows (DG.prettyLibEnv lenv) "\n"
| 2,660
| false
| true
| 0
| 20
| 960
| 960
| 464
| 496
| null | null |
bvdelft/parac2
|
src/Language/Java/Paragon/Compile.hs
|
bsd-3-clause
|
lockType = mkPkgType "LockID"
| 38
|
lockType = mkPkgType "LockID"
| 38
|
lockType = mkPkgType "LockID"
| 38
| false
| false
| 0
| 5
| 12
| 9
| 4
| 5
| null | null |
fujimura/s3
|
src/S3/Ls.hs
|
bsd-3-clause
|
runIO (Free a) = case a of
ReadProcessWithExitCode cmd args input f -> System.Process.readProcessWithExitCode cmd args input >>= runIO . f
| 142
|
runIO (Free a) = case a of
ReadProcessWithExitCode cmd args input f -> System.Process.readProcessWithExitCode cmd args input >>= runIO . f
| 142
|
runIO (Free a) = case a of
ReadProcessWithExitCode cmd args input f -> System.Process.readProcessWithExitCode cmd args input >>= runIO . f
| 142
| false
| false
| 0
| 11
| 24
| 52
| 25
| 27
| null | null |
shlevy/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
int64TyConKey = mkPreludeTyConUnique 21
| 65
|
int64TyConKey = mkPreludeTyConUnique 21
| 65
|
int64TyConKey = mkPreludeTyConUnique 21
| 65
| false
| false
| 0
| 5
| 29
| 9
| 4
| 5
| null | null |
dat2/488-compiler-haskell
|
Parser.hs
|
mit
|
boolConstExpn :: GenParser Char st Expn
boolConstExpn = do
sym <- symbol "true" <|> symbol "false"
return BoolConstExpn { bool = (sym == "true") }
| 151
|
boolConstExpn :: GenParser Char st Expn
boolConstExpn = do
sym <- symbol "true" <|> symbol "false"
return BoolConstExpn { bool = (sym == "true") }
| 151
|
boolConstExpn = do
sym <- symbol "true" <|> symbol "false"
return BoolConstExpn { bool = (sym == "true") }
| 111
| false
| true
| 0
| 11
| 29
| 56
| 27
| 29
| null | null |
michaelgwelch/bacnet
|
src/BACnet/Tag/Writer.hs
|
mit
|
writeNullCSTag :: TagNumber -> Writer
writeNullCSTag tn = writeCSTag tn (0 :: Length)
| 85
|
writeNullCSTag :: TagNumber -> Writer
writeNullCSTag tn = writeCSTag tn (0 :: Length)
| 85
|
writeNullCSTag tn = writeCSTag tn (0 :: Length)
| 47
| false
| true
| 0
| 7
| 12
| 34
| 16
| 18
| null | null |
eugenkiss/loopgotowhile
|
tests/Language/LoopGotoWhile/Goto/Extended/Tests.hs
|
bsd-3-clause
|
testControl3 :: Assertion
testControl3 = runProgram' [10, 1] p @?= 26
where p = "c0 := 16 / 2^2 + (x1 * (x2 % 2)) - 1;" ++
"M1: c0 := c0 - 1;" ++
" c1 := 2;" ++
"M2: c1 := c1 - 1;" ++
" x0 := x0 + 1;" ++
" x0 := x0 - 1;" ++
" x0 := x0 + 1;" ++
" IF c1 != 0 THEN GOTO M2 END;" ++
" IF c0 != 0 THEN GOTO M1 END"
| 546
|
testControl3 :: Assertion
testControl3 = runProgram' [10, 1] p @?= 26
where p = "c0 := 16 / 2^2 + (x1 * (x2 % 2)) - 1;" ++
"M1: c0 := c0 - 1;" ++
" c1 := 2;" ++
"M2: c1 := c1 - 1;" ++
" x0 := x0 + 1;" ++
" x0 := x0 - 1;" ++
" x0 := x0 + 1;" ++
" IF c1 != 0 THEN GOTO M2 END;" ++
" IF c0 != 0 THEN GOTO M1 END"
| 546
|
testControl3 = runProgram' [10, 1] p @?= 26
where p = "c0 := 16 / 2^2 + (x1 * (x2 % 2)) - 1;" ++
"M1: c0 := c0 - 1;" ++
" c1 := 2;" ++
"M2: c1 := c1 - 1;" ++
" x0 := x0 + 1;" ++
" x0 := x0 - 1;" ++
" x0 := x0 + 1;" ++
" IF c1 != 0 THEN GOTO M2 END;" ++
" IF c0 != 0 THEN GOTO M1 END"
| 520
| false
| true
| 0
| 12
| 323
| 66
| 34
| 32
| null | null |
j-rock/lambduh
|
src/Language/Lambduh.hs
|
mit
|
reduce :: Expr -> Expr
reduce e@(App e1 e2) = let e' = betaReduce e1 e2
in if e == e' then e else reduce e'
| 130
|
reduce :: Expr -> Expr
reduce e@(App e1 e2) = let e' = betaReduce e1 e2
in if e == e' then e else reduce e'
| 130
|
reduce e@(App e1 e2) = let e' = betaReduce e1 e2
in if e == e' then e else reduce e'
| 107
| false
| true
| 1
| 10
| 48
| 68
| 31
| 37
| null | null |
GaloisInc/saw-script
|
src/SAWScript/Prover/MRSolver/Monad.hs
|
bsd-3-clause
|
throwMRFailure :: MRFailure -> MRM a
throwMRFailure = throwError . MRExnFailure
| 79
|
throwMRFailure :: MRFailure -> MRM a
throwMRFailure = throwError . MRExnFailure
| 79
|
throwMRFailure = throwError . MRExnFailure
| 42
| false
| true
| 0
| 6
| 10
| 22
| 11
| 11
| null | null |
bruno-cadorette/AdventOfCode
|
Day 18/Day18.hs
|
mit
|
neighboorIndices (a, b) board = filter (/= (a,b)) $ range (min', max')
where
((minI, minJ), (maxI, maxJ)) = bounds board
min' = (max minI (a - 1), max minJ (b - 1))
max' = (min maxI (a + 1), min maxJ (b + 1))
| 237
|
neighboorIndices (a, b) board = filter (/= (a,b)) $ range (min', max')
where
((minI, minJ), (maxI, maxJ)) = bounds board
min' = (max minI (a - 1), max minJ (b - 1))
max' = (min maxI (a + 1), min maxJ (b + 1))
| 237
|
neighboorIndices (a, b) board = filter (/= (a,b)) $ range (min', max')
where
((minI, minJ), (maxI, maxJ)) = bounds board
min' = (max minI (a - 1), max minJ (b - 1))
max' = (min maxI (a + 1), min maxJ (b + 1))
| 237
| false
| false
| 2
| 9
| 72
| 144
| 79
| 65
| null | null |
vincenthz/cryptonite
|
Crypto/Internal/WordArray.hs
|
bsd-3-clause
|
-- | Create an array of Word8 aliasing an Addr#
array8 :: Addr# -> Array8
array8 = Array8
| 89
|
array8 :: Addr# -> Array8
array8 = Array8
| 41
|
array8 = Array8
| 15
| true
| true
| 0
| 5
| 17
| 16
| 9
| 7
| null | null |
mcmaniac/ghc
|
compiler/cmm/CLabel.hs
|
bsd-3-clause
|
mkLocalConInfoTableLabel c con = IdLabel con c ConInfoTable
| 62
|
mkLocalConInfoTableLabel c con = IdLabel con c ConInfoTable
| 62
|
mkLocalConInfoTableLabel c con = IdLabel con c ConInfoTable
| 62
| false
| false
| 0
| 5
| 10
| 18
| 8
| 10
| null | null |
piotrm0/planar
|
Gfx.hs
|
artistic-2.0
|
setup_viewport :: MonadIO m => AllStateT cs m ()
setup_viewport = do
V2 width height <- gets $ window_size . snd
withLensT gfx_in_allstate $ do
return ()
| 161
|
setup_viewport :: MonadIO m => AllStateT cs m ()
setup_viewport = do
V2 width height <- gets $ window_size . snd
withLensT gfx_in_allstate $ do
return ()
| 161
|
setup_viewport = do
V2 width height <- gets $ window_size . snd
withLensT gfx_in_allstate $ do
return ()
| 112
| false
| true
| 0
| 11
| 34
| 65
| 29
| 36
| null | null |
brendanhay/gogol
|
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'OrderreturnsReturnItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oriReject'
--
-- * 'oriReturnItemId'
--
-- * 'oriRefund'
orderreturnsReturnItem
:: OrderreturnsReturnItem
orderreturnsReturnItem =
OrderreturnsReturnItem'
{_oriReject = Nothing, _oriReturnItemId = Nothing, _oriRefund = Nothing}
| 420
|
orderreturnsReturnItem
:: OrderreturnsReturnItem
orderreturnsReturnItem =
OrderreturnsReturnItem'
{_oriReject = Nothing, _oriReturnItemId = Nothing, _oriRefund = Nothing}
| 180
|
orderreturnsReturnItem =
OrderreturnsReturnItem'
{_oriReject = Nothing, _oriReturnItemId = Nothing, _oriRefund = Nothing}
| 127
| true
| true
| 1
| 7
| 66
| 47
| 29
| 18
| null | null |
balodja/sesyrel
|
src/Sesyrel/FaultTree/Base.hs
|
bsd-3-clause
|
twoBitsAdderM :: Monad m => Variable -> Variable -> FaultTreeMonadT k m (Variable, Variable)
twoBitsAdderM a b = do
s <- xorM a b
c <- andM a b
return (s, c)
| 163
|
twoBitsAdderM :: Monad m => Variable -> Variable -> FaultTreeMonadT k m (Variable, Variable)
twoBitsAdderM a b = do
s <- xorM a b
c <- andM a b
return (s, c)
| 163
|
twoBitsAdderM a b = do
s <- xorM a b
c <- andM a b
return (s, c)
| 70
| false
| true
| 0
| 9
| 37
| 80
| 38
| 42
| null | null |
wavewave/scaffold
|
lib/Application/Scaffold/Job.hs
|
bsd-2-clause
|
startMakeYesodCrud :: FilePath -> IO ()
startMakeYesodCrud configfile = do
b <- constructBuildModes
putStrLn "startMakeYesodCrud"
withBuildFile b $ \(bc,pc) ->
getYesodCrud configfile >>= maybe (putStrLn "parsing config file error") (createYesodCrud bc)
| 275
|
startMakeYesodCrud :: FilePath -> IO ()
startMakeYesodCrud configfile = do
b <- constructBuildModes
putStrLn "startMakeYesodCrud"
withBuildFile b $ \(bc,pc) ->
getYesodCrud configfile >>= maybe (putStrLn "parsing config file error") (createYesodCrud bc)
| 274
|
startMakeYesodCrud configfile = do
b <- constructBuildModes
putStrLn "startMakeYesodCrud"
withBuildFile b $ \(bc,pc) ->
getYesodCrud configfile >>= maybe (putStrLn "parsing config file error") (createYesodCrud bc)
| 234
| false
| true
| 0
| 12
| 52
| 81
| 38
| 43
| null | null |
philderbeast/ghcjs
|
src/Compiler/JMacro/Base.hs
|
mit
|
opText BAndOp = "&"
| 26
|
opText BAndOp = "&"
| 26
|
opText BAndOp = "&"
| 26
| false
| false
| 1
| 5
| 10
| 13
| 4
| 9
| null | null |
sandmark/AlbanKnights
|
src/REPL/List.hs
|
bsd-3-clause
|
list :: Rating -> Either String Rating
list r = Left $ intercalate "\n" $ map f npcs
where npcs = [("ダイ","dai",dai r),("アイリース","eirlys",eirlys r)
,("カオル","kaour",kaour r),("エルシィ","elsie",elsie r)
]
f (name,key,(i,l,_)) = case i of
Just n -> wrappedPick name key n l
Nothing -> "【" ++ name ++ "】\t(不明)"
{-
【ダイ】 [1] => 遊び(1) -> 恋愛(2) -> 遊び(3)
【アイリース】 [96] => 恋愛(96) -> 料理(97) -> 任務(1)
【カオル】 [不明]
【エルシィ】 [77] => ファッション(77) -> 恋愛(78) -> 任務(79)
-}
| 540
|
list :: Rating -> Either String Rating
list r = Left $ intercalate "\n" $ map f npcs
where npcs = [("ダイ","dai",dai r),("アイリース","eirlys",eirlys r)
,("カオル","kaour",kaour r),("エルシィ","elsie",elsie r)
]
f (name,key,(i,l,_)) = case i of
Just n -> wrappedPick name key n l
Nothing -> "【" ++ name ++ "】\t(不明)"
{-
【ダイ】 [1] => 遊び(1) -> 恋愛(2) -> 遊び(3)
【アイリース】 [96] => 恋愛(96) -> 料理(97) -> 任務(1)
【カオル】 [不明]
【エルシィ】 [77] => ファッション(77) -> 恋愛(78) -> 任務(79)
-}
| 540
|
list r = Left $ intercalate "\n" $ map f npcs
where npcs = [("ダイ","dai",dai r),("アイリース","eirlys",eirlys r)
,("カオル","kaour",kaour r),("エルシィ","elsie",elsie r)
]
f (name,key,(i,l,_)) = case i of
Just n -> wrappedPick name key n l
Nothing -> "【" ++ name ++ "】\t(不明)"
{-
【ダイ】 [1] => 遊び(1) -> 恋愛(2) -> 遊び(3)
【アイリース】 [96] => 恋愛(96) -> 料理(97) -> 任務(1)
【カオル】 [不明]
【エルシィ】 [77] => ファッション(77) -> 恋愛(78) -> 任務(79)
-}
| 501
| false
| true
| 0
| 9
| 174
| 175
| 93
| 82
| null | null |
zombiecalypse/SexSelect
|
src/SexSelect.hs
|
mit
|
updatePopulation :: (RandomGen g) =>
MutationRate -> Survival ->
Offspring -> Goal -> [Genome] -> Rand g [Genome]
updatePopulation mr s os goal population = do
pop' <- mapM (reproduce mr os population) population
let pop = concat pop'
return $ bestPopulation s goal pop
| 321
|
updatePopulation :: (RandomGen g) =>
MutationRate -> Survival ->
Offspring -> Goal -> [Genome] -> Rand g [Genome]
updatePopulation mr s os goal population = do
pop' <- mapM (reproduce mr os population) population
let pop = concat pop'
return $ bestPopulation s goal pop
| 321
|
updatePopulation mr s os goal population = do
pop' <- mapM (reproduce mr os population) population
let pop = concat pop'
return $ bestPopulation s goal pop
| 161
| false
| true
| 0
| 12
| 96
| 110
| 53
| 57
| null | null |
bitc/serverer
|
src/Main.hs
|
mit
|
addClient :: Client -> ServerState -> ServerState
addClient client clients = client : clients
| 93
|
addClient :: Client -> ServerState -> ServerState
addClient client clients = client : clients
| 93
|
addClient client clients = client : clients
| 43
| false
| true
| 0
| 8
| 13
| 34
| 15
| 19
| null | null |
brendanhay/gogol
|
gogol-doubleclick-search/gen/Network/Google/DoubleClickSearch/Types/Product.hs
|
mpl-2.0
|
-- | Available to advertisers only after contacting DoubleClick Search
-- customer support.
cAttributionModel :: Lens' Conversion (Maybe Text)
cAttributionModel
= lens _cAttributionModel
(\ s a -> s{_cAttributionModel = a})
| 231
|
cAttributionModel :: Lens' Conversion (Maybe Text)
cAttributionModel
= lens _cAttributionModel
(\ s a -> s{_cAttributionModel = a})
| 139
|
cAttributionModel
= lens _cAttributionModel
(\ s a -> s{_cAttributionModel = a})
| 88
| true
| true
| 0
| 9
| 37
| 49
| 26
| 23
| null | null |
Sword-Smith/hfasto
|
src/MipsRegAlloc.hs
|
mit
|
killRegisterH (Mips.XOR rd _ _ ) = S.singleton rd
| 51
|
killRegisterH (Mips.XOR rd _ _ ) = S.singleton rd
| 51
|
killRegisterH (Mips.XOR rd _ _ ) = S.singleton rd
| 51
| false
| false
| 0
| 8
| 10
| 26
| 12
| 14
| null | null |
phischu/fragnix
|
tests/packages/scotty/Data.OrdPSQ.Internal.hs
|
bsd-3-clause
|
rdoubleRight
:: (Ord k, Ord p)
=> k -> p -> v -> LTree k p v -> k -> LTree k p v -> LTree k p v
rdoubleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =
rsingleRight k1 p1 v1 (lsingleLeft k2 p2 v2 t1 m1 t2) m2 t3
| 230
|
rdoubleRight
:: (Ord k, Ord p)
=> k -> p -> v -> LTree k p v -> k -> LTree k p v -> LTree k p v
rdoubleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =
rsingleRight k1 p1 v1 (lsingleLeft k2 p2 v2 t1 m1 t2) m2 t3
| 230
|
rdoubleRight k1 p1 v1 (LLoser _ (E k2 p2 v2) t1 m1 t2) m2 t3 =
rsingleRight k1 p1 v1 (lsingleLeft k2 p2 v2 t1 m1 t2) m2 t3
| 126
| false
| true
| 0
| 17
| 69
| 144
| 68
| 76
| null | null |
li-zhirui/EoplLangs
|
src/ImplicitRefsCont/Evaluator.hs
|
bsd-3-clause
|
valueOf (BeginExpr exprs) env s c = evalBeginExpr exprs env s c
| 69
|
valueOf (BeginExpr exprs) env s c = evalBeginExpr exprs env s c
| 69
|
valueOf (BeginExpr exprs) env s c = evalBeginExpr exprs env s c
| 69
| false
| false
| 1
| 7
| 17
| 32
| 14
| 18
| null | null |
DavidEichmann/boger-banana
|
src/Reactive/Banana/BOGRE.hs
|
bsd-3-clause
|
-- |Get's the velocity of the mouse. This is technically the average velocity of the mouse over the current frame.
getMouseVelB :: Frameworks t => HookedBogreSystem t -> Behavior t Vec3
getMouseVelB bs = stepper (0,0,0) (frameToVelocity <$> fE) where
sensitivity = 0.5
fE = frameE bs
frameToVelocity f = scale (sensitivity / (frameDt f)) (mouseMoveToVec3 (frameMouseMove f))
mouseMoveToVec3 (x,y) = (fromIntegral x, negate (fromIntegral y), 0)
{-
DYNAMIC FUNCTIONS THAT HANDLE DYNAMICALLY CREATED NODES
Due to not being able to dynamiclaly modify the EventNetwork with currentinput
(e.g. REACTIMATE create new Behaviors and Event based on current Behs/Events)
Implement everything in this dynamic way takign events with new nodes, and then
allow a conversion to non-dynamic version that can simple take the arguments and
artificially create an event for it that just fires once at time 0.
-}
-- |Use this to dynamically create new nodes whenever the passed 'Event' occurs. The resulting 'Event' will contain the newly created node.
-- The value of the passed 'Event' is ignored.
| 1,195
|
getMouseVelB :: Frameworks t => HookedBogreSystem t -> Behavior t Vec3
getMouseVelB bs = stepper (0,0,0) (frameToVelocity <$> fE) where
sensitivity = 0.5
fE = frameE bs
frameToVelocity f = scale (sensitivity / (frameDt f)) (mouseMoveToVec3 (frameMouseMove f))
mouseMoveToVec3 (x,y) = (fromIntegral x, negate (fromIntegral y), 0)
{-
DYNAMIC FUNCTIONS THAT HANDLE DYNAMICALLY CREATED NODES
Due to not being able to dynamiclaly modify the EventNetwork with currentinput
(e.g. REACTIMATE create new Behaviors and Event based on current Behs/Events)
Implement everything in this dynamic way takign events with new nodes, and then
allow a conversion to non-dynamic version that can simple take the arguments and
artificially create an event for it that just fires once at time 0.
-}
-- |Use this to dynamically create new nodes whenever the passed 'Event' occurs. The resulting 'Event' will contain the newly created node.
-- The value of the passed 'Event' is ignored.
| 1,080
|
getMouseVelB bs = stepper (0,0,0) (frameToVelocity <$> fE) where
sensitivity = 0.5
fE = frameE bs
frameToVelocity f = scale (sensitivity / (frameDt f)) (mouseMoveToVec3 (frameMouseMove f))
mouseMoveToVec3 (x,y) = (fromIntegral x, negate (fromIntegral y), 0)
{-
DYNAMIC FUNCTIONS THAT HANDLE DYNAMICALLY CREATED NODES
Due to not being able to dynamiclaly modify the EventNetwork with currentinput
(e.g. REACTIMATE create new Behaviors and Event based on current Behs/Events)
Implement everything in this dynamic way takign events with new nodes, and then
allow a conversion to non-dynamic version that can simple take the arguments and
artificially create an event for it that just fires once at time 0.
-}
-- |Use this to dynamically create new nodes whenever the passed 'Event' occurs. The resulting 'Event' will contain the newly created node.
-- The value of the passed 'Event' is ignored.
| 1,008
| true
| true
| 3
| 9
| 285
| 164
| 78
| 86
| null | null |
mankyKitty/haskell-to-llvm-compiler
|
src/Lexer.hs
|
mit
|
whitespace = Tok.whiteSpace lexer
| 33
|
whitespace = Tok.whiteSpace lexer
| 33
|
whitespace = Tok.whiteSpace lexer
| 33
| false
| false
| 0
| 6
| 3
| 11
| 5
| 6
| null | null |
mainland/dph
|
dph-examples/examples/spectral/QuickHull/handvec/Handvec.hs
|
bsd-3-clause
|
-- | Actually the heart of QuickHull.
--
-- The extra argument is the lifting context (number of lines/segments).
hsplit_l' :: Int# -> PData (PArray Point) -> PData Line -> PData (PArray Point)
hsplit_l' nLines# (PNested segd _) _
| Debug.traceEvent ("GANG[1/1] Issuing hsplit_l' " ++
"with " ++ show (I# nLines#) ++ " lines " ++
"and " ++ show (U.elementsSegd segd) ++ " points, " ++
"distributed as: " ++ show (U.toList $ U.lengthsSegd segd)) False = undefined
| 530
|
hsplit_l' :: Int# -> PData (PArray Point) -> PData Line -> PData (PArray Point)
hsplit_l' nLines# (PNested segd _) _
| Debug.traceEvent ("GANG[1/1] Issuing hsplit_l' " ++
"with " ++ show (I# nLines#) ++ " lines " ++
"and " ++ show (U.elementsSegd segd) ++ " points, " ++
"distributed as: " ++ show (U.toList $ U.lengthsSegd segd)) False = undefined
| 416
|
hsplit_l' nLines# (PNested segd _) _
| Debug.traceEvent ("GANG[1/1] Issuing hsplit_l' " ++
"with " ++ show (I# nLines#) ++ " lines " ++
"and " ++ show (U.elementsSegd segd) ++ " points, " ++
"distributed as: " ++ show (U.toList $ U.lengthsSegd segd)) False = undefined
| 336
| true
| true
| 0
| 19
| 147
| 147
| 71
| 76
| null | null |
sixears/fluffy
|
src/Fluffy/Data/List.hs
|
mit
|
stripBy :: (a -> Bool) -> [a] -> [a]
stripBy p = dropWhileEnd p . dropWhile p
| 77
|
stripBy :: (a -> Bool) -> [a] -> [a]
stripBy p = dropWhileEnd p . dropWhile p
| 77
|
stripBy p = dropWhileEnd p . dropWhile p
| 40
| false
| true
| 0
| 7
| 16
| 45
| 23
| 22
| null | null |
elieux/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
arrayArrayPrimTyConKey = mkPreludeTyConUnique 39
| 65
|
arrayArrayPrimTyConKey = mkPreludeTyConUnique 39
| 65
|
arrayArrayPrimTyConKey = mkPreludeTyConUnique 39
| 65
| false
| false
| 0
| 5
| 20
| 9
| 4
| 5
| null | null |
eddywestbrook/hobbits
|
src/Data/Binding/Hobbits/NuMatching.hs
|
bsd-3-clause
|
isoMbTypeRepr :: NuMatching b => (a -> b) -> (b -> a) -> MbTypeRepr a
isoMbTypeRepr f_to f_from =
MbTypeReprData $ MkMbTypeReprData $ \refresher a ->
f_from $ mapNames refresher (f_to a)
| 190
|
isoMbTypeRepr :: NuMatching b => (a -> b) -> (b -> a) -> MbTypeRepr a
isoMbTypeRepr f_to f_from =
MbTypeReprData $ MkMbTypeReprData $ \refresher a ->
f_from $ mapNames refresher (f_to a)
| 190
|
isoMbTypeRepr f_to f_from =
MbTypeReprData $ MkMbTypeReprData $ \refresher a ->
f_from $ mapNames refresher (f_to a)
| 120
| false
| true
| 6
| 10
| 35
| 87
| 40
| 47
| null | null |
ikuehne/craeft-hs
|
lib/Craeft/Driver.hs
|
gpl-3.0
|
-- | Compile the given module to LLVM IR assembly at the given path.
compileToLlvm :: FilePath -> AST.Module -> IO ()
compileToLlvm path mod =
runTransformationInContext mod $
LLVM.writeLLVMAssemblyToFile (LLVM.File path)
| 233
|
compileToLlvm :: FilePath -> AST.Module -> IO ()
compileToLlvm path mod =
runTransformationInContext mod $
LLVM.writeLLVMAssemblyToFile (LLVM.File path)
| 164
|
compileToLlvm path mod =
runTransformationInContext mod $
LLVM.writeLLVMAssemblyToFile (LLVM.File path)
| 115
| true
| true
| 0
| 9
| 43
| 56
| 26
| 30
| null | null |
ElastiLotem/resolve-trivial-conflicts
|
src/Environment.hs
|
gpl-2.0
|
getConflictStyle :: IO String
getConflictStyle =
do (exitCode, output, _) <- readProcessWithExitCode "git" ["config", "merge.conflictstyle"] stdin
case exitCode of
ExitSuccess -> return $ stripNewline output
ExitFailure 1 -> return "unset"
ExitFailure _ -> E.throwIO exitCode
where
stdin = ""
| 353
|
getConflictStyle :: IO String
getConflictStyle =
do (exitCode, output, _) <- readProcessWithExitCode "git" ["config", "merge.conflictstyle"] stdin
case exitCode of
ExitSuccess -> return $ stripNewline output
ExitFailure 1 -> return "unset"
ExitFailure _ -> E.throwIO exitCode
where
stdin = ""
| 353
|
getConflictStyle =
do (exitCode, output, _) <- readProcessWithExitCode "git" ["config", "merge.conflictstyle"] stdin
case exitCode of
ExitSuccess -> return $ stripNewline output
ExitFailure 1 -> return "unset"
ExitFailure _ -> E.throwIO exitCode
where
stdin = ""
| 323
| false
| true
| 0
| 11
| 99
| 97
| 47
| 50
| null | null |
adamse/haddock
|
haddock-api/src/Haddock/Backends/LaTeX.hs
|
bsd-2-clause
|
ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy"
| 73
|
ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy"
| 73
|
ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy"
| 73
| false
| false
| 1
| 6
| 23
| 25
| 11
| 14
| null | null |
sajith/cis194
|
hw07/JoinList.hs
|
mit
|
tag (Single m _) = m
| 22
|
tag (Single m _) = m
| 22
|
tag (Single m _) = m
| 22
| false
| false
| 0
| 6
| 7
| 18
| 8
| 10
| null | null |
tatac1/amqp-conduit
|
src/Network/AMQP/Conduit.hs
|
mit
|
pauseConsumer :: AmqpConn
-> IO AmqpConn
pauseConsumer chan = flowConsumer chan False
| 93
|
pauseConsumer :: AmqpConn
-> IO AmqpConn
pauseConsumer chan = flowConsumer chan False
| 93
|
pauseConsumer chan = flowConsumer chan False
| 44
| false
| true
| 0
| 7
| 19
| 27
| 12
| 15
| null | null |
uws-eresearch/docx2pandoc
|
src/Text/Pandoc/Readers/DocX.hs
|
gpl-2.0
|
divRemove :: [Block] -> [Block]
divRemove = concatMap divRemove'
| 64
|
divRemove :: [Block] -> [Block]
divRemove = concatMap divRemove'
| 64
|
divRemove = concatMap divRemove'
| 32
| false
| true
| 0
| 6
| 8
| 24
| 13
| 11
| null | null |
GaloisInc/ivory
|
ivory/src/Ivory/Language/Type.hs
|
bsd-3-clause
|
-- XXX do not export
exprUnary :: IvoryExpr a => (AST.Expr -> AST.Expr) -> (a -> a)
exprUnary k x = wrapExpr (k (unwrapExpr x))
| 127
|
exprUnary :: IvoryExpr a => (AST.Expr -> AST.Expr) -> (a -> a)
exprUnary k x = wrapExpr (k (unwrapExpr x))
| 106
|
exprUnary k x = wrapExpr (k (unwrapExpr x))
| 43
| true
| true
| 0
| 9
| 24
| 61
| 31
| 30
| null | null |
rscprof/kalium
|
src/Kalium/Util.hs
|
bsd-3-clause
|
zipFilter [] [] = Just []
| 25
|
zipFilter [] [] = Just []
| 25
|
zipFilter [] [] = Just []
| 25
| false
| false
| 0
| 6
| 5
| 20
| 9
| 11
| null | null |
Lythimus/lptv
|
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Writers/Docbook.hs
|
gpl-2.0
|
-- | Convert list of authors to a docbook <author> section
authorToDocbook :: WriterOptions -> [Inline] -> Doc
authorToDocbook opts name' =
let name = render Nothing $ inlinesToDocbook opts name'
in if ',' `elem` name
then -- last name first
let (lastname, rest) = break (==',') name
firstname = removeLeadingSpace rest in
inTagsSimple "firstname" (text $ escapeStringForXML firstname) <>
inTagsSimple "surname" (text $ escapeStringForXML lastname)
else -- last name last
let namewords = words name
lengthname = length namewords
(firstname, lastname) = case lengthname of
0 -> ("","")
1 -> ("", name)
n -> (intercalate " " (take (n-1) namewords), last namewords)
in inTagsSimple "firstname" (text $ escapeStringForXML firstname) $$
inTagsSimple "surname" (text $ escapeStringForXML lastname)
| 1,026
|
authorToDocbook :: WriterOptions -> [Inline] -> Doc
authorToDocbook opts name' =
let name = render Nothing $ inlinesToDocbook opts name'
in if ',' `elem` name
then -- last name first
let (lastname, rest) = break (==',') name
firstname = removeLeadingSpace rest in
inTagsSimple "firstname" (text $ escapeStringForXML firstname) <>
inTagsSimple "surname" (text $ escapeStringForXML lastname)
else -- last name last
let namewords = words name
lengthname = length namewords
(firstname, lastname) = case lengthname of
0 -> ("","")
1 -> ("", name)
n -> (intercalate " " (take (n-1) namewords), last namewords)
in inTagsSimple "firstname" (text $ escapeStringForXML firstname) $$
inTagsSimple "surname" (text $ escapeStringForXML lastname)
| 967
|
authorToDocbook opts name' =
let name = render Nothing $ inlinesToDocbook opts name'
in if ',' `elem` name
then -- last name first
let (lastname, rest) = break (==',') name
firstname = removeLeadingSpace rest in
inTagsSimple "firstname" (text $ escapeStringForXML firstname) <>
inTagsSimple "surname" (text $ escapeStringForXML lastname)
else -- last name last
let namewords = words name
lengthname = length namewords
(firstname, lastname) = case lengthname of
0 -> ("","")
1 -> ("", name)
n -> (intercalate " " (take (n-1) namewords), last namewords)
in inTagsSimple "firstname" (text $ escapeStringForXML firstname) $$
inTagsSimple "surname" (text $ escapeStringForXML lastname)
| 915
| true
| true
| 0
| 20
| 351
| 275
| 138
| 137
| null | null |
WraithM/LambdaCalc
|
src/Lexer.hs
|
bsd-3-clause
|
semi = T.semi lexer
| 25
|
semi = T.semi lexer
| 25
|
semi = T.semi lexer
| 25
| false
| false
| 0
| 6
| 9
| 11
| 5
| 6
| null | null |
adityagupta1089/Project-Euler-Haskell
|
src/problems/Problem90.hs
|
bsd-3-clause
|
main :: IO ()
main = print . length $ filter
squarePossible
[ (x, y) | x <- subsets, y <- subsets, show (sort x) < show (sort y) ]
where
subsets =
map (\xs -> if (6 `elem` xs) || (9 `elem` xs) then 6 : 9 : xs else xs)
. filter (\xs -> length xs == 6)
$ filterM (const [True, False]) [0 .. 9]
squarePossible (s1, s2) = all
(contained (s1, s2) . ((\x -> [x `div` 10, x `mod` 10]) . (\x -> x * x)))
[1 .. 9]
contained (s1, s2) [a, b] =
(a `elem` s1 && b `elem` s2) || (b `elem` s1 && a `elem` s2)
| 571
|
main :: IO ()
main = print . length $ filter
squarePossible
[ (x, y) | x <- subsets, y <- subsets, show (sort x) < show (sort y) ]
where
subsets =
map (\xs -> if (6 `elem` xs) || (9 `elem` xs) then 6 : 9 : xs else xs)
. filter (\xs -> length xs == 6)
$ filterM (const [True, False]) [0 .. 9]
squarePossible (s1, s2) = all
(contained (s1, s2) . ((\x -> [x `div` 10, x `mod` 10]) . (\x -> x * x)))
[1 .. 9]
contained (s1, s2) [a, b] =
(a `elem` s1 && b `elem` s2) || (b `elem` s1 && a `elem` s2)
| 571
|
main = print . length $ filter
squarePossible
[ (x, y) | x <- subsets, y <- subsets, show (sort x) < show (sort y) ]
where
subsets =
map (\xs -> if (6 `elem` xs) || (9 `elem` xs) then 6 : 9 : xs else xs)
. filter (\xs -> length xs == 6)
$ filterM (const [True, False]) [0 .. 9]
squarePossible (s1, s2) = all
(contained (s1, s2) . ((\x -> [x `div` 10, x `mod` 10]) . (\x -> x * x)))
[1 .. 9]
contained (s1, s2) [a, b] =
(a `elem` s1 && b `elem` s2) || (b `elem` s1 && a `elem` s2)
| 557
| false
| true
| 2
| 15
| 192
| 335
| 189
| 146
| null | null |
kmate/HaRe
|
old/testing/asPatterns/A3.hs
|
bsd-3-clause
|
newPat_1 = Empty
| 16
|
newPat_1 = Empty
| 16
|
newPat_1 = Empty
| 16
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
mishun/tangles
|
src/Math/Topology/KnotTh/Tangle.hs
|
lgpl-3.0
|
gridTangle :: (Int, Int) -> ((Int, Int) -> a) -> Tangle a
gridTangle (n, m) f | n < 0 = error $ printf "gridTangle: first dimension %i is negative" n
| m < 0 = error $ printf "gridTangle: second dimension %i is negative" m
| otherwise =
let border = ([1 .. n] `zip` repeat 0) ++ (map (\ i -> n * i) [1 .. m] `zip` repeat 1)
++ (map (\ i -> n * m + 1 - i) [1 .. n] `zip` repeat 2)
++ (map (\ i -> (m - i) * n + 1) [1 .. m] `zip` repeat 3)
body = do
j <- [1 .. m]
i <- [1 .. n]
return (
[ if j > 1 then (n * (j - 2) + i , 2) else (0, i - 1 )
, if i < n then (n * (j - 1) + i + 1, 3) else (0, j + n - 1 )
, if j < m then (n * j + i , 0) else (0, 2 * n + m - i )
, if i > 1 then (n * (j - 1) + i - 1, 1) else (0, 2 * m + 2 * n - j)
], f (i, j))
in implode (0, border, body)
| 1,010
|
gridTangle :: (Int, Int) -> ((Int, Int) -> a) -> Tangle a
gridTangle (n, m) f | n < 0 = error $ printf "gridTangle: first dimension %i is negative" n
| m < 0 = error $ printf "gridTangle: second dimension %i is negative" m
| otherwise =
let border = ([1 .. n] `zip` repeat 0) ++ (map (\ i -> n * i) [1 .. m] `zip` repeat 1)
++ (map (\ i -> n * m + 1 - i) [1 .. n] `zip` repeat 2)
++ (map (\ i -> (m - i) * n + 1) [1 .. m] `zip` repeat 3)
body = do
j <- [1 .. m]
i <- [1 .. n]
return (
[ if j > 1 then (n * (j - 2) + i , 2) else (0, i - 1 )
, if i < n then (n * (j - 1) + i + 1, 3) else (0, j + n - 1 )
, if j < m then (n * j + i , 0) else (0, 2 * n + m - i )
, if i > 1 then (n * (j - 1) + i - 1, 1) else (0, 2 * m + 2 * n - j)
], f (i, j))
in implode (0, border, body)
| 1,010
|
gridTangle (n, m) f | n < 0 = error $ printf "gridTangle: first dimension %i is negative" n
| m < 0 = error $ printf "gridTangle: second dimension %i is negative" m
| otherwise =
let border = ([1 .. n] `zip` repeat 0) ++ (map (\ i -> n * i) [1 .. m] `zip` repeat 1)
++ (map (\ i -> n * m + 1 - i) [1 .. n] `zip` repeat 2)
++ (map (\ i -> (m - i) * n + 1) [1 .. m] `zip` repeat 3)
body = do
j <- [1 .. m]
i <- [1 .. n]
return (
[ if j > 1 then (n * (j - 2) + i , 2) else (0, i - 1 )
, if i < n then (n * (j - 1) + i + 1, 3) else (0, j + n - 1 )
, if j < m then (n * j + i , 0) else (0, 2 * n + m - i )
, if i > 1 then (n * (j - 1) + i - 1, 1) else (0, 2 * m + 2 * n - j)
], f (i, j))
in implode (0, border, body)
| 952
| false
| true
| 1
| 20
| 467
| 544
| 300
| 244
| null | null |
Proclivis/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxLANGUAGE_SINDHI :: Int
wxLANGUAGE_SINDHI = 169
| 48
|
wxLANGUAGE_SINDHI :: Int
wxLANGUAGE_SINDHI = 169
| 48
|
wxLANGUAGE_SINDHI = 169
| 23
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
green-haskell/ghc
|
utils/genprimopcode/Main.hs
|
bsd-3-clause
|
ppType (TyApp (TyCon "Weak#") [x]) = "mkWeakPrimTy " ++ ppType x
| 70
|
ppType (TyApp (TyCon "Weak#") [x]) = "mkWeakPrimTy " ++ ppType x
| 70
|
ppType (TyApp (TyCon "Weak#") [x]) = "mkWeakPrimTy " ++ ppType x
| 70
| false
| false
| 0
| 8
| 16
| 34
| 16
| 18
| null | null |
kazu-yamamoto/dns
|
test/EncodeSpec.hs
|
bsd-3-clause
|
testResponseTXT :: DNSMessage
testResponseTXT = DNSMessage {
header = DNSHeader {
identifier = 48724
, flags = DNSFlags {
qOrR = QR_Response
, opcode = OP_STD
, authAnswer = False
, trunCation = False
, recDesired = True
, recAvailable = True
, rcode = NoErr
, authenData = False
, chkDisable = False
}
}
, ednsHeader = EDNSheader defaultEDNS
, question = [Question {
qname = "492056364.qzone.qq.com."
, qtype = TXT
}
]
, answer =
[ ResourceRecord "492056364.qzone.qq.com." TXT classIN 0 (RD_TXT "simple txt line")
]
, authority =
[ ResourceRecord "qzone.qq.com." NS classIN 45919 (RD_NS "ns-tel2.qq.com.")
, ResourceRecord "qzone.qq.com." NS classIN 45919 (RD_NS "ns-tel1.qq.com.")
]
, additional =
[ ResourceRecord "ns-tel1.qq.com." A classIN 46520 (RD_A $ toIPv4 [121, 14, 73, 115])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [222, 73, 76, 226])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [183, 60, 3, 202])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [218, 30, 72, 180])
]
}
| 1,329
|
testResponseTXT :: DNSMessage
testResponseTXT = DNSMessage {
header = DNSHeader {
identifier = 48724
, flags = DNSFlags {
qOrR = QR_Response
, opcode = OP_STD
, authAnswer = False
, trunCation = False
, recDesired = True
, recAvailable = True
, rcode = NoErr
, authenData = False
, chkDisable = False
}
}
, ednsHeader = EDNSheader defaultEDNS
, question = [Question {
qname = "492056364.qzone.qq.com."
, qtype = TXT
}
]
, answer =
[ ResourceRecord "492056364.qzone.qq.com." TXT classIN 0 (RD_TXT "simple txt line")
]
, authority =
[ ResourceRecord "qzone.qq.com." NS classIN 45919 (RD_NS "ns-tel2.qq.com.")
, ResourceRecord "qzone.qq.com." NS classIN 45919 (RD_NS "ns-tel1.qq.com.")
]
, additional =
[ ResourceRecord "ns-tel1.qq.com." A classIN 46520 (RD_A $ toIPv4 [121, 14, 73, 115])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [222, 73, 76, 226])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [183, 60, 3, 202])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [218, 30, 72, 180])
]
}
| 1,329
|
testResponseTXT = DNSMessage {
header = DNSHeader {
identifier = 48724
, flags = DNSFlags {
qOrR = QR_Response
, opcode = OP_STD
, authAnswer = False
, trunCation = False
, recDesired = True
, recAvailable = True
, rcode = NoErr
, authenData = False
, chkDisable = False
}
}
, ednsHeader = EDNSheader defaultEDNS
, question = [Question {
qname = "492056364.qzone.qq.com."
, qtype = TXT
}
]
, answer =
[ ResourceRecord "492056364.qzone.qq.com." TXT classIN 0 (RD_TXT "simple txt line")
]
, authority =
[ ResourceRecord "qzone.qq.com." NS classIN 45919 (RD_NS "ns-tel2.qq.com.")
, ResourceRecord "qzone.qq.com." NS classIN 45919 (RD_NS "ns-tel1.qq.com.")
]
, additional =
[ ResourceRecord "ns-tel1.qq.com." A classIN 46520 (RD_A $ toIPv4 [121, 14, 73, 115])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [222, 73, 76, 226])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [183, 60, 3, 202])
, ResourceRecord "ns-tel2.qq.com." A classIN 2890 (RD_A $ toIPv4 [218, 30, 72, 180])
]
}
| 1,299
| false
| true
| 0
| 13
| 451
| 350
| 200
| 150
| null | null |
gsnewmark/cis194
|
src/Cis194/Week4/Lecture.hs
|
apache-2.0
|
length' :: [a] -> Int
length' [] = 0
| 40
|
length' :: [a] -> Int
length' [] = 0
| 40
|
length' [] = 0
| 18
| false
| true
| 0
| 8
| 12
| 29
| 13
| 16
| null | null |
brendanhay/gogol
|
gogol-admin-datatransfer/gen/Network/Google/Resource/DataTransfer/Transfers/Insert.hs
|
mpl-2.0
|
-- | Creates a value of 'TransfersInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tiXgafv'
--
-- * 'tiUploadProtocol'
--
-- * 'tiAccessToken'
--
-- * 'tiUploadType'
--
-- * 'tiPayload'
--
-- * 'tiCallback'
transfersInsert
:: DataTransfer -- ^ 'tiPayload'
-> TransfersInsert
transfersInsert pTiPayload_ =
TransfersInsert'
{ _tiXgafv = Nothing
, _tiUploadProtocol = Nothing
, _tiAccessToken = Nothing
, _tiUploadType = Nothing
, _tiPayload = pTiPayload_
, _tiCallback = Nothing
}
| 609
|
transfersInsert
:: DataTransfer -- ^ 'tiPayload'
-> TransfersInsert
transfersInsert pTiPayload_ =
TransfersInsert'
{ _tiXgafv = Nothing
, _tiUploadProtocol = Nothing
, _tiAccessToken = Nothing
, _tiUploadType = Nothing
, _tiPayload = pTiPayload_
, _tiCallback = Nothing
}
| 309
|
transfersInsert pTiPayload_ =
TransfersInsert'
{ _tiXgafv = Nothing
, _tiUploadProtocol = Nothing
, _tiAccessToken = Nothing
, _tiUploadType = Nothing
, _tiPayload = pTiPayload_
, _tiCallback = Nothing
}
| 233
| true
| true
| 0
| 7
| 128
| 81
| 52
| 29
| null | null |
ArlequinWild/Lenguajes-de-programaci-n
|
Practica0.hs
|
gpl-3.0
|
{- Retos -}
-- axiliar limpia la cadena hasta encontrar blanco
elimina::String->String
elimina [] = []
| 102
|
elimina::String->String
elimina [] = []
| 39
|
elimina [] = []
| 15
| true
| true
| 0
| 6
| 15
| 24
| 13
| 11
| null | null |
adamsmasher/EMA
|
Ema.hs
|
gpl-3.0
|
doIncludes :: [Line] -> AssemblyStateT IO [Line]
doIncludes src = liftM concat $ sequence $ map doInclude src
| 109
|
doIncludes :: [Line] -> AssemblyStateT IO [Line]
doIncludes src = liftM concat $ sequence $ map doInclude src
| 109
|
doIncludes src = liftM concat $ sequence $ map doInclude src
| 60
| false
| true
| 0
| 8
| 17
| 49
| 23
| 26
| null | null |
oldmanmike/ghc
|
compiler/utils/UniqSet.hs
|
bsd-3-clause
|
foldUniqSet = foldUFM
| 21
|
foldUniqSet = foldUFM
| 21
|
foldUniqSet = foldUFM
| 21
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
sakari/haskell-gherkin
|
Language/Gherkin/Parser.hs
|
bsd-3-clause
|
parseWholeLine :: Parser String
parseWholeLine = manyTill anyChar $ try lineEnd
| 79
|
parseWholeLine :: Parser String
parseWholeLine = manyTill anyChar $ try lineEnd
| 79
|
parseWholeLine = manyTill anyChar $ try lineEnd
| 47
| false
| true
| 0
| 6
| 10
| 24
| 11
| 13
| null | null |
gres147679/MaDMaG
|
Input.hs
|
gpl-2.0
|
readFiles1 (f:fs) ds = do
m <- readFromFile f `catch` readError
let a = case m of
Left s -> Left s
Right d -> Right (d,f)
readFiles1 fs (ds++[a])
| 175
|
readFiles1 (f:fs) ds = do
m <- readFromFile f `catch` readError
let a = case m of
Left s -> Left s
Right d -> Right (d,f)
readFiles1 fs (ds++[a])
| 175
|
readFiles1 (f:fs) ds = do
m <- readFromFile f `catch` readError
let a = case m of
Left s -> Left s
Right d -> Right (d,f)
readFiles1 fs (ds++[a])
| 175
| false
| false
| 0
| 14
| 59
| 96
| 46
| 50
| null | null |
conal/shady-graphics
|
src/Shady/Image.hs
|
agpl-3.0
|
-- Hm! This utile' definition repeats [0,1), not [-.5,.5). Eep. How can
-- I shift without loss of generality? For instance, the current
-- definition can handle nD.
-- | Unit, rectangular tiling.
-- utile :: (AdditiveGroup s, Eq s, Frac p, ITrans (Complex s) p, ITrans (Complex s) a, Floating s) =>
-- Unop (p -> a)
-- utile :: Unop (Image a)
-- utile = translate2 (negate (0.5 :+ 0.5)) utile'
-- -- utile :: Unop (Image a)
-- utile :: forall p a s. (Fractional s, Frac p, ITrans (Complex s) a) =>
-- Unop (p -> a)
-- utile = translate2 (negate (0.5 :+ 0.5 :: Complex s)) utile'
utile :: (Frac p, AdditiveGroup p, Floating p, Eq p) =>
Unop (Complex p -> a)
utile f = utile' (f . subtract (0.5 :+ 0.5))
| 736
|
utile :: (Frac p, AdditiveGroup p, Floating p, Eq p) =>
Unop (Complex p -> a)
utile f = utile' (f . subtract (0.5 :+ 0.5))
| 131
|
utile f = utile' (f . subtract (0.5 :+ 0.5))
| 44
| true
| true
| 0
| 10
| 172
| 91
| 50
| 41
| null | null |
fmapfmapfmap/amazonka
|
amazonka-ml/gen/Network/AWS/MachineLearning/UpdateMLModel.hs
|
mpl-2.0
|
-- | A user-supplied name or description of the 'MLModel'.
umlmMLModelName :: Lens' UpdateMLModel (Maybe Text)
umlmMLModelName = lens _umlmMLModelName (\ s a -> s{_umlmMLModelName = a})
| 185
|
umlmMLModelName :: Lens' UpdateMLModel (Maybe Text)
umlmMLModelName = lens _umlmMLModelName (\ s a -> s{_umlmMLModelName = a})
| 126
|
umlmMLModelName = lens _umlmMLModelName (\ s a -> s{_umlmMLModelName = a})
| 74
| true
| true
| 0
| 9
| 26
| 46
| 25
| 21
| null | null |
vTurbine/ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
-- | Returns @True@ iff the expression is a 'Type' or 'Coercion'
-- expression at its top level
isTyCoArg :: Expr b -> Bool
isTyCoArg (Type {}) = True
| 154
|
isTyCoArg :: Expr b -> Bool
isTyCoArg (Type {}) = True
| 58
|
isTyCoArg (Type {}) = True
| 30
| true
| true
| 0
| 7
| 32
| 30
| 16
| 14
| null | null |
siddhanathan/ghc
|
includes/CodeGen.Platform.hs
|
bsd-3-clause
|
globalRegMaybe CurrentTSO = Just (RealRegSingle REG_CurrentTSO)
| 77
|
globalRegMaybe CurrentTSO = Just (RealRegSingle REG_CurrentTSO)
| 77
|
globalRegMaybe CurrentTSO = Just (RealRegSingle REG_CurrentTSO)
| 77
| false
| false
| 0
| 7
| 19
| 18
| 8
| 10
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-example/Drasil/SSP/References.hs
|
bsd-2-clause
|
fredlund1977 = cArticle [dgFredlund, jKrahn]
"Comparison of slope stability methods of analysis"
jnlCGJ 1977 [month Apr, pages [429..439], volume 14, number 3]
"fredlund1977"
| 180
|
fredlund1977 = cArticle [dgFredlund, jKrahn]
"Comparison of slope stability methods of analysis"
jnlCGJ 1977 [month Apr, pages [429..439], volume 14, number 3]
"fredlund1977"
| 180
|
fredlund1977 = cArticle [dgFredlund, jKrahn]
"Comparison of slope stability methods of analysis"
jnlCGJ 1977 [month Apr, pages [429..439], volume 14, number 3]
"fredlund1977"
| 180
| false
| false
| 0
| 8
| 28
| 58
| 28
| 30
| null | null |
limaner2002/EPC-tools
|
RapidFire/src/Appian/Client.hs
|
bsd-3-clause
|
-- | Will find a radio button on the page with the given label and
-- select the button using the provided index
radioButtonUpdate :: (Contravariant f, Plated s, AsValue s, AsJSON s, Applicative f) => Text -> AppianInteger -> Over (->) f s s (Either Text Update) (Either Text Update)
radioButtonUpdate label selection = failing (getRadioButtonField label . to (rdgValue .~ Just selection) . to toUpdate . to Right) (to $ const $ Left $ "Could not find RadioButtonField " <> tshow label)
| 486
|
radioButtonUpdate :: (Contravariant f, Plated s, AsValue s, AsJSON s, Applicative f) => Text -> AppianInteger -> Over (->) f s s (Either Text Update) (Either Text Update)
radioButtonUpdate label selection = failing (getRadioButtonField label . to (rdgValue .~ Just selection) . to toUpdate . to Right) (to $ const $ Left $ "Could not find RadioButtonField " <> tshow label)
| 373
|
radioButtonUpdate label selection = failing (getRadioButtonField label . to (rdgValue .~ Just selection) . to toUpdate . to Right) (to $ const $ Left $ "Could not find RadioButtonField " <> tshow label)
| 202
| true
| true
| 0
| 13
| 83
| 155
| 77
| 78
| null | null |
rleshchinskiy/vector
|
Data/Vector/Fusion/Bundle/Monadic.hs
|
bsd-3-clause
|
chunks = sChunks
| 16
|
chunks = sChunks
| 16
|
chunks = sChunks
| 16
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
uduki/hsQt
|
Qtc/Gui/QTextFormat.hs
|
bsd-2-clause
|
toTableFormat :: QTextFormat a -> (()) -> IO (QTextTableFormat ())
toTableFormat x0 ()
= withQTextTableFormatResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QTextFormat_toTableFormat cobj_x0
| 196
|
toTableFormat :: QTextFormat a -> (()) -> IO (QTextTableFormat ())
toTableFormat x0 ()
= withQTextTableFormatResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QTextFormat_toTableFormat cobj_x0
| 196
|
toTableFormat x0 ()
= withQTextTableFormatResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QTextFormat_toTableFormat cobj_x0
| 129
| false
| true
| 4
| 11
| 32
| 71
| 32
| 39
| null | null |
vdweegen/UvA-Software_Testing
|
Lab6/Jordan/Lecture6.hs
|
gpl-3.0
|
mers 20 = 2^4423-1
| 18
|
mers 20 = 2^4423-1
| 18
|
mers 20 = 2^4423-1
| 18
| false
| false
| 0
| 6
| 3
| 17
| 8
| 9
| null | null |
dmwit/wyvern
|
Main.hs
|
bsd-3-clause
|
rcName :: FilePath -> FilePath
rcName = (</> "config")
| 54
|
rcName :: FilePath -> FilePath
rcName = (</> "config")
| 54
|
rcName = (</> "config")
| 23
| false
| true
| 0
| 5
| 8
| 19
| 11
| 8
| null | null |
brendanhay/gogol
|
gogol-slides/gen/Network/Google/Slides/Types/Product.hs
|
mpl-2.0
|
-- | The amount of indentation for the start of the first line of the
-- paragraph. If unset, the value is inherited from the parent.
psIndentFirstLine :: Lens' ParagraphStyle (Maybe Dimension)
psIndentFirstLine
= lens _psIndentFirstLine
(\ s a -> s{_psIndentFirstLine = a})
| 282
|
psIndentFirstLine :: Lens' ParagraphStyle (Maybe Dimension)
psIndentFirstLine
= lens _psIndentFirstLine
(\ s a -> s{_psIndentFirstLine = a})
| 148
|
psIndentFirstLine
= lens _psIndentFirstLine
(\ s a -> s{_psIndentFirstLine = a})
| 88
| true
| true
| 0
| 9
| 50
| 49
| 26
| 23
| null | null |
ekmett/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
enableGlasgowExts :: DynP ()
enableGlasgowExts = do setGeneralFlag Opt_PrintExplicitForalls
mapM_ setExtensionFlag glasgowExtsFlags
| 154
|
enableGlasgowExts :: DynP ()
enableGlasgowExts = do setGeneralFlag Opt_PrintExplicitForalls
mapM_ setExtensionFlag glasgowExtsFlags
| 154
|
enableGlasgowExts = do setGeneralFlag Opt_PrintExplicitForalls
mapM_ setExtensionFlag glasgowExtsFlags
| 125
| false
| true
| 0
| 8
| 34
| 36
| 14
| 22
| null | null |
larioj/nemo
|
nemo.hs
|
mit
|
topoSort :: Ord a => Map a [a] -> Maybe [a]
topoSort g = let
computation =
while (not . Set.null . usingZero_)
decrementZeros
init = counts g
(result, (Counts _ remainder _)) = runState computation init in
maybeWhen (Map.null remainder) (concat result)
| 270
|
topoSort :: Ord a => Map a [a] -> Maybe [a]
topoSort g = let
computation =
while (not . Set.null . usingZero_)
decrementZeros
init = counts g
(result, (Counts _ remainder _)) = runState computation init in
maybeWhen (Map.null remainder) (concat result)
| 270
|
topoSort g = let
computation =
while (not . Set.null . usingZero_)
decrementZeros
init = counts g
(result, (Counts _ remainder _)) = runState computation init in
maybeWhen (Map.null remainder) (concat result)
| 226
| false
| true
| 0
| 13
| 60
| 122
| 60
| 62
| null | null |
badp/ganeti
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
cvEclusterclientcert :: (String, String, String)
cvEclusterclientcert =
("cluster",
Types.cVErrorCodeToRaw CvECLUSTERCLIENTCERT,
"Cluster client certificate files verification failure")
| 193
|
cvEclusterclientcert :: (String, String, String)
cvEclusterclientcert =
("cluster",
Types.cVErrorCodeToRaw CvECLUSTERCLIENTCERT,
"Cluster client certificate files verification failure")
| 193
|
cvEclusterclientcert =
("cluster",
Types.cVErrorCodeToRaw CvECLUSTERCLIENTCERT,
"Cluster client certificate files verification failure")
| 144
| false
| true
| 0
| 7
| 23
| 34
| 20
| 14
| null | null |
expipiplus1/vulkan
|
src/Vulkan/Extensions/VK_KHR_xcb_surface.hs
|
bsd-3-clause
|
enumPrefixXcbSurfaceCreateFlagsKHR :: String
enumPrefixXcbSurfaceCreateFlagsKHR = ""
| 84
|
enumPrefixXcbSurfaceCreateFlagsKHR :: String
enumPrefixXcbSurfaceCreateFlagsKHR = ""
| 84
|
enumPrefixXcbSurfaceCreateFlagsKHR = ""
| 39
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
antalsz/hs-to-coq
|
examples/graph/graph/Data/Graph/Inductive/PatriciaTree.hs
|
mit
|
fastNEMap :: forall a b c d. (a -> c) -> (b -> d) -> Gr a b -> Gr c d
fastNEMap fn fe (Gr g) = Gr (IM.map f g)
where
f :: Context' a b -> Context' c d
f (ps, a, ss) = (IM.map (map fe) ps, fn a, IM.map (map fe) ss)
----------------------------------------------------------------------
-- UTILITIES
----------------------------------------------------------------------
| 379
|
fastNEMap :: forall a b c d. (a -> c) -> (b -> d) -> Gr a b -> Gr c d
fastNEMap fn fe (Gr g) = Gr (IM.map f g)
where
f :: Context' a b -> Context' c d
f (ps, a, ss) = (IM.map (map fe) ps, fn a, IM.map (map fe) ss)
----------------------------------------------------------------------
-- UTILITIES
----------------------------------------------------------------------
| 379
|
fastNEMap fn fe (Gr g) = Gr (IM.map f g)
where
f :: Context' a b -> Context' c d
f (ps, a, ss) = (IM.map (map fe) ps, fn a, IM.map (map fe) ss)
----------------------------------------------------------------------
-- UTILITIES
----------------------------------------------------------------------
| 309
| false
| true
| 2
| 9
| 71
| 159
| 84
| 75
| null | null |
sdiehl/ghc
|
compiler/coreSyn/CoreUtils.hs
|
bsd-3-clause
|
diffExpr top env (App f1 a1) (App f2 a2)
= diffExpr top env f1 f2 ++ diffExpr top env a1 a2
| 96
|
diffExpr top env (App f1 a1) (App f2 a2)
= diffExpr top env f1 f2 ++ diffExpr top env a1 a2
| 96
|
diffExpr top env (App f1 a1) (App f2 a2)
= diffExpr top env f1 f2 ++ diffExpr top env a1 a2
| 96
| false
| false
| 0
| 7
| 25
| 53
| 25
| 28
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/Prelude/PrelNames.hs
|
bsd-3-clause
|
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 179
| 57
|
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 179
| 57
|
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 179
| 57
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
beni55/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
genPrim _ _ Narrow16IntOp [r] [x] = PrimInline [j| `r` = (`x` & 0x7FFF)-(`x` & 0x8000) |]
| 95
|
genPrim _ _ Narrow16IntOp [r] [x] = PrimInline [j| `r` = (`x` & 0x7FFF)-(`x` & 0x8000) |]
| 95
|
genPrim _ _ Narrow16IntOp [r] [x] = PrimInline [j| `r` = (`x` & 0x7FFF)-(`x` & 0x8000) |]
| 95
| false
| false
| 0
| 6
| 22
| 30
| 17
| 13
| null | null |
awbraunstein/emonad
|
src/KillRing.hs
|
mit
|
yank (KR [] _) = ("", mkKillRing)
| 33
|
yank (KR [] _) = ("", mkKillRing)
| 33
|
yank (KR [] _) = ("", mkKillRing)
| 33
| false
| false
| 0
| 8
| 6
| 25
| 13
| 12
| null | null |
jdevelop/skypelogr
|
Main.hs
|
bsd-3-clause
|
options :: [OptDescr (Settings -> IO Settings)]
options =
[ Option ['s'] ["source"] (ReqArg checkAndSetInput "") "Skype data folder",
Option ['d'] ["destination"] (ReqArg checkAndSetOutput "") "Skype destination folder"
]
where
checkAndSetInput dir opts = do
exists <- doesDirectoryExist dir
if (exists)
then return $ opts {skypeFolder = Just dir}
else ioError $ userError (printf "Source folder %s does not exist" dir)
checkAndSetOutput dir opts = do
exists <- doesDirectoryExist dir
if (exists)
then return $ opts {exportFolder = dir}
else ioError $ userError (printf "Export folder %s does not exist" dir)
| 688
|
options :: [OptDescr (Settings -> IO Settings)]
options =
[ Option ['s'] ["source"] (ReqArg checkAndSetInput "") "Skype data folder",
Option ['d'] ["destination"] (ReqArg checkAndSetOutput "") "Skype destination folder"
]
where
checkAndSetInput dir opts = do
exists <- doesDirectoryExist dir
if (exists)
then return $ opts {skypeFolder = Just dir}
else ioError $ userError (printf "Source folder %s does not exist" dir)
checkAndSetOutput dir opts = do
exists <- doesDirectoryExist dir
if (exists)
then return $ opts {exportFolder = dir}
else ioError $ userError (printf "Export folder %s does not exist" dir)
| 688
|
options =
[ Option ['s'] ["source"] (ReqArg checkAndSetInput "") "Skype data folder",
Option ['d'] ["destination"] (ReqArg checkAndSetOutput "") "Skype destination folder"
]
where
checkAndSetInput dir opts = do
exists <- doesDirectoryExist dir
if (exists)
then return $ opts {skypeFolder = Just dir}
else ioError $ userError (printf "Source folder %s does not exist" dir)
checkAndSetOutput dir opts = do
exists <- doesDirectoryExist dir
if (exists)
then return $ opts {exportFolder = dir}
else ioError $ userError (printf "Export folder %s does not exist" dir)
| 640
| false
| true
| 0
| 12
| 170
| 214
| 107
| 107
| null | null |
DanielSchiavini/ampersand
|
src/Database/Design/Ampersand/Input/Parsing.hs
|
gpl-3.0
|
-- Parse an Ampersand file and all transitive includes
parseADL :: Options -> FilePath -> IO (Guarded P_Context)
parseADL opts filePath =
whenCheckedIO (parseSingleADL opts filePath) $ \(ctxt, filePaths) ->
whenCheckedIO (parseADLs opts [filePath] filePaths) $ \ctxts ->
return $ Checked $ foldl mergeContexts ctxt ctxts
| 333
|
parseADL :: Options -> FilePath -> IO (Guarded P_Context)
parseADL opts filePath =
whenCheckedIO (parseSingleADL opts filePath) $ \(ctxt, filePaths) ->
whenCheckedIO (parseADLs opts [filePath] filePaths) $ \ctxts ->
return $ Checked $ foldl mergeContexts ctxt ctxts
| 278
|
parseADL opts filePath =
whenCheckedIO (parseSingleADL opts filePath) $ \(ctxt, filePaths) ->
whenCheckedIO (parseADLs opts [filePath] filePaths) $ \ctxts ->
return $ Checked $ foldl mergeContexts ctxt ctxts
| 219
| true
| true
| 0
| 11
| 58
| 100
| 51
| 49
| null | null |
techtangents/ablist
|
src/Data/AbList.hs
|
bsd-3-clause
|
abFoldl' :: (t -> a -> t) -> (t -> b -> t) -> t -> (AbList a b) -> t
abFoldl' _ _ t AbNil = t
| 93
|
abFoldl' :: (t -> a -> t) -> (t -> b -> t) -> t -> (AbList a b) -> t
abFoldl' _ _ t AbNil = t
| 93
|
abFoldl' _ _ t AbNil = t
| 24
| false
| true
| 0
| 11
| 27
| 72
| 35
| 37
| null | null |
spinda/liquidhaskell
|
tests/gsoc15/unknown/pos/RBTree-height.hs
|
bsd-3-clause
|
ins kx s@(Node B x l r) = case compare kx x of
LT -> let t = lbal x (ins kx l) r in t
GT -> let t = rbal x l (ins kx r) in t
EQ -> s
| 218
|
ins kx s@(Node B x l r) = case compare kx x of
LT -> let t = lbal x (ins kx l) r in t
GT -> let t = rbal x l (ins kx r) in t
EQ -> s
| 218
|
ins kx s@(Node B x l r) = case compare kx x of
LT -> let t = lbal x (ins kx l) r in t
GT -> let t = rbal x l (ins kx r) in t
EQ -> s
| 218
| false
| false
| 0
| 14
| 127
| 106
| 50
| 56
| null | null |
DanielWaterworth/Idris-dev
|
src/IRTS/CodegenLLVM.hs
|
bsd-3-clause
|
cgConst' (TT.B64V v) = C.Vector (map ((C.Int 64) . fromIntegral) . V.toList $ v)
| 80
|
cgConst' (TT.B64V v) = C.Vector (map ((C.Int 64) . fromIntegral) . V.toList $ v)
| 80
|
cgConst' (TT.B64V v) = C.Vector (map ((C.Int 64) . fromIntegral) . V.toList $ v)
| 80
| false
| false
| 0
| 14
| 13
| 53
| 26
| 27
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.