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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ciderpunx/exercismo
|
src/CustomSet.hs
|
gpl-3.0
|
intersection (Set xs) (Set ys) =
let zs = filter (`elem` xs) ys
in case zs of
[] -> Empty
_ -> Set zs
| 122
|
intersection (Set xs) (Set ys) =
let zs = filter (`elem` xs) ys
in case zs of
[] -> Empty
_ -> Set zs
| 122
|
intersection (Set xs) (Set ys) =
let zs = filter (`elem` xs) ys
in case zs of
[] -> Empty
_ -> Set zs
| 122
| false
| false
| 1
| 10
| 44
| 70
| 33
| 37
| null | null |
tonyfloatersu/solution-haskell-craft-of-FP
|
Chapter_6_my_note.hs
|
mit
|
makeDiscount :: BillType -> Price
makeDiscount _tp = 100 * div (length [i | i <- _tp, fst i == dsctgt]) satisfytgt
where
dsctgt :: String
dsctgt = "Dry Sherry"
satisfytgt :: Int
satisfytgt = 2
| 219
|
makeDiscount :: BillType -> Price
makeDiscount _tp = 100 * div (length [i | i <- _tp, fst i == dsctgt]) satisfytgt
where
dsctgt :: String
dsctgt = "Dry Sherry"
satisfytgt :: Int
satisfytgt = 2
| 219
|
makeDiscount _tp = 100 * div (length [i | i <- _tp, fst i == dsctgt]) satisfytgt
where
dsctgt :: String
dsctgt = "Dry Sherry"
satisfytgt :: Int
satisfytgt = 2
| 185
| false
| true
| 3
| 12
| 62
| 82
| 40
| 42
| null | null |
AlbinTheander/oden
|
src/Oden/Compiler/Validation.hs
|
mit
|
validateType (TSlice _ t) = validateType t
| 42
|
validateType (TSlice _ t) = validateType t
| 42
|
validateType (TSlice _ t) = validateType t
| 42
| false
| false
| 0
| 7
| 6
| 20
| 9
| 11
| null | null |
stevely/hspirv
|
src/SpirV/Builder/Raw.hs
|
bsd-3-clause
|
-- Id 1: Result type, must be float type
-- Id 2: First operand
-- Id 3: Second operand
fSub :: Id -> Id -> Id -> Builder Id
fSub = fourOp OpFSub
| 145
|
fSub :: Id -> Id -> Id -> Builder Id
fSub = fourOp OpFSub
| 57
|
fSub = fourOp OpFSub
| 20
| true
| true
| 0
| 8
| 32
| 32
| 17
| 15
| null | null |
dorchard/gram_lang
|
frontend/src/Language/Granule/Checker/Constraints/SymbolicGrades.hs
|
bsd-3-clause
|
symGradePlus s t | isSProduct s || isSProduct t =
either solverError id (applyToProducts symGradePlus SProduct id s t)
| 120
|
symGradePlus s t | isSProduct s || isSProduct t =
either solverError id (applyToProducts symGradePlus SProduct id s t)
| 120
|
symGradePlus s t | isSProduct s || isSProduct t =
either solverError id (applyToProducts symGradePlus SProduct id s t)
| 120
| false
| false
| 0
| 9
| 20
| 48
| 21
| 27
| null | null |
j1r1k/portager
|
src/Portager/Flatten.hs
|
bsd-3-clause
|
mergeLists as [] = as
| 21
|
mergeLists as [] = as
| 21
|
mergeLists as [] = as
| 21
| false
| false
| 0
| 5
| 4
| 18
| 7
| 11
| null | null |
Helium4Haskell/helium
|
src/Helium/Utils/Texts.hs
|
gpl-3.0
|
commasAnd :: [String] -> String
commasAnd [] = []
| 49
|
commasAnd :: [String] -> String
commasAnd [] = []
| 49
|
commasAnd [] = []
| 17
| false
| true
| 0
| 6
| 8
| 25
| 13
| 12
| null | null |
jochem88/btjchm
|
Main.hs
|
mit
|
pong :: Handle -> T.Text -> IO ()
pong h s = write h "PONG" $ T.concat [":",T.drop 6 s]
| 87
|
pong :: Handle -> T.Text -> IO ()
pong h s = write h "PONG" $ T.concat [":",T.drop 6 s]
| 87
|
pong h s = write h "PONG" $ T.concat [":",T.drop 6 s]
| 53
| false
| true
| 0
| 9
| 19
| 58
| 28
| 30
| null | null |
oldmanmike/ghc
|
compiler/simplCore/OccurAnal.hs
|
bsd-3-clause
|
extendFvs_ :: UniqFM VarSet -> VarSet -> VarSet
extendFvs_ env s = fst (extendFvs env s)
| 88
|
extendFvs_ :: UniqFM VarSet -> VarSet -> VarSet
extendFvs_ env s = fst (extendFvs env s)
| 88
|
extendFvs_ env s = fst (extendFvs env s)
| 40
| false
| true
| 0
| 7
| 15
| 38
| 18
| 20
| null | null |
Vlix/facebookmessenger
|
src/Web/Facebook/Messenger/Internal.hs
|
mit
|
withText' :: String -- ^ /reference in case the parsing fails/
-> [(Text, a)] -- ^ /lookup list of JSON String to sum type/
-> Value
-> Parser a
withText' s tups = withText s $ \t ->
case lookup t tups of
Just val -> pure val
_ -> fail $ "Wrong String for " <> s <> ": " <> unpack t
-- | Like 'withText'', but case insensitive.
| 374
|
withText' :: String -- ^ /reference in case the parsing fails/
-> [(Text, a)] -- ^ /lookup list of JSON String to sum type/
-> Value
-> Parser a
withText' s tups = withText s $ \t ->
case lookup t tups of
Just val -> pure val
_ -> fail $ "Wrong String for " <> s <> ": " <> unpack t
-- | Like 'withText'', but case insensitive.
| 374
|
withText' s tups = withText s $ \t ->
case lookup t tups of
Just val -> pure val
_ -> fail $ "Wrong String for " <> s <> ": " <> unpack t
-- | Like 'withText'', but case insensitive.
| 199
| false
| true
| 0
| 13
| 117
| 101
| 51
| 50
| null | null |
scott-fleischman/greek-grammar
|
haskell/greek-grammar/src/Text/Greek/IO/Render.hs
|
mit
|
renderRhConsonant Consonant.Rh_ψ = "Consonant ψ"
| 48
|
renderRhConsonant Consonant.Rh_ψ = "Consonant ψ"
| 48
|
renderRhConsonant Consonant.Rh_ψ = "Consonant ψ"
| 48
| false
| false
| 0
| 6
| 4
| 13
| 6
| 7
| null | null |
yav/smtLib
|
src/SMTLib2/BitVector.hs
|
mit
|
bvugt :: Expr -> Expr -> Expr
bvugt x y = app "bvugt" [x,y]
| 59
|
bvugt :: Expr -> Expr -> Expr
bvugt x y = app "bvugt" [x,y]
| 59
|
bvugt x y = app "bvugt" [x,y]
| 29
| false
| true
| 0
| 6
| 13
| 35
| 18
| 17
| null | null |
jgm/citeproc
|
src/Citeproc/Types.hs
|
bsd-2-clause
|
variableType "editorial-director" = NameVariable
| 48
|
variableType "editorial-director" = NameVariable
| 48
|
variableType "editorial-director" = NameVariable
| 48
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
gridaphobe/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
pprCode :: CodeStyle -> SDoc -> SDoc
pprCode cs d = withPprStyle (PprCode cs) d
| 79
|
pprCode :: CodeStyle -> SDoc -> SDoc
pprCode cs d = withPprStyle (PprCode cs) d
| 79
|
pprCode cs d = withPprStyle (PprCode cs) d
| 42
| false
| true
| 0
| 7
| 14
| 35
| 17
| 18
| null | null |
romanb/amazonka
|
amazonka-s3/gen/Network/AWS/S3/Types.hs
|
mpl-2.0
|
-- | 'Destination' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'dBucket' @::@ 'Text'
--
destination :: Text -- ^ 'dBucket'
-> Destination
destination p1 = Destination
{ _dBucket = p1
}
| 243
|
destination :: Text -- ^ 'dBucket'
-> Destination
destination p1 = Destination
{ _dBucket = p1
}
| 116
|
destination p1 = Destination
{ _dBucket = p1
}
| 54
| true
| true
| 0
| 6
| 56
| 33
| 21
| 12
| null | null |
cabrera/stack
|
src/Stack/Types/Config.hs
|
bsd-3-clause
|
resolverName (ResolverCompiler v) = compilerVersionName v
| 57
|
resolverName (ResolverCompiler v) = compilerVersionName v
| 57
|
resolverName (ResolverCompiler v) = compilerVersionName v
| 57
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
prl-tokyo/bigul-configuration-adaptation
|
Transformations/src/Generics/BiGUL/TH.hs
|
mit
|
constructorToPatAndBody (RecC name sts) = liftM (True, name,) $ replicateM (length sts) (newName "var")
| 106
|
constructorToPatAndBody (RecC name sts) = liftM (True, name,) $ replicateM (length sts) (newName "var")
| 106
|
constructorToPatAndBody (RecC name sts) = liftM (True, name,) $ replicateM (length sts) (newName "var")
| 106
| false
| false
| 0
| 8
| 16
| 48
| 24
| 24
| null | null |
frontrowed/stratosphere
|
library-gen/Stratosphere/ResourceProperties/EC2LaunchTemplateCreditSpecification.hs
|
mit
|
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata-creditspecification.html#cfn-ec2-launchtemplate-launchtemplatedata-creditspecification-cpucredits
ecltcsCpuCredits :: Lens' EC2LaunchTemplateCreditSpecification (Maybe (Val Text))
ecltcsCpuCredits = lens _eC2LaunchTemplateCreditSpecificationCpuCredits (\s a -> s { _eC2LaunchTemplateCreditSpecificationCpuCredits = a })
| 439
|
ecltcsCpuCredits :: Lens' EC2LaunchTemplateCreditSpecification (Maybe (Val Text))
ecltcsCpuCredits = lens _eC2LaunchTemplateCreditSpecificationCpuCredits (\s a -> s { _eC2LaunchTemplateCreditSpecificationCpuCredits = a })
| 221
|
ecltcsCpuCredits = lens _eC2LaunchTemplateCreditSpecificationCpuCredits (\s a -> s { _eC2LaunchTemplateCreditSpecificationCpuCredits = a })
| 139
| true
| true
| 1
| 9
| 22
| 57
| 28
| 29
| null | null |
h3nnn4n/rubiks-cube-haskell
|
Rubik.hs
|
gpl-3.0
|
inverted (Edge Blue Red ) = (Edge Red Blue )
| 54
|
inverted (Edge Blue Red ) = (Edge Red Blue )
| 54
|
inverted (Edge Blue Red ) = (Edge Red Blue )
| 54
| false
| false
| 0
| 7
| 19
| 25
| 12
| 13
| null | null |
mpickering/pandoc-lit
|
src/Text/Pandoc/Lit.hs
|
bsd-3-clause
|
transformInline _config x = x
| 29
|
transformInline _config x = x
| 29
|
transformInline _config x = x
| 29
| false
| false
| 0
| 4
| 4
| 12
| 5
| 7
| null | null |
ggreif/clash-compiler
|
clash-lib/src/CLaSH/Normalize/Util.hs
|
bsd-2-clause
|
lambdaDrop :: HashMap TmName (Type,Term) -- ^ Original Binders
-> HashMap TmName [TmName] -- ^ Dependency Graph
-> [TmName] -- ^ Recursive block
-> (TmName,(Type,Term)) -- ^ Lambda-dropped Binders
lambdaDrop bndrs depGraph cyc@(root:_) = block
where
doms = dominator depGraph cyc
block = blockSink bndrs doms (0,root)
| 388
|
lambdaDrop :: HashMap TmName (Type,Term) -- ^ Original Binders
-> HashMap TmName [TmName] -- ^ Dependency Graph
-> [TmName] -- ^ Recursive block
-> (TmName,(Type,Term))
lambdaDrop bndrs depGraph cyc@(root:_) = block
where
doms = dominator depGraph cyc
block = blockSink bndrs doms (0,root)
| 354
|
lambdaDrop bndrs depGraph cyc@(root:_) = block
where
doms = dominator depGraph cyc
block = blockSink bndrs doms (0,root)
| 131
| true
| true
| 2
| 11
| 117
| 119
| 62
| 57
| null | null |
harendra-kumar/unicode-transforms
|
unicode-data/UCD2Haskell.hs
|
bsd-3-clause
|
readCodePoint :: String -> Char
readCodePoint = chr . read . ("0x"++)
| 69
|
readCodePoint :: String -> Char
readCodePoint = chr . read . ("0x"++)
| 69
|
readCodePoint = chr . read . ("0x"++)
| 37
| false
| true
| 0
| 6
| 11
| 27
| 15
| 12
| null | null |
MasseR/xmonadcontrib
|
XMonad/Actions/Search.hs
|
bsd-3-clause
|
-- | > removeColonPrefix "foo://bar" ~> "//bar"
-- > removeColonPrefix "foo//bar" ~> "foo//bar"
removeColonPrefix :: String -> String
removeColonPrefix s = if ':' `elem` s then drop 1 $ dropWhile (':' /=) s else s
| 213
|
removeColonPrefix :: String -> String
removeColonPrefix s = if ':' `elem` s then drop 1 $ dropWhile (':' /=) s else s
| 117
|
removeColonPrefix s = if ':' `elem` s then drop 1 $ dropWhile (':' /=) s else s
| 79
| true
| true
| 0
| 8
| 34
| 50
| 28
| 22
| null | null |
TomMD/ghc
|
compiler/main/Annotations.hs
|
bsd-3-clause
|
-- | An empty annotation environment.
emptyAnnEnv :: AnnEnv
emptyAnnEnv = MkAnnEnv emptyUFM
| 91
|
emptyAnnEnv :: AnnEnv
emptyAnnEnv = MkAnnEnv emptyUFM
| 53
|
emptyAnnEnv = MkAnnEnv emptyUFM
| 31
| true
| true
| 0
| 5
| 12
| 15
| 8
| 7
| null | null |
frerich/pandoc
|
src/Text/Pandoc/Writers/LaTeX.hs
|
gpl-2.0
|
inlineToLaTeX (RawInline f str)
| f == Format "latex" || f == Format "tex"
= return $ text str
| otherwise = return empty
| 159
|
inlineToLaTeX (RawInline f str)
| f == Format "latex" || f == Format "tex"
= return $ text str
| otherwise = return empty
| 159
|
inlineToLaTeX (RawInline f str)
| f == Format "latex" || f == Format "tex"
= return $ text str
| otherwise = return empty
| 159
| false
| false
| 1
| 11
| 61
| 58
| 26
| 32
| null | null |
tyh0/312-Catan-Project
|
Main.hs
|
gpl-3.0
|
hextileforid :: Int -> SCBoard -> Maybe HexTile
hextileforid id (_, _, hextiles, _)
= find (\ (lid, _, _, _) -> lid == id) hextiles
| 133
|
hextileforid :: Int -> SCBoard -> Maybe HexTile
hextileforid id (_, _, hextiles, _)
= find (\ (lid, _, _, _) -> lid == id) hextiles
| 133
|
hextileforid id (_, _, hextiles, _)
= find (\ (lid, _, _, _) -> lid == id) hextiles
| 85
| false
| true
| 0
| 9
| 27
| 73
| 39
| 34
| null | null |
kmate/raw-feldspar-mcs
|
examples/ZeldsparFFT.hs
|
bsd-3-clause
|
-- Fusion of a whole FFT is not possible for 'n' = 1024,
-- so we store the internal result after each stage to the same store.
fftBase :: Bool -> Length -> CoreZ ComplexSamples ComplexSamples ()
fftBase inv n = do
core <- lift $ fftCore inv n
let rev = bitRev n
n' = P.fromIntegral n
a <- lift $ newStore n'
b <- lift $ newStore n'
flipFlop (a, b) (core P.++ rev)
-- | Generates all 'ilog2 n' FFT/IFFT stages for a sample vector.
| 449
|
fftBase :: Bool -> Length -> CoreZ ComplexSamples ComplexSamples ()
fftBase inv n = do
core <- lift $ fftCore inv n
let rev = bitRev n
n' = P.fromIntegral n
a <- lift $ newStore n'
b <- lift $ newStore n'
flipFlop (a, b) (core P.++ rev)
-- | Generates all 'ilog2 n' FFT/IFFT stages for a sample vector.
| 321
|
fftBase inv n = do
core <- lift $ fftCore inv n
let rev = bitRev n
n' = P.fromIntegral n
a <- lift $ newStore n'
b <- lift $ newStore n'
flipFlop (a, b) (core P.++ rev)
-- | Generates all 'ilog2 n' FFT/IFFT stages for a sample vector.
| 252
| true
| true
| 0
| 11
| 106
| 125
| 60
| 65
| null | null |
jimcrayne/lmdb-bindings
|
Database/LMDB/Flags.hs
|
agpl-3.0
|
flagValWord64 = flagValNum64
| 28
|
flagValWord64 = flagValNum64
| 28
|
flagValWord64 = flagValNum64
| 28
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
AlexanderPankiv/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
| 51
|
gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
| 51
|
gHC_STABLE = mkBaseModule (fsLit "GHC.Stable")
| 51
| false
| false
| 0
| 7
| 9
| 15
| 7
| 8
| null | null |
lslah/nvim-hs
|
library/Neovim/Context/Internal.hs
|
apache-2.0
|
-- | Convenient helper to create a new config for the given state and read-only
-- config.
--
-- Sets the 'pluginSettings' field to 'Nothing'.
retypeConfig :: r -> st -> Config anotherR anotherSt -> Config r st
retypeConfig r _ cfg = cfg { pluginSettings = Nothing, customConfig = r }
| 284
|
retypeConfig :: r -> st -> Config anotherR anotherSt -> Config r st
retypeConfig r _ cfg = cfg { pluginSettings = Nothing, customConfig = r }
| 141
|
retypeConfig r _ cfg = cfg { pluginSettings = Nothing, customConfig = r }
| 73
| true
| true
| 0
| 8
| 51
| 58
| 32
| 26
| null | null |
ganeti/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
idiskParams :: FrozenSet String
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
| 93
|
idiskParams :: FrozenSet String
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
| 93
|
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
| 61
| false
| true
| 0
| 8
| 8
| 27
| 13
| 14
| null | null |
penguinland/nlp
|
GrammarFilters.hs
|
gpl-3.0
|
isANP _ = False
| 15
|
isANP _ = False
| 15
|
isANP _ = False
| 15
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
grtlr/wyas
|
src/Wyas/Evaluator.hs
|
bsd-3-clause
|
boolBoolBinop = boolBinop unpackBool
| 36
|
boolBoolBinop = boolBinop unpackBool
| 36
|
boolBoolBinop = boolBinop unpackBool
| 36
| false
| false
| 1
| 5
| 3
| 12
| 4
| 8
| null | null |
schell/lamdu
|
Lamdu/Data/Expression/Lens.hs
|
gpl-3.0
|
exprBitraverse ::
Applicative f =>
(defa -> f defb) -> (pla -> f plb) ->
Expression defa pla -> f (Expression defb plb)
exprBitraverse onDef onPl = f
where
f (Expression body payload) =
Expression <$> bodyBitraverse onDef f body <*> onPl payload
| 263
|
exprBitraverse ::
Applicative f =>
(defa -> f defb) -> (pla -> f plb) ->
Expression defa pla -> f (Expression defb plb)
exprBitraverse onDef onPl = f
where
f (Expression body payload) =
Expression <$> bodyBitraverse onDef f body <*> onPl payload
| 263
|
exprBitraverse onDef onPl = f
where
f (Expression body payload) =
Expression <$> bodyBitraverse onDef f body <*> onPl payload
| 137
| false
| true
| 5
| 12
| 60
| 119
| 54
| 65
| null | null |
siddhanathan/ghc
|
libraries/base/Text/Printf.hs
|
bsd-3-clause
|
getSpecs :: Bool -> Bool -> Maybe FormatSign -> Bool -> String -> [UPrintf]
-> (FieldFormat, String, [UPrintf])
getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us
| 181
|
getSpecs :: Bool -> Bool -> Maybe FormatSign -> Bool -> String -> [UPrintf]
-> (FieldFormat, String, [UPrintf])
getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us
| 181
|
getSpecs _ z s a ('-' : cs0) us = getSpecs True z s a cs0 us
| 60
| false
| true
| 0
| 14
| 43
| 91
| 46
| 45
| null | null |
databrary/databrary
|
src/Model/Format.hs
|
agpl-3.0
|
addFormatExtension :: RawFilePath -> Format -> RawFilePath
addFormatExtension p (formatExtension -> (e:_)) = addExtension p e
| 125
|
addFormatExtension :: RawFilePath -> Format -> RawFilePath
addFormatExtension p (formatExtension -> (e:_)) = addExtension p e
| 125
|
addFormatExtension p (formatExtension -> (e:_)) = addExtension p e
| 66
| false
| true
| 0
| 9
| 15
| 43
| 22
| 21
| null | null |
infotroph/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
verbCmd' :: IncludeParser
verbCmd' = fmap snd <$>
withRaw $ try $ do
string "\\verb"
c <- anyChar
manyTill anyChar (char c)
| 164
|
verbCmd' :: IncludeParser
verbCmd' = fmap snd <$>
withRaw $ try $ do
string "\\verb"
c <- anyChar
manyTill anyChar (char c)
| 164
|
verbCmd' = fmap snd <$>
withRaw $ try $ do
string "\\verb"
c <- anyChar
manyTill anyChar (char c)
| 138
| false
| true
| 6
| 10
| 62
| 63
| 25
| 38
| null | null |
Saeron/haskell
|
AGO-Rel2-1-40.hs
|
apache-2.0
|
--b--
p1_geometrica x r = x>0 && r>0 ==>
and [ div z y == r | (y,z) <- zip xs (tail xs) ]
where xs = take 100 (geometrica x r)
--OK, passed 100 tests.
--Comprueba que al dividir un numero de la geometrica por su anterior
--obtines como resultado la constante de la geometrica, hay que tener
--cuidado con definir geometrica como Int, en este caso no tiene sufi-
--ciente capacidad para 100 elementos y se quedan en 0(no se cumple).
--c--
| 446
|
p1_geometrica x r = x>0 && r>0 ==>
and [ div z y == r | (y,z) <- zip xs (tail xs) ]
where xs = take 100 (geometrica x r)
--OK, passed 100 tests.
--Comprueba que al dividir un numero de la geometrica por su anterior
--obtines como resultado la constante de la geometrica, hay que tener
--cuidado con definir geometrica como Int, en este caso no tiene sufi-
--ciente capacidad para 100 elementos y se quedan en 0(no se cumple).
--c--
| 440
|
p1_geometrica x r = x>0 && r>0 ==>
and [ div z y == r | (y,z) <- zip xs (tail xs) ]
where xs = take 100 (geometrica x r)
--OK, passed 100 tests.
--Comprueba que al dividir un numero de la geometrica por su anterior
--obtines como resultado la constante de la geometrica, hay que tener
--cuidado con definir geometrica como Int, en este caso no tiene sufi-
--ciente capacidad para 100 elementos y se quedan en 0(no se cumple).
--c--
| 440
| true
| false
| 0
| 12
| 92
| 95
| 50
| 45
| null | null |
mwahab1/pandoc
|
src/Text/Pandoc/Readers/HTML.hs
|
gpl-2.0
|
replaceNotes' :: Inline -> TagParser Inline
replaceNotes' (RawInline (Format "noteref") ref) = maybe (Str "") (Note . B.toList) . lookup ref <$> getNotes
where
getNotes = noteTable <$> getState
| 199
|
replaceNotes' :: Inline -> TagParser Inline
replaceNotes' (RawInline (Format "noteref") ref) = maybe (Str "") (Note . B.toList) . lookup ref <$> getNotes
where
getNotes = noteTable <$> getState
| 199
|
replaceNotes' (RawInline (Format "noteref") ref) = maybe (Str "") (Note . B.toList) . lookup ref <$> getNotes
where
getNotes = noteTable <$> getState
| 155
| false
| true
| 1
| 10
| 34
| 85
| 39
| 46
| null | null |
shlevy/hnix-store
|
hnix-store-core/src/System/Nix/Internal/StorePath.hs
|
mit
|
-- | Smart constructor for 'StorePathName' that ensures the underlying
-- content invariant is met.
makeStorePathName :: Text -> Maybe StorePathName
makeStorePathName n = case matchTest storePathNameRegex n of
True -> Just $ StorePathName n
False -> Nothing
-- | Regular expression to match valid store path names.
| 320
|
makeStorePathName :: Text -> Maybe StorePathName
makeStorePathName n = case matchTest storePathNameRegex n of
True -> Just $ StorePathName n
False -> Nothing
-- | Regular expression to match valid store path names.
| 220
|
makeStorePathName n = case matchTest storePathNameRegex n of
True -> Just $ StorePathName n
False -> Nothing
-- | Regular expression to match valid store path names.
| 171
| true
| true
| 0
| 9
| 53
| 52
| 26
| 26
| null | null |
tphyahoo/happs-tutorial
|
src/View.hs
|
bsd-3-clause
|
-- no pagination for now
joblink postedBy j = simpleLink ("/tutorial/viewjob?user="++(B.unpack postedBy)++"&job=" ++ j,j)
| 123
|
joblink postedBy j = simpleLink ("/tutorial/viewjob?user="++(B.unpack postedBy)++"&job=" ++ j,j)
| 96
|
joblink postedBy j = simpleLink ("/tutorial/viewjob?user="++(B.unpack postedBy)++"&job=" ++ j,j)
| 96
| true
| false
| 0
| 12
| 15
| 41
| 21
| 20
| null | null |
adamschoenemann/simple-frp
|
test/FRP/TestFunctions.hs
|
mit
|
hsterm_01 = [hsterm| \x -> x + x |]
| 35
|
hsterm_01 = [hsterm| \x -> x + x |]
| 35
|
hsterm_01 = [hsterm| \x -> x + x |]
| 35
| false
| false
| 0
| 4
| 8
| 10
| 7
| 3
| null | null |
NickolayStorm/usatu-learning
|
Functional programming/lab3/2nd.hs
|
mit
|
boo = all foo [(2,2), (6,3), (7,4)]
| 35
|
boo = all foo [(2,2), (6,3), (7,4)]
| 35
|
boo = all foo [(2,2), (6,3), (7,4)]
| 35
| false
| false
| 0
| 7
| 6
| 38
| 23
| 15
| null | null |
artuuge/xmonad-configuration
|
src/showVol.hs
|
gpl-3.0
|
repVolumeState :: (HasVolumeState a) => a -> String
repVolumeState a =
let v = a ^. volume
m = v `div` 9000
n = (v `mod` 9000) `div` 3000
xs = [' ', '.', ':']
in case (m, n) of
(0, 0) -> "[" ++ (replicate 10 ' ') ++ "]"
(10, 0) -> "[" ++ (replicate 10 '|') ++ "]"
_ -> "[" ++ (replicate m '|') ++ [(xs !! n)] ++ (replicate (9 - m) ' ') ++ "]"
----------
| 405
|
repVolumeState :: (HasVolumeState a) => a -> String
repVolumeState a =
let v = a ^. volume
m = v `div` 9000
n = (v `mod` 9000) `div` 3000
xs = [' ', '.', ':']
in case (m, n) of
(0, 0) -> "[" ++ (replicate 10 ' ') ++ "]"
(10, 0) -> "[" ++ (replicate 10 '|') ++ "]"
_ -> "[" ++ (replicate m '|') ++ [(xs !! n)] ++ (replicate (9 - m) ' ') ++ "]"
----------
| 405
|
repVolumeState a =
let v = a ^. volume
m = v `div` 9000
n = (v `mod` 9000) `div` 3000
xs = [' ', '.', ':']
in case (m, n) of
(0, 0) -> "[" ++ (replicate 10 ' ') ++ "]"
(10, 0) -> "[" ++ (replicate 10 '|') ++ "]"
_ -> "[" ++ (replicate m '|') ++ [(xs !! n)] ++ (replicate (9 - m) ' ') ++ "]"
----------
| 353
| false
| true
| 0
| 15
| 133
| 209
| 116
| 93
| null | null |
XinhuaZhang/PetaVisionHaskell
|
Classifier/LibLinear/Bindings.hs
|
gpl-3.0
|
p'problem'l p = plusPtr p 0
| 27
|
p'problem'l p = plusPtr p 0
| 27
|
p'problem'l p = plusPtr p 0
| 27
| false
| false
| 0
| 5
| 5
| 14
| 6
| 8
| null | null |
danr/hipspec
|
tfp1/tests/PuoF.hs
|
gpl-3.0
|
S _ == Z = False
| 18
|
S _ == Z = False
| 18
|
S _ == Z = False
| 18
| false
| false
| 0
| 5
| 7
| 15
| 6
| 9
| null | null |
spechub/Hets
|
HasCASL/Symbol.hs
|
gpl-2.0
|
hideRelSymbol :: Symbol -> Env -> Env
hideRelSymbol sym sig =
hideSymbol sym $ Set.fold hideSymbol sig $ dependentSyms sym sig
| 130
|
hideRelSymbol :: Symbol -> Env -> Env
hideRelSymbol sym sig =
hideSymbol sym $ Set.fold hideSymbol sig $ dependentSyms sym sig
| 130
|
hideRelSymbol sym sig =
hideSymbol sym $ Set.fold hideSymbol sig $ dependentSyms sym sig
| 92
| false
| true
| 0
| 8
| 24
| 47
| 22
| 25
| null | null |
naphthalene/haskell-99onthewall
|
ten/1.hs
|
bsd-2-clause
|
myLast :: [a] -> a
myLast (x:xs) = case (x, xs) of
(_, []) -> x
(_, y:ys) -> myLast ys
| 92
|
myLast :: [a] -> a
myLast (x:xs) = case (x, xs) of
(_, []) -> x
(_, y:ys) -> myLast ys
| 92
|
myLast (x:xs) = case (x, xs) of
(_, []) -> x
(_, y:ys) -> myLast ys
| 73
| false
| true
| 2
| 7
| 26
| 72
| 39
| 33
| null | null |
alexander-at-github/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpCodeSize ParOp = primOpCodeSizeForeignCall
| 49
|
primOpCodeSize ParOp = primOpCodeSizeForeignCall
| 49
|
primOpCodeSize ParOp = primOpCodeSizeForeignCall
| 49
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
siddhanathan/yi
|
yi-core/src/Yi/MiniBuffer.hs
|
gpl-2.0
|
getMinibufferList :: [(T.Text, a)] -> Proxy a -> T.Text
-> (T.Text -> YiM ()) -> YiM ()
getMinibufferList vs _ prompt = withMinibufferFin prompt (fmap fst vs)
| 176
|
getMinibufferList :: [(T.Text, a)] -> Proxy a -> T.Text
-> (T.Text -> YiM ()) -> YiM ()
getMinibufferList vs _ prompt = withMinibufferFin prompt (fmap fst vs)
| 176
|
getMinibufferList vs _ prompt = withMinibufferFin prompt (fmap fst vs)
| 70
| false
| true
| 0
| 12
| 44
| 82
| 41
| 41
| null | null |
SKA-ScienceDataProcessor/RC
|
MS5/programs/gridding.hs
|
apache-2.0
|
-- ----------------------------------------------------------------------------
-- --- Strategy ---
-- ----------------------------------------------------------------------------
gridderStrat :: Config -> Strategy ()
gridderStrat cfg = do
-- Make point domain for visibilities
tdom <- makeRangeDomain 0 (cfgPoints cfg)
-- Create data flow for tag, bind it to FFT plans
let gpar = cfgGrid cfg
gcfpar = cfgGCF cfg
-- Data flows we want to calculate
vis <- uniq $ flow "vis"
let gcfs = gcf vis
gridded = grid vis gcfs createGrid
result = gridder vis gcfs
-- Create ranged domains for grid coordinates
udoms <- makeRangeDomain 0 (gridWidth gpar)
vdoms <- makeRangeDomain 0 (gridHeight gpar)
let uvdoms = (udoms, vdoms)
-- Split and distribute over coordinate domain
vdom <- split vdoms (gridTiles gpar)
udom <- split udoms (gridTiles gpar)
let uvdom = (udom, vdom)
distribute vdom ParSchedule $ distribute udom ParSchedule $ do
-- Read visibilities
bind vis $ oskarReader tdom (cfgInput cfg) 0 0
-- Create w-binned domain, split
wdoms <- makeBinDomain $ binSizer gpar tdom uvdom vis
wdom <- split wdoms (gridBins gpar)
-- Load GCFs
distribute wdom SeqSchedule $
bind gcfs (gcfKernel gcfpar wdom)
-- Bin visibilities (could distribute, but there's no benefit)
rebind vis (binner gpar tdom uvdom wdom)
-- Bind kernel rules
bindRule createGrid (gridInit gcfpar uvdom)
bindRule grid (gridKernel gpar gcfpar uvdoms wdom uvdom)
-- Run gridding distributed
calculate gridded
-- Compute the result by detiling & iFFT on result tiles
bind createGrid (gridInitDetile uvdoms)
bind gridded (gridDetiling gcfpar uvdom uvdoms gridded createGrid)
bindRule idft (ifftKern gpar uvdoms)
calculate result
-- Write out
void $ bindNew $ imageWriter gpar (cfgOutput cfg) result
| 1,952
|
gridderStrat :: Config -> Strategy ()
gridderStrat cfg = do
-- Make point domain for visibilities
tdom <- makeRangeDomain 0 (cfgPoints cfg)
-- Create data flow for tag, bind it to FFT plans
let gpar = cfgGrid cfg
gcfpar = cfgGCF cfg
-- Data flows we want to calculate
vis <- uniq $ flow "vis"
let gcfs = gcf vis
gridded = grid vis gcfs createGrid
result = gridder vis gcfs
-- Create ranged domains for grid coordinates
udoms <- makeRangeDomain 0 (gridWidth gpar)
vdoms <- makeRangeDomain 0 (gridHeight gpar)
let uvdoms = (udoms, vdoms)
-- Split and distribute over coordinate domain
vdom <- split vdoms (gridTiles gpar)
udom <- split udoms (gridTiles gpar)
let uvdom = (udom, vdom)
distribute vdom ParSchedule $ distribute udom ParSchedule $ do
-- Read visibilities
bind vis $ oskarReader tdom (cfgInput cfg) 0 0
-- Create w-binned domain, split
wdoms <- makeBinDomain $ binSizer gpar tdom uvdom vis
wdom <- split wdoms (gridBins gpar)
-- Load GCFs
distribute wdom SeqSchedule $
bind gcfs (gcfKernel gcfpar wdom)
-- Bin visibilities (could distribute, but there's no benefit)
rebind vis (binner gpar tdom uvdom wdom)
-- Bind kernel rules
bindRule createGrid (gridInit gcfpar uvdom)
bindRule grid (gridKernel gpar gcfpar uvdoms wdom uvdom)
-- Run gridding distributed
calculate gridded
-- Compute the result by detiling & iFFT on result tiles
bind createGrid (gridInitDetile uvdoms)
bind gridded (gridDetiling gcfpar uvdom uvdoms gridded createGrid)
bindRule idft (ifftKern gpar uvdoms)
calculate result
-- Write out
void $ bindNew $ imageWriter gpar (cfgOutput cfg) result
| 1,711
|
gridderStrat cfg = do
-- Make point domain for visibilities
tdom <- makeRangeDomain 0 (cfgPoints cfg)
-- Create data flow for tag, bind it to FFT plans
let gpar = cfgGrid cfg
gcfpar = cfgGCF cfg
-- Data flows we want to calculate
vis <- uniq $ flow "vis"
let gcfs = gcf vis
gridded = grid vis gcfs createGrid
result = gridder vis gcfs
-- Create ranged domains for grid coordinates
udoms <- makeRangeDomain 0 (gridWidth gpar)
vdoms <- makeRangeDomain 0 (gridHeight gpar)
let uvdoms = (udoms, vdoms)
-- Split and distribute over coordinate domain
vdom <- split vdoms (gridTiles gpar)
udom <- split udoms (gridTiles gpar)
let uvdom = (udom, vdom)
distribute vdom ParSchedule $ distribute udom ParSchedule $ do
-- Read visibilities
bind vis $ oskarReader tdom (cfgInput cfg) 0 0
-- Create w-binned domain, split
wdoms <- makeBinDomain $ binSizer gpar tdom uvdom vis
wdom <- split wdoms (gridBins gpar)
-- Load GCFs
distribute wdom SeqSchedule $
bind gcfs (gcfKernel gcfpar wdom)
-- Bin visibilities (could distribute, but there's no benefit)
rebind vis (binner gpar tdom uvdom wdom)
-- Bind kernel rules
bindRule createGrid (gridInit gcfpar uvdom)
bindRule grid (gridKernel gpar gcfpar uvdoms wdom uvdom)
-- Run gridding distributed
calculate gridded
-- Compute the result by detiling & iFFT on result tiles
bind createGrid (gridInitDetile uvdoms)
bind gridded (gridDetiling gcfpar uvdom uvdoms gridded createGrid)
bindRule idft (ifftKern gpar uvdoms)
calculate result
-- Write out
void $ bindNew $ imageWriter gpar (cfgOutput cfg) result
| 1,673
| true
| true
| 0
| 13
| 460
| 482
| 226
| 256
| null | null |
cutsea110/BISocie
|
Application.hs
|
bsd-3-clause
|
getApplicationRepl :: IO (Int, App, Application)
getApplicationRepl = do
settings <- getAppSettings
foundation <- makeFoundation settings
wsettings <- getDevSettings $ warpSettings foundation
app1 <- makeApplication foundation
return (getPort wsettings, foundation, app1)
| 291
|
getApplicationRepl :: IO (Int, App, Application)
getApplicationRepl = do
settings <- getAppSettings
foundation <- makeFoundation settings
wsettings <- getDevSettings $ warpSettings foundation
app1 <- makeApplication foundation
return (getPort wsettings, foundation, app1)
| 291
|
getApplicationRepl = do
settings <- getAppSettings
foundation <- makeFoundation settings
wsettings <- getDevSettings $ warpSettings foundation
app1 <- makeApplication foundation
return (getPort wsettings, foundation, app1)
| 242
| false
| true
| 0
| 10
| 50
| 88
| 40
| 48
| null | null |
ThomWright/CIS194
|
src/HW04.hs
|
bsd-3-clause
|
-- Exercise 5 -----------------------------------------
times :: Num a => Poly a -> Poly a -> Poly a
times (P p1) (P p2) = sum $ prefixZeros $ multCoeffs p1 p2
| 160
|
times :: Num a => Poly a -> Poly a -> Poly a
times (P p1) (P p2) = sum $ prefixZeros $ multCoeffs p1 p2
| 103
|
times (P p1) (P p2) = sum $ prefixZeros $ multCoeffs p1 p2
| 58
| true
| true
| 2
| 11
| 30
| 71
| 32
| 39
| null | null |
mightymoose/liquidhaskell
|
benchmarks/vector-0.10.0.1/Data/Vector/Generic/New.nocpp.hs
|
bsd-3-clause
|
modify f (New p) = New (do { v <- p; f v; return v })
| 53
|
modify f (New p) = New (do { v <- p; f v; return v })
| 53
|
modify f (New p) = New (do { v <- p; f v; return v })
| 53
| false
| false
| 0
| 9
| 15
| 47
| 22
| 25
| null | null |
fpco/schoolofhaskell.com
|
src/FP/EnvSettings.hs
|
mit
|
authMiddlewareUsernamePassword :: Maybe (ByteString, ByteString)
authMiddlewareUsernamePassword = (,)
<$> (encodeUtf8 <$> lookupEnv "HTTP_USERNAME")
<*> (encodeUtf8 <$> lookupEnv "HTTP_PASSWORD")
| 203
|
authMiddlewareUsernamePassword :: Maybe (ByteString, ByteString)
authMiddlewareUsernamePassword = (,)
<$> (encodeUtf8 <$> lookupEnv "HTTP_USERNAME")
<*> (encodeUtf8 <$> lookupEnv "HTTP_PASSWORD")
| 203
|
authMiddlewareUsernamePassword = (,)
<$> (encodeUtf8 <$> lookupEnv "HTTP_USERNAME")
<*> (encodeUtf8 <$> lookupEnv "HTTP_PASSWORD")
| 138
| false
| true
| 5
| 8
| 25
| 56
| 29
| 27
| null | null |
brendanhay/gogol
|
gogol-serviceusage/gen/Network/Google/ServiceUsage/Types/Product.hs
|
mpl-2.0
|
-- | The limit unit of the limit to which this override applies. An example
-- unit would be: \`1\/{project}\/{region}\` Note that \`{project}\` and
-- \`{region}\` are not placeholders in this example; the literal
-- characters \`{\` and \`}\` occur in the string.
qoUnit :: Lens' QuotaOverride (Maybe Text)
qoUnit = lens _qoUnit (\ s a -> s{_qoUnit = a})
| 356
|
qoUnit :: Lens' QuotaOverride (Maybe Text)
qoUnit = lens _qoUnit (\ s a -> s{_qoUnit = a})
| 90
|
qoUnit = lens _qoUnit (\ s a -> s{_qoUnit = a})
| 47
| true
| true
| 0
| 9
| 59
| 49
| 28
| 21
| null | null |
mettekou/ghc
|
compiler/basicTypes/SrcLoc.hs
|
bsd-3-clause
|
-- | Creates a "bad" 'SrcLoc' that has no detailed information about its location
mkGeneralSrcLoc :: FastString -> SrcLoc
mkGeneralSrcLoc = UnhelpfulLoc
| 152
|
mkGeneralSrcLoc :: FastString -> SrcLoc
mkGeneralSrcLoc = UnhelpfulLoc
| 70
|
mkGeneralSrcLoc = UnhelpfulLoc
| 30
| true
| true
| 0
| 7
| 21
| 23
| 10
| 13
| null | null |
bvdelft/parac2
|
src/Language/Java/Paragon/TypeCheck/Interpreter.hs
|
bsd-3-clause
|
iActor :: [(Ident SourcePos, TcRefType)] -> Actor SourcePos -> InterpretM PL.TcActor
iActor iTys (Actor _ aname) = PL.SingletonActor <$> iActorName aname
| 153
|
iActor :: [(Ident SourcePos, TcRefType)] -> Actor SourcePos -> InterpretM PL.TcActor
iActor iTys (Actor _ aname) = PL.SingletonActor <$> iActorName aname
| 153
|
iActor iTys (Actor _ aname) = PL.SingletonActor <$> iActorName aname
| 68
| false
| true
| 0
| 8
| 20
| 61
| 30
| 31
| null | null |
haraldsteinlechner/lambdaWolf
|
src/Frontend.hs
|
gpl-3.0
|
-- Buffers are indexed by ints.
setBuffer :: BufferView -> Index -> RenderM ()
setBuffer buffer index = modify set
where set s = let binding = input s -- very ugly here. but can be fixed ;)
in s { input = binding { bufferBinding = setBuffer' binding } }
setBuffer' = M.insert index buffer . bufferBinding
-- Render lives in RenderM
| 361
|
setBuffer :: BufferView -> Index -> RenderM ()
setBuffer buffer index = modify set
where set s = let binding = input s -- very ugly here. but can be fixed ;)
in s { input = binding { bufferBinding = setBuffer' binding } }
setBuffer' = M.insert index buffer . bufferBinding
-- Render lives in RenderM
| 328
|
setBuffer buffer index = modify set
where set s = let binding = input s -- very ugly here. but can be fixed ;)
in s { input = binding { bufferBinding = setBuffer' binding } }
setBuffer' = M.insert index buffer . bufferBinding
-- Render lives in RenderM
| 281
| true
| true
| 1
| 13
| 92
| 95
| 48
| 47
| null | null |
MarkArts/wubstuts
|
src/DirTree.hs
|
gpl-3.0
|
getChilds :: (Eq a) => Tree a -> (Tree a -> Bool) -> [Tree a]
getChilds (Node _ []) _ = []
| 90
|
getChilds :: (Eq a) => Tree a -> (Tree a -> Bool) -> [Tree a]
getChilds (Node _ []) _ = []
| 90
|
getChilds (Node _ []) _ = []
| 28
| false
| true
| 0
| 10
| 21
| 64
| 32
| 32
| null | null |
peter-fogg/pardoc
|
src/Text/Pandoc/Writers/Docx.hs
|
gpl-2.0
|
inlineToOpenXML opts (Code attrs str) =
withTextProp (rStyle "VerbatimChar")
$ if writerHighlight opts
then case highlight formatOpenXML attrs str of
Nothing -> unhighlighted
Just h -> return h
else unhighlighted
where unhighlighted = intercalate [br] `fmap`
(mapM formattedString $ lines str)
formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)
toHlTok (toktype,tok) = mknode "w:r" []
[ mknode "w:rPr" []
[ rStyle $ show toktype ]
, mknode "w:t" [("xml:space","preserve")] tok ]
| 705
|
inlineToOpenXML opts (Code attrs str) =
withTextProp (rStyle "VerbatimChar")
$ if writerHighlight opts
then case highlight formatOpenXML attrs str of
Nothing -> unhighlighted
Just h -> return h
else unhighlighted
where unhighlighted = intercalate [br] `fmap`
(mapM formattedString $ lines str)
formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)
toHlTok (toktype,tok) = mknode "w:r" []
[ mknode "w:rPr" []
[ rStyle $ show toktype ]
, mknode "w:t" [("xml:space","preserve")] tok ]
| 705
|
inlineToOpenXML opts (Code attrs str) =
withTextProp (rStyle "VerbatimChar")
$ if writerHighlight opts
then case highlight formatOpenXML attrs str of
Nothing -> unhighlighted
Just h -> return h
else unhighlighted
where unhighlighted = intercalate [br] `fmap`
(mapM formattedString $ lines str)
formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)
toHlTok (toktype,tok) = mknode "w:r" []
[ mknode "w:rPr" []
[ rStyle $ show toktype ]
, mknode "w:t" [("xml:space","preserve")] tok ]
| 705
| false
| false
| 4
| 11
| 287
| 196
| 98
| 98
| null | null |
brendanhay/gogol
|
gogol-dataproc/gen/Network/Google/Dataproc/Types/Product.hs
|
mpl-2.0
|
-- | Optional. The Cloud Storage URI of the truststore file used for SSL
-- encryption. If not provided, Dataproc will provide a self-signed
-- certificate.
kcTruststoreURI :: Lens' KerberosConfig (Maybe Text)
kcTruststoreURI
= lens _kcTruststoreURI
(\ s a -> s{_kcTruststoreURI = a})
| 292
|
kcTruststoreURI :: Lens' KerberosConfig (Maybe Text)
kcTruststoreURI
= lens _kcTruststoreURI
(\ s a -> s{_kcTruststoreURI = a})
| 135
|
kcTruststoreURI
= lens _kcTruststoreURI
(\ s a -> s{_kcTruststoreURI = a})
| 82
| true
| true
| 0
| 9
| 50
| 50
| 27
| 23
| null | null |
dimara/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
hvstMemoryNode :: String
hvstMemoryNode = "mem_node"
| 52
|
hvstMemoryNode :: String
hvstMemoryNode = "mem_node"
| 52
|
hvstMemoryNode = "mem_node"
| 27
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
jpvillaisaza/licensor
|
app/Main.hs
|
mit
|
optDescrs :: [OptDescr ((Bool, Bool) -> IO (Bool, Bool))]
optDescrs =
[ Option ['q', 's'] ["quiet", "silent"]
(NoArg (\(_, b) -> pure (False, b)))
"Quiet/silent mode"
, Option [] ["licenses"]
(NoArg (\(a, _) -> pure (a, True)))
"Fetch license files"
, Option ['h'] ["help"]
(NoArg (\_ -> exitWith prettyUsageInfo))
"Display help message"
, Option ['V'] ["version"]
(NoArg (\_ -> exitWith prettyVersion))
"Print version information"
]
where
exitWith f = do
progName <- getProgName
hPutStrLn stdout (f progName)
exitSuccess
| 610
|
optDescrs :: [OptDescr ((Bool, Bool) -> IO (Bool, Bool))]
optDescrs =
[ Option ['q', 's'] ["quiet", "silent"]
(NoArg (\(_, b) -> pure (False, b)))
"Quiet/silent mode"
, Option [] ["licenses"]
(NoArg (\(a, _) -> pure (a, True)))
"Fetch license files"
, Option ['h'] ["help"]
(NoArg (\_ -> exitWith prettyUsageInfo))
"Display help message"
, Option ['V'] ["version"]
(NoArg (\_ -> exitWith prettyVersion))
"Print version information"
]
where
exitWith f = do
progName <- getProgName
hPutStrLn stdout (f progName)
exitSuccess
| 610
|
optDescrs =
[ Option ['q', 's'] ["quiet", "silent"]
(NoArg (\(_, b) -> pure (False, b)))
"Quiet/silent mode"
, Option [] ["licenses"]
(NoArg (\(a, _) -> pure (a, True)))
"Fetch license files"
, Option ['h'] ["help"]
(NoArg (\_ -> exitWith prettyUsageInfo))
"Display help message"
, Option ['V'] ["version"]
(NoArg (\_ -> exitWith prettyVersion))
"Print version information"
]
where
exitWith f = do
progName <- getProgName
hPutStrLn stdout (f progName)
exitSuccess
| 552
| false
| true
| 0
| 12
| 166
| 243
| 132
| 111
| null | null |
input-output-hk/pos-haskell-prototype
|
util/src/Pos/Util/Trace.hs
|
mit
|
-- | setup logging and return a Trace
setupLogging :: MonadIO m
=> Text
-> Log.LoggerConfig
-> Log.LoggerName
-> IO (Trace m (Log.Severity, Text))
setupLogging cfoKey lc ln = do
lh <- Log.setupLogging cfoKey lc
return $ logTrace lh ln
| 294
|
setupLogging :: MonadIO m
=> Text
-> Log.LoggerConfig
-> Log.LoggerName
-> IO (Trace m (Log.Severity, Text))
setupLogging cfoKey lc ln = do
lh <- Log.setupLogging cfoKey lc
return $ logTrace lh ln
| 256
|
setupLogging cfoKey lc ln = do
lh <- Log.setupLogging cfoKey lc
return $ logTrace lh ln
| 95
| true
| true
| 0
| 14
| 99
| 92
| 43
| 49
| null | null |
edahlgren/protocol-buffers
|
hprotoc/Text/ProtocolBuffers/ProtoCompile/Gen.hs
|
apache-2.0
|
fqMod :: ProtoName -> String
fqMod (ProtoName _ a b c) = joinMod $ a++b++[c]
| 76
|
fqMod :: ProtoName -> String
fqMod (ProtoName _ a b c) = joinMod $ a++b++[c]
| 76
|
fqMod (ProtoName _ a b c) = joinMod $ a++b++[c]
| 47
| false
| true
| 0
| 9
| 14
| 51
| 24
| 27
| null | null |
mrd/camfort
|
src/Camfort/Helpers/Syntax.hs
|
apache-2.0
|
toCol0 (FU.Position o _ l) = FU.Position o 1 l
| 46
|
toCol0 (FU.Position o _ l) = FU.Position o 1 l
| 46
|
toCol0 (FU.Position o _ l) = FU.Position o 1 l
| 46
| false
| false
| 0
| 8
| 9
| 30
| 14
| 16
| null | null |
fmthoma/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
isAlgType :: Type -> Bool
isAlgType ty
= case splitTyConApp_maybe ty of
Just (tc, ty_args) -> ASSERT( ty_args `lengthIs` tyConArity tc )
isAlgTyCon tc
_other -> False
-- | See "Type#type_classification" for what an algebraic type is.
-- Should only be applied to /types/, as opposed to e.g. partially
-- saturated type constructors. Closed type constructors are those
-- with a fixed right hand side, as opposed to e.g. associated types
| 491
|
isAlgType :: Type -> Bool
isAlgType ty
= case splitTyConApp_maybe ty of
Just (tc, ty_args) -> ASSERT( ty_args `lengthIs` tyConArity tc )
isAlgTyCon tc
_other -> False
-- | See "Type#type_classification" for what an algebraic type is.
-- Should only be applied to /types/, as opposed to e.g. partially
-- saturated type constructors. Closed type constructors are those
-- with a fixed right hand side, as opposed to e.g. associated types
| 491
|
isAlgType ty
= case splitTyConApp_maybe ty of
Just (tc, ty_args) -> ASSERT( ty_args `lengthIs` tyConArity tc )
isAlgTyCon tc
_other -> False
-- | See "Type#type_classification" for what an algebraic type is.
-- Should only be applied to /types/, as opposed to e.g. partially
-- saturated type constructors. Closed type constructors are those
-- with a fixed right hand side, as opposed to e.g. associated types
| 465
| false
| true
| 0
| 11
| 125
| 69
| 37
| 32
| null | null |
diku-dk/futhark
|
src/Language/Futhark/Prop.hs
|
isc
|
patternDimNames (PatAttr _ p _) = patternDimNames p
| 51
|
patternDimNames (PatAttr _ p _) = patternDimNames p
| 51
|
patternDimNames (PatAttr _ p _) = patternDimNames p
| 51
| false
| false
| 0
| 7
| 7
| 22
| 10
| 12
| null | null |
brendanhay/gogol
|
gogol-dns/gen/Network/Google/Resource/DNS/Policies/Patch.hs
|
mpl-2.0
|
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
ppUploadProtocol :: Lens' PoliciesPatch (Maybe Text)
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
| 200
|
ppUploadProtocol :: Lens' PoliciesPatch (Maybe Text)
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
| 138
|
ppUploadProtocol
= lens _ppUploadProtocol
(\ s a -> s{_ppUploadProtocol = a})
| 85
| true
| true
| 1
| 9
| 33
| 52
| 25
| 27
| null | null |
hesiod/OpenGL
|
src/Graphics/Rendering/OpenGL/GLU/ErrorsInternal.hs
|
bsd-3-clause
|
setRecordedErrors :: ([GLenum],Bool) -> IO ()
setRecordedErrors = writeIORef theRecordedErrors
| 94
|
setRecordedErrors :: ([GLenum],Bool) -> IO ()
setRecordedErrors = writeIORef theRecordedErrors
| 94
|
setRecordedErrors = writeIORef theRecordedErrors
| 48
| false
| true
| 0
| 7
| 9
| 32
| 17
| 15
| null | null |
anton-dessiatov/stack
|
src/main/Main.hs
|
bsd-3-clause
|
initCmd :: InitOpts -> GlobalOpts -> IO ()
initCmd initOpts go = do
pwd <- getCurrentDir
withMiniConfigAndLock go (initProject IsInitCmd pwd initOpts (globalResolver go))
-- | Create a project directory structure and initialize the stack config.
| 254
|
initCmd :: InitOpts -> GlobalOpts -> IO ()
initCmd initOpts go = do
pwd <- getCurrentDir
withMiniConfigAndLock go (initProject IsInitCmd pwd initOpts (globalResolver go))
-- | Create a project directory structure and initialize the stack config.
| 254
|
initCmd initOpts go = do
pwd <- getCurrentDir
withMiniConfigAndLock go (initProject IsInitCmd pwd initOpts (globalResolver go))
-- | Create a project directory structure and initialize the stack config.
| 211
| false
| true
| 0
| 11
| 44
| 63
| 30
| 33
| null | null |
urv/fixhs
|
src/Data/FIX/Spec/FIX40.hs
|
lgpl-2.1
|
mHeartbeat :: FIXMessageSpec
mHeartbeat = FMSpec
{ msName = "Heartbeat"
, msType = C.pack "0"
, msHeader = headerFIX40
, msBody = mHeartbeatBody
, msTrailer = trailerFIX40 }
where
mHeartbeatBody =
LT.insert (tnum tTestReqID) tTestReqID LT.new
| 276
|
mHeartbeat :: FIXMessageSpec
mHeartbeat = FMSpec
{ msName = "Heartbeat"
, msType = C.pack "0"
, msHeader = headerFIX40
, msBody = mHeartbeatBody
, msTrailer = trailerFIX40 }
where
mHeartbeatBody =
LT.insert (tnum tTestReqID) tTestReqID LT.new
| 276
|
mHeartbeat = FMSpec
{ msName = "Heartbeat"
, msType = C.pack "0"
, msHeader = headerFIX40
, msBody = mHeartbeatBody
, msTrailer = trailerFIX40 }
where
mHeartbeatBody =
LT.insert (tnum tTestReqID) tTestReqID LT.new
| 247
| false
| true
| 1
| 8
| 69
| 86
| 43
| 43
| null | null |
rprospero/NeutronPipe
|
tests/Properties.hs
|
mit
|
main :: IO ()
main = defaultMain tests
| 38
|
main :: IO ()
main = defaultMain tests
| 38
|
main = defaultMain tests
| 24
| false
| true
| 0
| 6
| 7
| 19
| 9
| 10
| null | null |
mattias-lundell/timber-llvm
|
src/Syntax2Core.hs
|
bsd-3-clause
|
s2cEc env t (EMatch m) = do m <- s2cMc env t m
return (eMatch m)
| 110
|
s2cEc env t (EMatch m) = do m <- s2cMc env t m
return (eMatch m)
| 110
|
s2cEc env t (EMatch m) = do m <- s2cMc env t m
return (eMatch m)
| 110
| false
| false
| 0
| 9
| 61
| 45
| 20
| 25
| null | null |
kmels/hledger
|
hledger-lib/Hledger/Utils.hs
|
gpl-3.0
|
-- | remove all subtrees whose nodes do not fulfill predicate
treefilter :: (a -> Bool) -> Tree a -> Tree a
treefilter f t = Node
(root t)
(map (treefilter f) $ filter (treeany f) $ branches t)
| 227
|
treefilter :: (a -> Bool) -> Tree a -> Tree a
treefilter f t = Node
(root t)
(map (treefilter f) $ filter (treeany f) $ branches t)
| 165
|
treefilter f t = Node
(root t)
(map (treefilter f) $ filter (treeany f) $ branches t)
| 119
| true
| true
| 0
| 11
| 72
| 87
| 40
| 47
| null | null |
wilbowma/accelerate
|
accelerate-examples/tests/primitives/Stencil2.hs
|
bsd-3-clause
|
run2D x = error $ "unknown variant: " ++ x
| 45
|
run2D x = error $ "unknown variant: " ++ x
| 45
|
run2D x = error $ "unknown variant: " ++ x
| 45
| false
| false
| 0
| 6
| 12
| 17
| 8
| 9
| null | null |
jamshidh/ethereum-data-leveldb
|
src/Blockchain/ExtDBs.hs
|
bsd-3-clause
|
deleteKey::N.NibbleString->DBM ()
deleteKey key = do
ctx <- get
newStateDB <-
liftIO $ runResourceT $ MP.deleteKey (stateDB ctx) key
put ctx{stateDB=newStateDB}
| 170
|
deleteKey::N.NibbleString->DBM ()
deleteKey key = do
ctx <- get
newStateDB <-
liftIO $ runResourceT $ MP.deleteKey (stateDB ctx) key
put ctx{stateDB=newStateDB}
| 170
|
deleteKey key = do
ctx <- get
newStateDB <-
liftIO $ runResourceT $ MP.deleteKey (stateDB ctx) key
put ctx{stateDB=newStateDB}
| 136
| false
| true
| 0
| 11
| 30
| 74
| 35
| 39
| null | null |
hvr/alex
|
src/Main.hs
|
bsd-3-clause
|
main:: IO ()
main = do
args <- getArgs
case getOpt Permute argInfo args of
(cli,_,[]) | DumpHelp `elem` cli -> do
prog <- getProgramName
bye (usageInfo (usageHeader prog) argInfo)
(cli,_,[]) | DumpVersion `elem` cli ->
bye copyright
(cli,[file],[]) ->
runAlex cli file
(_,_,errors) -> do
prog <- getProgramName
die (concat errors ++ usageInfo (usageHeader prog) argInfo)
| 438
|
main:: IO ()
main = do
args <- getArgs
case getOpt Permute argInfo args of
(cli,_,[]) | DumpHelp `elem` cli -> do
prog <- getProgramName
bye (usageInfo (usageHeader prog) argInfo)
(cli,_,[]) | DumpVersion `elem` cli ->
bye copyright
(cli,[file],[]) ->
runAlex cli file
(_,_,errors) -> do
prog <- getProgramName
die (concat errors ++ usageInfo (usageHeader prog) argInfo)
| 438
|
main = do
args <- getArgs
case getOpt Permute argInfo args of
(cli,_,[]) | DumpHelp `elem` cli -> do
prog <- getProgramName
bye (usageInfo (usageHeader prog) argInfo)
(cli,_,[]) | DumpVersion `elem` cli ->
bye copyright
(cli,[file],[]) ->
runAlex cli file
(_,_,errors) -> do
prog <- getProgramName
die (concat errors ++ usageInfo (usageHeader prog) argInfo)
| 425
| false
| true
| 1
| 19
| 124
| 205
| 100
| 105
| null | null |
RossMeikleham/NesMonad
|
tests/CpuTest.hs
|
mit
|
cpuTests = TFA.testGroup "CPU Tests"
[testWorkRamMirror, testCtrlRamMirror]
| 80
|
cpuTests = TFA.testGroup "CPU Tests"
[testWorkRamMirror, testCtrlRamMirror]
| 80
|
cpuTests = TFA.testGroup "CPU Tests"
[testWorkRamMirror, testCtrlRamMirror]
| 80
| false
| false
| 1
| 5
| 11
| 23
| 10
| 13
| null | null |
enolan/Idris-dev
|
src/Idris/Reflection.hs
|
bsd-3-clause
|
reifyTTApp t [n, b, x]
| t == reflm "Bind" = do n' <- reifyTTName n
b' <- reifyTTBinder reifyTT (reflm "TT") b
x' <- reifyTT x
return $ Bind n' b' x'
| 268
|
reifyTTApp t [n, b, x]
| t == reflm "Bind" = do n' <- reifyTTName n
b' <- reifyTTBinder reifyTT (reflm "TT") b
x' <- reifyTT x
return $ Bind n' b' x'
| 268
|
reifyTTApp t [n, b, x]
| t == reflm "Bind" = do n' <- reifyTTName n
b' <- reifyTTBinder reifyTT (reflm "TT") b
x' <- reifyTT x
return $ Bind n' b' x'
| 268
| false
| false
| 0
| 11
| 151
| 89
| 39
| 50
| null | null |
mettekou/ghc
|
compiler/cmm/CmmUtils.hs
|
bsd-3-clause
|
-----------------------------------------------------------------------------
-- Overlap and usage
-- | Returns True if the two STG registers overlap on the specified
-- platform, in the sense that writing to one will clobber the
-- other. This includes the case that the two registers are the same
-- STG register. See Note [Overlapping global registers] for details.
regsOverlap :: DynFlags -> CmmReg -> CmmReg -> Bool
regsOverlap dflags (CmmGlobal g) (CmmGlobal g')
| Just real <- globalRegMaybe (targetPlatform dflags) g,
Just real' <- globalRegMaybe (targetPlatform dflags) g',
real == real'
= True
| 619
|
regsOverlap :: DynFlags -> CmmReg -> CmmReg -> Bool
regsOverlap dflags (CmmGlobal g) (CmmGlobal g')
| Just real <- globalRegMaybe (targetPlatform dflags) g,
Just real' <- globalRegMaybe (targetPlatform dflags) g',
real == real'
= True
| 249
|
regsOverlap dflags (CmmGlobal g) (CmmGlobal g')
| Just real <- globalRegMaybe (targetPlatform dflags) g,
Just real' <- globalRegMaybe (targetPlatform dflags) g',
real == real'
= True
| 197
| true
| true
| 0
| 11
| 103
| 108
| 52
| 56
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-lang/Language/Drasil/NounPhrase.hs
|
bsd-2-clause
|
capFirstWord w@(c:cs)
| not (isLetter c) = w
| not (isLatin1 c) = w
| otherwise = toUpper c : cs
| 109
|
capFirstWord w@(c:cs)
| not (isLetter c) = w
| not (isLatin1 c) = w
| otherwise = toUpper c : cs
| 109
|
capFirstWord w@(c:cs)
| not (isLetter c) = w
| not (isLatin1 c) = w
| otherwise = toUpper c : cs
| 109
| false
| false
| 1
| 10
| 33
| 69
| 32
| 37
| null | null |
tjakway/ghcjvm
|
compiler/basicTypes/Literal.hs
|
bsd-3-clause
|
hashLiteral (MachInt i) = hashInteger i
| 47
|
hashLiteral (MachInt i) = hashInteger i
| 47
|
hashLiteral (MachInt i) = hashInteger i
| 47
| false
| false
| 0
| 7
| 13
| 18
| 8
| 10
| null | null |
jeffreyrosenbluth/Cards
|
src/DSL.hs
|
bsd-3-clause
|
binary :: String -> (CardPredAlg -> CardPredAlg -> CardPredAlg)
-> Operator Parser (CardPredAlg)
binary name f = InfixL (f <$ symbol name)
| 145
|
binary :: String -> (CardPredAlg -> CardPredAlg -> CardPredAlg)
-> Operator Parser (CardPredAlg)
binary name f = InfixL (f <$ symbol name)
| 145
|
binary name f = InfixL (f <$ symbol name)
| 41
| false
| true
| 0
| 9
| 28
| 56
| 28
| 28
| null | null |
bhamrick/HSS
|
HSS/Color.hs
|
mit
|
magenta = RGB 0xFF 0x00 0xFF
| 44
|
magenta = RGB 0xFF 0x00 0xFF
| 44
|
magenta = RGB 0xFF 0x00 0xFF
| 44
| false
| false
| 0
| 5
| 21
| 13
| 6
| 7
| null | null |
ekmett/hask
|
old/src/Hask/Foldable.hs
|
bsd-3-clause
|
traverseHask :: (Base.Traversable f, Monoidal m) => (a -> m b) -> f a -> m (f b)
traverseHask f = runWrapMonoidal . Base.traverse (WrapMonoidal . f)
| 148
|
traverseHask :: (Base.Traversable f, Monoidal m) => (a -> m b) -> f a -> m (f b)
traverseHask f = runWrapMonoidal . Base.traverse (WrapMonoidal . f)
| 148
|
traverseHask f = runWrapMonoidal . Base.traverse (WrapMonoidal . f)
| 67
| false
| true
| 0
| 10
| 26
| 77
| 38
| 39
| null | null |
PuZZleDucK/Hls
|
Hls.hs
|
gpl-3.0
|
padDisplayString :: String -> Int -> String
padDisplayString input targetLength | (length input) >= targetLength = input
| otherwise = input ++ take (targetLength-(length input)) (repeat '_')
| 227
|
padDisplayString :: String -> Int -> String
padDisplayString input targetLength | (length input) >= targetLength = input
| otherwise = input ++ take (targetLength-(length input)) (repeat '_')
| 227
|
padDisplayString input targetLength | (length input) >= targetLength = input
| otherwise = input ++ take (targetLength-(length input)) (repeat '_')
| 183
| false
| true
| 0
| 11
| 62
| 77
| 37
| 40
| null | null |
yamamotoj/alfred-git-workflow
|
src/GitDirHistory.hs
|
mit
|
withGitDirFile:: IOMode -> (Handle -> IO r) -> IO r
withGitDirFile mode f = do
path <- gitDirFilePath
r <- withFile path mode f
return r
| 143
|
withGitDirFile:: IOMode -> (Handle -> IO r) -> IO r
withGitDirFile mode f = do
path <- gitDirFilePath
r <- withFile path mode f
return r
| 143
|
withGitDirFile mode f = do
path <- gitDirFilePath
r <- withFile path mode f
return r
| 91
| false
| true
| 0
| 10
| 32
| 70
| 30
| 40
| null | null |
MortimerMcMire315/sparkive
|
src/View/Util.hs
|
gpl-3.0
|
isLoggedIn :: DBConn -> SessionServerPart (Either String Bool)
isLoggedIn conn = do eitherInfo <- getUserInfo conn
return $ eitherInfo >>= (\info -> case info of
RC.LoggedOut -> Right False
RC.LoggedIn _ -> Right True
)
| 384
|
isLoggedIn :: DBConn -> SessionServerPart (Either String Bool)
isLoggedIn conn = do eitherInfo <- getUserInfo conn
return $ eitherInfo >>= (\info -> case info of
RC.LoggedOut -> Right False
RC.LoggedIn _ -> Right True
)
| 384
|
isLoggedIn conn = do eitherInfo <- getUserInfo conn
return $ eitherInfo >>= (\info -> case info of
RC.LoggedOut -> Right False
RC.LoggedIn _ -> Right True
)
| 321
| false
| true
| 0
| 15
| 199
| 92
| 42
| 50
| null | null |
k0001/opaleye-sot
|
src/lib/Tisch/Internal/Fun.hs
|
bsd-3-clause
|
-- | Split the @source@ string using the given Regular Expression as a
-- delimiter.
--
-- If there is no match to the pattern, the function an array with just one
-- element: the original string. If there is at least one match,
-- for each match it returns the text from the end of the last match (or the
-- beginning of the string) to the beginning of the match. When there are no
-- more matches, it returns the text from the end of the last match to the end
-- of the string.
--
-- Sql function: @regexp_split_to_array(source, regexp)@.
reSplit
:: (O.PGText ~ regex, O.PGText ~ source)
=> Kol regex
-- ^ Regular expression. See Section 9.1 of the PostgreSQL manual to
-- understand the syntax.
-> Kol source
-> Kol (O.PGArray O.PGText)
reSplit (Kol re) (Kol s) = Kol $ unsafeFunExpr "regexp_split_to_array"
[AnyColumn s, AnyColumn re]
| 853
|
reSplit
:: (O.PGText ~ regex, O.PGText ~ source)
=> Kol regex
-- ^ Regular expression. See Section 9.1 of the PostgreSQL manual to
-- understand the syntax.
-> Kol source
-> Kol (O.PGArray O.PGText)
reSplit (Kol re) (Kol s) = Kol $ unsafeFunExpr "regexp_split_to_array"
[AnyColumn s, AnyColumn re]
| 312
|
reSplit (Kol re) (Kol s) = Kol $ unsafeFunExpr "regexp_split_to_array"
[AnyColumn s, AnyColumn re]
| 101
| true
| true
| 0
| 12
| 165
| 116
| 62
| 54
| null | null |
ababkin/qmuli
|
library/Qi/Program/SQS/Lang.hs
|
mit
|
deleteSqsMessage
:: (Member SqsEff effs)
=> SqsQueueId
-> ReceiptHandle
-> Eff effs ()
deleteSqsMessage = send .: DeleteSqsMessage
| 138
|
deleteSqsMessage
:: (Member SqsEff effs)
=> SqsQueueId
-> ReceiptHandle
-> Eff effs ()
deleteSqsMessage = send .: DeleteSqsMessage
| 138
|
deleteSqsMessage = send .: DeleteSqsMessage
| 43
| false
| true
| 2
| 10
| 25
| 49
| 23
| 26
| null | null |
cocreature/leksah
|
src/IDE/Pane/Errors.hs
|
gpl-2.0
|
-- | Add a 'LogRef' at a specific index to the Errors pane
addErrorToList' :: Int -> LogRef -> IDEErrors -> IDEAction
addErrorToList' index lr pane = do
-- refs <- readIDE errorRefs
ac <- liftIO $ readIORef (autoClose pane)
-- when (null refs && ac) . void $ closePane pane
isDark <- getDarkState
liftIO $ do
let store = errorStore pane
-- listStoreClear store
-- forM_ (zip (toList refs) [0..]) $ \ (lr, index) ->
listStoreInsert store index $ ErrColumn lr (
(if even index then fst else snd) $
(if isDark then fst else snd) $
case logRefType lr of
WarningRef -> (("#282000", "#201900"), ("#FFF1DE", "#FFF5E8"))
LintRef -> (("#003000", "#002800"), ("#DBFFDB", "#EDFFED"))
_ -> (("#380000", "#280000"), ("#FFDEDE", "#FFEBEB")))
-- | Get the currently selected error
| 953
|
addErrorToList' :: Int -> LogRef -> IDEErrors -> IDEAction
addErrorToList' index lr pane = do
-- refs <- readIDE errorRefs
ac <- liftIO $ readIORef (autoClose pane)
-- when (null refs && ac) . void $ closePane pane
isDark <- getDarkState
liftIO $ do
let store = errorStore pane
-- listStoreClear store
-- forM_ (zip (toList refs) [0..]) $ \ (lr, index) ->
listStoreInsert store index $ ErrColumn lr (
(if even index then fst else snd) $
(if isDark then fst else snd) $
case logRefType lr of
WarningRef -> (("#282000", "#201900"), ("#FFF1DE", "#FFF5E8"))
LintRef -> (("#003000", "#002800"), ("#DBFFDB", "#EDFFED"))
_ -> (("#380000", "#280000"), ("#FFDEDE", "#FFEBEB")))
-- | Get the currently selected error
| 894
|
addErrorToList' index lr pane = do
-- refs <- readIDE errorRefs
ac <- liftIO $ readIORef (autoClose pane)
-- when (null refs && ac) . void $ closePane pane
isDark <- getDarkState
liftIO $ do
let store = errorStore pane
-- listStoreClear store
-- forM_ (zip (toList refs) [0..]) $ \ (lr, index) ->
listStoreInsert store index $ ErrColumn lr (
(if even index then fst else snd) $
(if isDark then fst else snd) $
case logRefType lr of
WarningRef -> (("#282000", "#201900"), ("#FFF1DE", "#FFF5E8"))
LintRef -> (("#003000", "#002800"), ("#DBFFDB", "#EDFFED"))
_ -> (("#380000", "#280000"), ("#FFDEDE", "#FFEBEB")))
-- | Get the currently selected error
| 835
| true
| true
| 0
| 19
| 314
| 219
| 118
| 101
| null | null |
kawu/adict
|
util/MkPoliHist.hs
|
bsd-2-clause
|
fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> M.Map k a
fromListWith f xs =
let update m (!k, !x) = M.insertWith' f k x m
in foldl' update M.empty xs
| 166
|
fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> M.Map k a
fromListWith f xs =
let update m (!k, !x) = M.insertWith' f k x m
in foldl' update M.empty xs
| 166
|
fromListWith f xs =
let update m (!k, !x) = M.insertWith' f k x m
in foldl' update M.empty xs
| 102
| false
| true
| 0
| 11
| 45
| 102
| 50
| 52
| null | null |
MichaelBurge/yxdb-utils
|
bin-src/Cydb2Csv.hs
|
gpl-3.0
|
main = cydb2csvMain
| 19
|
main = cydb2csvMain
| 19
|
main = cydb2csvMain
| 19
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
green-haskell/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
-- Extra instances
genAuxBinds :: SrcSpan -> BagDerivStuff -> SeparateBagsDerivStuff
genAuxBinds loc b = genAuxBinds' b2 where
(b1,b2) = partitionBagWith splitDerivAuxBind b
splitDerivAuxBind (DerivAuxBind x) = Left x
splitDerivAuxBind x = Right x
rm_dups = foldrBag dup_check emptyBag
dup_check a b = if anyBag (== a) b then b else consBag a b
genAuxBinds' :: BagDerivStuff -> SeparateBagsDerivStuff
genAuxBinds' = foldrBag f ( mapBag (genAuxBindSpec loc) (rm_dups b1)
, emptyBag, emptyBag, emptyBag)
f :: DerivStuff -> SeparateBagsDerivStuff -> SeparateBagsDerivStuff
f (DerivAuxBind _) = panic "genAuxBinds'" -- We have removed these before
f (DerivHsBind b) = add1 b
f (DerivTyCon t) = add2 t
f (DerivFamInst t) = add3 t
f (DerivInst i) = add4 i
add1 x (a,b,c,d) = (x `consBag` a,b,c,d)
add2 x (a,b,c,d) = (a,x `consBag` b,c,d)
add3 x (a,b,c,d) = (a,b,x `consBag` c,d)
add4 x (a,b,c,d) = (a,b,c,x `consBag` d)
| 1,000
|
genAuxBinds :: SrcSpan -> BagDerivStuff -> SeparateBagsDerivStuff
genAuxBinds loc b = genAuxBinds' b2 where
(b1,b2) = partitionBagWith splitDerivAuxBind b
splitDerivAuxBind (DerivAuxBind x) = Left x
splitDerivAuxBind x = Right x
rm_dups = foldrBag dup_check emptyBag
dup_check a b = if anyBag (== a) b then b else consBag a b
genAuxBinds' :: BagDerivStuff -> SeparateBagsDerivStuff
genAuxBinds' = foldrBag f ( mapBag (genAuxBindSpec loc) (rm_dups b1)
, emptyBag, emptyBag, emptyBag)
f :: DerivStuff -> SeparateBagsDerivStuff -> SeparateBagsDerivStuff
f (DerivAuxBind _) = panic "genAuxBinds'" -- We have removed these before
f (DerivHsBind b) = add1 b
f (DerivTyCon t) = add2 t
f (DerivFamInst t) = add3 t
f (DerivInst i) = add4 i
add1 x (a,b,c,d) = (x `consBag` a,b,c,d)
add2 x (a,b,c,d) = (a,x `consBag` b,c,d)
add3 x (a,b,c,d) = (a,b,x `consBag` c,d)
add4 x (a,b,c,d) = (a,b,c,x `consBag` d)
| 980
|
genAuxBinds loc b = genAuxBinds' b2 where
(b1,b2) = partitionBagWith splitDerivAuxBind b
splitDerivAuxBind (DerivAuxBind x) = Left x
splitDerivAuxBind x = Right x
rm_dups = foldrBag dup_check emptyBag
dup_check a b = if anyBag (== a) b then b else consBag a b
genAuxBinds' :: BagDerivStuff -> SeparateBagsDerivStuff
genAuxBinds' = foldrBag f ( mapBag (genAuxBindSpec loc) (rm_dups b1)
, emptyBag, emptyBag, emptyBag)
f :: DerivStuff -> SeparateBagsDerivStuff -> SeparateBagsDerivStuff
f (DerivAuxBind _) = panic "genAuxBinds'" -- We have removed these before
f (DerivHsBind b) = add1 b
f (DerivTyCon t) = add2 t
f (DerivFamInst t) = add3 t
f (DerivInst i) = add4 i
add1 x (a,b,c,d) = (x `consBag` a,b,c,d)
add2 x (a,b,c,d) = (a,x `consBag` b,c,d)
add3 x (a,b,c,d) = (a,b,x `consBag` c,d)
add4 x (a,b,c,d) = (a,b,c,x `consBag` d)
| 914
| true
| true
| 0
| 11
| 229
| 424
| 233
| 191
| null | null |
tjunier/mlgsc
|
src/Trim.hs
|
mit
|
trimHmmTransProb Aln = C.fromList [(0.0, Pre), (0.99, Aln), (0.01, Post)]
| 73
|
trimHmmTransProb Aln = C.fromList [(0.0, Pre), (0.99, Aln), (0.01, Post)]
| 73
|
trimHmmTransProb Aln = C.fromList [(0.0, Pre), (0.99, Aln), (0.01, Post)]
| 73
| false
| false
| 0
| 7
| 9
| 41
| 24
| 17
| null | null |
deontologician/orbRPG
|
Game/OrbRPG/Types.hs
|
gpl-3.0
|
noResponse :: Action
noResponse gs = gs{response = Nothing}
| 59
|
noResponse :: Action
noResponse gs = gs{response = Nothing}
| 59
|
noResponse gs = gs{response = Nothing}
| 38
| false
| true
| 0
| 6
| 8
| 22
| 12
| 10
| null | null |
igraves/peparser-haskell
|
PEFile.hs
|
bsd-3-clause
|
arrayrep :: [SectionMeta] -> UArray Word32 Word8
arrayrep secn = array (0,maxaddr) words
where
words = concat $ map sectoblist secn
maxaddr = maximum $ map fst words
--Ask for an address to begin a new head for a bytestring to build from, simple enough.
{-
grabAt :: Word32 -> UArray Word32 Word8 -> LBS.ByteString
grabAt indx ary = LBS.pack $ elems newarray
where maxdx = maximum $ indices ary
newarray = ixmap (0,maxdx-indx) (\i -> i - indx) ary --remap the array
-}
| 521
|
arrayrep :: [SectionMeta] -> UArray Word32 Word8
arrayrep secn = array (0,maxaddr) words
where
words = concat $ map sectoblist secn
maxaddr = maximum $ map fst words
--Ask for an address to begin a new head for a bytestring to build from, simple enough.
{-
grabAt :: Word32 -> UArray Word32 Word8 -> LBS.ByteString
grabAt indx ary = LBS.pack $ elems newarray
where maxdx = maximum $ indices ary
newarray = ixmap (0,maxdx-indx) (\i -> i - indx) ary --remap the array
-}
| 521
|
arrayrep secn = array (0,maxaddr) words
where
words = concat $ map sectoblist secn
maxaddr = maximum $ map fst words
--Ask for an address to begin a new head for a bytestring to build from, simple enough.
{-
grabAt :: Word32 -> UArray Word32 Word8 -> LBS.ByteString
grabAt indx ary = LBS.pack $ elems newarray
where maxdx = maximum $ indices ary
newarray = ixmap (0,maxdx-indx) (\i -> i - indx) ary --remap the array
-}
| 472
| false
| true
| 0
| 8
| 136
| 69
| 36
| 33
| null | null |
mrak/ptui
|
src/Ptui/Config.hs
|
bsd-3-clause
|
lookupInt :: Ini -> Text -> Text -> (PtuiConfig -> Int) -> Int
lookupInt ini section key f = either (const $ f defaultConfig) (read.unpack) (lookupValue section key ini)
| 169
|
lookupInt :: Ini -> Text -> Text -> (PtuiConfig -> Int) -> Int
lookupInt ini section key f = either (const $ f defaultConfig) (read.unpack) (lookupValue section key ini)
| 169
|
lookupInt ini section key f = either (const $ f defaultConfig) (read.unpack) (lookupValue section key ini)
| 106
| false
| true
| 0
| 10
| 28
| 75
| 38
| 37
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.