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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kmilner/tamarin-prover
|
lib/theory/src/Theory/Constraint/System.hs
|
gpl-3.0
|
normDG :: ProofContext -> System -> System
normDG ctxt sys = L.set sNodes normalizedNodes sys
where
normalizedNodes = M.map (\r -> runReader (normRule r) (L.get pcMaudeHandle ctxt)) (L.get sNodes sys)
-- | Returns the mirrored DGs, if they exist.
| 253
|
normDG :: ProofContext -> System -> System
normDG ctxt sys = L.set sNodes normalizedNodes sys
where
normalizedNodes = M.map (\r -> runReader (normRule r) (L.get pcMaudeHandle ctxt)) (L.get sNodes sys)
-- | Returns the mirrored DGs, if they exist.
| 253
|
normDG ctxt sys = L.set sNodes normalizedNodes sys
where
normalizedNodes = M.map (\r -> runReader (normRule r) (L.get pcMaudeHandle ctxt)) (L.get sNodes sys)
-- | Returns the mirrored DGs, if they exist.
| 210
| false
| true
| 0
| 11
| 45
| 92
| 45
| 47
| null | null |
tjakway/ghcjvm
|
compiler/basicTypes/Module.hs
|
bsd-3-clause
|
mkModuleSet ms = Map.fromList [(m,()) | m <- ms ]
| 52
|
mkModuleSet ms = Map.fromList [(m,()) | m <- ms ]
| 52
|
mkModuleSet ms = Map.fromList [(m,()) | m <- ms ]
| 52
| false
| false
| 0
| 8
| 12
| 33
| 17
| 16
| null | null |
lukexi/ghc-7.8-arm64
|
compiler/cmm/CmmUtils.hs
|
bsd-3-clause
|
mapGraphNodes :: ( CmmNode C O -> CmmNode C O
, CmmNode O O -> CmmNode O O
, CmmNode O C -> CmmNode O C)
-> CmmGraph -> CmmGraph
mapGraphNodes funs@(mf,_,_) g =
ofBlockMap (entryLabel $ mf $ CmmEntry $ g_entry g) $ mapMap (mapBlock3' funs) $ toBlockMap g
| 304
|
mapGraphNodes :: ( CmmNode C O -> CmmNode C O
, CmmNode O O -> CmmNode O O
, CmmNode O C -> CmmNode O C)
-> CmmGraph -> CmmGraph
mapGraphNodes funs@(mf,_,_) g =
ofBlockMap (entryLabel $ mf $ CmmEntry $ g_entry g) $ mapMap (mapBlock3' funs) $ toBlockMap g
| 304
|
mapGraphNodes funs@(mf,_,_) g =
ofBlockMap (entryLabel $ mf $ CmmEntry $ g_entry g) $ mapMap (mapBlock3' funs) $ toBlockMap g
| 127
| false
| true
| 0
| 11
| 99
| 128
| 63
| 65
| null | null |
hephaestus-pl/hephaestus
|
alexandre/feature-modeling/TestSetup.hs
|
mit
|
fmTree1_old = Old.FeatureModel ftree1_old []
| 44
|
fmTree1_old = Old.FeatureModel ftree1_old []
| 44
|
fmTree1_old = Old.FeatureModel ftree1_old []
| 44
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
sdiehl/ghc
|
testsuite/tests/simplCore/should_run/T3591.hs
|
bsd-3-clause
|
await :: forall m x. Monad m => Trampoline m (Await x) x
await = suspend (Await return)
| 87
|
await :: forall m x. Monad m => Trampoline m (Await x) x
await = suspend (Await return)
| 87
|
await = suspend (Await return)
| 30
| false
| true
| 0
| 9
| 17
| 46
| 23
| 23
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
conference/2018-05-lambdaconf/telegram-bot-in-haskell/app/Main6.hs
|
unlicense
|
-- | Bot application.
bot :: BotApp Model Action
bot = BotApp
{ botInitialModel = Model []
, botAction = flip handleUpdate
, botHandler = handleAction
, botJobs = []
}
| 177
|
bot :: BotApp Model Action
bot = BotApp
{ botInitialModel = Model []
, botAction = flip handleUpdate
, botHandler = handleAction
, botJobs = []
}
| 155
|
bot = BotApp
{ botInitialModel = Model []
, botAction = flip handleUpdate
, botHandler = handleAction
, botJobs = []
}
| 128
| true
| true
| 1
| 9
| 40
| 60
| 31
| 29
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-printers/Language/Drasil/HTML/Print.hs
|
bsd-2-clause
|
pOps Rational = "ℚ"
| 25
|
pOps Rational = "ℚ"
| 25
|
pOps Rational = "ℚ"
| 25
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
geophf/1HaskellADay
|
exercises/HAD/Y2017/M02/D23/Solution.hs
|
mit
|
constructURL :: AccessID -> FilePath
constructURL id = baseURL ++ (head (rend '_' id)) ++ ".fasta"
| 98
|
constructURL :: AccessID -> FilePath
constructURL id = baseURL ++ (head (rend '_' id)) ++ ".fasta"
| 98
|
constructURL id = baseURL ++ (head (rend '_' id)) ++ ".fasta"
| 61
| false
| true
| 0
| 10
| 15
| 44
| 21
| 23
| null | null |
mitchellwrosen/effects-a-la-carte
|
src/Control/Eff/State.hs
|
bsd-3-clause
|
execState :: Eff (Reader s ': Writer s ': effs) a -> s -> Eff effs s
execState f s = snd <$> runState f s
| 105
|
execState :: Eff (Reader s ': Writer s ': effs) a -> s -> Eff effs s
execState f s = snd <$> runState f s
| 105
|
execState f s = snd <$> runState f s
| 36
| false
| true
| 0
| 11
| 25
| 68
| 31
| 37
| null | null |
sternenseemann/spacecookie
|
server/Network/Spacecookie/Config.hs
|
gpl-3.0
|
maybePath [] _ = fail "got empty path"
| 42
|
maybePath [] _ = fail "got empty path"
| 42
|
maybePath [] _ = fail "got empty path"
| 42
| false
| false
| 0
| 6
| 11
| 16
| 7
| 9
| null | null |
ulricha/dsh
|
src/Database/DSH/Common/QueryPlan.hs
|
bsd-3-clause
|
-- | Replace a node in a top shape with another node.
updateShape :: DagVector v => AlgNode -> AlgNode -> Shape v -> Shape v
updateShape old new shape = fmap (updateVector old new) shape
| 186
|
updateShape :: DagVector v => AlgNode -> AlgNode -> Shape v -> Shape v
updateShape old new shape = fmap (updateVector old new) shape
| 132
|
updateShape old new shape = fmap (updateVector old new) shape
| 61
| true
| true
| 0
| 9
| 35
| 62
| 28
| 34
| null | null |
jystic/QuickSpec
|
qs1/TinyWMProperties.hs
|
bsd-3-clause
|
-- flatten a stackset to a list
toList :: StackSet a -> (Int,[[a]])
toList x = (current x, map snd $ M.toList (stacks x))
| 122
|
toList :: StackSet a -> (Int,[[a]])
toList x = (current x, map snd $ M.toList (stacks x))
| 90
|
toList x = (current x, map snd $ M.toList (stacks x))
| 53
| true
| true
| 0
| 10
| 24
| 67
| 33
| 34
| null | null |
vdweegen/UvA-Software_Testing
|
Lab4/Willem/Exercises.hs
|
gpl-3.0
|
prop_trClos_no_duplicates :: Rel Int -> Bool
prop_trClos_no_duplicates a = nub b == b where b = trClos a
| 104
|
prop_trClos_no_duplicates :: Rel Int -> Bool
prop_trClos_no_duplicates a = nub b == b where b = trClos a
| 104
|
prop_trClos_no_duplicates a = nub b == b where b = trClos a
| 59
| false
| true
| 0
| 7
| 17
| 38
| 18
| 20
| null | null |
jbearer/hspl
|
test/Testing.hs
|
mit
|
srcLoc = snd $ last callStack
| 29
|
srcLoc = snd $ last callStack
| 29
|
srcLoc = snd $ last callStack
| 29
| false
| false
| 0
| 6
| 5
| 13
| 6
| 7
| null | null |
diagrams/diagrams-contrib
|
src/Diagrams/Color/XKCD.hs
|
bsd-3-clause
|
aquaMarine = fromJust $ readHexColor "#2ee8bb"
| 57
|
aquaMarine = fromJust $ readHexColor "#2ee8bb"
| 57
|
aquaMarine = fromJust $ readHexColor "#2ee8bb"
| 57
| false
| false
| 0
| 6
| 16
| 13
| 6
| 7
| null | null |
include4eto/fractal-generation
|
Main.hs
|
gpl-3.0
|
title :: String
title = "Animated Fractal Generation"
| 53
|
title :: String
title = "Animated Fractal Generation"
| 53
|
title = "Animated Fractal Generation"
| 37
| false
| true
| 0
| 6
| 7
| 18
| 7
| 11
| null | null |
snoyberg/ghc
|
libraries/base/GHC/Event/PSQ.hs
|
bsd-3-clause
|
secondBest :: LTree a -> Key -> PSQ a
secondBest Start _ = Void
| 79
|
secondBest :: LTree a -> Key -> PSQ a
secondBest Start _ = Void
| 79
|
secondBest Start _ = Void
| 41
| false
| true
| 0
| 8
| 29
| 35
| 15
| 20
| null | null |
ekinan/HaskellTurtleGraphics
|
src/TProgram/TProgram.hs
|
bsd-3-clause
|
-- | Rotates the turtle right by some amount. By right,
-- we are referring to clockwise rotation.
right :: Degrees -> TProgram
right = motion Rotate rotate unitcRotate
| 170
|
right :: Degrees -> TProgram
right = motion Rotate rotate unitcRotate
| 69
|
right = motion Rotate rotate unitcRotate
| 40
| true
| true
| 0
| 5
| 30
| 24
| 13
| 11
| null | null |
dysinger/amazonka
|
amazonka-storagegateway/gen/Network/AWS/StorageGateway/AddWorkingStorage.hs
|
mpl-2.0
|
awsrGatewayARN :: Lens' AddWorkingStorageResponse (Maybe Text)
awsrGatewayARN = lens _awsrGatewayARN (\s a -> s { _awsrGatewayARN = a })
| 136
|
awsrGatewayARN :: Lens' AddWorkingStorageResponse (Maybe Text)
awsrGatewayARN = lens _awsrGatewayARN (\s a -> s { _awsrGatewayARN = a })
| 136
|
awsrGatewayARN = lens _awsrGatewayARN (\s a -> s { _awsrGatewayARN = a })
| 73
| false
| true
| 0
| 9
| 18
| 45
| 24
| 21
| null | null |
kmein/aang
|
app/Main.hs
|
mit
|
concatCapitalized :: [Text.Text] -> Text.Text
concatCapitalized = Text.unwords . map capitalize
where
capitalize str =
case Text.uncons str of
Just (x, xs) -> toUpper x `Text.cons` xs
Nothing -> Text.empty
| 243
|
concatCapitalized :: [Text.Text] -> Text.Text
concatCapitalized = Text.unwords . map capitalize
where
capitalize str =
case Text.uncons str of
Just (x, xs) -> toUpper x `Text.cons` xs
Nothing -> Text.empty
| 243
|
concatCapitalized = Text.unwords . map capitalize
where
capitalize str =
case Text.uncons str of
Just (x, xs) -> toUpper x `Text.cons` xs
Nothing -> Text.empty
| 197
| false
| true
| 1
| 9
| 67
| 95
| 44
| 51
| null | null |
vladimir-ipatov/ganeti
|
test/hs/Test/Ganeti/Daemon.hs
|
gpl-2.0
|
-- | Test a few integer arguments (only one for now).
prop_numeric_arg :: Int -> Property
prop_numeric_arg argument =
checkOpt (Just . show) defaultOptions
failTest (const (==?)) (Just . fromIntegral)
(argument, oPort 0, optPort)
| 239
|
prop_numeric_arg :: Int -> Property
prop_numeric_arg argument =
checkOpt (Just . show) defaultOptions
failTest (const (==?)) (Just . fromIntegral)
(argument, oPort 0, optPort)
| 185
|
prop_numeric_arg argument =
checkOpt (Just . show) defaultOptions
failTest (const (==?)) (Just . fromIntegral)
(argument, oPort 0, optPort)
| 149
| true
| true
| 0
| 7
| 43
| 69
| 36
| 33
| null | null |
maqqr/psycho-bongo-fight
|
NoSound.hs
|
mit
|
playStream :: Playable a => a -> Float -> Bool -> IO Channel
playStream music volume loop = return $ Channel 0
| 110
|
playStream :: Playable a => a -> Float -> Bool -> IO Channel
playStream music volume loop = return $ Channel 0
| 110
|
playStream music volume loop = return $ Channel 0
| 49
| false
| true
| 0
| 9
| 21
| 47
| 22
| 25
| null | null |
meiersi/blaze-protobuf
|
BaseLine.hs
|
bsd-3-clause
|
binPlayer :: Player -> Builder
binPlayer = word8 . fromIntegral . fromEnum
| 74
|
binPlayer :: Player -> Builder
binPlayer = word8 . fromIntegral . fromEnum
| 74
|
binPlayer = word8 . fromIntegral . fromEnum
| 43
| false
| true
| 1
| 7
| 11
| 30
| 13
| 17
| null | null |
vTurbine/ghc
|
compiler/basicTypes/RdrName.hs
|
bsd-3-clause
|
pickGREs :: RdrName -> [GlobalRdrElt] -> [GlobalRdrElt]
-- ^ Takes a list of GREs which have the right OccName 'x'
-- Pick those GREs that are are in scope
-- * Qualified, as 'M.x' if want_qual is Qual M _
-- * Unqualified, as 'x' if want_unqual is Unqual _
--
-- Return each such GRE, with its ImportSpecs filtered, to reflect
-- how it is in scope qualifed or unqualified respectively.
-- See Note [GRE filtering]
pickGREs (Unqual {}) gres = mapMaybe pickUnqualGRE gres
| 492
|
pickGREs :: RdrName -> [GlobalRdrElt] -> [GlobalRdrElt]
pickGREs (Unqual {}) gres = mapMaybe pickUnqualGRE gres
| 116
|
pickGREs (Unqual {}) gres = mapMaybe pickUnqualGRE gres
| 60
| true
| true
| 1
| 9
| 105
| 54
| 31
| 23
| null | null |
mcschroeder/ghc
|
compiler/basicTypes/MkId.hs
|
bsd-3-clause
|
mkFCallId :: DynFlags -> Unique -> ForeignCall -> Type -> Id
mkFCallId dflags uniq fcall ty
= ASSERT( isEmptyVarSet (tyCoVarsOfType ty) )
-- A CCallOpId should have no free type variables;
-- when doing substitutions won't substitute over it
mkGlobalId (FCallId fcall) name ty info
where
occ_str = showSDoc dflags (braces (ppr fcall <+> ppr ty))
-- The "occurrence name" of a ccall is the full info about the
-- ccall; it is encoded, but may have embedded spaces etc!
name = mkFCallName uniq occ_str
info = noCafIdInfo
`setArityInfo` arity
`setStrictnessInfo` strict_sig
(bndrs, _) = tcSplitPiTys ty
arity = count isIdLikeBinder bndrs
strict_sig = mkClosedStrictSig (replicate arity topDmd) topRes
-- the call does not claim to be strict in its arguments, since they
-- may be lifted (foreign import prim) and the called code doesn't
-- necessarily force them. See Trac #11076.
{-
************************************************************************
* *
\subsection{DictFuns and default methods}
* *
************************************************************************
Note [Dict funs and default methods]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dict funs and default methods are *not* ImplicitIds. Their definition
involves user-written code, so we can't figure out their strictness etc
based on fixed info, as we can for constructors and record selectors (say).
NB: See also Note [Exported LocalIds] in Id
-}
| 1,677
|
mkFCallId :: DynFlags -> Unique -> ForeignCall -> Type -> Id
mkFCallId dflags uniq fcall ty
= ASSERT( isEmptyVarSet (tyCoVarsOfType ty) )
-- A CCallOpId should have no free type variables;
-- when doing substitutions won't substitute over it
mkGlobalId (FCallId fcall) name ty info
where
occ_str = showSDoc dflags (braces (ppr fcall <+> ppr ty))
-- The "occurrence name" of a ccall is the full info about the
-- ccall; it is encoded, but may have embedded spaces etc!
name = mkFCallName uniq occ_str
info = noCafIdInfo
`setArityInfo` arity
`setStrictnessInfo` strict_sig
(bndrs, _) = tcSplitPiTys ty
arity = count isIdLikeBinder bndrs
strict_sig = mkClosedStrictSig (replicate arity topDmd) topRes
-- the call does not claim to be strict in its arguments, since they
-- may be lifted (foreign import prim) and the called code doesn't
-- necessarily force them. See Trac #11076.
{-
************************************************************************
* *
\subsection{DictFuns and default methods}
* *
************************************************************************
Note [Dict funs and default methods]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dict funs and default methods are *not* ImplicitIds. Their definition
involves user-written code, so we can't figure out their strictness etc
based on fixed info, as we can for constructors and record selectors (say).
NB: See also Note [Exported LocalIds] in Id
-}
| 1,677
|
mkFCallId dflags uniq fcall ty
= ASSERT( isEmptyVarSet (tyCoVarsOfType ty) )
-- A CCallOpId should have no free type variables;
-- when doing substitutions won't substitute over it
mkGlobalId (FCallId fcall) name ty info
where
occ_str = showSDoc dflags (braces (ppr fcall <+> ppr ty))
-- The "occurrence name" of a ccall is the full info about the
-- ccall; it is encoded, but may have embedded spaces etc!
name = mkFCallName uniq occ_str
info = noCafIdInfo
`setArityInfo` arity
`setStrictnessInfo` strict_sig
(bndrs, _) = tcSplitPiTys ty
arity = count isIdLikeBinder bndrs
strict_sig = mkClosedStrictSig (replicate arity topDmd) topRes
-- the call does not claim to be strict in its arguments, since they
-- may be lifted (foreign import prim) and the called code doesn't
-- necessarily force them. See Trac #11076.
{-
************************************************************************
* *
\subsection{DictFuns and default methods}
* *
************************************************************************
Note [Dict funs and default methods]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dict funs and default methods are *not* ImplicitIds. Their definition
involves user-written code, so we can't figure out their strictness etc
based on fixed info, as we can for constructors and record selectors (say).
NB: See also Note [Exported LocalIds] in Id
-}
| 1,616
| false
| true
| 5
| 12
| 464
| 178
| 94
| 84
| null | null |
holdenlee/notebook
|
src/NestedCategories.hs
|
mit
|
{- As in, MapReduce -}
reduce :: (Monoid m, Ord a, Ord m) => [(a, m)] -> [(a, m)]
reduce = M.toList . M.map mconcat . MM.toMap . MM.fromList
| 142
|
reduce :: (Monoid m, Ord a, Ord m) => [(a, m)] -> [(a, m)]
reduce = M.toList . M.map mconcat . MM.toMap . MM.fromList
| 117
|
reduce = M.toList . M.map mconcat . MM.toMap . MM.fromList
| 58
| true
| true
| 0
| 10
| 30
| 85
| 44
| 41
| null | null |
daherb/Boten-Anna
|
Config.hs
|
artistic-2.0
|
logging = False
| 15
|
logging = False
| 15
|
logging = False
| 15
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
asvyazin/hs-onedrive
|
src/Onedrive/Session.hs
|
bsd-3-clause
|
newSessionWithRenewableToken :: Text -> IO Text -> IO Session
newSessionWithRenewableToken accessToken renewAccessToken = do
tokenStore <- atomically $ newTVar accessToken
return $ SessionWithRenewableToken tokenStore renewAccessToken
| 238
|
newSessionWithRenewableToken :: Text -> IO Text -> IO Session
newSessionWithRenewableToken accessToken renewAccessToken = do
tokenStore <- atomically $ newTVar accessToken
return $ SessionWithRenewableToken tokenStore renewAccessToken
| 238
|
newSessionWithRenewableToken accessToken renewAccessToken = do
tokenStore <- atomically $ newTVar accessToken
return $ SessionWithRenewableToken tokenStore renewAccessToken
| 176
| false
| true
| 0
| 10
| 28
| 61
| 26
| 35
| null | null |
sunakshi2/sqlVisualiser
|
ReadnSend.hs
|
gpl-2.0
|
drawup (l:[]) snd i = do
if snd == [] then drawNothing else drawArrow ptsArrowDwn
drawArrow $ getlinepts i $ add i $ head' pointsu
upd l pointsu i (x + (fromIntegral i*0.4)) yu
drawup [] snd (i+1)
--drawlines $ getlinepts i $ add i $ head' pointsu
--drawArrow $ arrowPts i $ getlinepts i $ add i $ head' pointsu
| 566
|
drawup (l:[]) snd i = do
if snd == [] then drawNothing else drawArrow ptsArrowDwn
drawArrow $ getlinepts i $ add i $ head' pointsu
upd l pointsu i (x + (fromIntegral i*0.4)) yu
drawup [] snd (i+1)
--drawlines $ getlinepts i $ add i $ head' pointsu
--drawArrow $ arrowPts i $ getlinepts i $ add i $ head' pointsu
| 566
|
drawup (l:[]) snd i = do
if snd == [] then drawNothing else drawArrow ptsArrowDwn
drawArrow $ getlinepts i $ add i $ head' pointsu
upd l pointsu i (x + (fromIntegral i*0.4)) yu
drawup [] snd (i+1)
--drawlines $ getlinepts i $ add i $ head' pointsu
--drawArrow $ arrowPts i $ getlinepts i $ add i $ head' pointsu
| 566
| false
| false
| 1
| 13
| 315
| 124
| 57
| 67
| null | null |
Kheldar/hw-koans
|
test/Check/Either.hs
|
bsd-3-clause
|
prop_isLeft :: Property
prop_isLeft = property $ do
eab <- forAll $ genEither (Gen.int Range.constantBounded) (Gen.int Range.constantBounded)
K.isLeft (toK eab) === P.isLeft eab
| 181
|
prop_isLeft :: Property
prop_isLeft = property $ do
eab <- forAll $ genEither (Gen.int Range.constantBounded) (Gen.int Range.constantBounded)
K.isLeft (toK eab) === P.isLeft eab
| 181
|
prop_isLeft = property $ do
eab <- forAll $ genEither (Gen.int Range.constantBounded) (Gen.int Range.constantBounded)
K.isLeft (toK eab) === P.isLeft eab
| 157
| false
| true
| 0
| 13
| 26
| 74
| 35
| 39
| null | null |
OS2World/DEV-UTIL-HUGS
|
oldlib/SkewHeap.hs
|
bsd-3-clause
|
foldl :: Ord a => (b -> a -> b) -> b -> Heap a -> b
foldl f e E = e
| 67
|
foldl :: Ord a => (b -> a -> b) -> b -> Heap a -> b
foldl f e E = e
| 67
|
foldl f e E = e
| 15
| false
| true
| 0
| 10
| 22
| 57
| 26
| 31
| null | null |
badp/ganeti
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
-- | All of the following values are quite arbitrary - there are no
-- "good" defaults, these must be customised per-site
ispecsMinmaxDefaults :: Map String (Map String Int)
ispecsMinmaxDefaults =
Map.fromList
[(ispecsMin,
Map.fromList
[(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMinISpec),
(ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec),
(ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMinISpec),
(ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec),
(ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec),
(ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMinISpec)]),
(ispecsMax,
Map.fromList
[(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMaxISpec),
(ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec),
(ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMaxISpec),
(ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec),
(ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec),
(ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMaxISpec)])]
| 1,193
|
ispecsMinmaxDefaults :: Map String (Map String Int)
ispecsMinmaxDefaults =
Map.fromList
[(ispecsMin,
Map.fromList
[(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMinISpec),
(ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec),
(ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMinISpec),
(ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec),
(ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec),
(ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMinISpec)]),
(ispecsMax,
Map.fromList
[(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMaxISpec),
(ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec),
(ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMaxISpec),
(ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec),
(ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec),
(ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMaxISpec)])]
| 1,071
|
ispecsMinmaxDefaults =
Map.fromList
[(ispecsMin,
Map.fromList
[(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMinISpec),
(ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMinISpec),
(ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMinISpec),
(ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMinISpec),
(ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMinISpec),
(ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMinISpec)]),
(ispecsMax,
Map.fromList
[(ConstantUtils.ispecMemSize, Types.iSpecMemorySize Types.defMaxISpec),
(ConstantUtils.ispecCpuCount, Types.iSpecCpuCount Types.defMaxISpec),
(ConstantUtils.ispecDiskCount, Types.iSpecDiskCount Types.defMaxISpec),
(ConstantUtils.ispecDiskSize, Types.iSpecDiskSize Types.defMaxISpec),
(ConstantUtils.ispecNicCount, Types.iSpecNicCount Types.defMaxISpec),
(ConstantUtils.ispecSpindleUse, Types.iSpecSpindleUse Types.defMaxISpec)])]
| 1,019
| true
| true
| 0
| 11
| 144
| 275
| 152
| 123
| null | null |
plow-technologies/distributed-simple-cell
|
tests/Tests.hs
|
mit
|
unvalueTestCellEntry :: TestCellEntry -> TestCellEntry
unvalueTestCellEntry (TestCellEntry (k,_)) = TestCellEntry (k,0)
| 119
|
unvalueTestCellEntry :: TestCellEntry -> TestCellEntry
unvalueTestCellEntry (TestCellEntry (k,_)) = TestCellEntry (k,0)
| 119
|
unvalueTestCellEntry (TestCellEntry (k,_)) = TestCellEntry (k,0)
| 64
| false
| true
| 0
| 8
| 10
| 39
| 21
| 18
| null | null |
phischu/fragnix
|
tests/packages/scotty/Text.PrettyPrint.Annotated.HughesPJClass.hs
|
bsd-3-clause
|
prettyShow :: (Pretty a) => a -> String
prettyShow = render . pPrint
| 68
|
prettyShow :: (Pretty a) => a -> String
prettyShow = render . pPrint
| 68
|
prettyShow = render . pPrint
| 28
| false
| true
| 1
| 8
| 12
| 36
| 16
| 20
| null | null |
shnarazk/mios
|
src/SAT/Mios.hs
|
gpl-3.0
|
showPathBaseName :: MiosProgramOption -> String
showPathBaseName (_targetFile -> Left str) = (reverse . takeWhile (/= '/') . reverse) str
| 137
|
showPathBaseName :: MiosProgramOption -> String
showPathBaseName (_targetFile -> Left str) = (reverse . takeWhile (/= '/') . reverse) str
| 137
|
showPathBaseName (_targetFile -> Left str) = (reverse . takeWhile (/= '/') . reverse) str
| 89
| false
| true
| 0
| 10
| 18
| 49
| 25
| 24
| null | null |
AmpersandTarski/ampersand
|
src/Ampersand/Core/AbstractSyntaxTree.hs
|
gpl-3.0
|
isObjExp :: BoxItem -> Bool
isObjExp BxExpr{} = True
| 52
|
isObjExp :: BoxItem -> Bool
isObjExp BxExpr{} = True
| 52
|
isObjExp BxExpr{} = True
| 24
| false
| true
| 0
| 6
| 8
| 22
| 11
| 11
| null | null |
fmapfmapfmap/amazonka
|
amazonka-kms/test/Test/AWS/Gen/KMS.hs
|
mpl-2.0
|
testReEncryptResponse :: ReEncryptResponse -> TestTree
testReEncryptResponse = res
"ReEncryptResponse"
"fixture/ReEncryptResponse.proto"
kMS
(Proxy :: Proxy ReEncrypt)
| 183
|
testReEncryptResponse :: ReEncryptResponse -> TestTree
testReEncryptResponse = res
"ReEncryptResponse"
"fixture/ReEncryptResponse.proto"
kMS
(Proxy :: Proxy ReEncrypt)
| 183
|
testReEncryptResponse = res
"ReEncryptResponse"
"fixture/ReEncryptResponse.proto"
kMS
(Proxy :: Proxy ReEncrypt)
| 128
| false
| true
| 0
| 6
| 30
| 36
| 17
| 19
| null | null |
xicesky/sky-haskell-playground
|
src/Sky/Util/GraphMonad.hs
|
bsd-3-clause
|
gmIterateNames :: (Monad m, RefName k) => k -> Int -> GraphT k m k
gmIterateNames name i = gmTryName (name `mappend` makeSuffix i) $ gmIterateNames name (i+1)
| 158
|
gmIterateNames :: (Monad m, RefName k) => k -> Int -> GraphT k m k
gmIterateNames name i = gmTryName (name `mappend` makeSuffix i) $ gmIterateNames name (i+1)
| 158
|
gmIterateNames name i = gmTryName (name `mappend` makeSuffix i) $ gmIterateNames name (i+1)
| 91
| false
| true
| 0
| 9
| 27
| 77
| 39
| 38
| null | null |
banacorn/socket.io-haskell
|
Web/SocketIO/Connection.hs
|
mit
|
handleConnection (Connect sessionID, Nothing) = do
logWithSessionID Warn sessionID "[Request] Connect: Session not found"
return $ MsgError NoEndpoint NoData
| 166
|
handleConnection (Connect sessionID, Nothing) = do
logWithSessionID Warn sessionID "[Request] Connect: Session not found"
return $ MsgError NoEndpoint NoData
| 166
|
handleConnection (Connect sessionID, Nothing) = do
logWithSessionID Warn sessionID "[Request] Connect: Session not found"
return $ MsgError NoEndpoint NoData
| 166
| false
| false
| 0
| 8
| 27
| 40
| 18
| 22
| null | null |
jacekszymanski/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxPAPER_ENV_C3 :: Int
wxPAPER_ENV_C3 = 29
| 41
|
wxPAPER_ENV_C3 :: Int
wxPAPER_ENV_C3 = 29
| 41
|
wxPAPER_ENV_C3 = 29
| 19
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
andreasabel/helf
|
src/OrderedCom2.hs
|
mit
|
arrow a b = A.Pi Nothing a b
| 28
|
arrow a b = A.Pi Nothing a b
| 28
|
arrow a b = A.Pi Nothing a b
| 28
| false
| false
| 1
| 5
| 7
| 27
| 9
| 18
| null | null |
wereHamster/nauva
|
pkg/hs/nauva-css/src/Nauva/CSS/Helpers.hs
|
mit
|
onActive :: Writer [Statement] () -> Writer [Statement] ()
onActive style = tell [SSuffix ":active" style]
| 106
|
onActive :: Writer [Statement] () -> Writer [Statement] ()
onActive style = tell [SSuffix ":active" style]
| 106
|
onActive style = tell [SSuffix ":active" style]
| 47
| false
| true
| 0
| 7
| 15
| 52
| 25
| 27
| null | null |
yav/parsimony
|
src/Parsimony/Combinator.hs
|
bsd-2-clause
|
-- | Parse a list of values recognized by the given parser.
-- The sequence of values should be terminated by a pattern recognized
-- by the terminator patser.
-- The terminator is tried before the value pattern, so if there
-- is overlap between the two, the terminator is recognized.
manyTill :: Parser t a -> Parser t end -> Parser t [a]
manyTill p end = scan
where scan = (end *> return []) <|> ((:) <$> p <*> scan)
| 423
|
manyTill :: Parser t a -> Parser t end -> Parser t [a]
manyTill p end = scan
where scan = (end *> return []) <|> ((:) <$> p <*> scan)
| 137
|
manyTill p end = scan
where scan = (end *> return []) <|> ((:) <$> p <*> scan)
| 82
| true
| true
| 0
| 9
| 85
| 89
| 46
| 43
| null | null |
olorin/amazonka
|
amazonka-s3/gen/Network/AWS/S3/PutBucketLifecycleConfiguration.hs
|
mpl-2.0
|
-- | Creates a value of 'PutBucketLifecycleConfigurationResponse' with the minimum fields required to make a request.
--
putBucketLifecycleConfigurationResponse
:: PutBucketLifecycleConfigurationResponse
putBucketLifecycleConfigurationResponse =
PutBucketLifecycleConfigurationResponse'
| 294
|
putBucketLifecycleConfigurationResponse
:: PutBucketLifecycleConfigurationResponse
putBucketLifecycleConfigurationResponse =
PutBucketLifecycleConfigurationResponse'
| 173
|
putBucketLifecycleConfigurationResponse =
PutBucketLifecycleConfigurationResponse'
| 86
| true
| true
| 1
| 5
| 30
| 17
| 8
| 9
| null | null |
adbrowne/dynamodb-eventstore
|
dynamodb-eventstore-web/src/DynamoDbEventStore/Feed.hs
|
mit
|
jsonEntry :: Entry -> Value
jsonEntry Entry{..} =
let
entryid = "id" .= entryId
title = "title" .= entryTitle
author = "author" .= (jsonAuthor genericAuthor)
updated = "updated" .= formatJsonTime entryUpdated
summary = "summary" .= entrySummary
content = "content" .= jsonEntryContent entryContent
links = "links" .= (Array . V.fromList) (jsonLink <$> entryLinks)
in object [entryid, author, title, summary, content, links, updated]
| 464
|
jsonEntry :: Entry -> Value
jsonEntry Entry{..} =
let
entryid = "id" .= entryId
title = "title" .= entryTitle
author = "author" .= (jsonAuthor genericAuthor)
updated = "updated" .= formatJsonTime entryUpdated
summary = "summary" .= entrySummary
content = "content" .= jsonEntryContent entryContent
links = "links" .= (Array . V.fromList) (jsonLink <$> entryLinks)
in object [entryid, author, title, summary, content, links, updated]
| 464
|
jsonEntry Entry{..} =
let
entryid = "id" .= entryId
title = "title" .= entryTitle
author = "author" .= (jsonAuthor genericAuthor)
updated = "updated" .= formatJsonTime entryUpdated
summary = "summary" .= entrySummary
content = "content" .= jsonEntryContent entryContent
links = "links" .= (Array . V.fromList) (jsonLink <$> entryLinks)
in object [entryid, author, title, summary, content, links, updated]
| 436
| false
| true
| 0
| 13
| 92
| 148
| 79
| 69
| null | null |
k0001/gtk2hs
|
tools/c2hs/chs/CHS.hs
|
gpl-3.0
|
showPrefix :: Maybe String -> Bool -> ShowS
showPrefix Nothing _ = showString ""
| 117
|
showPrefix :: Maybe String -> Bool -> ShowS
showPrefix Nothing _ = showString ""
| 117
|
showPrefix Nothing _ = showString ""
| 50
| false
| true
| 0
| 6
| 50
| 30
| 14
| 16
| null | null |
alphalambda/codeworld
|
codeworld-api/src/CodeWorld/Sketches.hs
|
apache-2.0
|
sketchedThoughtBubble :: HasCallStack => Picture
sketchedThoughtBubble =
Sketch
(getDebugSrcLoc callStack)
"sketchedThoughtBubble"
$(embedAsUrl "image/svg+xml" "data/ThoughtBubbleTransparency70.svg")
10
10
| 227
|
sketchedThoughtBubble :: HasCallStack => Picture
sketchedThoughtBubble =
Sketch
(getDebugSrcLoc callStack)
"sketchedThoughtBubble"
$(embedAsUrl "image/svg+xml" "data/ThoughtBubbleTransparency70.svg")
10
10
| 227
|
sketchedThoughtBubble =
Sketch
(getDebugSrcLoc callStack)
"sketchedThoughtBubble"
$(embedAsUrl "image/svg+xml" "data/ThoughtBubbleTransparency70.svg")
10
10
| 178
| false
| true
| 0
| 7
| 37
| 46
| 20
| 26
| null | null |
brendanhay/gogol
|
gogol-appengine/gen/Network/Google/AppEngine/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'CreateVersionMetadataV1' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cvmvCloudBuildId'
createVersionMetadataV1
:: CreateVersionMetadataV1
createVersionMetadataV1 = CreateVersionMetadataV1' {_cvmvCloudBuildId = Nothing}
| 337
|
createVersionMetadataV1
:: CreateVersionMetadataV1
createVersionMetadataV1 = CreateVersionMetadataV1' {_cvmvCloudBuildId = Nothing}
| 135
|
createVersionMetadataV1 = CreateVersionMetadataV1' {_cvmvCloudBuildId = Nothing}
| 80
| true
| true
| 0
| 7
| 46
| 31
| 17
| 14
| null | null |
brendanhay/gogol
|
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Operations/SetIAMPolicy.hs
|
mpl-2.0
|
-- | Multipart request metadata.
prosipPayload :: Lens' ProjectsRegionsOperationsSetIAMPolicy SetIAMPolicyRequest
prosipPayload
= lens _prosipPayload
(\ s a -> s{_prosipPayload = a})
| 190
|
prosipPayload :: Lens' ProjectsRegionsOperationsSetIAMPolicy SetIAMPolicyRequest
prosipPayload
= lens _prosipPayload
(\ s a -> s{_prosipPayload = a})
| 157
|
prosipPayload
= lens _prosipPayload
(\ s a -> s{_prosipPayload = a})
| 76
| true
| true
| 0
| 8
| 28
| 43
| 22
| 21
| null | null |
gspindles/mj-score-eval
|
src/Game/Mahjong/Pattern.hs
|
mit
|
allSequences = Pattern "All Sequences" "平和" 5
| 48
|
allSequences = Pattern "All Sequences" "平和" 5
| 48
|
allSequences = Pattern "All Sequences" "平和" 5
| 48
| false
| false
| 0
| 5
| 9
| 13
| 6
| 7
| null | null |
xor-xor/webapp_spock
|
src/App.hs
|
bsd-3-clause
|
clearMessage :: SpockAction Pg.Connection MySession AppState ()
clearMessage = do
sess <- readSession
writeSession (MySession (visitedCounter sess) (loggedInAs sess) Nothing Nothing)
| 186
|
clearMessage :: SpockAction Pg.Connection MySession AppState ()
clearMessage = do
sess <- readSession
writeSession (MySession (visitedCounter sess) (loggedInAs sess) Nothing Nothing)
| 186
|
clearMessage = do
sess <- readSession
writeSession (MySession (visitedCounter sess) (loggedInAs sess) Nothing Nothing)
| 122
| false
| true
| 0
| 11
| 24
| 61
| 29
| 32
| null | null |
apyrgio/snf-ganeti
|
test/hs/Test/Ganeti/Types.hs
|
bsd-2-clause
|
-- | Test 'StorageType' serialisation.
prop_StorageType_serialisation :: StorageType -> Property
prop_StorageType_serialisation = testSerialisation
| 147
|
prop_StorageType_serialisation :: StorageType -> Property
prop_StorageType_serialisation = testSerialisation
| 108
|
prop_StorageType_serialisation = testSerialisation
| 50
| true
| true
| 0
| 5
| 12
| 16
| 9
| 7
| null | null |
bjornbm/astro
|
src/Astro/Celestrak/Parser.hs
|
bsd-3-clause
|
testLine = "2003 01 01 52640 -0.088474 0.188235 -0.2894287 0.0004278 -0.055412 -0.000565 -0.000054 0.000103 32"
| 115
|
testLine = "2003 01 01 52640 -0.088474 0.188235 -0.2894287 0.0004278 -0.055412 -0.000565 -0.000054 0.000103 32"
| 115
|
testLine = "2003 01 01 52640 -0.088474 0.188235 -0.2894287 0.0004278 -0.055412 -0.000565 -0.000054 0.000103 32"
| 115
| false
| false
| 0
| 4
| 18
| 6
| 3
| 3
| null | null |
gnn/Hets
|
Common/Doc.hs
|
gpl-2.0
|
codeOutAppl :: StripComment -> GlobalAnnos -> PrecMap -> Maybe Display_format
-> Map.Map Id [Token] -> Doc -> [Doc] -> Doc
codeOutAppl stripCs ga precs md m origDoc args = case origDoc of
IdApplDoc _ i@(Id ts cs _) aas ->
let mk = codeToken . tokStr
doSplit = fromMaybe (error "doSplit") . splitDoc
mkList op largs cl = fsep $ codeOutId IdAppl m op : punctuate comma
(map (codeOut stripCs ga precs md m) largs)
++ [codeOutId IdAppl m cl]
in if isGenNumber splitDoc ga i aas then
mk $ toNumber doSplit i aas
else if isGenFrac splitDoc ga i aas then
mk $ toFrac doSplit aas
else if isGenFloat splitDoc ga i aas then
mk $ toFloat doSplit ga aas
else if isGenString splitDoc ga i aas then
mk $ toString doSplit ga i aas
else if isGenList splitDoc ga i aas then
toMixfixList mkList doSplit ga i aas
else if null args || length args /= placeCount i then
codeOutId IdAppl m i <> if null args then empty else
parens (sepByCommas args)
else let
pars = parenApplArgs ga precs origDoc
parArgs = zipWith (\ b -> if b then parens else id) pars args
(fts, ncs, cFun) = case Map.lookup i m of
Nothing ->
(fst $ splitMixToken ts, cs, IdSymb)
Just nts -> (nts, [], Native)
((_, rArgs), fArgs) = mapAccumL ( \ (b, ac) t ->
if isPlace t then case ac of
hd : tl -> ((b, tl), (False, hd))
_ -> error "Common.Doc.codeOutAppl1"
else ((True, ac), (True,
let s = tokStr t in
if b then Text cFun s else makeIdApplLabel cFun s i)))
(False, parArgs) fts
in fsep $ hgroup $
(if null ncs then fArgs
else if null fArgs then error "Common.Doc.codeOutAppl2"
else init fArgs ++
[(True, snd (last fArgs) <> codeCompIds m cs)])
++ map ( \ d -> (False, d)) rArgs
_ -> error "Common.Doc.codeOutAppl2"
| 2,299
|
codeOutAppl :: StripComment -> GlobalAnnos -> PrecMap -> Maybe Display_format
-> Map.Map Id [Token] -> Doc -> [Doc] -> Doc
codeOutAppl stripCs ga precs md m origDoc args = case origDoc of
IdApplDoc _ i@(Id ts cs _) aas ->
let mk = codeToken . tokStr
doSplit = fromMaybe (error "doSplit") . splitDoc
mkList op largs cl = fsep $ codeOutId IdAppl m op : punctuate comma
(map (codeOut stripCs ga precs md m) largs)
++ [codeOutId IdAppl m cl]
in if isGenNumber splitDoc ga i aas then
mk $ toNumber doSplit i aas
else if isGenFrac splitDoc ga i aas then
mk $ toFrac doSplit aas
else if isGenFloat splitDoc ga i aas then
mk $ toFloat doSplit ga aas
else if isGenString splitDoc ga i aas then
mk $ toString doSplit ga i aas
else if isGenList splitDoc ga i aas then
toMixfixList mkList doSplit ga i aas
else if null args || length args /= placeCount i then
codeOutId IdAppl m i <> if null args then empty else
parens (sepByCommas args)
else let
pars = parenApplArgs ga precs origDoc
parArgs = zipWith (\ b -> if b then parens else id) pars args
(fts, ncs, cFun) = case Map.lookup i m of
Nothing ->
(fst $ splitMixToken ts, cs, IdSymb)
Just nts -> (nts, [], Native)
((_, rArgs), fArgs) = mapAccumL ( \ (b, ac) t ->
if isPlace t then case ac of
hd : tl -> ((b, tl), (False, hd))
_ -> error "Common.Doc.codeOutAppl1"
else ((True, ac), (True,
let s = tokStr t in
if b then Text cFun s else makeIdApplLabel cFun s i)))
(False, parArgs) fts
in fsep $ hgroup $
(if null ncs then fArgs
else if null fArgs then error "Common.Doc.codeOutAppl2"
else init fArgs ++
[(True, snd (last fArgs) <> codeCompIds m cs)])
++ map ( \ d -> (False, d)) rArgs
_ -> error "Common.Doc.codeOutAppl2"
| 2,299
|
codeOutAppl stripCs ga precs md m origDoc args = case origDoc of
IdApplDoc _ i@(Id ts cs _) aas ->
let mk = codeToken . tokStr
doSplit = fromMaybe (error "doSplit") . splitDoc
mkList op largs cl = fsep $ codeOutId IdAppl m op : punctuate comma
(map (codeOut stripCs ga precs md m) largs)
++ [codeOutId IdAppl m cl]
in if isGenNumber splitDoc ga i aas then
mk $ toNumber doSplit i aas
else if isGenFrac splitDoc ga i aas then
mk $ toFrac doSplit aas
else if isGenFloat splitDoc ga i aas then
mk $ toFloat doSplit ga aas
else if isGenString splitDoc ga i aas then
mk $ toString doSplit ga i aas
else if isGenList splitDoc ga i aas then
toMixfixList mkList doSplit ga i aas
else if null args || length args /= placeCount i then
codeOutId IdAppl m i <> if null args then empty else
parens (sepByCommas args)
else let
pars = parenApplArgs ga precs origDoc
parArgs = zipWith (\ b -> if b then parens else id) pars args
(fts, ncs, cFun) = case Map.lookup i m of
Nothing ->
(fst $ splitMixToken ts, cs, IdSymb)
Just nts -> (nts, [], Native)
((_, rArgs), fArgs) = mapAccumL ( \ (b, ac) t ->
if isPlace t then case ac of
hd : tl -> ((b, tl), (False, hd))
_ -> error "Common.Doc.codeOutAppl1"
else ((True, ac), (True,
let s = tokStr t in
if b then Text cFun s else makeIdApplLabel cFun s i)))
(False, parArgs) fts
in fsep $ hgroup $
(if null ncs then fArgs
else if null fArgs then error "Common.Doc.codeOutAppl2"
else init fArgs ++
[(True, snd (last fArgs) <> codeCompIds m cs)])
++ map ( \ d -> (False, d)) rArgs
_ -> error "Common.Doc.codeOutAppl2"
| 2,164
| false
| true
| 0
| 30
| 952
| 769
| 396
| 373
| null | null |
spechub/Hets
|
CSMOF/Parser.hs
|
gpl-2.0
|
equalPropertyName :: String -> NamedElement -> Bool
equalPropertyName name ne =
case ne of
(NamedElement _ _ (TTypedElement (TypedElement {}))) ->
namedElementName ne == name
_ -> False
| 200
|
equalPropertyName :: String -> NamedElement -> Bool
equalPropertyName name ne =
case ne of
(NamedElement _ _ (TTypedElement (TypedElement {}))) ->
namedElementName ne == name
_ -> False
| 200
|
equalPropertyName name ne =
case ne of
(NamedElement _ _ (TTypedElement (TypedElement {}))) ->
namedElementName ne == name
_ -> False
| 148
| false
| true
| 0
| 13
| 42
| 75
| 36
| 39
| null | null |
tim-m89/Salsa
|
Foreign/Salsa/Common.hs
|
bsd-3-clause
|
-- Value-level equivalent of Obj type constructor:
_Obj :: t -> Obj t
_Obj _ = undefined
| 88
|
_Obj :: t -> Obj t
_Obj _ = undefined
| 37
|
_Obj _ = undefined
| 18
| true
| true
| 0
| 6
| 16
| 22
| 11
| 11
| null | null |
Changaco/haskell-plugins
|
src/System/Plugins/Eval.hs
|
lgpl-2.1
|
typeOf :: String -> [Import] -> IO (Either String String)
typeOf src imps = do
r <- eval src imps :: IO (Either String Dynamic)
return $ fmap (init . tail . show) r
-- ---------------------------------------------------------------------
-- wrappers
--
| 261
|
typeOf :: String -> [Import] -> IO (Either String String)
typeOf src imps = do
r <- eval src imps :: IO (Either String Dynamic)
return $ fmap (init . tail . show) r
-- ---------------------------------------------------------------------
-- wrappers
--
| 261
|
typeOf src imps = do
r <- eval src imps :: IO (Either String Dynamic)
return $ fmap (init . tail . show) r
-- ---------------------------------------------------------------------
-- wrappers
--
| 203
| false
| true
| 0
| 11
| 47
| 90
| 45
| 45
| null | null |
roberth/uu-helium
|
test/correct/ManyConstructs.hs
|
gpl-3.0
|
main :: ([Int], [Int], Int, Int, [Int], A, ())
main = -- primUnsafePerformIO, primPutStrLn, primShowTuple8 in inserted main
( [1..5] -- primEnum...
, [1,3..10]
, case [1..] of (y:_) -> y
, case [3,5..] of (_:_:y:_) -> y
, [ y | x <- [1..10], x > 5, let { y :: Int; y = x + 1 }] -- primConcatMap
, A 3 "bla" -- primConcat
, unsafePerformIO (do { putChar 'a'; putChar 'b' }) -- primBindIO
)
| 434
|
main :: ([Int], [Int], Int, Int, [Int], A, ())
main = -- primUnsafePerformIO, primPutStrLn, primShowTuple8 in inserted main
( [1..5] -- primEnum...
, [1,3..10]
, case [1..] of (y:_) -> y
, case [3,5..] of (_:_:y:_) -> y
, [ y | x <- [1..10], x > 5, let { y :: Int; y = x + 1 }] -- primConcatMap
, A 3 "bla" -- primConcat
, unsafePerformIO (do { putChar 'a'; putChar 'b' }) -- primBindIO
)
| 434
|
main = -- primUnsafePerformIO, primPutStrLn, primShowTuple8 in inserted main
( [1..5] -- primEnum...
, [1,3..10]
, case [1..] of (y:_) -> y
, case [3,5..] of (_:_:y:_) -> y
, [ y | x <- [1..10], x > 5, let { y :: Int; y = x + 1 }] -- primConcatMap
, A 3 "bla" -- primConcat
, unsafePerformIO (do { putChar 'a'; putChar 'b' }) -- primBindIO
)
| 387
| false
| true
| 0
| 12
| 124
| 205
| 120
| 85
| null | null |
balangs/eTeak
|
aschem/Picture.hs
|
bsd-3-clause
|
aboutFace OrientS = OrientN
| 27
|
aboutFace OrientS = OrientN
| 27
|
aboutFace OrientS = OrientN
| 27
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
olsner/ghc
|
compiler/basicTypes/Unique.hs
|
bsd-3-clause
|
-- The "tyvar uniques" print specially nicely: a, b, c, etc.
-- See pprUnique for details
initTyVarUnique :: Unique
initTyVarUnique = mkUnique 't' 0
| 149
|
initTyVarUnique :: Unique
initTyVarUnique = mkUnique 't' 0
| 58
|
initTyVarUnique = mkUnique 't' 0
| 32
| true
| true
| 0
| 5
| 24
| 18
| 10
| 8
| null | null |
tonicebrian/tetris-haskell
|
src/Main.hs
|
gpl-3.0
|
setBluishEvenLighter = setSourceRGB (145/256) (196/256) (196/256)
| 65
|
setBluishEvenLighter = setSourceRGB (145/256) (196/256) (196/256)
| 65
|
setBluishEvenLighter = setSourceRGB (145/256) (196/256) (196/256)
| 65
| false
| false
| 0
| 7
| 5
| 34
| 18
| 16
| null | null |
erikd/yesod
|
yesod/Yesod/Default/Config2.hs
|
mit
|
makeYesodLogger :: LoggerSet -> IO Logger
makeYesodLogger loggerSet' = do
(getter, _) <- clockDateCacher
return $! Yesod.Core.Types.Logger loggerSet' getter
| 164
|
makeYesodLogger :: LoggerSet -> IO Logger
makeYesodLogger loggerSet' = do
(getter, _) <- clockDateCacher
return $! Yesod.Core.Types.Logger loggerSet' getter
| 164
|
makeYesodLogger loggerSet' = do
(getter, _) <- clockDateCacher
return $! Yesod.Core.Types.Logger loggerSet' getter
| 122
| false
| true
| 0
| 9
| 26
| 50
| 25
| 25
| null | null |
Cahu/krpc-hs
|
src/KRPCHS/SpaceCenter.hs
|
gpl-3.0
|
getAntennaPacketResourceCostStream :: KRPCHS.SpaceCenter.Antenna -> RPCContext (KRPCStream (Double))
getAntennaPacketResourceCostStream thisArg = requestStream $ getAntennaPacketResourceCostStreamReq thisArg
| 207
|
getAntennaPacketResourceCostStream :: KRPCHS.SpaceCenter.Antenna -> RPCContext (KRPCStream (Double))
getAntennaPacketResourceCostStream thisArg = requestStream $ getAntennaPacketResourceCostStreamReq thisArg
| 207
|
getAntennaPacketResourceCostStream thisArg = requestStream $ getAntennaPacketResourceCostStreamReq thisArg
| 106
| false
| true
| 0
| 9
| 13
| 40
| 20
| 20
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/HsSyn/HsUtils.hs
|
bsd-3-clause
|
mkRecStmt :: [LStmtLR idL RdrName bodyR] -> StmtLR idL RdrName bodyR
mkHsIntegral i = OverLit (HsIntegral i) noRebindableInfo noSyntaxExpr
| 154
|
mkRecStmt :: [LStmtLR idL RdrName bodyR] -> StmtLR idL RdrName bodyR
mkHsIntegral i = OverLit (HsIntegral i) noRebindableInfo noSyntaxExpr
| 152
|
mkHsIntegral i = OverLit (HsIntegral i) noRebindableInfo noSyntaxExpr
| 80
| false
| true
| 0
| 8
| 34
| 53
| 24
| 29
| null | null |
leksah/yi
|
src/library/Yi/Buffer/HighLevel.hs
|
gpl-2.0
|
moveToSol :: BufferM ()
moveToSol = maybeMoveB Line Backward
| 60
|
moveToSol :: BufferM ()
moveToSol = maybeMoveB Line Backward
| 60
|
moveToSol = maybeMoveB Line Backward
| 36
| false
| true
| 0
| 6
| 8
| 21
| 10
| 11
| null | null |
robertclancy/tapl
|
arith/ArithParser.hs
|
gpl-2.0
|
fls :: Parser Term
fls = string "#f" >> return Fls
| 50
|
fls :: Parser Term
fls = string "#f" >> return Fls
| 50
|
fls = string "#f" >> return Fls
| 31
| false
| true
| 2
| 6
| 10
| 31
| 12
| 19
| null | null |
spl/emgm
|
src/Generics/EMGM/Functions/Everywhere.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- Generic instance declaration
--------------------------------------------------------------------------------
rsumEverywhere' :: Everywhere' a b1 -> Everywhere' a b2 -> (a -> a) -> (b1 :+: b2) -> b1 :+: b2
rsumEverywhere' ra _ f (L a) = L (selEverywhere' ra f a)
| 348
|
rsumEverywhere' :: Everywhere' a b1 -> Everywhere' a b2 -> (a -> a) -> (b1 :+: b2) -> b1 :+: b2
rsumEverywhere' ra _ f (L a) = L (selEverywhere' ra f a)
| 153
|
rsumEverywhere' ra _ f (L a) = L (selEverywhere' ra f a)
| 57
| true
| true
| 0
| 13
| 40
| 91
| 45
| 46
| null | null |
ktvoelker/KB
|
clay/Colors.hs
|
gpl-3.0
|
midLightMain :: Color
midLightMain = "#DDDDDD"
| 46
|
midLightMain :: Color
midLightMain = "#DDDDDD"
| 46
|
midLightMain = "#DDDDDD"
| 24
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
jvilar/hrows
|
lib/GUI/Update.hs
|
gpl-2.0
|
showIteration (ShowSources srcs) = \control -> showSources (dialogManager control) srcs (window $ mainWindow control)
| 117
|
showIteration (ShowSources srcs) = \control -> showSources (dialogManager control) srcs (window $ mainWindow control)
| 117
|
showIteration (ShowSources srcs) = \control -> showSources (dialogManager control) srcs (window $ mainWindow control)
| 117
| false
| false
| 0
| 9
| 13
| 44
| 21
| 23
| null | null |
danieldk/alpino-tools
|
src/Data/Alpino/Model/Conduit.hs
|
apache-2.0
|
concat :: Monad m => Conduit [a] m a
concat =
conduitState
()
(\_ v -> return $ StateProducing () v)
(\_ -> return [])
| 134
|
concat :: Monad m => Conduit [a] m a
concat =
conduitState
()
(\_ v -> return $ StateProducing () v)
(\_ -> return [])
| 134
|
concat =
conduitState
()
(\_ v -> return $ StateProducing () v)
(\_ -> return [])
| 97
| false
| true
| 0
| 9
| 40
| 73
| 36
| 37
| null | null |
saxsoares/PARADIGMAS
|
HASKELL/teste.hs
|
gpl-2.0
|
|otherwise = dadosdemaior(index - 1)
| 36
|
|otherwise = dadosdemaior(index - 1)
| 36
|
|otherwise = dadosdemaior(index - 1)
| 36
| false
| false
| 1
| 7
| 4
| 18
| 9
| 9
| null | null |
holoed/GHCJS-rxjs
|
RxJS/Tests.hs
|
apache-2.0
|
sample2 :: IO Disposable
sample2 = (range 0 10) |> subscribe (\x -> print (x::Int))
| 83
|
sample2 :: IO Disposable
sample2 = (range 0 10) |> subscribe (\x -> print (x::Int))
| 83
|
sample2 = (range 0 10) |> subscribe (\x -> print (x::Int))
| 58
| false
| true
| 2
| 7
| 14
| 52
| 26
| 26
| null | null |
andyarvanitis/Idris-dev
|
src/IRTS/Bytecode.hs
|
bsd-3-clause
|
assign r1 r2 | r1 == r2 = []
| otherwise = [ASSIGN r1 r2]
| 70
|
assign r1 r2 | r1 == r2 = []
| otherwise = [ASSIGN r1 r2]
| 70
|
assign r1 r2 | r1 == r2 = []
| otherwise = [ASSIGN r1 r2]
| 70
| false
| false
| 0
| 8
| 27
| 40
| 18
| 22
| null | null |
noschinl/cyp
|
src/Test/Info2/Cyp/Env.hs
|
mit
|
generalizeEnvProp :: Env -> Prop -> Prop
generalizeEnvProp env = generalizeExceptProp (M.toList (fixes env))
| 108
|
generalizeEnvProp :: Env -> Prop -> Prop
generalizeEnvProp env = generalizeExceptProp (M.toList (fixes env))
| 108
|
generalizeEnvProp env = generalizeExceptProp (M.toList (fixes env))
| 67
| false
| true
| 0
| 9
| 13
| 39
| 19
| 20
| null | null |
alephcloud/hs-aws-general
|
tests/SignatureV4.hs
|
mit
|
-- ** Test Methods
testCanonicalRequest
:: String
-> TestRequest
-> EitherT String IO CanonicalRequest
testCanonicalRequest name r = do
creq_ <- liftIO $ readFileNormalized f
if creq == creq_
then return result
else left $ "test " <> name <> " failed to compute canonical request: "
<> "\n expected:" <> show creq_
<> "\n computed:" <> show creq
where
f = testFileBase name <> ".creq"
result@(CanonicalRequest creq) = canonicalRequest
(testRequestMethod r)
(testRequestPath r)
(testRequestQuery r)
(testRequestHeaders r)
(testRequestPayload r)
| 640
|
testCanonicalRequest
:: String
-> TestRequest
-> EitherT String IO CanonicalRequest
testCanonicalRequest name r = do
creq_ <- liftIO $ readFileNormalized f
if creq == creq_
then return result
else left $ "test " <> name <> " failed to compute canonical request: "
<> "\n expected:" <> show creq_
<> "\n computed:" <> show creq
where
f = testFileBase name <> ".creq"
result@(CanonicalRequest creq) = canonicalRequest
(testRequestMethod r)
(testRequestPath r)
(testRequestQuery r)
(testRequestHeaders r)
(testRequestPayload r)
| 620
|
testCanonicalRequest name r = do
creq_ <- liftIO $ readFileNormalized f
if creq == creq_
then return result
else left $ "test " <> name <> " failed to compute canonical request: "
<> "\n expected:" <> show creq_
<> "\n computed:" <> show creq
where
f = testFileBase name <> ".creq"
result@(CanonicalRequest creq) = canonicalRequest
(testRequestMethod r)
(testRequestPath r)
(testRequestQuery r)
(testRequestHeaders r)
(testRequestPayload r)
| 524
| true
| true
| 2
| 14
| 176
| 185
| 83
| 102
| null | null |
bgamari/pandoc
|
src/Text/Pandoc/Readers/Markdown.hs
|
gpl-2.0
|
isHruleChar '-' = True
| 22
|
isHruleChar '-' = True
| 22
|
isHruleChar '-' = True
| 22
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
GaloisInc/halvm-ghc
|
compiler/iface/IfaceType.hs
|
bsd-3-clause
|
pprIfaceTypeApp :: IfaceTyCon -> IfaceTcArgs -> SDoc
pprIfaceTypeApp tc args = sdocWithDynFlags (pprTyTcApp TopPrec tc args)
| 124
|
pprIfaceTypeApp :: IfaceTyCon -> IfaceTcArgs -> SDoc
pprIfaceTypeApp tc args = sdocWithDynFlags (pprTyTcApp TopPrec tc args)
| 124
|
pprIfaceTypeApp tc args = sdocWithDynFlags (pprTyTcApp TopPrec tc args)
| 71
| false
| true
| 0
| 7
| 15
| 37
| 18
| 19
| null | null |
clample/lamdabtc
|
backend/src/Protocol/Server.hs
|
bsd-3-clause
|
execConnProd (Context c) = execContext c
| 40
|
execConnProd (Context c) = execContext c
| 40
|
execConnProd (Context c) = execContext c
| 40
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/ExtensionPredicates.hs
|
bsd-3-clause
|
-- | Is the <https://www.opengl.org/registry/specs/EXT/draw_range_elements.txt EXT_draw_range_elements> extension supported?
-- Note that in the presence of multiple contexts with different capabilities,
-- this might be wrong. Use 'glGetEXTDrawRangeElements' in those cases instead.
gl_EXT_draw_range_elements :: Bool
gl_EXT_draw_range_elements = member "GL_EXT_draw_range_elements" extensions
| 394
|
gl_EXT_draw_range_elements :: Bool
gl_EXT_draw_range_elements = member "GL_EXT_draw_range_elements" extensions
| 110
|
gl_EXT_draw_range_elements = member "GL_EXT_draw_range_elements" extensions
| 75
| true
| true
| 0
| 5
| 38
| 19
| 11
| 8
| null | null |
Chrisr850/Villefort
|
src/Villefort/Weekly.hs
|
bsd-3-clause
|
firstSecond :: [[String]] -> [[String]]
firstSecond (x:y:xs) = [(x ++ [(y !! 1)])] ++ firstSecond xs
| 100
|
firstSecond :: [[String]] -> [[String]]
firstSecond (x:y:xs) = [(x ++ [(y !! 1)])] ++ firstSecond xs
| 100
|
firstSecond (x:y:xs) = [(x ++ [(y !! 1)])] ++ firstSecond xs
| 60
| false
| true
| 0
| 11
| 15
| 68
| 38
| 30
| null | null |
christiaanb/clash
|
clash/CLasH/Utils/GhcTools.hs
|
bsd-3-clause
|
findAnns ::
Monad m =>
(Var.Var -> m [CLasHAnn])
-> HscTypes.CoreModule
-> m [CLasHAnn]
findAnns criteria core = do
let binds = CoreSyn.flattenBinds $ HscTypes.cm_binds core
anns <- Monad.mapM (criteria . fst) binds
case anns of
[] -> return []
xs -> return $ concat xs
-- | Find a binder in module according to a certain criteria
| 353
|
findAnns ::
Monad m =>
(Var.Var -> m [CLasHAnn])
-> HscTypes.CoreModule
-> m [CLasHAnn]
findAnns criteria core = do
let binds = CoreSyn.flattenBinds $ HscTypes.cm_binds core
anns <- Monad.mapM (criteria . fst) binds
case anns of
[] -> return []
xs -> return $ concat xs
-- | Find a binder in module according to a certain criteria
| 353
|
findAnns criteria core = do
let binds = CoreSyn.flattenBinds $ HscTypes.cm_binds core
anns <- Monad.mapM (criteria . fst) binds
case anns of
[] -> return []
xs -> return $ concat xs
-- | Find a binder in module according to a certain criteria
| 257
| false
| true
| 0
| 12
| 80
| 130
| 62
| 68
| null | null |
adz/real_world_haskell
|
ch03/BookStore.hs
|
mit
|
customer2 = Customer {
customerID = 271828
, customerAddress = ["1048576 Disk Drive",
"Milpitas, CA 95134",
"USA"]
, customerName = "Jane Q. Citizen"
}
| 267
|
customer2 = Customer {
customerID = 271828
, customerAddress = ["1048576 Disk Drive",
"Milpitas, CA 95134",
"USA"]
, customerName = "Jane Q. Citizen"
}
| 267
|
customer2 = Customer {
customerID = 271828
, customerAddress = ["1048576 Disk Drive",
"Milpitas, CA 95134",
"USA"]
, customerName = "Jane Q. Citizen"
}
| 267
| false
| false
| 1
| 8
| 139
| 42
| 23
| 19
| null | null |
iatorm/grime
|
Parser.hs
|
mit
|
numRange2D :: Int -> Parsec String () (Range, Range)
numRange2D m = do
xRange <- numRange 0
maybeYRange <- optionMaybe $ char ',' >> numRange 0
return $ case maybeYRange of
Nothing -> (xRange, xRange)
Just yRange -> (xRange, yRange)
-- Parse a size constraint
| 274
|
numRange2D :: Int -> Parsec String () (Range, Range)
numRange2D m = do
xRange <- numRange 0
maybeYRange <- optionMaybe $ char ',' >> numRange 0
return $ case maybeYRange of
Nothing -> (xRange, xRange)
Just yRange -> (xRange, yRange)
-- Parse a size constraint
| 274
|
numRange2D m = do
xRange <- numRange 0
maybeYRange <- optionMaybe $ char ',' >> numRange 0
return $ case maybeYRange of
Nothing -> (xRange, xRange)
Just yRange -> (xRange, yRange)
-- Parse a size constraint
| 221
| false
| true
| 0
| 11
| 59
| 103
| 51
| 52
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/basicTypes/OccName.hs
|
bsd-3-clause
|
-- Haskell-source data constructors should be
-- in the Data name space
tvName = TvName
| 117
|
tvName = TvName
| 20
|
tvName = TvName
| 20
| true
| false
| 1
| 5
| 44
| 12
| 5
| 7
| null | null |
sdiehl/ghc
|
compiler/types/OptCoercion.hs
|
bsd-3-clause
|
opt_transList :: InScopeSet -> [NormalCo] -> [NormalCo] -> [NormalCo]
opt_transList is = zipWith (opt_trans is)
| 111
|
opt_transList :: InScopeSet -> [NormalCo] -> [NormalCo] -> [NormalCo]
opt_transList is = zipWith (opt_trans is)
| 111
|
opt_transList is = zipWith (opt_trans is)
| 41
| false
| true
| 0
| 8
| 14
| 44
| 23
| 21
| null | null |
manyoo/Morakot
|
Handler.hs
|
bsd-3-clause
|
fileRetriever :: Handler
fileRetriever conf req resp = do
let filePath = handleReqURI conf $ reqURI req
fExists <- liftIO $ doesFileExist filePath
case fExists of
True -> do (fLength, modTime, body) <- liftIO $ getFile filePath
let cType = getFileType conf filePath
return $ addHeaders resp{ statusCode = SC200, respBody = Just body}
[contentLengthHeader fLength,
contentTypeHeader cType,
lastModHeader modTime]
False -> sendThisResponse $ addHeaders resp{ statusCode = SC404 , respBody = Just body }
[contentLengthHeader fLength,
contentTypeHeader cType]
where (body, cType, fLength) = fileNotFoundPage
-------- helper functions for file retrieve ----------------
| 874
|
fileRetriever :: Handler
fileRetriever conf req resp = do
let filePath = handleReqURI conf $ reqURI req
fExists <- liftIO $ doesFileExist filePath
case fExists of
True -> do (fLength, modTime, body) <- liftIO $ getFile filePath
let cType = getFileType conf filePath
return $ addHeaders resp{ statusCode = SC200, respBody = Just body}
[contentLengthHeader fLength,
contentTypeHeader cType,
lastModHeader modTime]
False -> sendThisResponse $ addHeaders resp{ statusCode = SC404 , respBody = Just body }
[contentLengthHeader fLength,
contentTypeHeader cType]
where (body, cType, fLength) = fileNotFoundPage
-------- helper functions for file retrieve ----------------
| 874
|
fileRetriever conf req resp = do
let filePath = handleReqURI conf $ reqURI req
fExists <- liftIO $ doesFileExist filePath
case fExists of
True -> do (fLength, modTime, body) <- liftIO $ getFile filePath
let cType = getFileType conf filePath
return $ addHeaders resp{ statusCode = SC200, respBody = Just body}
[contentLengthHeader fLength,
contentTypeHeader cType,
lastModHeader modTime]
False -> sendThisResponse $ addHeaders resp{ statusCode = SC404 , respBody = Just body }
[contentLengthHeader fLength,
contentTypeHeader cType]
where (body, cType, fLength) = fileNotFoundPage
-------- helper functions for file retrieve ----------------
| 849
| false
| true
| 0
| 16
| 301
| 210
| 105
| 105
| null | null |
rueshyna/gogol
|
gogol-compute/gen/Network/Google/Compute/Types/Product.hs
|
mpl-2.0
|
-- | [Output Only] Type of the resource. Always compute#address for
-- addresses.
aKind :: Lens' Address Text
aKind = lens _aKind (\ s a -> s{_aKind = a})
| 154
|
aKind :: Lens' Address Text
aKind = lens _aKind (\ s a -> s{_aKind = a})
| 72
|
aKind = lens _aKind (\ s a -> s{_aKind = a})
| 44
| true
| true
| 0
| 9
| 28
| 48
| 24
| 24
| null | null |
beni55/fay
|
src/Fay/Compiler/Desugar.hs
|
bsd-3-clause
|
checkEnum :: (Data l, Typeable l) => Module l -> Desugar l ()
checkEnum = mapM_ f . universeBi
where
f ex = case ex of
e@(EnumFrom _ e1) -> checkIntOrUnknown e [e1]
e@(EnumFromTo _ e1 e2) -> checkIntOrUnknown e [e1,e2]
e@(EnumFromThen _ e1 e2) -> checkIntOrUnknown e [e1,e2]
e@(EnumFromThenTo _ e1 e2 e3) -> checkIntOrUnknown e [e1,e2,e3]
_ -> return ()
checkIntOrUnknown :: Exp l -> [Exp l] -> Desugar l ()
checkIntOrUnknown exp es = unless (any isIntOrUnknown es) (throwError . UnsupportedEnum $ unAnn exp)
isIntOrUnknown :: Exp l -> Bool
isIntOrUnknown e = case e of
Con {} -> False
Lit _ Int{} -> True
Lit {} -> False
Tuple {} -> False
List {} -> False
EnumFrom {} -> False
EnumFromTo {} -> False
EnumFromThen {} -> False
EnumFromThenTo {} -> False
_ -> True
-- | Adds an explicit import Prelude statement when appropriate.
| 1,040
|
checkEnum :: (Data l, Typeable l) => Module l -> Desugar l ()
checkEnum = mapM_ f . universeBi
where
f ex = case ex of
e@(EnumFrom _ e1) -> checkIntOrUnknown e [e1]
e@(EnumFromTo _ e1 e2) -> checkIntOrUnknown e [e1,e2]
e@(EnumFromThen _ e1 e2) -> checkIntOrUnknown e [e1,e2]
e@(EnumFromThenTo _ e1 e2 e3) -> checkIntOrUnknown e [e1,e2,e3]
_ -> return ()
checkIntOrUnknown :: Exp l -> [Exp l] -> Desugar l ()
checkIntOrUnknown exp es = unless (any isIntOrUnknown es) (throwError . UnsupportedEnum $ unAnn exp)
isIntOrUnknown :: Exp l -> Bool
isIntOrUnknown e = case e of
Con {} -> False
Lit _ Int{} -> True
Lit {} -> False
Tuple {} -> False
List {} -> False
EnumFrom {} -> False
EnumFromTo {} -> False
EnumFromThen {} -> False
EnumFromThenTo {} -> False
_ -> True
-- | Adds an explicit import Prelude statement when appropriate.
| 1,040
|
checkEnum = mapM_ f . universeBi
where
f ex = case ex of
e@(EnumFrom _ e1) -> checkIntOrUnknown e [e1]
e@(EnumFromTo _ e1 e2) -> checkIntOrUnknown e [e1,e2]
e@(EnumFromThen _ e1 e2) -> checkIntOrUnknown e [e1,e2]
e@(EnumFromThenTo _ e1 e2 e3) -> checkIntOrUnknown e [e1,e2,e3]
_ -> return ()
checkIntOrUnknown :: Exp l -> [Exp l] -> Desugar l ()
checkIntOrUnknown exp es = unless (any isIntOrUnknown es) (throwError . UnsupportedEnum $ unAnn exp)
isIntOrUnknown :: Exp l -> Bool
isIntOrUnknown e = case e of
Con {} -> False
Lit _ Int{} -> True
Lit {} -> False
Tuple {} -> False
List {} -> False
EnumFrom {} -> False
EnumFromTo {} -> False
EnumFromThen {} -> False
EnumFromThenTo {} -> False
_ -> True
-- | Adds an explicit import Prelude statement when appropriate.
| 978
| false
| true
| 0
| 10
| 361
| 385
| 194
| 191
| null | null |
zachsully/hakaru
|
haskell/Language/Hakaru/CodeGen/Flatten.hs
|
bsd-3-clause
|
logSumExpCG :: S.Seq CExpr -> (CExpr -> CodeGen ())
logSumExpCG seqE =
let size = S.length $ seqE
name = "logSumExp" ++ (show size)
funcId = Ident name
in \loc -> do -- reset the names so that the function is the same for each arity
let argIds = fmap Ident (take size cNameStream)
decls = fmap (typeDeclaration SProb) argIds
vars = fmap CVar argIds
funCG [CDouble] funcId decls
(putStat . CReturn . Just . logSumExp . S.fromList $ vars)
putExprStat $ loc .=. (CCall (CVar funcId) (F.toList seqE))
-------------------------------------
-- LogSumExp for Summation of Prob --
-------------------------------------
{-
For summation of SProb we need a new logSumExp function that will find the max
of an array and then sum it in a loop
-}
| 809
|
logSumExpCG :: S.Seq CExpr -> (CExpr -> CodeGen ())
logSumExpCG seqE =
let size = S.length $ seqE
name = "logSumExp" ++ (show size)
funcId = Ident name
in \loc -> do -- reset the names so that the function is the same for each arity
let argIds = fmap Ident (take size cNameStream)
decls = fmap (typeDeclaration SProb) argIds
vars = fmap CVar argIds
funCG [CDouble] funcId decls
(putStat . CReturn . Just . logSumExp . S.fromList $ vars)
putExprStat $ loc .=. (CCall (CVar funcId) (F.toList seqE))
-------------------------------------
-- LogSumExp for Summation of Prob --
-------------------------------------
{-
For summation of SProb we need a new logSumExp function that will find the max
of an array and then sum it in a loop
-}
| 809
|
logSumExpCG seqE =
let size = S.length $ seqE
name = "logSumExp" ++ (show size)
funcId = Ident name
in \loc -> do -- reset the names so that the function is the same for each arity
let argIds = fmap Ident (take size cNameStream)
decls = fmap (typeDeclaration SProb) argIds
vars = fmap CVar argIds
funCG [CDouble] funcId decls
(putStat . CReturn . Just . logSumExp . S.fromList $ vars)
putExprStat $ loc .=. (CCall (CVar funcId) (F.toList seqE))
-------------------------------------
-- LogSumExp for Summation of Prob --
-------------------------------------
{-
For summation of SProb we need a new logSumExp function that will find the max
of an array and then sum it in a loop
-}
| 757
| false
| true
| 0
| 16
| 200
| 206
| 104
| 102
| null | null |
twittner/zeromq-haskell
|
src/System/ZMQ4/Internal.hs
|
mit
|
messageClose :: Message -> IO ()
messageClose (Message ptr) = do
throwIfMinus1_ "messageClose" $ c_zmq_msg_close ptr
free ptr
| 133
|
messageClose :: Message -> IO ()
messageClose (Message ptr) = do
throwIfMinus1_ "messageClose" $ c_zmq_msg_close ptr
free ptr
| 133
|
messageClose (Message ptr) = do
throwIfMinus1_ "messageClose" $ c_zmq_msg_close ptr
free ptr
| 100
| false
| true
| 0
| 8
| 25
| 48
| 21
| 27
| null | null |
dbp/heist-async
|
Heist/Splices/Async.hs
|
bsd-3-clause
|
divAsync :: Monad m => Splice m
divAsync = do
node <- getParamNode
let name = fromMaybe "undefined" $ X.getAttribute "name" node
return [X.setAttribute "data-splice-name" name $ X.Element "div" (filter ((/= "name").fst) $ X.elementAttrs node) (X.elementChildren node)]
-- | a special div-async that instead of replacing the corresponding one on the page, it appends it's contents inside the existing div-async-append. Note: div-async's and div-async-appends are not interchangeable. This is so that it is easy to see what is going to happen from looking at the templates. If you need this sort of behavior, wrap you div-async-append inside a div-async.
| 659
|
divAsync :: Monad m => Splice m
divAsync = do
node <- getParamNode
let name = fromMaybe "undefined" $ X.getAttribute "name" node
return [X.setAttribute "data-splice-name" name $ X.Element "div" (filter ((/= "name").fst) $ X.elementAttrs node) (X.elementChildren node)]
-- | a special div-async that instead of replacing the corresponding one on the page, it appends it's contents inside the existing div-async-append. Note: div-async's and div-async-appends are not interchangeable. This is so that it is easy to see what is going to happen from looking at the templates. If you need this sort of behavior, wrap you div-async-append inside a div-async.
| 659
|
divAsync = do
node <- getParamNode
let name = fromMaybe "undefined" $ X.getAttribute "name" node
return [X.setAttribute "data-splice-name" name $ X.Element "div" (filter ((/= "name").fst) $ X.elementAttrs node) (X.elementChildren node)]
-- | a special div-async that instead of replacing the corresponding one on the page, it appends it's contents inside the existing div-async-append. Note: div-async's and div-async-appends are not interchangeable. This is so that it is easy to see what is going to happen from looking at the templates. If you need this sort of behavior, wrap you div-async-append inside a div-async.
| 627
| false
| true
| 0
| 16
| 105
| 113
| 54
| 59
| null | null |
uuhan/Idris-dev
|
src/Idris/Core/ProofTerm.hs
|
bsd-3-clause
|
updateSolvedPath ns (InScope n (Hole ty) t)
| Just v <- lookup n ns = case ns of
[_] -> updateSolvedPath [(n,v)] t
_ -> updateSolvedPath ns $
updateSolvedPath [(n,v)] t
| 280
|
updateSolvedPath ns (InScope n (Hole ty) t)
| Just v <- lookup n ns = case ns of
[_] -> updateSolvedPath [(n,v)] t
_ -> updateSolvedPath ns $
updateSolvedPath [(n,v)] t
| 280
|
updateSolvedPath ns (InScope n (Hole ty) t)
| Just v <- lookup n ns = case ns of
[_] -> updateSolvedPath [(n,v)] t
_ -> updateSolvedPath ns $
updateSolvedPath [(n,v)] t
| 280
| false
| false
| 0
| 12
| 142
| 99
| 49
| 50
| null | null |
hferreiro/replay
|
compiler/cmm/PprC.hs
|
bsd-3-clause
|
pprExternDecl :: Bool -> CLabel -> SDoc
pprExternDecl _in_srt lbl
-- do not print anything for "known external" things
| not (needsCDecl lbl) = empty
| Just sz <- foreignLabelStdcallInfo lbl = stdcall_decl sz
| otherwise =
hcat [ visibility, label_type lbl,
lparen, ppr lbl, text ");" ]
where
label_type lbl | isCFunctionLabel lbl = ptext (sLit "F_")
| otherwise = ptext (sLit "I_")
visibility
| externallyVisibleCLabel lbl = char 'E'
| otherwise = char 'I'
-- If the label we want to refer to is a stdcall function (on Windows) then
-- we must generate an appropriate prototype for it, so that the C compiler will
-- add the @n suffix to the label (#2276)
stdcall_decl sz = sdocWithDynFlags $ \dflags ->
ptext (sLit "extern __attribute__((stdcall)) void ") <> ppr lbl
<> parens (commafy (replicate (sz `quot` wORD_SIZE dflags) (machRep_U_CType (wordWidth dflags))))
<> semi
| 1,000
|
pprExternDecl :: Bool -> CLabel -> SDoc
pprExternDecl _in_srt lbl
-- do not print anything for "known external" things
| not (needsCDecl lbl) = empty
| Just sz <- foreignLabelStdcallInfo lbl = stdcall_decl sz
| otherwise =
hcat [ visibility, label_type lbl,
lparen, ppr lbl, text ");" ]
where
label_type lbl | isCFunctionLabel lbl = ptext (sLit "F_")
| otherwise = ptext (sLit "I_")
visibility
| externallyVisibleCLabel lbl = char 'E'
| otherwise = char 'I'
-- If the label we want to refer to is a stdcall function (on Windows) then
-- we must generate an appropriate prototype for it, so that the C compiler will
-- add the @n suffix to the label (#2276)
stdcall_decl sz = sdocWithDynFlags $ \dflags ->
ptext (sLit "extern __attribute__((stdcall)) void ") <> ppr lbl
<> parens (commafy (replicate (sz `quot` wORD_SIZE dflags) (machRep_U_CType (wordWidth dflags))))
<> semi
| 1,000
|
pprExternDecl _in_srt lbl
-- do not print anything for "known external" things
| not (needsCDecl lbl) = empty
| Just sz <- foreignLabelStdcallInfo lbl = stdcall_decl sz
| otherwise =
hcat [ visibility, label_type lbl,
lparen, ppr lbl, text ");" ]
where
label_type lbl | isCFunctionLabel lbl = ptext (sLit "F_")
| otherwise = ptext (sLit "I_")
visibility
| externallyVisibleCLabel lbl = char 'E'
| otherwise = char 'I'
-- If the label we want to refer to is a stdcall function (on Windows) then
-- we must generate an appropriate prototype for it, so that the C compiler will
-- add the @n suffix to the label (#2276)
stdcall_decl sz = sdocWithDynFlags $ \dflags ->
ptext (sLit "extern __attribute__((stdcall)) void ") <> ppr lbl
<> parens (commafy (replicate (sz `quot` wORD_SIZE dflags) (machRep_U_CType (wordWidth dflags))))
<> semi
| 960
| false
| true
| 9
| 12
| 270
| 277
| 127
| 150
| null | null |
TikhonJelvis/array-forth
|
test/Language/ArrayForth/Test.hs
|
gpl-3.0
|
case_unext = do let ?res = run ". . unext ."
1 @=? p
unchanged [a, b, r, s, t]
| 110
|
case_unext = do let ?res = run ". . unext ."
1 @=? p
unchanged [a, b, r, s, t]
| 110
|
case_unext = do let ?res = run ". . unext ."
1 @=? p
unchanged [a, b, r, s, t]
| 110
| false
| false
| 0
| 10
| 51
| 46
| 23
| 23
| null | null |
kazu-yamamoto/dns
|
internal/Network/DNS/Types/Internal.hs
|
bsd-3-clause
|
-- | Convert a 16-bit DNS OPCODE number to its internal representation
--
toOPCODE :: Word16 -> Maybe OPCODE
toOPCODE i = case i of
0 -> Just OP_STD
1 -> Just OP_INV
2 -> Just OP_SSR
-- OPCODE 3 is unassigned
4 -> Just OP_NOTIFY
5 -> Just OP_UPDATE
_ -> Nothing
-- | Convert the internal representation of a DNS OPCODE to its 16-bit numeric
-- value.
--
| 368
|
toOPCODE :: Word16 -> Maybe OPCODE
toOPCODE i = case i of
0 -> Just OP_STD
1 -> Just OP_INV
2 -> Just OP_SSR
-- OPCODE 3 is unassigned
4 -> Just OP_NOTIFY
5 -> Just OP_UPDATE
_ -> Nothing
-- | Convert the internal representation of a DNS OPCODE to its 16-bit numeric
-- value.
--
| 294
|
toOPCODE i = case i of
0 -> Just OP_STD
1 -> Just OP_INV
2 -> Just OP_SSR
-- OPCODE 3 is unassigned
4 -> Just OP_NOTIFY
5 -> Just OP_UPDATE
_ -> Nothing
-- | Convert the internal representation of a DNS OPCODE to its 16-bit numeric
-- value.
--
| 259
| true
| true
| 0
| 8
| 84
| 87
| 42
| 45
| null | null |
ChristopherKing42/tagsoup
|
Text/HTML/TagSoup.hs
|
bsd-3-clause
|
-- | This function takes a list, and returns all suffixes whose
-- first item matches the predicate.
sections :: (a -> Bool) -> [a] -> [[a]]
sections p = filter (p . head) . init . tails
| 188
|
sections :: (a -> Bool) -> [a] -> [[a]]
sections p = filter (p . head) . init . tails
| 85
|
sections p = filter (p . head) . init . tails
| 45
| true
| true
| 0
| 9
| 39
| 58
| 32
| 26
| null | null |
Erdwolf/autotool-bonn
|
src/Prolog/Programming/Central.hs
|
gpl-2.0
|
{-
resolveTerm p q = do
us <- resolve p [q]
return $ removeUnresolvedVariables $ map (flip apply q) us
where
removeUnresolvedVariables = filter $ (not.) $ everything (||) $ mkQ False $ \(VariableName i _) -> i /= 0
-}
{- Config parser -}
parseConfig = parse configuration "(config)"
| 293
|
parseConfig = parse configuration "(config)"
| 44
|
parseConfig = parse configuration "(config)"
| 44
| true
| false
| 1
| 5
| 60
| 17
| 7
| 10
| null | null |
netom/hamloghs
|
src/HlOptions.hs
|
mit
|
apParseFlExp :: AP.Parser FlExp
apParseFlExp
= ( FlGte <$> apParseTagName <*> ( (AP.string ">=") >> apParseFlValue ) )
<|> ( FlGt <$> apParseTagName <*> ( (AP.string ">" ) >> apParseFlValue ) )
<|> ( FlLte <$> apParseTagName <*> ( (AP.string "<=") >> apParseFlValue ) )
<|> ( FlLt <$> apParseTagName <*> ( (AP.string "<" ) >> apParseFlValue ) )
<|> ( FlReg <$> apParseTagName <*> ( (AP.string "=~") >> (apParseFlValue >>= runEither . compile defaultCompOpt defaultExecOpt) ) )
<|> ( FlEq <$> apParseTagName <*> ( (AP.string "=" ) >> apParseFlValue ) )
<|> ( FlNeq <$> apParseTagName <*> ( (AP.string "!=") >> apParseFlValue ) )
<|> ( AP.string "*" >> FlEx <$> apParseTagName )
| 713
|
apParseFlExp :: AP.Parser FlExp
apParseFlExp
= ( FlGte <$> apParseTagName <*> ( (AP.string ">=") >> apParseFlValue ) )
<|> ( FlGt <$> apParseTagName <*> ( (AP.string ">" ) >> apParseFlValue ) )
<|> ( FlLte <$> apParseTagName <*> ( (AP.string "<=") >> apParseFlValue ) )
<|> ( FlLt <$> apParseTagName <*> ( (AP.string "<" ) >> apParseFlValue ) )
<|> ( FlReg <$> apParseTagName <*> ( (AP.string "=~") >> (apParseFlValue >>= runEither . compile defaultCompOpt defaultExecOpt) ) )
<|> ( FlEq <$> apParseTagName <*> ( (AP.string "=" ) >> apParseFlValue ) )
<|> ( FlNeq <$> apParseTagName <*> ( (AP.string "!=") >> apParseFlValue ) )
<|> ( AP.string "*" >> FlEx <$> apParseTagName )
| 713
|
apParseFlExp
= ( FlGte <$> apParseTagName <*> ( (AP.string ">=") >> apParseFlValue ) )
<|> ( FlGt <$> apParseTagName <*> ( (AP.string ">" ) >> apParseFlValue ) )
<|> ( FlLte <$> apParseTagName <*> ( (AP.string "<=") >> apParseFlValue ) )
<|> ( FlLt <$> apParseTagName <*> ( (AP.string "<" ) >> apParseFlValue ) )
<|> ( FlReg <$> apParseTagName <*> ( (AP.string "=~") >> (apParseFlValue >>= runEither . compile defaultCompOpt defaultExecOpt) ) )
<|> ( FlEq <$> apParseTagName <*> ( (AP.string "=" ) >> apParseFlValue ) )
<|> ( FlNeq <$> apParseTagName <*> ( (AP.string "!=") >> apParseFlValue ) )
<|> ( AP.string "*" >> FlEx <$> apParseTagName )
| 681
| false
| true
| 21
| 11
| 150
| 280
| 150
| 130
| null | null |
LambdaHack/LambdaHack
|
engine-src/Game/LambdaHack/Common/PointArray.hs
|
bsd-3-clause
|
ifoldrA' f z0 Array{..} =
U.ifoldr' (\n c a -> f (toEnum n) (fromUnboxRep c) a) z0 avector
| 92
|
ifoldrA' f z0 Array{..} =
U.ifoldr' (\n c a -> f (toEnum n) (fromUnboxRep c) a) z0 avector
| 92
|
ifoldrA' f z0 Array{..} =
U.ifoldr' (\n c a -> f (toEnum n) (fromUnboxRep c) a) z0 avector
| 92
| false
| false
| 0
| 10
| 19
| 59
| 29
| 30
| null | null |
tavisrudd/ghcjs-base
|
test/Tests/Buffer.hs
|
mit
|
wrapIntoByteString :: IO ()
wrapIntoByteString = do
buf <- fromByteArray `fmap` atoz
BS8.pack ['A'..'Z'] @=? toByteString 0 Nothing buf
BS8.pack ['K'..'Z'] @=? toByteString 10 Nothing buf
BS8.pack ['K'..'O'] @=? toByteString 10 (Just 5) buf
| 248
|
wrapIntoByteString :: IO ()
wrapIntoByteString = do
buf <- fromByteArray `fmap` atoz
BS8.pack ['A'..'Z'] @=? toByteString 0 Nothing buf
BS8.pack ['K'..'Z'] @=? toByteString 10 Nothing buf
BS8.pack ['K'..'O'] @=? toByteString 10 (Just 5) buf
| 248
|
wrapIntoByteString = do
buf <- fromByteArray `fmap` atoz
BS8.pack ['A'..'Z'] @=? toByteString 0 Nothing buf
BS8.pack ['K'..'Z'] @=? toByteString 10 Nothing buf
BS8.pack ['K'..'O'] @=? toByteString 10 (Just 5) buf
| 220
| false
| true
| 0
| 10
| 41
| 107
| 51
| 56
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.