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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
music-suite/music-pitch | src/Music/Pitch/Literal/Pitch.hs | bsd-3-clause | gb = fromPitch $ viaPitchL (4, (-1), 0) | 46 | gb = fromPitch $ viaPitchL (4, (-1), 0) | 46 | gb = fromPitch $ viaPitchL (4, (-1), 0) | 46 | false | false | 0 | 9 | 14 | 27 | 15 | 12 | null | null |
yav/haskell-lexer | Language/Haskell/Lexer/Layout.hs | mit | -- | This is an implementation of Haskell layout, as specified in
-- section 9.3 of the revised Haskell 98 report.
-- This preprocessor inserts the extra \<n\> and {n} tokens.
layoutPre :: [PosToken] -> [PosToken]
layoutPre = indent . open | 239 | layoutPre :: [PosToken] -> [PosToken]
layoutPre = indent . open | 63 | layoutPre = indent . open | 25 | true | true | 0 | 6 | 40 | 28 | 17 | 11 | null | null |
mocnik-science/chorale | src/Chorale/Common.hs | mit | -- --== FUNCTINOS
-- | like 'const' but with 2 arguments
const2 :: a -> b -> c -> a
const2 a _ _ = a | 101 | const2 :: a -> b -> c -> a
const2 a _ _ = a | 43 | const2 a _ _ = a | 16 | true | true | 0 | 7 | 26 | 32 | 17 | 15 | null | null |
hemio-ev/hamsql | src/Database/HamSql/Internal/InquireDeployed.hs | gpl-3.0 | keyQuery :: Query
keyQuery =
[sql|
SELECT
irel.relname AS index_name,
array_agg (a.attname ORDER BY c.ordinality) AS columns
FROM pg_index AS i
JOIN pg_class AS trel ON trel.oid = i.indrelid
JOIN pg_namespace AS tnsp ON trel.relnamespace = tnsp.oid
... | 763 | keyQuery :: Query
keyQuery =
[sql|
SELECT
irel.relname AS index_name,
array_agg (a.attname ORDER BY c.ordinality) AS columns
FROM pg_index AS i
JOIN pg_class AS trel ON trel.oid = i.indrelid
JOIN pg_namespace AS tnsp ON trel.relnamespace = tnsp.oid
... | 763 | keyQuery =
[sql|
SELECT
irel.relname AS index_name,
array_agg (a.attname ORDER BY c.ordinality) AS columns
FROM pg_index AS i
JOIN pg_class AS trel ON trel.oid = i.indrelid
JOIN pg_namespace AS tnsp ON trel.relnamespace = tnsp.oid
JOIN pg_class... | 745 | false | true | 0 | 6 | 262 | 22 | 11 | 11 | null | null |
jvranish/TheExperiment | src/Language/TheExperiment/CodeGen/Gen.hs | bsd-3-clause | genTopLevel (TypeDef { defnPos = pos
, defnNodeData = t
, typeDefName = name } )
= [CDeclExt $ genTypeDef pos name t] | 172 | genTopLevel (TypeDef { defnPos = pos
, defnNodeData = t
, typeDefName = name } )
= [CDeclExt $ genTypeDef pos name t] | 172 | genTopLevel (TypeDef { defnPos = pos
, defnNodeData = t
, typeDefName = name } )
= [CDeclExt $ genTypeDef pos name t] | 172 | false | false | 0 | 8 | 77 | 48 | 26 | 22 | null | null |
GaloisInc/halvm-ghc | compiler/main/HscMain.hs | bsd-3-clause | hscTcRnGetInfo :: HscEnv -> Name -> IO (Maybe (TyThing, Fixity, [ClsInst], [FamInst]))
hscTcRnGetInfo hsc_env0 name
= runInteractiveHsc hsc_env0 $
do { hsc_env <- getHscEnv
; ioMsgMaybe' $ tcRnGetInfo hsc_env name } | 228 | hscTcRnGetInfo :: HscEnv -> Name -> IO (Maybe (TyThing, Fixity, [ClsInst], [FamInst]))
hscTcRnGetInfo hsc_env0 name
= runInteractiveHsc hsc_env0 $
do { hsc_env <- getHscEnv
; ioMsgMaybe' $ tcRnGetInfo hsc_env name } | 228 | hscTcRnGetInfo hsc_env0 name
= runInteractiveHsc hsc_env0 $
do { hsc_env <- getHscEnv
; ioMsgMaybe' $ tcRnGetInfo hsc_env name } | 141 | false | true | 0 | 12 | 43 | 85 | 43 | 42 | null | null |
stappit/fit-parser | library/Types.hs | gpl-3.0 | mkLRB100 :: Word16 -> LeftRightBalance100
mkLRB100 w = LRB100 balance contribX100
where
contribX100 = w .&. 0x3FFF
balance = if w `testBit` 15
then Right
else Unknown | 218 | mkLRB100 :: Word16 -> LeftRightBalance100
mkLRB100 w = LRB100 balance contribX100
where
contribX100 = w .&. 0x3FFF
balance = if w `testBit` 15
then Right
else Unknown | 218 | mkLRB100 w = LRB100 balance contribX100
where
contribX100 = w .&. 0x3FFF
balance = if w `testBit` 15
then Right
else Unknown | 176 | false | true | 0 | 8 | 78 | 53 | 29 | 24 | null | null |
dysinger/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeInstanceStatus.hs | mpl-2.0 | -- | 'DescribeInstanceStatus' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'disDryRun' @::@ 'Maybe' 'Bool'
--
-- * 'disFilters' @::@ ['Filter']
--
-- * 'disIncludeAllInstances' @::@ 'Maybe' 'Bool'
--
-- * 'disInstanceIds' @::@ ['Text']
--
-- * 'disMaxResults' @::@ 'Maybe' 'Int'
--
... | 703 | describeInstanceStatus :: DescribeInstanceStatus
describeInstanceStatus = DescribeInstanceStatus
{ _disDryRun = Nothing
, _disInstanceIds = mempty
, _disFilters = mempty
, _disNextToken = Nothing
, _disMaxResults = Nothing
, _disIncludeAllInsta... | 340 | describeInstanceStatus = DescribeInstanceStatus
{ _disDryRun = Nothing
, _disInstanceIds = mempty
, _disFilters = mempty
, _disNextToken = Nothing
, _disMaxResults = Nothing
, _disIncludeAllInstances = Nothing
} | 291 | true | true | 0 | 7 | 164 | 69 | 48 | 21 | null | null |
alexbiehl/StringMap | tests/StringMapStrict.hs | mit | l4 :: [(String, Attr)]
l4 = fromList' [("a",[1]),("b",[2]),("c",[3]),("a",[2]),("ab",[22]),("a",[3])] | 101 | l4 :: [(String, Attr)]
l4 = fromList' [("a",[1]),("b",[2]),("c",[3]),("a",[2]),("ab",[22]),("a",[3])] | 101 | l4 = fromList' [("a",[1]),("b",[2]),("c",[3]),("a",[2]),("ab",[22]),("a",[3])] | 78 | false | true | 0 | 8 | 7 | 101 | 62 | 39 | null | null |
dbp/hs-stripe | src/Web/Stripe/Client.hs | bsd-3-clause | setUserAgent :: C8.ByteString -> Request -> Request
setUserAgent ua req = req { requestHeaders = ("User-Agent", ua) : filteredHeaders }
where
filteredHeaders = filter ((/= "User-Agent") . fst) $ requestHeaders req
-- | Transforms a 'StripeRequest' into a more general 'URI', which can be used to
-- make an auth... | 432 | setUserAgent :: C8.ByteString -> Request -> Request
setUserAgent ua req = req { requestHeaders = ("User-Agent", ua) : filteredHeaders }
where
filteredHeaders = filter ((/= "User-Agent") . fst) $ requestHeaders req
-- | Transforms a 'StripeRequest' into a more general 'URI', which can be used to
-- make an auth... | 432 | setUserAgent ua req = req { requestHeaders = ("User-Agent", ua) : filteredHeaders }
where
filteredHeaders = filter ((/= "User-Agent") . fst) $ requestHeaders req
-- | Transforms a 'StripeRequest' into a more general 'URI', which can be used to
-- make an authenticated query to the Stripe server.
-- _TODO the... | 380 | false | true | 0 | 9 | 79 | 76 | 42 | 34 | null | null |
DavidAlphaFox/darcs | harness/test.hs | gpl-2.0 | readRepoFormat (map toLower -> "darcs-2") = Darcs2 | 50 | readRepoFormat (map toLower -> "darcs-2") = Darcs2 | 50 | readRepoFormat (map toLower -> "darcs-2") = Darcs2 | 50 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
trygvis/hledger | hledger-lib/Hledger/Data/Dates.hs | gpl-3.0 | dateSpanAsText (DateSpan (Just b) Nothing) = printf "from %s" (show b) | 71 | dateSpanAsText (DateSpan (Just b) Nothing) = printf "from %s" (show b) | 71 | dateSpanAsText (DateSpan (Just b) Nothing) = printf "from %s" (show b) | 71 | false | false | 0 | 8 | 11 | 35 | 16 | 19 | null | null |
beijaflor-io/haskell-language-conf | src/Data/Conf/Internal.hs | mit | expression :: Parser Expression
expression = label "expression" $ do
s <- manyTill (letterChar <|> char '_' <|> char '-') spaceChar
skipSpace
as <- manyTill argument (char ';')
return $ Expression (Text.pack s) as | 229 | expression :: Parser Expression
expression = label "expression" $ do
s <- manyTill (letterChar <|> char '_' <|> char '-') spaceChar
skipSpace
as <- manyTill argument (char ';')
return $ Expression (Text.pack s) as | 229 | expression = label "expression" $ do
s <- manyTill (letterChar <|> char '_' <|> char '-') spaceChar
skipSpace
as <- manyTill argument (char ';')
return $ Expression (Text.pack s) as | 197 | false | true | 0 | 13 | 49 | 91 | 41 | 50 | null | null |
justinlynn/monadix | src/Main.hs | bsd-3-clause | main = do
xmobarProcess <- spawnPipe "start-xmobar"
trayerProcess <- spawnPipe "start-trayer"
xmonad $ defaultConfig {
manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ smartBorders $ layoutHook defaultConfig
, handleEventHook = docksEventHook <+... | 744 | main = do
xmobarProcess <- spawnPipe "start-xmobar"
trayerProcess <- spawnPipe "start-trayer"
xmonad $ defaultConfig {
manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ smartBorders $ layoutHook defaultConfig
, handleEventHook = docksEventHook <+... | 744 | main = do
xmobarProcess <- spawnPipe "start-xmobar"
trayerProcess <- spawnPipe "start-trayer"
xmonad $ defaultConfig {
manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ smartBorders $ layoutHook defaultConfig
, handleEventHook = docksEventHook <+... | 744 | false | false | 1 | 15 | 288 | 150 | 77 | 73 | null | null |
gbataille/pandoc | src/Text/Pandoc/Writers/Shared.hs | gpl-2.0 | stripLeadingTrailingSpace :: [Inline] -> [Inline]
stripLeadingTrailingSpace = go . reverse . go . reverse
where go (Space:xs) = xs
go xs = xs
-- Put display math in its own block (for ODT/DOCX). | 213 | stripLeadingTrailingSpace :: [Inline] -> [Inline]
stripLeadingTrailingSpace = go . reverse . go . reverse
where go (Space:xs) = xs
go xs = xs
-- Put display math in its own block (for ODT/DOCX). | 213 | stripLeadingTrailingSpace = go . reverse . go . reverse
where go (Space:xs) = xs
go xs = xs
-- Put display math in its own block (for ODT/DOCX). | 163 | false | true | 0 | 7 | 51 | 61 | 32 | 29 | null | null |
ublubu/tile-rider | src/SDL/Draw.hs | mit | fillRectangle :: SDL.T.Renderer -> SDL.T.Rect -> IO ()
fillRectangle renderer shape = catchErrorCode "failed to fill rectangle" =<<
(with shape $ SDL.V.renderFillRect renderer) | 207 | fillRectangle :: SDL.T.Renderer -> SDL.T.Rect -> IO ()
fillRectangle renderer shape = catchErrorCode "failed to fill rectangle" =<<
(with shape $ SDL.V.renderFillRect renderer) | 207 | fillRectangle renderer shape = catchErrorCode "failed to fill rectangle" =<<
(with shape $ SDL.V.renderFillRect renderer) | 152 | false | true | 0 | 10 | 53 | 63 | 30 | 33 | null | null |
plaprade/haskoin | haskoin-core/src/Network/Haskoin/Crypto/ExtendedKeys.hs | unlicense | -- | Apply a parsed path to an extended key to derive the new key defined in the
-- path. If the path starts with m/, a private key will be returned and if the
-- path starts with M/, a public key will be returned. Private derivations on a
-- public key, and public derivations with a hard segment, return an error
-- va... | 1,573 | applyPath :: ParsedPath -> XKey -> Either String XKey
applyPath path key = case (path, key) of
(ParsedPrv _, XPrv k) -> return $ XPrv $ derivPrvF k
(ParsedPrv _, XPub _) -> Left "applyPath: Invalid public key"
(ParsedPub _, XPrv k) -> return $ XPub $ deriveXPubKey $ derivPrvF k
(ParsedPub _, XPub ... | 1,248 | applyPath path key = case (path, key) of
(ParsedPrv _, XPrv k) -> return $ XPrv $ derivPrvF k
(ParsedPrv _, XPub _) -> Left "applyPath: Invalid public key"
(ParsedPub _, XPrv k) -> return $ XPub $ deriveXPubKey $ derivPrvF k
(ParsedPub _, XPub k) -> derivPubFE >>= \f -> return $ XPub $ f k
-... | 1,194 | true | true | 6 | 11 | 414 | 413 | 202 | 211 | null | null |
ice1000/OI-codes | codewars/101-200/tiny-three-pass-compiler-also-give-up.hs | agpl-3.0 | parseHelper p [a,b,c] = parse p [a,b,c] | 39 | parseHelper p [a,b,c] = parse p [a,b,c] | 39 | parseHelper p [a,b,c] = parse p [a,b,c] | 39 | false | false | 0 | 6 | 6 | 34 | 19 | 15 | null | null |
edsko/cabal | Cabal/tests/PackageTests/PackageTester.hs | bsd-3-clause | -- TODO: Really should accumulate... but I think to do this
-- properly we can't just append
withEnv :: [(String, Maybe String)] -> TestM a -> TestM a
withEnv e m = do
(_, test0) <- ask
when (not (null (testEnvironment test0)))
$ error "nested withEnv (not yet) supported"
withReaderT (\(suite, test)... | 364 | withEnv :: [(String, Maybe String)] -> TestM a -> TestM a
withEnv e m = do
(_, test0) <- ask
when (not (null (testEnvironment test0)))
$ error "nested withEnv (not yet) supported"
withReaderT (\(suite, test) -> (suite, test { testEnvironment = e })) m | 271 | withEnv e m = do
(_, test0) <- ask
when (not (null (testEnvironment test0)))
$ error "nested withEnv (not yet) supported"
withReaderT (\(suite, test) -> (suite, test { testEnvironment = e })) m | 213 | true | true | 0 | 14 | 80 | 124 | 65 | 59 | null | null |
rwbarton/rw | Crawl/BananaUtils.hs | bsd-3-clause | randomize :: (Random a) => (a, a) -> R.Event t b -> R.Event t a
randomize range clock = fst $ R.mapAccum (mkStdGen 17) (fmap (const $ fp . randomR range) clock)
where fp p = fst p `seq` snd p `seq` p | 201 | randomize :: (Random a) => (a, a) -> R.Event t b -> R.Event t a
randomize range clock = fst $ R.mapAccum (mkStdGen 17) (fmap (const $ fp . randomR range) clock)
where fp p = fst p `seq` snd p `seq` p | 201 | randomize range clock = fst $ R.mapAccum (mkStdGen 17) (fmap (const $ fp . randomR range) clock)
where fp p = fst p `seq` snd p `seq` p | 137 | false | true | 0 | 11 | 44 | 121 | 61 | 60 | null | null |
nightscape/platform | shared/src/Unison/Codebase.hs | mit | make :: (Show v, Monad f, Var v)
=> (Term v -> Reference)
-> Store f v
-> Codebase f v Reference.Reference (Type v) (Term v)
make hash store =
let
readTypeOf = Store.typeOfTerm store
admissibleTypeAt e loc =
Typechecker.admissibleTypeAt readTypeOf loc e
createTerm e md = do
t ... | 5,160 | make :: (Show v, Monad f, Var v)
=> (Term v -> Reference)
-> Store f v
-> Codebase f v Reference.Reference (Type v) (Term v)
make hash store =
let
readTypeOf = Store.typeOfTerm store
admissibleTypeAt e loc =
Typechecker.admissibleTypeAt readTypeOf loc e
createTerm e md = do
t ... | 5,160 | make hash store =
let
readTypeOf = Store.typeOfTerm store
admissibleTypeAt e loc =
Typechecker.admissibleTypeAt readTypeOf loc e
createTerm e md = do
t <- Typechecker.synthesize readTypeOf e
let r = hash e
pure r <* case r of
Reference.Builtin _ ->
Store.writeMe... | 5,020 | false | true | 0 | 26 | 1,540 | 1,858 | 885 | 973 | null | null |
alexbaluta/courseography | dependencies/HaXml-1.25.3/src/Text/XML/HaXml/ByteStringPP.hs | gpl-3.0 | (<+>) b1 b2 = b1 <> pack " " <> b2 | 35 | (<+>) b1 b2 = b1 <> pack " " <> b2 | 35 | (<+>) b1 b2 = b1 <> pack " " <> b2 | 35 | false | false | 3 | 5 | 11 | 29 | 12 | 17 | null | null |
np/mbox-tools | mbox-pick.hs | bsd-3-clause | options :: [OptDescr Flag]
options =
[ fmtOpt usage (set fmt)
, Option "?" ["help"] (NoArg (set help True)) "Show this help message"
] | 143 | options :: [OptDescr Flag]
options =
[ fmtOpt usage (set fmt)
, Option "?" ["help"] (NoArg (set help True)) "Show this help message"
] | 143 | options =
[ fmtOpt usage (set fmt)
, Option "?" ["help"] (NoArg (set help True)) "Show this help message"
] | 116 | false | true | 0 | 11 | 32 | 67 | 32 | 35 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/SWHS/IMods.hs | bsd-2-clause | -----------
-- Intro --
-----------
instModIntro :: Sentence
instModIntro = foldlSent [S "The", plural goal, foldlList Comma List
(map makeRef2S [waterTempGS, pcmTempGS, waterEnergyGS, pcmEnergyGS]) `sAre`
S "solved by" +:+. foldlList Comma List (map makeRef2S
[eBalanceOnWtr, eBalanceOnPCM, heatEInWtr, heatEInPC... | 841 | instModIntro :: Sentence
instModIntro = foldlSent [S "The", plural goal, foldlList Comma List
(map makeRef2S [waterTempGS, pcmTempGS, waterEnergyGS, pcmEnergyGS]) `sAre`
S "solved by" +:+. foldlList Comma List (map makeRef2S
[eBalanceOnWtr, eBalanceOnPCM, heatEInWtr, heatEInPCM]), S "The",
plural solution, S "f... | 804 | instModIntro = foldlSent [S "The", plural goal, foldlList Comma List
(map makeRef2S [waterTempGS, pcmTempGS, waterEnergyGS, pcmEnergyGS]) `sAre`
S "solved by" +:+. foldlList Comma List (map makeRef2S
[eBalanceOnWtr, eBalanceOnPCM, heatEInWtr, heatEInPCM]), S "The",
plural solution, S "for", makeRef2S eBalanceOn... | 779 | true | true | 0 | 12 | 131 | 275 | 146 | 129 | null | null |
rfranek/duckling | Duckling/Time/RO/Rules.hs | bsd-3-clause | ruleTrimestruNumeralYear :: Rule
ruleTrimestruNumeralYear = Rule
{ name = "trimestru <number> <year>"
, pattern =
[ Predicate $ isGrain TG.Quarter
, dimension Numeral
, dimension Time
]
, prod = \tokens -> case tokens of
(_:token:Token Time td:_) -> do
v <- getIntValue token
... | 389 | ruleTrimestruNumeralYear :: Rule
ruleTrimestruNumeralYear = Rule
{ name = "trimestru <number> <year>"
, pattern =
[ Predicate $ isGrain TG.Quarter
, dimension Numeral
, dimension Time
]
, prod = \tokens -> case tokens of
(_:token:Token Time td:_) -> do
v <- getIntValue token
... | 389 | ruleTrimestruNumeralYear = Rule
{ name = "trimestru <number> <year>"
, pattern =
[ Predicate $ isGrain TG.Quarter
, dimension Numeral
, dimension Time
]
, prod = \tokens -> case tokens of
(_:token:Token Time td:_) -> do
v <- getIntValue token
tt $ cycleNthAfter False TG.Quart... | 356 | false | true | 0 | 17 | 108 | 135 | 69 | 66 | null | null |
hvr/vector | Data/Vector/Unboxed.hs | bsd-3-clause | null = G.null | 13 | null = G.null | 13 | null = G.null | 13 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M06/D19/Solution.hs | mit | artJSON = "non-duplicate-articles.json" | 39 | artJSON = "non-duplicate-articles.json" | 39 | artJSON = "non-duplicate-articles.json" | 39 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
fmapfmapfmap/amazonka | amazonka-s3/gen/Network/AWS/S3/Types/Product.hs | mpl-2.0 | -- | Protocol to use (http, https) when redirecting requests. The default is
-- the protocol that is used in the original request.
rartProtocol :: Lens' RedirectAllRequestsTo (Maybe Protocol)
rartProtocol = lens _rartProtocol (\ s a -> s{_rartProtocol = a}) | 257 | rartProtocol :: Lens' RedirectAllRequestsTo (Maybe Protocol)
rartProtocol = lens _rartProtocol (\ s a -> s{_rartProtocol = a}) | 126 | rartProtocol = lens _rartProtocol (\ s a -> s{_rartProtocol = a}) | 65 | true | true | 1 | 9 | 39 | 52 | 26 | 26 | null | null |
ckaestne/CIDE | CIDE_Language_Haskell/test/WSP/Webserver/Console.hs | gpl-3.0 | changeOptions handles
= let { names = getNames handles} in
standardQuery ("HWS+WASH Console/Options") $
do { p $ text "Set options on the following deployments";
let { noInput = null names;
modifier = if noInput then attr "disabled" "disabled" else empty};
... | 696 | changeOptions handles
= let { names = getNames handles} in
standardQuery ("HWS+WASH Console/Options") $
do { p $ text "Set options on the following deployments";
let { noInput = null names;
modifier = if noInput then attr "disabled" "disabled" else empty};
... | 696 | changeOptions handles
= let { names = getNames handles} in
standardQuery ("HWS+WASH Console/Options") $
do { p $ text "Set options on the following deployments";
let { noInput = null names;
modifier = if noInput then attr "disabled" "disabled" else empty};
... | 696 | false | false | 1 | 18 | 267 | 208 | 103 | 105 | null | null |
ice1000/OI-codes | codewars/301-400/factorial-tail.hs | agpl-3.0 | zeroes :: Integral a => a -> a -> a
zeroes base n = minimum . ((f . (head &&& length)) <$>) . group . pd $ base
where f (a, b) = (`div` fromIntegral b) . sum . ((n `div`) <$>) $ [a ^ i | i <- [1 .. floor (fromIntegral a `logBase` fromIntegral n)]]
pd x | x == 1 = [ ]
| null d = [x]
... | 461 | zeroes :: Integral a => a -> a -> a
zeroes base n = minimum . ((f . (head &&& length)) <$>) . group . pd $ base
where f (a, b) = (`div` fromIntegral b) . sum . ((n `div`) <$>) $ [a ^ i | i <- [1 .. floor (fromIntegral a `logBase` fromIntegral n)]]
pd x | x == 1 = [ ]
| null d = [x]
... | 461 | zeroes base n = minimum . ((f . (head &&& length)) <$>) . group . pd $ base
where f (a, b) = (`div` fromIntegral b) . sum . ((n `div`) <$>) $ [a ^ i | i <- [1 .. floor (fromIntegral a `logBase` fromIntegral n)]]
pd x | x == 1 = [ ]
| null d = [x]
| True = head d : pd (div x... | 425 | false | true | 2 | 13 | 162 | 285 | 147 | 138 | null | null |
DanielRS/marquee | src/Text/Marquee/Parser/Common.hs | mit | atMostN :: Int -> Parser a -> Parser [a]
atMostN n p
| n <= 0 = count 0 p
| otherwise = count n p <|> atMostN (n - 1) p | 123 | atMostN :: Int -> Parser a -> Parser [a]
atMostN n p
| n <= 0 = count 0 p
| otherwise = count n p <|> atMostN (n - 1) p | 123 | atMostN n p
| n <= 0 = count 0 p
| otherwise = count n p <|> atMostN (n - 1) p | 82 | false | true | 0 | 9 | 35 | 86 | 38 | 48 | null | null |
travitch/llvm-analysis | src/LLVM/Analysis/CFG/Internal.hs | bsd-3-clause | dataflowMeet BwdDataflowAnalysis { analysisMeet = m } = m | 57 | dataflowMeet BwdDataflowAnalysis { analysisMeet = m } = m | 57 | dataflowMeet BwdDataflowAnalysis { analysisMeet = m } = m | 57 | false | false | 0 | 7 | 8 | 19 | 9 | 10 | null | null |
d0kt0r0/estuary | client/src/Estuary/Render/Renderer.hs | gpl-3.0 | minRenderPeriod :: NominalDiffTime
minRenderPeriod = 0.120 | 58 | minRenderPeriod :: NominalDiffTime
minRenderPeriod = 0.120 | 58 | minRenderPeriod = 0.120 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
mariefarrell/Hets | Maude/PreComorphism.hs | gpl-2.0 | mapSentence :: MSign.Sign -> MSentence.Sentence -> Result CAS.CASLFORMULA
mapSentence sg sen = let
mk = kindMapId $ MSign.kindRel sg
named = makeNamed "" sen
form = mb_rl2formula mk named
in return $ sentence $ case sen of
MSentence.Equation (MAS.Eq _ _ _ ats) -> if any MAS.owise ats then let
... | 835 | mapSentence :: MSign.Sign -> MSentence.Sentence -> Result CAS.CASLFORMULA
mapSentence sg sen = let
mk = kindMapId $ MSign.kindRel sg
named = makeNamed "" sen
form = mb_rl2formula mk named
in return $ sentence $ case sen of
MSentence.Equation (MAS.Eq _ _ _ ats) -> if any MAS.owise ats then let
... | 835 | mapSentence sg sen = let
mk = kindMapId $ MSign.kindRel sg
named = makeNamed "" sen
form = mb_rl2formula mk named
in return $ sentence $ case sen of
MSentence.Equation (MAS.Eq _ _ _ ats) -> if any MAS.owise ats then let
sg_sens = map (makeNamed "") $ Set.toList $ MSign.sentences sg
... | 761 | false | true | 2 | 18 | 204 | 253 | 122 | 131 | null | null |
kajigor/uKanren_transformations | app/console/ConsPDApp.hs | bsd-3-clause | runTyping = do
runConsPD (-1) "type" Program.Typing.query | 61 | runTyping = do
runConsPD (-1) "type" Program.Typing.query | 61 | runTyping = do
runConsPD (-1) "type" Program.Typing.query | 61 | false | false | 1 | 10 | 10 | 28 | 12 | 16 | null | null |
jwalsh/mal | haskell/Core.hs | mpl-2.0 | dissoc _ = throwStr "invalid call to dissoc" | 44 | dissoc _ = throwStr "invalid call to dissoc" | 44 | dissoc _ = throwStr "invalid call to dissoc" | 44 | false | false | 0 | 4 | 7 | 13 | 5 | 8 | null | null |
leshchevds/ganeti | src/Ganeti/DataCollectors/Diskstats.hs | bsd-2-clause | -- | Main function.
main :: Options -> [String] -> IO ()
main opts args = do
let inputFile = fromMaybe defaultFile $ optInputFile opts
unless (null args) . exitErr $ "This program takes exactly zero" ++
" arguments, got '" ++ unwords args ++ "'"
report <- buildDCReport inputFile
... | 348 | main :: Options -> [String] -> IO ()
main opts args = do
let inputFile = fromMaybe defaultFile $ optInputFile opts
unless (null args) . exitErr $ "This program takes exactly zero" ++
" arguments, got '" ++ unwords args ++ "'"
report <- buildDCReport inputFile
putStrLn $ J.encod... | 328 | main opts args = do
let inputFile = fromMaybe defaultFile $ optInputFile opts
unless (null args) . exitErr $ "This program takes exactly zero" ++
" arguments, got '" ++ unwords args ++ "'"
report <- buildDCReport inputFile
putStrLn $ J.encode report | 291 | true | true | 0 | 14 | 95 | 109 | 50 | 59 | null | null |
dbp/mealstrat | spec/Spec.hs | isc | exampleBook :: Book
exampleBook = Book 0 "Book" "book" "Someone" 2015 | 69 | exampleBook :: Book
exampleBook = Book 0 "Book" "book" "Someone" 2015 | 69 | exampleBook = Book 0 "Book" "book" "Someone" 2015 | 49 | false | true | 0 | 5 | 10 | 22 | 11 | 11 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/cmm/CmmMachOp.hs | bsd-3-clause | mo_wordAnd dflags = MO_And (wordWidth dflags) | 50 | mo_wordAnd dflags = MO_And (wordWidth dflags) | 50 | mo_wordAnd dflags = MO_And (wordWidth dflags) | 50 | false | false | 0 | 7 | 10 | 18 | 8 | 10 | null | null |
jdmarble/spatialIndex | test/MetricSpaceTest.hs | bsd-3-clause | prop_symmetry :: MetricSpace a => a -> a -> a -> Bool
prop_symmetry _ x y = (distance x y) == (distance y x) | 108 | prop_symmetry :: MetricSpace a => a -> a -> a -> Bool
prop_symmetry _ x y = (distance x y) == (distance y x) | 108 | prop_symmetry _ x y = (distance x y) == (distance y x) | 54 | false | true | 0 | 10 | 23 | 63 | 29 | 34 | null | null |
AlexanderPankiv/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprDo _ _ = panic "pprDo" | 41 | pprDo _ _ = panic "pprDo" | 41 | pprDo _ _ = panic "pprDo" | 41 | false | false | 1 | 5 | 21 | 15 | 6 | 9 | null | null |
graninas/ICFPC2007 | Endo/IcfpcEndo/Wire.hs | gpl-3.0 | next node = succ node | 21 | next node = succ node | 21 | next node = succ node | 21 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Targets.hs | bsd-3-clause | -- | Users are allowed to give package names case-insensitively, so we must
-- disambiguate named package references.
--
disambiguatePackageTargets :: Package pkg'
=> PackageIndex pkg'
-> [PackageName]
-> [PackageTarget pkg]
... | 1,859 | disambiguatePackageTargets :: Package pkg'
=> PackageIndex pkg'
-> [PackageName]
-> [PackageTarget pkg]
-> ( [PackageTargetProblem]
, [PackageSpecifier pkg] )
disambiguatePackageTarg... | 1,738 | disambiguatePackageTargets availablePkgIndex availableExtra targets =
partitionEithers (map disambiguatePackageTarget targets)
where
disambiguatePackageTarget packageTarget = case packageTarget of
PackageTargetLocation pkg -> Right (SpecificSourcePackage pkg)
PackageTargetNamed pkgname constraint... | 1,441 | true | true | 0 | 15 | 574 | 303 | 147 | 156 | null | null |
GaloisInc/saw-script | cryptol-saw-core/src/Verifier/SAW/Cryptol/Monadify.hs | bsd-3-clause | globalDefString :: GlobalDef -> String
globalDefString = T.unpack . toAbsoluteName . globalDefName | 98 | globalDefString :: GlobalDef -> String
globalDefString = T.unpack . toAbsoluteName . globalDefName | 98 | globalDefString = T.unpack . toAbsoluteName . globalDefName | 59 | false | true | 0 | 7 | 11 | 25 | 13 | 12 | null | null |
bergey/plots | src/Plots/Themes.hs | bsd-3-clause | alphaColourMap :: [(Rational, AlphaColour Double)] -> ColourMap
alphaColourMap [] = ColourMap M.empty | 101 | alphaColourMap :: [(Rational, AlphaColour Double)] -> ColourMap
alphaColourMap [] = ColourMap M.empty | 101 | alphaColourMap [] = ColourMap M.empty | 37 | false | true | 0 | 8 | 11 | 37 | 19 | 18 | null | null |
utnfrlp/paradigmas | haskell/ejemplos.hs | gpl-3.0 | --
-- Compilado de ejercicios de haskell
-- resolucion simple iterativa o recursiva
--
-- Extraído, traducido, testeado y retocado desde
-- http://www.haskell.org/haskellwiki/99_questions
--
-- por Julián Perelli
-- Catedra de Paradigmas de Programación
-- Facultad Regional La Plata
-- Universidad Tecnológica Nacional
... | 421 | factorial n =
if n == 0
then 1
else n * factorial (n - 1) | 77 | factorial n =
if n == 0
then 1
else n * factorial (n - 1) | 77 | true | false | 0 | 9 | 84 | 49 | 32 | 17 | null | null |
phadej/yaml | Data/Yaml.hs | bsd-2-clause | array :: [Value] -> Value
array = Array . V.fromList | 52 | array :: [Value] -> Value
array = Array . V.fromList | 52 | array = Array . V.fromList | 26 | false | true | 1 | 7 | 9 | 32 | 14 | 18 | null | null |
frantisekfarka/ghc-dsi | compiler/main/DynFlags.hs | bsd-3-clause | isAvxEnabled :: DynFlags -> Bool
isAvxEnabled dflags = avx dflags || avx2 dflags || avx512f dflags | 98 | isAvxEnabled :: DynFlags -> Bool
isAvxEnabled dflags = avx dflags || avx2 dflags || avx512f dflags | 98 | isAvxEnabled dflags = avx dflags || avx2 dflags || avx512f dflags | 65 | false | true | 0 | 7 | 15 | 40 | 17 | 23 | null | null |
markus-git/signal | src/Signal/Core.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- ** Some `smart` constructions
signal :: S Symbol i a -> Signal i a
signal = Signal . symbol | 176 | signal :: S Symbol i a -> Signal i a
signal = Signal . symbol | 61 | signal = Signal . symbol | 24 | true | true | 0 | 6 | 21 | 33 | 17 | 16 | null | null |
GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32/Driver/SPI.hs | bsd-3-clause | debugPin3 = Nothing | 19 | debugPin3 = Nothing | 19 | debugPin3 = Nothing | 19 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
devtype-blogspot-com/Haskell-Examples | OddCont/Demo.hs | gpl-3.0 | {- êîòîðàÿ ïðèíèìàåò ïîëîæèòåëüíîå ÷èñëî n è êîíòåéíåð. Îíà äîëæíà âîçâðàùàòü òó ÷àñòü ýëåìåíòîâ èñõîäíîãî êîíòåéíåðà, êîòîðàÿ óäåðæèâàåòñÿ n ëåâûìè êîíñòðóêòîðàìè, îòáðàñûâàÿ âñå, êðîìå ïåðâûõ 2n-1 ýëåìåíòîâ. Åñëè êîíòåéíåð «êîðî÷å», ÷åì n êîíñòðóêòîðîâ, îí íå ìåíÿåòñÿ.
GHCi> let testCont = BiCons 'a' 'b' (BiCons 'c'... | 606 | takeNCons 1 (Singl a) = Singl a | 31 | takeNCons 1 (Singl a) = Singl a | 31 | true | false | 0 | 7 | 96 | 21 | 10 | 11 | null | null |
acowley/ghc | compiler/hsSyn/HsDecls.hs | bsd-3-clause | tyClDeclLName :: TyClDecl name -> Located name
tyClDeclLName (FamDecl { tcdFam = FamilyDecl { fdLName = ln } }) = ln | 116 | tyClDeclLName :: TyClDecl name -> Located name
tyClDeclLName (FamDecl { tcdFam = FamilyDecl { fdLName = ln } }) = ln | 116 | tyClDeclLName (FamDecl { tcdFam = FamilyDecl { fdLName = ln } }) = ln | 69 | false | true | 0 | 12 | 20 | 45 | 23 | 22 | null | null |
music-suite/music-pitch | src/Music/Pitch/Scale.hs | bsd-3-clause | ajorMajorSeventhChord :: Function Pitch
majorMajorSeventhChord = Function [_M3,m3,_M3] _P8
| 91 | majorMajorSeventhChord :: Function Pitch
majorMajorSeventhChord = Function [_M3,m3,_M3] _P8 | 91 | majorMajorSeventhChord = Function [_M3,m3,_M3] _P8 | 50 | false | true | 0 | 6 | 9 | 28 | 15 | 13 | null | null |
charringer/gonimo-back | src/Gonimo/Server/Handlers.hs | agpl-3.0 | -- | Create an anonymous account and a client.
-- Each device is uniquely identified by a ClientId, multiple
-- Client's can share a single account in case a user login was provided,
-- otherwise every client corresponds to a single Account.
createClient :: ServerConstraint r => Maybe Text -> Eff r Client.AuthDat... | 1,253 | createClient :: ServerConstraint r => Maybe Text -> Eff r Client.AuthData
createClient mUserAgent = do
now <- getCurrentTime
authToken <- GonimoSecret <$> generateSecret
let userAgent = maybe noUserAgentDefault (take maxUserAgentLength) mUserAgent
funnyName <- createFunnyName
runDb $ do
aid <- Db.insert A... | 1,005 | createClient mUserAgent = do
now <- getCurrentTime
authToken <- GonimoSecret <$> generateSecret
let userAgent = maybe noUserAgentDefault (take maxUserAgentLength) mUserAgent
funnyName <- createFunnyName
runDb $ do
aid <- Db.insert Account { accountCreated = now
}
cid <... | 931 | true | true | 0 | 13 | 409 | 194 | 102 | 92 | null | null |
wmarvel/haskellrogue | src/Console.hs | mit | within :: Int -> Int -> Int -> Bool
within v vMin vMax = vMin <= v && v <= vMax | 79 | within :: Int -> Int -> Int -> Bool
within v vMin vMax = vMin <= v && v <= vMax | 79 | within v vMin vMax = vMin <= v && v <= vMax | 43 | false | true | 2 | 9 | 20 | 50 | 23 | 27 | null | null |
gsdlab/clafer | src/Language/Clafer/Intermediate/Intclafer.hs | mit | iFoldMap f i@(IRPExp (PExp Nothing _ _ iExp)) =
f i `mappend` (iFoldMap f $ IRIExp iExp) | 90 | iFoldMap f i@(IRPExp (PExp Nothing _ _ iExp)) =
f i `mappend` (iFoldMap f $ IRIExp iExp) | 90 | iFoldMap f i@(IRPExp (PExp Nothing _ _ iExp)) =
f i `mappend` (iFoldMap f $ IRIExp iExp) | 90 | false | false | 0 | 10 | 18 | 58 | 28 | 30 | null | null |
NicolasDP/hs-memory | Data/ByteArray/Pack.hs | bsd-3-clause | -- | put Word32 in the current position in the stream
-- /!\ use Host Endianness
putWord32 :: Word32 -> Packer ()
putWord32 = putStorable | 137 | putWord32 :: Word32 -> Packer ()
putWord32 = putStorable | 56 | putWord32 = putStorable | 23 | true | true | 0 | 7 | 24 | 22 | 12 | 10 | null | null |
thielema/wxhaskell | wxcore/src/haskell/Graphics/UI/WXCore/Types.hs | lgpl-2.1 | rectOverlaps :: (Num a, Ord a) => Rect2D a -> Rect2D a -> Bool
rectOverlaps (Rect x1 y1 w1 h1) (Rect x2 y2 w2 h2)
= (x1+w1 >= x2 && x1 <= x2+w2) && (y1+h1 >= y2 && y1 <= y2+h2) | 178 | rectOverlaps :: (Num a, Ord a) => Rect2D a -> Rect2D a -> Bool
rectOverlaps (Rect x1 y1 w1 h1) (Rect x2 y2 w2 h2)
= (x1+w1 >= x2 && x1 <= x2+w2) && (y1+h1 >= y2 && y1 <= y2+h2) | 178 | rectOverlaps (Rect x1 y1 w1 h1) (Rect x2 y2 w2 h2)
= (x1+w1 >= x2 && x1 <= x2+w2) && (y1+h1 >= y2 && y1 <= y2+h2) | 115 | false | true | 0 | 12 | 42 | 125 | 61 | 64 | null | null |
zaxtax/hakaru | haskell/Language/Hakaru/Syntax/TypeOf.hs | bsd-3-clause | typeOfReducer Red_Nop = sUnit | 39 | typeOfReducer Red_Nop = sUnit | 39 | typeOfReducer Red_Nop = sUnit | 39 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
romildo/gsynt | src/gsynt.hs | isc | isNullable (NT x:xs) set = elem x set && isNullable xs set | 58 | isNullable (NT x:xs) set = elem x set && isNullable xs set | 58 | isNullable (NT x:xs) set = elem x set && isNullable xs set | 58 | false | false | 0 | 8 | 11 | 35 | 16 | 19 | null | null |
jwiegley/ghc-release | utils/haddock/src/Haddock/GhcUtils.hs | gpl-3.0 | getMainDeclBinder :: HsDecl name -> [name]
getMainDeclBinder (TyClD d) = [tcdName d] | 84 | getMainDeclBinder :: HsDecl name -> [name]
getMainDeclBinder (TyClD d) = [tcdName d] | 84 | getMainDeclBinder (TyClD d) = [tcdName d] | 41 | false | true | 0 | 7 | 11 | 36 | 18 | 18 | null | null |
tek/proteome | packages/test/test/Proteome/Test/AddMenuTest.hs | mit | promptConfig ::
MonadIO m =>
[Text] ->
PromptConfig m
promptConfig cs =
PromptConfig (promptInput cs) basicTransition noPromptRenderer [] | 145 | promptConfig ::
MonadIO m =>
[Text] ->
PromptConfig m
promptConfig cs =
PromptConfig (promptInput cs) basicTransition noPromptRenderer [] | 145 | promptConfig cs =
PromptConfig (promptInput cs) basicTransition noPromptRenderer [] | 85 | false | true | 0 | 8 | 25 | 53 | 24 | 29 | null | null |
olorin/amazonka | amazonka-ec2/gen/Network/AWS/EC2/RunInstances.hs | mpl-2.0 | -- | The Base64-encoded MIME user data for the instances.
rUserData :: Lens' RunInstances (Maybe Text)
rUserData = lens _rUserData (\ s a -> s{_rUserData = a}) | 159 | rUserData :: Lens' RunInstances (Maybe Text)
rUserData = lens _rUserData (\ s a -> s{_rUserData = a}) | 101 | rUserData = lens _rUserData (\ s a -> s{_rUserData = a}) | 56 | true | true | 0 | 9 | 26 | 46 | 25 | 21 | null | null |
jxv/cis-194-winter-2016 | src/Homework/Week02/Assignment.hs | mit | insert logMsg@(LogMessage _ timeStamp0 _) msgTree@(Node before midLogMsg@(LogMessage _ timeStamp1 _) after)
| timeStamp0 <= timeStamp1 = Node (insert logMsg before) midLogMsg after
| otherwise = Node before midLogMsg (insert logMsg after) | 273 | insert logMsg@(LogMessage _ timeStamp0 _) msgTree@(Node before midLogMsg@(LogMessage _ timeStamp1 _) after)
| timeStamp0 <= timeStamp1 = Node (insert logMsg before) midLogMsg after
| otherwise = Node before midLogMsg (insert logMsg after) | 273 | insert logMsg@(LogMessage _ timeStamp0 _) msgTree@(Node before midLogMsg@(LogMessage _ timeStamp1 _) after)
| timeStamp0 <= timeStamp1 = Node (insert logMsg before) midLogMsg after
| otherwise = Node before midLogMsg (insert logMsg after) | 273 | false | false | 1 | 11 | 66 | 100 | 49 | 51 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/WebGLRenderingContextBase.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContextBase.stencilFuncSeparate Mozilla WebGLRenderingContextBase.stencilFuncSeparate documentation>
stencilFuncSeparate ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> GLenum -> GLenum -> GLint ... | 549 | stencilFuncSeparate ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> GLenum -> GLenum -> GLint -> GLuint -> m ()
stencilFuncSeparate self face func ref mask
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "stencilFuncSeparate"
... | 378 | stencilFuncSeparate self face func ref mask
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "stencilFuncSeparate"
[toJSVal face, toJSVal func, toJSVal ref, toJSVal mask])) | 211 | true | true | 0 | 13 | 118 | 119 | 58 | 61 | null | null |
apyrgio/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | inststWrongnode :: String
inststWrongnode = Types.instanceStatusToRaw WrongNode | 79 | inststWrongnode :: String
inststWrongnode = Types.instanceStatusToRaw WrongNode | 79 | inststWrongnode = Types.instanceStatusToRaw WrongNode | 53 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
cdornan/keystore | src/Data/KeyStore/Sections.hs | bsd-3-clause | locate_keys :: Sections h s k => REFORMAT h s k -> Name -> IO [Key]
locate_keys ic' nm = reformat ic' $ sortBy (flip $ comparing _key_name) . filter yup <$> keys ic
where
yup = isp . _key_name
isp nm' = nm_s `isPrefixOf` _name nm'
nm_s = _name nm
ic = _REFORMAT ic'
-- | Return the generic... | 479 | locate_keys :: Sections h s k => REFORMAT h s k -> Name -> IO [Key]
locate_keys ic' nm = reformat ic' $ sortBy (flip $ comparing _key_name) . filter yup <$> keys ic
where
yup = isp . _key_name
isp nm' = nm_s `isPrefixOf` _name nm'
nm_s = _name nm
ic = _REFORMAT ic'
-- | Return the generic... | 479 | locate_keys ic' nm = reformat ic' $ sortBy (flip $ comparing _key_name) . filter yup <$> keys ic
where
yup = isp . _key_name
isp nm' = nm_s `isPrefixOf` _name nm'
nm_s = _name nm
ic = _REFORMAT ic'
-- | Return the generic name for a given key thst is used by the specified
-- host, returni... | 411 | false | true | 5 | 11 | 122 | 151 | 66 | 85 | null | null |
kumasento/alex | src/CharSet.hs | bsd-3-clause | charRangeToCharSpan _ (Range (BoundaryAbove c) _) | c == maxBound = Nothing | 75 | charRangeToCharSpan _ (Range (BoundaryAbove c) _) | c == maxBound = Nothing | 75 | charRangeToCharSpan _ (Range (BoundaryAbove c) _) | c == maxBound = Nothing | 75 | false | false | 0 | 9 | 11 | 35 | 16 | 19 | null | null |
ml9951/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | ppr_expr (HsMultiIf _ alts)
= sep $ ptext (sLit "if") : map ppr_alt alts
where ppr_alt (L _ (GRHS guards expr)) =
sep [ char '|' <+> interpp'SP guards
, ptext (sLit "->") <+> pprDeeper (ppr expr) ]
-- special case: let ... in let ... | 262 | ppr_expr (HsMultiIf _ alts)
= sep $ ptext (sLit "if") : map ppr_alt alts
where ppr_alt (L _ (GRHS guards expr)) =
sep [ char '|' <+> interpp'SP guards
, ptext (sLit "->") <+> pprDeeper (ppr expr) ]
-- special case: let ... in let ... | 262 | ppr_expr (HsMultiIf _ alts)
= sep $ ptext (sLit "if") : map ppr_alt alts
where ppr_alt (L _ (GRHS guards expr)) =
sep [ char '|' <+> interpp'SP guards
, ptext (sLit "->") <+> pprDeeper (ppr expr) ]
-- special case: let ... in let ... | 262 | false | false | 0 | 10 | 74 | 107 | 51 | 56 | null | null |
rpglover64/lens | src/Language/Haskell/TH/Lens.hs | bsd-3-clause | _PragmaD :: Prism' Dec Pragma
_PragmaD
= prism remitter reviewer
where
remitter = PragmaD
reviewer (PragmaD x) = Right x
reviewer x = Left x | 162 | _PragmaD :: Prism' Dec Pragma
_PragmaD
= prism remitter reviewer
where
remitter = PragmaD
reviewer (PragmaD x) = Right x
reviewer x = Left x | 162 | _PragmaD
= prism remitter reviewer
where
remitter = PragmaD
reviewer (PragmaD x) = Right x
reviewer x = Left x | 132 | false | true | 2 | 7 | 46 | 58 | 27 | 31 | null | null |
dysinger/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/DeletePreset.hs | mpl-2.0 | -- | The identifier of the preset for which you want to get detailed information.
dpId :: Lens' DeletePreset Text
dpId = lens _dpId (\s a -> s { _dpId = a }) | 157 | dpId :: Lens' DeletePreset Text
dpId = lens _dpId (\s a -> s { _dpId = a }) | 75 | dpId = lens _dpId (\s a -> s { _dpId = a }) | 43 | true | true | 0 | 9 | 32 | 47 | 23 | 24 | null | null |
apunktbau/co4 | src/CO4/Prelude/Nat.hs | gpl-3.0 | encEqNatProf a b = traced "eqNat" $ encEqNat a b | 48 | encEqNatProf a b = traced "eqNat" $ encEqNat a b | 48 | encEqNatProf a b = traced "eqNat" $ encEqNat a b | 48 | false | false | 0 | 6 | 9 | 23 | 10 | 13 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Yaml.hs | gpl-2.0 | parseRules ("YAML","header") =
(((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("YAML","comment"))
<|>
(currentContext >>= \x -> guard (x == ("YAML","header")) >> pDefault >>= withAttribute OtherTok)) | 231 | parseRules ("YAML","header") =
(((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("YAML","comment"))
<|>
(currentContext >>= \x -> guard (x == ("YAML","header")) >> pDefault >>= withAttribute OtherTok)) | 231 | parseRules ("YAML","header") =
(((pDetectChar False '#' >>= withAttribute CommentTok) >>~ pushContext ("YAML","comment"))
<|>
(currentContext >>= \x -> guard (x == ("YAML","header")) >> pDefault >>= withAttribute OtherTok)) | 231 | false | false | 0 | 15 | 33 | 93 | 49 | 44 | null | null |
GaloisInc/gidl | src/Gidl/Backend/Ivory/Types.hs | bsd-3-clause | importType :: Type -> ImportType
importType (StructType n _) = UserType n | 73 | importType :: Type -> ImportType
importType (StructType n _) = UserType n | 73 | importType (StructType n _) = UserType n | 40 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
Lainepress/easy | Text/RE/TestBench/Parsers.hs | bsd-3-clause | parseSeverity :: Replace a => a -> Maybe Severity
parseSeverity = flip HM.lookup severity_hm . textifyR | 103 | parseSeverity :: Replace a => a -> Maybe Severity
parseSeverity = flip HM.lookup severity_hm . textifyR | 103 | parseSeverity = flip HM.lookup severity_hm . textifyR | 53 | false | true | 0 | 8 | 15 | 43 | 18 | 25 | null | null |
snoyberg/ghc | compiler/nativeGen/PPC/Regs.hs | bsd-3-clause | toc = regSingle 2 | 21 | toc = regSingle 2 | 21 | toc = regSingle 2 | 21 | false | false | 0 | 5 | 7 | 9 | 4 | 5 | null | null |
soenkehahn/stack | src/main/Main.hs | bsd-3-clause | onPluginErr :: PluginException -> IO ()
onPluginErr (PluginNotFound _ name) = do
T.hPutStr stderr $ "Stack plugin not found: " <> name
exitFailure | 150 | onPluginErr :: PluginException -> IO ()
onPluginErr (PluginNotFound _ name) = do
T.hPutStr stderr $ "Stack plugin not found: " <> name
exitFailure | 150 | onPluginErr (PluginNotFound _ name) = do
T.hPutStr stderr $ "Stack plugin not found: " <> name
exitFailure | 110 | false | true | 0 | 10 | 26 | 50 | 23 | 27 | null | null |
flipstone/orville | orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/Expr/Where/BooleanExpr.hs | mit | columnIsNotNull :: ColumnName -> BooleanExpr
columnIsNotNull name =
BooleanExpr $
RawSql.toRawSql (columnReference name)
<> RawSql.space
<> RawSql.fromString "IS NOT NULL" | 189 | columnIsNotNull :: ColumnName -> BooleanExpr
columnIsNotNull name =
BooleanExpr $
RawSql.toRawSql (columnReference name)
<> RawSql.space
<> RawSql.fromString "IS NOT NULL" | 189 | columnIsNotNull name =
BooleanExpr $
RawSql.toRawSql (columnReference name)
<> RawSql.space
<> RawSql.fromString "IS NOT NULL" | 144 | false | true | 0 | 10 | 37 | 48 | 23 | 25 | null | null |
green-haskell/ghc | compiler/cmm/CmmNode.hs | bsd-3-clause | -- | Returns the head uniques of the scopes. This is based on the
-- assumption that the @Unique@ of @SubScope@ identifies the
-- underlying super-scope. Used for efficient equality and comparison,
-- see below.
scopeUniques :: CmmTickScope -> [U.Unique]
scopeUniques GlobalScope = [] | 294 | scopeUniques :: CmmTickScope -> [U.Unique]
scopeUniques GlobalScope = [] | 82 | scopeUniques GlobalScope = [] | 39 | true | true | 0 | 7 | 53 | 33 | 18 | 15 | null | null |
rueshyna/gogol | gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types/Product.hs | mpl-2.0 | -- | Whether the email is registered.
vprRegistered :: Lens' VerifyPasswordResponse (Maybe Bool)
vprRegistered
= lens _vprRegistered
(\ s a -> s{_vprRegistered = a}) | 173 | vprRegistered :: Lens' VerifyPasswordResponse (Maybe Bool)
vprRegistered
= lens _vprRegistered
(\ s a -> s{_vprRegistered = a}) | 135 | vprRegistered
= lens _vprRegistered
(\ s a -> s{_vprRegistered = a}) | 76 | true | true | 1 | 9 | 31 | 52 | 25 | 27 | null | null |
massysett/dapi | dapi.hs | bsd-3-clause | pdctLast :: MA.OptSpec (ParseOpts -> Ex.Exceptional String ParseOpts)
pdctLast = MA.OptSpec ["last"] "l" (MA.NoArg (fmap return f))
where
f = addOperand
. Exp.operand
. Pd.operand "last date in the list"
$ ((== 0) . iBack) | 252 | pdctLast :: MA.OptSpec (ParseOpts -> Ex.Exceptional String ParseOpts)
pdctLast = MA.OptSpec ["last"] "l" (MA.NoArg (fmap return f))
where
f = addOperand
. Exp.operand
. Pd.operand "last date in the list"
$ ((== 0) . iBack) | 252 | pdctLast = MA.OptSpec ["last"] "l" (MA.NoArg (fmap return f))
where
f = addOperand
. Exp.operand
. Pd.operand "last date in the list"
$ ((== 0) . iBack) | 182 | false | true | 6 | 9 | 64 | 106 | 49 | 57 | null | null |
matthewleon/libmpd-haskell | src/Network/MPD/Commands/CurrentPlaylist.hs | mit | -- | Retrieve a list of changed songs currently in the playlist since
-- a given playlist version.
plChanges :: MonadMPD m => Integer -> m [Song]
plChanges = A.runCommand . A.plChanges | 184 | plChanges :: MonadMPD m => Integer -> m [Song]
plChanges = A.runCommand . A.plChanges | 85 | plChanges = A.runCommand . A.plChanges | 38 | true | true | 0 | 8 | 31 | 38 | 20 | 18 | null | null |
urbanslug/ghc | testsuite/tests/concurrent/should_run/T3279.hs | bsd-3-clause | main :: IO ()
main = do
evaluate f `catch` \(SomeException e) -> return 0
-- the evaluation of 'x' is now suspended at point X
tid <- mask_ $ forkIO (evaluate f >> return ())
killThread tid
-- now execute the 'unblock' above with a pending exception
yield
-- should print 1 + 1 = 2
print ... | 321 | main :: IO ()
main = do
evaluate f `catch` \(SomeException e) -> return 0
-- the evaluation of 'x' is now suspended at point X
tid <- mask_ $ forkIO (evaluate f >> return ())
killThread tid
-- now execute the 'unblock' above with a pending exception
yield
-- should print 1 + 1 = 2
print ... | 321 | main = do
evaluate f `catch` \(SomeException e) -> return 0
-- the evaluation of 'x' is now suspended at point X
tid <- mask_ $ forkIO (evaluate f >> return ())
killThread tid
-- now execute the 'unblock' above with a pending exception
yield
-- should print 1 + 1 = 2
print f | 307 | false | true | 0 | 13 | 90 | 89 | 42 | 47 | null | null |
hferreiro/replay | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr _
= panic "X86.Ppr.pprInstr: no match" | 55 | pprInstr _
= panic "X86.Ppr.pprInstr: no match" | 55 | pprInstr _
= panic "X86.Ppr.pprInstr: no match" | 55 | false | false | 0 | 5 | 14 | 12 | 5 | 7 | null | null |
DanielSchuessler/hstri | QuickCheckUtil.hs | gpl-3.0 | -- | Shrinks the index in the given list
forAllElementsShrink
:: (Show (Element xs), AsList xs, Testable prop) =>
xs -> (Element xs -> prop) -> Property
forAllElementsShrink (asList -> xs) p =
case length xs of
0 -> label "Vacuously true (empty domain)" True
n -> forAllShrink (choose (0,n-1)... | 445 | forAllElementsShrink
:: (Show (Element xs), AsList xs, Testable prop) =>
xs -> (Element xs -> prop) -> Property
forAllElementsShrink (asList -> xs) p =
case length xs of
0 -> label "Vacuously true (empty domain)" True
n -> forAllShrink (choose (0,n-1)) shrink (\i -> let x = xs !! i in
... | 404 | forAllElementsShrink (asList -> xs) p =
case length xs of
0 -> label "Vacuously true (empty domain)" True
n -> forAllShrink (choose (0,n-1)) shrink (\i -> let x = xs !! i in
printTestCase (show x) (p x)) | 285 | true | true | 0 | 15 | 153 | 159 | 80 | 79 | null | null |
ezyang/ghc | testsuite/tests/codeGen/should_run/CmmSwitchTest32.hs | bsd-3-clause | al -2147483638# = -1073741777# | 30 | al -2147483638# = -1073741777# | 30 | al -2147483638# = -1073741777# | 30 | false | false | 0 | 5 | 3 | 14 | 6 | 8 | null | null |
arnabgho/HLearn | src/HLearn/Data/SpaceTree/Algorithms/NearestNeighbor.Old.hs | bsd-3-clause | init_neighbor :: SpaceTree t dp => dp -> t dp -> Neighbor dp
init_neighbor query t = Neighbor
{ neighbor = stNode t
, neighborDistance = distance query (stNode t)
} | 176 | init_neighbor :: SpaceTree t dp => dp -> t dp -> Neighbor dp
init_neighbor query t = Neighbor
{ neighbor = stNode t
, neighborDistance = distance query (stNode t)
} | 176 | init_neighbor query t = Neighbor
{ neighbor = stNode t
, neighborDistance = distance query (stNode t)
} | 115 | false | true | 0 | 10 | 42 | 71 | 34 | 37 | null | null |
ecordell/hackaroons | src/Macaroon/Macaroon.hs | mit | bytestringSignature :: Macaroon -> C.ByteString
bytestringSignature = signature | 79 | bytestringSignature :: Macaroon -> C.ByteString
bytestringSignature = signature | 79 | bytestringSignature = signature | 31 | false | true | 0 | 6 | 7 | 17 | 9 | 8 | null | null |
danidiaz/lens | src/Control/Lens/Iso.hs | bsd-3-clause | -- | The isomorphism for flipping a function.
--
-- >>>((,)^.flipped) 1 2
-- (2,1)
flipped :: Iso (a -> b -> c) (a' -> b' -> c') (b -> a -> c) (b' -> a' -> c')
flipped = iso flip flip | 183 | flipped :: Iso (a -> b -> c) (a' -> b' -> c') (b -> a -> c) (b' -> a' -> c')
flipped = iso flip flip | 100 | flipped = iso flip flip | 23 | true | true | 0 | 9 | 42 | 79 | 41 | 38 | null | null |
mydaum/cabal | Cabal/Distribution/Compat/CopyFile.hs | bsd-3-clause | setFileOrdinary path = setFileMode path 0o644 | 47 | setFileOrdinary path = setFileMode path 0o644 | 47 | setFileOrdinary path = setFileMode path 0o644 | 47 | false | false | 0 | 5 | 7 | 14 | 6 | 8 | null | null |
goldfirere/singletons | singletons-th/src/Data/Singletons/TH/Single/Type.hs | bsd-3-clause | singTypeKVBs ::
[DTyVarBndrSpec] -- ^ The bound type variables from the original type signature.
-> [DType] -- ^ The argument types of the signature (promoted).
-> DCxt -- ^ The context of the signature (singled).
-> DType -- ^ The result type of the signature (promoted).
->... | 1,166 | singTypeKVBs ::
[DTyVarBndrSpec] -- ^ The bound type variables from the original type signature.
-> [DType] -- ^ The argument types of the signature (promoted).
-> DCxt -- ^ The context of the signature (singled).
-> DType -- ^ The result type of the signature (promoted).
->... | 1,110 | singTypeKVBs orig_tvbs prom_args sing_ctxt prom_res bound_tvbs
| null orig_tvbs
-- There are no explicitly `forall`ed type variable binders, so we must
-- infer them ourselves.
= changeDTVFlags SpecifiedSpec $
deleteFirstsBy
((==) `on` extractTvbName)
(toposortTyVarsOf $ prom_args ++ sing_ctxt +... | 687 | true | true | 0 | 12 | 271 | 158 | 85 | 73 | null | null |
plaprade/haskoin | haskoin-core/src/Network/Haskoin/Script/Parser.hs | unlicense | isSpendPK _ = False | 44 | isSpendPK _ = False | 44 | isSpendPK _ = False | 44 | false | false | 0 | 5 | 28 | 9 | 4 | 5 | null | null |
vikraman/ghc | compiler/parser/ApiAnnotation.hs | bsd-3-clause | unicodeAnn AnnRarrowtail = AnnRarrowtailU | 41 | unicodeAnn AnnRarrowtail = AnnRarrowtailU | 41 | unicodeAnn AnnRarrowtail = AnnRarrowtailU | 41 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
rueshyna/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | The playlist\'s privacy status.
plsPrivacyStatus :: Lens' PlayListStatus (Maybe PlayListStatusPrivacyStatus)
plsPrivacyStatus
= lens _plsPrivacyStatus
(\ s a -> s{_plsPrivacyStatus = a}) | 199 | plsPrivacyStatus :: Lens' PlayListStatus (Maybe PlayListStatusPrivacyStatus)
plsPrivacyStatus
= lens _plsPrivacyStatus
(\ s a -> s{_plsPrivacyStatus = a}) | 162 | plsPrivacyStatus
= lens _plsPrivacyStatus
(\ s a -> s{_plsPrivacyStatus = a}) | 85 | true | true | 0 | 9 | 30 | 48 | 25 | 23 | null | null |
jhance/llvm-untyped | LLVM/Untyped/Core.hs | gpl-3.0 | getVisibility :: Value -> LLVM Visibility
getVisibility (Value value) = LLVM $ L.toVisibility <$> L.getVisibility value | 119 | getVisibility :: Value -> LLVM Visibility
getVisibility (Value value) = LLVM $ L.toVisibility <$> L.getVisibility value | 119 | getVisibility (Value value) = LLVM $ L.toVisibility <$> L.getVisibility value | 77 | false | true | 0 | 7 | 15 | 42 | 20 | 22 | null | null |
rueshyna/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | If this instruction includes a combining function this is the name of
-- the intermediate store between the GBK and the CombineValues.
pgbkiOriginalCombineValuesInputStoreName :: Lens' PartialGroupByKeyInstruction (Maybe Text)
pgbkiOriginalCombineValuesInputStoreName
= lens _pgbkiOriginalCombineValuesInputStoreN... | 398 | pgbkiOriginalCombineValuesInputStoreName :: Lens' PartialGroupByKeyInstruction (Maybe Text)
pgbkiOriginalCombineValuesInputStoreName
= lens _pgbkiOriginalCombineValuesInputStoreName
(\ s a ->
s{_pgbkiOriginalCombineValuesInputStoreName = a}) | 258 | pgbkiOriginalCombineValuesInputStoreName
= lens _pgbkiOriginalCombineValuesInputStoreName
(\ s a ->
s{_pgbkiOriginalCombineValuesInputStoreName = a}) | 166 | true | true | 0 | 8 | 57 | 50 | 26 | 24 | null | null |
phunehehe/foomail | src/Helper.hs | mpl-2.0 | fetchMessage :: IMAPConnection -> UID -> IO Message
fetchMessage connection uid = do
message <- I.fetch connection uid
return $ parseMessage uid $ decodeUtf8 $ B.fromStrict message | 188 | fetchMessage :: IMAPConnection -> UID -> IO Message
fetchMessage connection uid = do
message <- I.fetch connection uid
return $ parseMessage uid $ decodeUtf8 $ B.fromStrict message | 188 | fetchMessage connection uid = do
message <- I.fetch connection uid
return $ parseMessage uid $ decodeUtf8 $ B.fromStrict message | 136 | false | true | 0 | 11 | 34 | 69 | 30 | 39 | null | null |
mcschroeder/ghc | compiler/stgSyn/StgLint.hs | bsd-3-clause | {-
Checks for
(a) *some* type errors
(b) locally-defined variables used but not defined
Note: unless -dverbose-stg is on, display of lint errors will result
in "panic: bOGUS_LVs".
WARNING:
~~~~~~~~
This module has suffered bit-rot; it is likely to yield lint errors
for Stg code that is currently per... | 1,540 | lintStgBindings :: String -> [StgBinding] -> [StgBinding]
lintStgBindings whodunnit binds
= {-# SCC "StgLint" #-}
case (initL (lint_binds binds)) of
Nothing -> binds
Just msg -> pprPanic "" (vcat [
text "*** Stg Lint ErrMsgs: in" <+>
text whodunni... | 740 | lintStgBindings whodunnit binds
= {-# SCC "StgLint" #-}
case (initL (lint_binds binds)) of
Nothing -> binds
Just msg -> pprPanic "" (vcat [
text "*** Stg Lint ErrMsgs: in" <+>
text whodunnit <+> text "***",
msg,
... | 682 | true | true | 0 | 14 | 533 | 188 | 92 | 96 | null | null |
lifengsun/haskell-exercise | scheme/04/errorcheck.hs | gpl-3.0 | primitives :: [(String, [LispVal] -> ThrowsError LispVal)]
primitives = [("+", numericBinOp (+)),
("-", numericBinOp (-)),
("*", numericBinOp (*)),
("/", numericBinOp div),
("mod", numericBinOp mod),
("quotient",... | 388 | primitives :: [(String, [LispVal] -> ThrowsError LispVal)]
primitives = [("+", numericBinOp (+)),
("-", numericBinOp (-)),
("*", numericBinOp (*)),
("/", numericBinOp div),
("mod", numericBinOp mod),
("quotient",... | 388 | primitives = [("+", numericBinOp (+)),
("-", numericBinOp (-)),
("*", numericBinOp (*)),
("/", numericBinOp div),
("mod", numericBinOp mod),
("quotient", numericBinOp quot),
("remainder", numericBi... | 329 | false | true | 0 | 8 | 152 | 120 | 72 | 48 | null | null |
Yuras/tide | src/HaskellLex.hs | bsd-3-clause | isSymbol ch | Char.isSymbol ch = True | 37 | isSymbol ch | Char.isSymbol ch = True | 37 | isSymbol ch | Char.isSymbol ch = True | 37 | false | false | 0 | 9 | 6 | 20 | 8 | 12 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.