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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pauldoo/scratch | RealWorldHaskell/ch12/Barcode.hs | isc | row :: (Ix a, Ix b) => b -> Array (a, b) c -> Array a c
row j a = ixmap (l, u) project a
where
project i = (i, j)
((l, _), (u, _)) = bounds a | 161 | row :: (Ix a, Ix b) => b -> Array (a, b) c -> Array a c
row j a = ixmap (l, u) project a
where
project i = (i, j)
((l, _), (u, _)) = bounds a | 161 | row j a = ixmap (l, u) project a
where
project i = (i, j)
((l, _), (u, _)) = bounds a | 105 | false | true | 1 | 9 | 58 | 115 | 61 | 54 | null | null |
brendanhay/gogol | gogol-vision/gen/Network/Google/Vision/Types/Product.hs | mpl-2.0 | -- | Web pages containing the matching images from the Internet.
gcvvwdcPagesWithMatchingImages :: Lens' GoogleCloudVisionV1p3beta1WebDetection [GoogleCloudVisionV1p3beta1WebDetectionWebPage]
gcvvwdcPagesWithMatchingImages
= lens _gcvvwdcPagesWithMatchingImages
(\ s a -> s{_gcvvwdcPagesWithMatchingImages = a})
. _Default
. _Coerce | 352 | gcvvwdcPagesWithMatchingImages :: Lens' GoogleCloudVisionV1p3beta1WebDetection [GoogleCloudVisionV1p3beta1WebDetectionWebPage]
gcvvwdcPagesWithMatchingImages
= lens _gcvvwdcPagesWithMatchingImages
(\ s a -> s{_gcvvwdcPagesWithMatchingImages = a})
. _Default
. _Coerce | 287 | gcvvwdcPagesWithMatchingImages
= lens _gcvvwdcPagesWithMatchingImages
(\ s a -> s{_gcvvwdcPagesWithMatchingImages = a})
. _Default
. _Coerce | 160 | true | true | 2 | 8 | 50 | 57 | 28 | 29 | null | null |
Zolomon/edan40-functional-music | march.hs | mit | marchChords :: [[Chord]]
marchChords = [[(G, "Minor"),(G, "Minor")],[(G, "Minor"),(G, "Minor")]] | 97 | marchChords :: [[Chord]]
marchChords = [[(G, "Minor"),(G, "Minor")],[(G, "Minor"),(G, "Minor")]] | 96 | marchChords = [[(G, "Minor"),(G, "Minor")],[(G, "Minor"),(G, "Minor")]] | 71 | false | true | 0 | 7 | 10 | 59 | 38 | 21 | null | null |
JPMoresmau/leksah | src/IDE/Utils/GUIUtils.hs | gpl-2.0 | showErrorDialog :: Text -> IO ()
showErrorDialog msg = showDialog msg MessageTypeError | 86 | showErrorDialog :: Text -> IO ()
showErrorDialog msg = showDialog msg MessageTypeError | 86 | showErrorDialog msg = showDialog msg MessageTypeError | 53 | false | true | 0 | 7 | 11 | 31 | 14 | 17 | null | null |
Balletie/.xmonad | lib/Layouts.hs | unlicense | myLayout = workspaceModifiers layout
where
layout = vertical ||| horizontal ||| full | 94 | myLayout = workspaceModifiers layout
where
layout = vertical ||| horizontal ||| full | 94 | myLayout = workspaceModifiers layout
where
layout = vertical ||| horizontal ||| full | 94 | false | false | 1 | 6 | 21 | 27 | 12 | 15 | null | null |
gitfoxi/ascii-vector-avc | JtagStateMachine.hs | gpl-2.0 | jtagStateTrans ShiftIr True = Exit1Ir | 44 | jtagStateTrans ShiftIr True = Exit1Ir | 44 | jtagStateTrans ShiftIr True = Exit1Ir | 44 | false | false | 0 | 5 | 11 | 11 | 5 | 6 | null | null |
mgmeier/extra | src/System/Time/Extra.hs | bsd-3-clause | -- | Show a number of seconds, typically a duration, in a suitable manner with
-- responable precision for a human.
--
-- > showDuration 3.435 == "3.44s"
-- > showDuration 623.8 == "10m24s"
-- > showDuration 62003.8 == "17h13m"
-- > showDuration 1e8 == "27777h47m"
showDuration :: Seconds -> String
showDuration x
| x >= 3600 = f (x / 60) "h" "m"
| x >= 60 = f x "m" "s"
| otherwise = showDP 2 x ++ "s"
where
f x m s = show ms ++ m ++ ['0' | ss < 10] ++ show ss ++ s
where (ms,ss) = round x `divMod` 60
-- | Call once to start, then call repeatedly to get the elapsed time since the first
-- call. Values will usually increase, unless the system clock is updated
-- (if you need the guarantee, see 'offsetTimeIncrease'). | 772 | showDuration :: Seconds -> String
showDuration x
| x >= 3600 = f (x / 60) "h" "m"
| x >= 60 = f x "m" "s"
| otherwise = showDP 2 x ++ "s"
where
f x m s = show ms ++ m ++ ['0' | ss < 10] ++ show ss ++ s
where (ms,ss) = round x `divMod` 60
-- | Call once to start, then call repeatedly to get the elapsed time since the first
-- call. Values will usually increase, unless the system clock is updated
-- (if you need the guarantee, see 'offsetTimeIncrease'). | 497 | showDuration x
| x >= 3600 = f (x / 60) "h" "m"
| x >= 60 = f x "m" "s"
| otherwise = showDP 2 x ++ "s"
where
f x m s = show ms ++ m ++ ['0' | ss < 10] ++ show ss ++ s
where (ms,ss) = round x `divMod` 60
-- | Call once to start, then call repeatedly to get the elapsed time since the first
-- call. Values will usually increase, unless the system clock is updated
-- (if you need the guarantee, see 'offsetTimeIncrease'). | 463 | true | true | 1 | 10 | 197 | 180 | 86 | 94 | null | null |
isomorphism/labelled-hexdump-parser | Util.hs | bsd-3-clause | showHexPadded n
| n >= 0 = "0x" ++ pad ++ s
| otherwise = "-" ++ showHexPadded (-n)
where s = Numeric.showHex n ""
pad = replicate (max 0 $ 8 - length s) '0' | 179 | showHexPadded n
| n >= 0 = "0x" ++ pad ++ s
| otherwise = "-" ++ showHexPadded (-n)
where s = Numeric.showHex n ""
pad = replicate (max 0 $ 8 - length s) '0' | 179 | showHexPadded n
| n >= 0 = "0x" ++ pad ++ s
| otherwise = "-" ++ showHexPadded (-n)
where s = Numeric.showHex n ""
pad = replicate (max 0 $ 8 - length s) '0' | 179 | false | false | 1 | 9 | 57 | 90 | 42 | 48 | null | null |
pgj/bead | src/Bead/Persistence/SQL/TestData.hs | bsd-3-clause | cmt = Comment "comment" "User" time CT_Student | 48 | cmt = Comment "comment" "User" time CT_Student | 48 | cmt = Comment "comment" "User" time CT_Student | 48 | false | false | 0 | 5 | 8 | 15 | 7 | 8 | null | null |
jwiegley/ghc-release | libraries/time/test/TestParseTime.hs | gpl-3.0 | show2 :: (Show n,Integral n) => n -> String
show2 i = (show (div i 10)) ++ (show (mod i 10)) | 92 | show2 :: (Show n,Integral n) => n -> String
show2 i = (show (div i 10)) ++ (show (mod i 10)) | 92 | show2 i = (show (div i 10)) ++ (show (mod i 10)) | 48 | false | true | 2 | 9 | 20 | 72 | 34 | 38 | null | null |
BartAdv/idris-cil | src/IRTS/Cil/FFI.hs | bsd-3-clause | assemblyNameAndTypeFrom (ValueType assemblyName typeName) = (assemblyName, typeName) | 88 | assemblyNameAndTypeFrom (ValueType assemblyName typeName) = (assemblyName, typeName) | 88 | assemblyNameAndTypeFrom (ValueType assemblyName typeName) = (assemblyName, typeName) | 88 | false | false | 0 | 7 | 10 | 23 | 12 | 11 | null | null |
abhishekkr/tutorials_as_code | talks-articles/languages-n-runtimes/haskell/PhilipWadler-UniversityOfEdinburgh-2011/lecture18.example03.hs | mit | notP = parP( do { token '~'; p <- propP; return (Not p) } ) | 63 | notP = parP( do { token '~'; p <- propP; return (Not p) } ) | 63 | notP = parP( do { token '~'; p <- propP; return (Not p) } ) | 63 | false | false | 0 | 11 | 18 | 41 | 20 | 21 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Parser.hs | gpl-3.0 | shouldIgnoreCode code = do
context <- getCurrentContexts
return $ any disabling context
where
disabling (ContextAnnotation list) =
any disabling' list
disabling _ = False
disabling' (DisableComment n) = code == n
-- Store potential parse problems outside of parsec | 295 | shouldIgnoreCode code = do
context <- getCurrentContexts
return $ any disabling context
where
disabling (ContextAnnotation list) =
any disabling' list
disabling _ = False
disabling' (DisableComment n) = code == n
-- Store potential parse problems outside of parsec | 295 | shouldIgnoreCode code = do
context <- getCurrentContexts
return $ any disabling context
where
disabling (ContextAnnotation list) =
any disabling' list
disabling _ = False
disabling' (DisableComment n) = code == n
-- Store potential parse problems outside of parsec | 295 | false | false | 1 | 8 | 69 | 85 | 36 | 49 | null | null |
sseefried/shady-gen | src/Shady/Play/CseTest.hs | agpl-3.0 | a1 :: FloatE
a1 = magnitudeSq (t *^ uv) | 39 | a1 :: FloatE
a1 = magnitudeSq (t *^ uv) | 39 | a1 = magnitudeSq (t *^ uv) | 26 | false | true | 0 | 7 | 8 | 21 | 11 | 10 | null | null |
yoo-e/weixin-mp-sdk | WeiXin/PublicPlatform/JS.hs | mit | wxppJsApiConfig :: MonadIO m
=> WxppAppID
-> WxppJsTicket
-> Bool
-> UrlText
-> [Text] -- ^ API list
-> m (JavascriptUrl url)
-- {{{1
wxppJsApiConfig app_id ticket debug url api_list = do
fmap (wxppJsApiConfigCode url) $ wxppJsApiConfigJsVal app_id ticket debug url api_list
-- }}}1
-- | 因为目前没找到可能的方法在服务器端能确保取出当前页面的URL
-- yesod-helpers 的 getCurrentUrl 只是一个能回到相同的 route 的 url
-- (它依赖配置文件而变)
-- 目前的解释办法是:调用者(服务器端)提供一个它认为正确的url
-- js 里(客户端)判断当前页面与服务器预期的不一致的话,
-- 则重定向至服务器预期的地址上去 | 577 | wxppJsApiConfig :: MonadIO m
=> WxppAppID
-> WxppJsTicket
-> Bool
-> UrlText
-> [Text] -- ^ API list
-> m (JavascriptUrl url)
wxppJsApiConfig app_id ticket debug url api_list = do
fmap (wxppJsApiConfigCode url) $ wxppJsApiConfigJsVal app_id ticket debug url api_list
-- }}}1
-- | 因为目前没找到可能的方法在服务器端能确保取出当前页面的URL
-- yesod-helpers 的 getCurrentUrl 只是一个能回到相同的 route 的 url
-- (它依赖配置文件而变)
-- 目前的解释办法是:调用者(服务器端)提供一个它认为正确的url
-- js 里(客户端)判断当前页面与服务器预期的不一致的话,
-- 则重定向至服务器预期的地址上去 | 569 | wxppJsApiConfig app_id ticket debug url api_list = do
fmap (wxppJsApiConfigCode url) $ wxppJsApiConfigJsVal app_id ticket debug url api_list
-- }}}1
-- | 因为目前没找到可能的方法在服务器端能确保取出当前页面的URL
-- yesod-helpers 的 getCurrentUrl 只是一个能回到相同的 route 的 url
-- (它依赖配置文件而变)
-- 目前的解释办法是:调用者(服务器端)提供一个它认为正确的url
-- js 里(客户端)判断当前页面与服务器预期的不一致的话,
-- 则重定向至服务器预期的地址上去 | 345 | true | true | 0 | 13 | 165 | 97 | 51 | 46 | null | null |
micknelso/language-c | src/Language/CFamily/C/Analysis/SemRep.hs | bsd-3-clause | -- | filter global declarations
filterGlobalDecls :: (DeclEvent -> Bool) -> GlobalDecls -> GlobalDecls
filterGlobalDecls decl_filter gmap = GlobalDecls
{
gObjs = Map.filter (decl_filter . DeclEvent) (gObjs gmap),
gTags = Map.filter (decl_filter . TagEvent) (gTags gmap),
gTypeDefs = Map.filter (decl_filter . TypeDefEvent) (gTypeDefs gmap)
} | 375 | filterGlobalDecls :: (DeclEvent -> Bool) -> GlobalDecls -> GlobalDecls
filterGlobalDecls decl_filter gmap = GlobalDecls
{
gObjs = Map.filter (decl_filter . DeclEvent) (gObjs gmap),
gTags = Map.filter (decl_filter . TagEvent) (gTags gmap),
gTypeDefs = Map.filter (decl_filter . TypeDefEvent) (gTypeDefs gmap)
} | 343 | filterGlobalDecls decl_filter gmap = GlobalDecls
{
gObjs = Map.filter (decl_filter . DeclEvent) (gObjs gmap),
gTags = Map.filter (decl_filter . TagEvent) (gTags gmap),
gTypeDefs = Map.filter (decl_filter . TypeDefEvent) (gTypeDefs gmap)
} | 272 | true | true | 0 | 10 | 78 | 116 | 61 | 55 | null | null |
jwiegley/hnix | src/Nix/Builtins.hs | bsd-3-clause | filter_
:: forall e t f m
. MonadNix e t f m
=> NValue t f m
-> NValue t f m
-> m (NValue t f m)
filter_ f =
toValue
<=< filterM (fromValue <=< callFunc f)
<=< fromValue | 190 | filter_
:: forall e t f m
. MonadNix e t f m
=> NValue t f m
-> NValue t f m
-> m (NValue t f m)
filter_ f =
toValue
<=< filterM (fromValue <=< callFunc f)
<=< fromValue | 190 | filter_ f =
toValue
<=< filterM (fromValue <=< callFunc f)
<=< fromValue | 82 | false | true | 0 | 12 | 61 | 96 | 46 | 50 | null | null |
eijian/deeplearning | src/Parser.hs | bsd-3-clause | rType :: String
rType = "type" | 30 | rType :: String
rType = "type" | 30 | rType = "type" | 14 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
fmapfmapfmap/amazonka | amazonka-cloudwatch-logs/test/Test/AWS/Gen/CloudWatchLogs.hs | mpl-2.0 | testDeleteMetricFilter :: DeleteMetricFilter -> TestTree
testDeleteMetricFilter = req
"DeleteMetricFilter"
"fixture/DeleteMetricFilter.yaml" | 148 | testDeleteMetricFilter :: DeleteMetricFilter -> TestTree
testDeleteMetricFilter = req
"DeleteMetricFilter"
"fixture/DeleteMetricFilter.yaml" | 148 | testDeleteMetricFilter = req
"DeleteMetricFilter"
"fixture/DeleteMetricFilter.yaml" | 91 | false | true | 0 | 7 | 17 | 28 | 11 | 17 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2014-10-edx-delft-fp101x-intro-to-fp-erik-meijer/lab4.hs | unlicense | -- ===================================
-- Ex. 15
-- ===================================
-- h :: ((b -> c) -> b) -> (b -> c) -> c
h :: ((a -> b) -> a) -> ((a -> b) -> b)
h g f = (f . g) $ f | 189 | h :: ((a -> b) -> a) -> ((a -> b) -> b)
h g f = (f . g) $ f | 59 | h g f = (f . g) $ f | 19 | true | true | 2 | 11 | 43 | 70 | 37 | 33 | null | null |
capital-match/bake | src/Development/Bake/Core/Type.hs | bsd-3-clause | -- | Produce notifications on 'stdout' when users should be notified about success/failure.
ovenNotifyStdout :: Oven state patch test -> Oven state patch test
ovenNotifyStdout = ovenNotifyAdd $ \author subject body ->
putBlock "Email" ["To: " ++ author, "Subject: " ++ subject, body] | 287 | ovenNotifyStdout :: Oven state patch test -> Oven state patch test
ovenNotifyStdout = ovenNotifyAdd $ \author subject body ->
putBlock "Email" ["To: " ++ author, "Subject: " ++ subject, body] | 195 | ovenNotifyStdout = ovenNotifyAdd $ \author subject body ->
putBlock "Email" ["To: " ++ author, "Subject: " ++ subject, body] | 128 | true | true | 0 | 9 | 46 | 65 | 34 | 31 | null | null |
tomberek/rulestesting | src/Control/Arrow/CCA/AExp.hs | bsd-3-clause | fromCCA (First f) = appE [|Control.Categorical.Bifunctor.first|] (fromCCA f) | 76 | fromCCA (First f) = appE [|Control.Categorical.Bifunctor.first|] (fromCCA f) | 76 | fromCCA (First f) = appE [|Control.Categorical.Bifunctor.first|] (fromCCA f) | 76 | false | false | 0 | 7 | 7 | 30 | 15 | 15 | null | null |
fpco/stackage-curator | src/Stackage/ShowBuildPlan.hs | mit | parseCompleteSpec :: MonadThrow m => Text -> m CompleteSpec
parseCompleteSpec t =
maybe (throwM $ InvalidSpec t) return $
parseNightly <|> parseLts
where
parseNightly = do
d <- T.stripPrefix "nightly-" t
x <- readMaybe $ T.unpack d
Just $ Nightly x
parseLts = do
t1 <- T.stripPrefix "lts-" t
Right (x, t2) <- Just $ decimal t1
t3 <- T.stripPrefix "." t2
Right (y, "") <- Just $ decimal t3
Just $ LTS x y | 489 | parseCompleteSpec :: MonadThrow m => Text -> m CompleteSpec
parseCompleteSpec t =
maybe (throwM $ InvalidSpec t) return $
parseNightly <|> parseLts
where
parseNightly = do
d <- T.stripPrefix "nightly-" t
x <- readMaybe $ T.unpack d
Just $ Nightly x
parseLts = do
t1 <- T.stripPrefix "lts-" t
Right (x, t2) <- Just $ decimal t1
t3 <- T.stripPrefix "." t2
Right (y, "") <- Just $ decimal t3
Just $ LTS x y | 489 | parseCompleteSpec t =
maybe (throwM $ InvalidSpec t) return $
parseNightly <|> parseLts
where
parseNightly = do
d <- T.stripPrefix "nightly-" t
x <- readMaybe $ T.unpack d
Just $ Nightly x
parseLts = do
t1 <- T.stripPrefix "lts-" t
Right (x, t2) <- Just $ decimal t1
t3 <- T.stripPrefix "." t2
Right (y, "") <- Just $ decimal t3
Just $ LTS x y | 429 | false | true | 2 | 10 | 160 | 201 | 88 | 113 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 2176895 = 3375 | 34 | getValueFromProduct 2176895 = 3375 | 34 | getValueFromProduct 2176895 = 3375 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/JoinList.hs | bsd-3-clause | reverse (A xs ys) = A (reverse ys) (reverse xs) | 47 | reverse (A xs ys) = A (reverse ys) (reverse xs) | 47 | reverse (A xs ys) = A (reverse ys) (reverse xs) | 47 | false | false | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
miguel-negrao/iCalendar | Text/ICalendar/Parser/Content.hs | bsd-3-clause | takeWhile1 :: (Char -> Bool) -> TextParser ByteString
takeWhile1 p = scan False f <?> "takeWhile1 ..."
where f g (Just x) | p x = Just (Just True)
| g = Just Nothing
| otherwise = Nothing
f g _ | g = Just Nothing
| otherwise = Nothing | 336 | takeWhile1 :: (Char -> Bool) -> TextParser ByteString
takeWhile1 p = scan False f <?> "takeWhile1 ..."
where f g (Just x) | p x = Just (Just True)
| g = Just Nothing
| otherwise = Nothing
f g _ | g = Just Nothing
| otherwise = Nothing | 336 | takeWhile1 p = scan False f <?> "takeWhile1 ..."
where f g (Just x) | p x = Just (Just True)
| g = Just Nothing
| otherwise = Nothing
f g _ | g = Just Nothing
| otherwise = Nothing | 282 | false | true | 3 | 8 | 151 | 127 | 56 | 71 | null | null |
jwiegley/ghc-release | utils/haddock/src/Haddock/Options.hs | gpl-3.0 | optLast :: [a] -> Maybe a
optLast [] = Nothing | 46 | optLast :: [a] -> Maybe a
optLast [] = Nothing | 46 | optLast [] = Nothing | 20 | false | true | 0 | 6 | 9 | 26 | 13 | 13 | null | null |
ygale/yesod | yesod-auth/Yesod/PasswordStore.hs | mit | makePasswordSaltWith :: (ByteString -> Salt -> Int -> ByteString)
-- ^ A function modeling an algorithm (e.g. 'pbkdf1')
-> (Int -> Int)
-- ^ A function to modify the strength
-> ByteString
-- ^ A password, given as clear text
-> Salt
-- ^ A hash 'Salt'
-> Int
-- ^ The password strength (e.g. @10000, 20000, etc.@)
-> ByteString
makePasswordSaltWith algorithm strengthModifier pwd salt strength = writePwHash (strength, salt, hash)
where hash = encode $ algorithm pwd salt (strengthModifier strength)
-- | Hash a password with a given strength (14 is a good default), using a given
-- salt. The output of this function can be written directly to a password file
-- or database. Example:
--
-- > >>> makePasswordSalt "hunter2" (makeSalt "72cd18b5ebfe6e96") 14
-- > "sha256|14|NzJjZDE4YjVlYmZlNmU5Ng==|yuiNrZW3KHX+pd0sWy9NTTsy5Yopmtx4UYscItSsoxc=" | 1,060 | makePasswordSaltWith :: (ByteString -> Salt -> Int -> ByteString)
-- ^ A function modeling an algorithm (e.g. 'pbkdf1')
-> (Int -> Int)
-- ^ A function to modify the strength
-> ByteString
-- ^ A password, given as clear text
-> Salt
-- ^ A hash 'Salt'
-> Int
-- ^ The password strength (e.g. @10000, 20000, etc.@)
-> ByteString
makePasswordSaltWith algorithm strengthModifier pwd salt strength = writePwHash (strength, salt, hash)
where hash = encode $ algorithm pwd salt (strengthModifier strength)
-- | Hash a password with a given strength (14 is a good default), using a given
-- salt. The output of this function can be written directly to a password file
-- or database. Example:
--
-- > >>> makePasswordSalt "hunter2" (makeSalt "72cd18b5ebfe6e96") 14
-- > "sha256|14|NzJjZDE4YjVlYmZlNmU5Ng==|yuiNrZW3KHX+pd0sWy9NTTsy5Yopmtx4UYscItSsoxc=" | 1,060 | makePasswordSaltWith algorithm strengthModifier pwd salt strength = writePwHash (strength, salt, hash)
where hash = encode $ algorithm pwd salt (strengthModifier strength)
-- | Hash a password with a given strength (14 is a good default), using a given
-- salt. The output of this function can be written directly to a password file
-- or database. Example:
--
-- > >>> makePasswordSalt "hunter2" (makeSalt "72cd18b5ebfe6e96") 14
-- > "sha256|14|NzJjZDE4YjVlYmZlNmU5Ng==|yuiNrZW3KHX+pd0sWy9NTTsy5Yopmtx4UYscItSsoxc=" | 521 | false | true | 3 | 11 | 343 | 121 | 64 | 57 | null | null |
rueshyna/gogol | gogol-slides/gen/Network/Google/Slides/Types/Product.hs | mpl-2.0 | -- | Solid color fill.
lfSolidFill :: Lens' LineFill (Maybe SolidFill)
lfSolidFill
= lens _lfSolidFill (\ s a -> s{_lfSolidFill = a}) | 135 | lfSolidFill :: Lens' LineFill (Maybe SolidFill)
lfSolidFill
= lens _lfSolidFill (\ s a -> s{_lfSolidFill = a}) | 112 | lfSolidFill
= lens _lfSolidFill (\ s a -> s{_lfSolidFill = a}) | 64 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
dalaing/type-systems | src/Rules/Kind/Infer/Common.hs | bsd-3-clause | mkInferKind :: (MonadError e m, AsUnknownKindError e)
=> [InferKindRule e w s r m ki ty a]
-> Type ki ty a -> m (Kind ki a)
mkInferKind rules =
let
go ty =
fromMaybe (throwing _UnknownKindError ()) .
asum .
fmap (\r -> fixInferKindRule go r ty) $
rules
in
go | 318 | mkInferKind :: (MonadError e m, AsUnknownKindError e)
=> [InferKindRule e w s r m ki ty a]
-> Type ki ty a -> m (Kind ki a)
mkInferKind rules =
let
go ty =
fromMaybe (throwing _UnknownKindError ()) .
asum .
fmap (\r -> fixInferKindRule go r ty) $
rules
in
go | 318 | mkInferKind rules =
let
go ty =
fromMaybe (throwing _UnknownKindError ()) .
asum .
fmap (\r -> fixInferKindRule go r ty) $
rules
in
go | 170 | false | true | 0 | 15 | 111 | 134 | 65 | 69 | null | null |
guoguo12/haskell-ptable | ptable.hs | apache-2.0 | anum "Yb" = 70 | 14 | anum "Yb" = 70 | 14 | anum "Yb" = 70 | 14 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Compute/Types/Product.hs | mpl-2.0 | -- | [Output Only] The URL for this instance template list. The server
-- defines this URL.
itlSelfLink :: Lens' InstanceTemplateList (Maybe Text)
itlSelfLink
= lens _itlSelfLink (\ s a -> s{_itlSelfLink = a}) | 211 | itlSelfLink :: Lens' InstanceTemplateList (Maybe Text)
itlSelfLink
= lens _itlSelfLink (\ s a -> s{_itlSelfLink = a}) | 119 | itlSelfLink
= lens _itlSelfLink (\ s a -> s{_itlSelfLink = a}) | 64 | true | true | 1 | 9 | 35 | 53 | 26 | 27 | null | null |
DaMSL/K3 | src/Language/K3/Analysis/Provenance/Inference.hs | apache-2.0 | picleartM :: () -> PInfM ()
picleartM _ = get >>= return . picleart >>= put | 75 | picleartM :: () -> PInfM ()
picleartM _ = get >>= return . picleart >>= put | 75 | picleartM _ = get >>= return . picleart >>= put | 47 | false | true | 0 | 7 | 15 | 37 | 18 | 19 | null | null |
markuspf/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | processMetaInformation :: Archive -> Idris ()
processMetaInformation ar = do
ds <- getEntry [] "ibc_metainformation" ar
mapM_ (\ (n, m) -> updateIState (\i ->
i { tt_ctxt = setMetaInformation n m (tt_ctxt i) })) ds | 253 | processMetaInformation :: Archive -> Idris ()
processMetaInformation ar = do
ds <- getEntry [] "ibc_metainformation" ar
mapM_ (\ (n, m) -> updateIState (\i ->
i { tt_ctxt = setMetaInformation n m (tt_ctxt i) })) ds | 253 | processMetaInformation ar = do
ds <- getEntry [] "ibc_metainformation" ar
mapM_ (\ (n, m) -> updateIState (\i ->
i { tt_ctxt = setMetaInformation n m (tt_ctxt i) })) ds | 207 | false | true | 0 | 17 | 73 | 93 | 47 | 46 | null | null |
mathfur/grep-tree | src/Corner.hs | mit | -- $setup
-- >>> import Data.Text (pack)
-- | ある行の上にある角と下にある角を取得する
-- 戻り値: (Intで指定した関数の最初の行と思われるCorner, 全Corner)
--
-- >>> getCorners [] 0
-- (Nothing,Nothing,[])
--
-- >>> getCorners [pack "def foo", pack " print 123", pack "end"] 1
-- (Just (Corner (RbMethod (Just "foo")) "def foo"),Just 0,[Corner (RbMethod (Just "foo")) "def foo",Corner CurrentLine " print 123",Corner RbEnd "end"])
--
-- >>> getCorners (map pack ["def bar", " def foo", " print 123", " end", "end"]) 2
-- (Just (Corner (RbMethod (Just "foo")) " def foo"),Just 1,[Corner (RbMethod (Just "bar")) "def bar",Corner (RbMethod (Just "foo")) " def foo",Corner CurrentLine " print 123",Corner RbEnd " end",Corner RbEnd "end"])
--
-- >>> getCorners (map pack ["def foo(s)", " print s", "end", "", "def bar(src)", " foo(src)", "end", "", "puts bar()"]) 1
-- (Just (Corner (RbMethod (Just "foo")) "def foo(s)"),Just 0,[Corner (RbMethod (Just "foo")) "def foo(s)",Corner CurrentLine " print s",Corner RbEnd "end"])
--
-- >>> getCorners (map pack ["def foo(s)", " print s", "end", "", "def bar(src)", " foo(src)", "end", "", "puts bar()"]) 4
-- (Nothing,Nothing,[Corner CurrentLine "def bar(src)"])
--
-- >>> getCorners (map pack ["def foo(s)", " print s", "end", "", "def bar(src)", " foo(src)", "end", "", "puts bar()"]) 5
-- (Just (Corner (RbMethod (Just "bar")) "def bar(src)"),Just 4,[Corner (RbMethod (Just "bar")) "def bar(src)",Corner CurrentLine " foo(src)",Corner RbEnd "end"])
--
-- >>> getCorners (map pack ["module Foo", " def foo(s)", " print s", " end", "", " def bar(src)", " foo(src)", " end", "end", "", "puts bar('13:45')"]) 6
-- (Just (Corner (RbMethod (Just "bar")) " def bar(src)"),Just 5,[Corner (RbModule "Foo") "module Foo",Corner (RbMethod (Just "bar")) " def bar(src)",Corner CurrentLine " foo(src)",Corner RbEnd " end",Corner RbEnd "end"])
--
-- >>> getCorners (map pack ["module Foo", " def foo(s)", " print s", " end", "", " def bar(src)", " foo(src)", " end", "end", "", "puts bar('13:45')"]) 10
-- (Nothing,Nothing,[Corner CurrentLine "puts bar('13:45')"])
getCorners :: [Line] -> Int -> (Maybe Corner, Maybe Int, [Corner])
getCorners [] _ = (Nothing, Nothing, []) | 2,204 | getCorners :: [Line] -> Int -> (Maybe Corner, Maybe Int, [Corner])
getCorners [] _ = (Nothing, Nothing, []) | 107 | getCorners [] _ = (Nothing, Nothing, []) | 40 | true | true | 0 | 8 | 370 | 86 | 60 | 26 | null | null |
jameshsmith/HRL | Server/Abyss/Game.hs | mit | initGame :: Game Action Level ()
initGame = do
loadLevel levelOne
actor player != Name "Player"
actor player != inventoryList [(Item.longswordP2, 1), (Item.redPotion, 32)]
baseHP <# actor player != 50
game | 227 | initGame :: Game Action Level ()
initGame = do
loadLevel levelOne
actor player != Name "Player"
actor player != inventoryList [(Item.longswordP2, 1), (Item.redPotion, 32)]
baseHP <# actor player != 50
game | 227 | initGame = do
loadLevel levelOne
actor player != Name "Player"
actor player != inventoryList [(Item.longswordP2, 1), (Item.redPotion, 32)]
baseHP <# actor player != 50
game | 194 | false | true | 1 | 11 | 52 | 96 | 43 | 53 | null | null |
tjhance/logic-puzzles | src/Main.hs | mit | battleShipCharToInput _ = error "Invalid battleship char" | 57 | battleShipCharToInput _ = error "Invalid battleship char" | 57 | battleShipCharToInput _ = error "Invalid battleship char" | 57 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
ilyasergey/GHC-XAppFix | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | selExpr64 expr
= do dflags <- getDynFlagsNat
pprPanic "iselExpr64(powerpc)" (pprPlatform (targetPlatform dflags) expr)
| 130 | iselExpr64 expr
= do dflags <- getDynFlagsNat
pprPanic "iselExpr64(powerpc)" (pprPlatform (targetPlatform dflags) expr) | 130 | iselExpr64 expr
= do dflags <- getDynFlagsNat
pprPanic "iselExpr64(powerpc)" (pprPlatform (targetPlatform dflags) expr) | 130 | false | false | 0 | 11 | 24 | 38 | 17 | 21 | null | null |
cutsea110/Kestrel | Foundation.hs | bsd-3-clause | wikiWriterOption :: (AppMessage -> Text) -> WriterOptions
wikiWriterOption msgShow =
def { writerStandalone = True
, writerTemplate = "$if(toc)$\n<a id='pandoc-TOC-toggle' href=''></a><div id='pandoc-TOC-Title'>" ++ T.unpack (msgShow MsgTOC) ++ "$toc$</div>\n$endif$\n$body$"
, writerTableOfContents = True
, writerNumberSections = False
, writerIdentifierPrefix = "pandoc-"
} | 408 | wikiWriterOption :: (AppMessage -> Text) -> WriterOptions
wikiWriterOption msgShow =
def { writerStandalone = True
, writerTemplate = "$if(toc)$\n<a id='pandoc-TOC-toggle' href=''></a><div id='pandoc-TOC-Title'>" ++ T.unpack (msgShow MsgTOC) ++ "$toc$</div>\n$endif$\n$body$"
, writerTableOfContents = True
, writerNumberSections = False
, writerIdentifierPrefix = "pandoc-"
} | 408 | wikiWriterOption msgShow =
def { writerStandalone = True
, writerTemplate = "$if(toc)$\n<a id='pandoc-TOC-toggle' href=''></a><div id='pandoc-TOC-Title'>" ++ T.unpack (msgShow MsgTOC) ++ "$toc$</div>\n$endif$\n$body$"
, writerTableOfContents = True
, writerNumberSections = False
, writerIdentifierPrefix = "pandoc-"
} | 350 | false | true | 0 | 12 | 72 | 80 | 44 | 36 | null | null |
smit1625/gospotchess | src/Site.hs | gpl-3.0 | ------------------------------------------------------------------------------
-- | The application initializer.
app :: SnapletInit App App
app = makeSnaplet "app" "An snaplet example application." Nothing $ do
heist' <- nestSnaplet "" heist $ heistInit "templates"
api' <- nestSnaplet "api" api apiInit
addRoutes routes
return $ App api' heist' | 361 | app :: SnapletInit App App
app = makeSnaplet "app" "An snaplet example application." Nothing $ do
heist' <- nestSnaplet "" heist $ heistInit "templates"
api' <- nestSnaplet "api" api apiInit
addRoutes routes
return $ App api' heist' | 248 | app = makeSnaplet "app" "An snaplet example application." Nothing $ do
heist' <- nestSnaplet "" heist $ heistInit "templates"
api' <- nestSnaplet "api" api apiInit
addRoutes routes
return $ App api' heist' | 221 | true | true | 0 | 11 | 58 | 88 | 37 | 51 | null | null |
jchl/jtrace | src/Render.hs | mit | (*#*) :: Point -> Point -> Point
(a1, b1, c1) *#* (a2, b2, c2) = (a1 * a2, b1 * b2, c1 * c2) | 92 | (*#*) :: Point -> Point -> Point
(a1, b1, c1) *#* (a2, b2, c2) = (a1 * a2, b1 * b2, c1 * c2) | 92 | (a1, b1, c1) *#* (a2, b2, c2) = (a1 * a2, b1 * b2, c1 * c2) | 59 | false | true | 0 | 6 | 23 | 66 | 38 | 28 | null | null |
robertclancy/tapl | inference/lib/Language/Inference/Pretty.hs | gpl-2.0 | prettyTerm (TmVar x) = text x | 29 | prettyTerm (TmVar x) = text x | 29 | prettyTerm (TmVar x) = text x | 29 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
kim/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | The volume size.
vSize :: Lens' Volume (Maybe Int)
vSize = lens _vSize (\s a -> s { _vSize = a }) | 102 | vSize :: Lens' Volume (Maybe Int)
vSize = lens _vSize (\s a -> s { _vSize = a }) | 80 | vSize = lens _vSize (\s a -> s { _vSize = a }) | 46 | true | true | 0 | 9 | 23 | 46 | 25 | 21 | null | null |
sol/logsink | src/System/Logging/LogSink/Config.hs | mit | -- | Set up the global `LogSink` according to the given sink configurations.
setupLogging :: [SinkConfig] -> IO ()
setupLogging sinks = either die (setLogSink . combine) (mapM toLogSink sinks) | 192 | setupLogging :: [SinkConfig] -> IO ()
setupLogging sinks = either die (setLogSink . combine) (mapM toLogSink sinks) | 115 | setupLogging sinks = either die (setLogSink . combine) (mapM toLogSink sinks) | 77 | true | true | 0 | 7 | 29 | 49 | 25 | 24 | null | null |
jkarni/th-alpha | src/Language/Haskell/TH/Alpha.hs | bsd-3-clause | expEqual' :: DExp -> DExp -> LookupST ()
expEqual' (DVarE a1 ) (DVarE a2 ) = a1 ~=~ a2 | 92 | expEqual' :: DExp -> DExp -> LookupST ()
expEqual' (DVarE a1 ) (DVarE a2 ) = a1 ~=~ a2 | 92 | expEqual' (DVarE a1 ) (DVarE a2 ) = a1 ~=~ a2 | 51 | false | true | 0 | 10 | 24 | 50 | 23 | 27 | null | null |
urbanslug/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | bcoPrimTyConKey = mkPreludeTyConUnique 73 | 65 | bcoPrimTyConKey = mkPreludeTyConUnique 73 | 65 | bcoPrimTyConKey = mkPreludeTyConUnique 73 | 65 | false | false | 0 | 5 | 27 | 9 | 4 | 5 | null | null |
seinokatsuhiro/koshu-java-tool | InstSize.hs | bsd-3-clause | instSize (J.INVOKESTATIC _) = 3 | 39 | instSize (J.INVOKESTATIC _) = 3 | 39 | instSize (J.INVOKESTATIC _) = 3 | 39 | false | false | 0 | 7 | 12 | 18 | 8 | 10 | null | null |
AdityaKumarRavikanti/Boxes | src/SheetDB.hs | mit | query :: Selector -> Sheet -> Query
query sel sheet = Query (Select sel sheet) 0 0 NoOrder | 90 | query :: Selector -> Sheet -> Query
query sel sheet = Query (Select sel sheet) 0 0 NoOrder | 90 | query sel sheet = Query (Select sel sheet) 0 0 NoOrder | 54 | false | true | 0 | 7 | 17 | 45 | 21 | 24 | null | null |
themoritz/cabal | cabal-install/Distribution/Client/Config.hs | bsd-3-clause | liftConfigFlag :: FieldDescr ConfigFlags -> FieldDescr SavedConfig
liftConfigFlag = liftField
savedConfigureFlags (\flags conf -> conf { savedConfigureFlags = flags }) | 169 | liftConfigFlag :: FieldDescr ConfigFlags -> FieldDescr SavedConfig
liftConfigFlag = liftField
savedConfigureFlags (\flags conf -> conf { savedConfigureFlags = flags }) | 169 | liftConfigFlag = liftField
savedConfigureFlags (\flags conf -> conf { savedConfigureFlags = flags }) | 102 | false | true | 0 | 9 | 21 | 45 | 23 | 22 | null | null |
michalkonecny/polypaver | src/Numeric/ER/RnToRm/UnitDom/ChebyshevBase/Polynom/Basic.hs | bsd-3-clause | chplSetMinGranularity gran (ERChebPoly coeffs) =
ERChebPoly $ Map.map (B.setMinGranularity gran) coeffs | 107 | chplSetMinGranularity gran (ERChebPoly coeffs) =
ERChebPoly $ Map.map (B.setMinGranularity gran) coeffs | 107 | chplSetMinGranularity gran (ERChebPoly coeffs) =
ERChebPoly $ Map.map (B.setMinGranularity gran) coeffs | 107 | false | false | 0 | 9 | 14 | 36 | 17 | 19 | null | null |
uduki/hsQt | Qtc/Gui/QStyleOption.hs | bsd-2-clause | qinit :: QStyleOption a -> ((QWidget t1)) -> IO ()
qinit x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QStyleOption_init cobj_x0 cobj_x1 | 176 | qinit :: QStyleOption a -> ((QWidget t1)) -> IO ()
qinit x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QStyleOption_init cobj_x0 cobj_x1 | 176 | qinit x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
withObjectPtr x1 $ \cobj_x1 ->
qtc_QStyleOption_init cobj_x0 cobj_x1 | 125 | false | true | 0 | 9 | 36 | 73 | 36 | 37 | null | null |
thsutton/tincan | src/Learning/TinCan/Validation.hs | bsd-2-clause | validateVerb json@(Object _) = fail "No implementation for validateVerb" | 72 | validateVerb json@(Object _) = fail "No implementation for validateVerb" | 72 | validateVerb json@(Object _) = fail "No implementation for validateVerb" | 72 | false | false | 0 | 8 | 8 | 21 | 10 | 11 | null | null |
spechub/Hets | OMDoc/OMDocInterface.hs | gpl-2.0 | isSymbol :: Constitutive -> Bool
isSymbol (CSy {}) = True | 57 | isSymbol :: Constitutive -> Bool
isSymbol (CSy {}) = True | 57 | isSymbol (CSy {}) = True | 24 | false | true | 0 | 6 | 9 | 30 | 14 | 16 | null | null |
MoritzR/CurseOfDestiny | src/Game.hs | gpl-3.0 | convertGameAction EndRound _ = return EndTurn | 45 | convertGameAction EndRound _ = return EndTurn | 45 | convertGameAction EndRound _ = return EndTurn | 45 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
ml9951/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Arrow notation
arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
arrAName = varQual aRROW (fsLit "arr") arrAIdKey | 159 | arrAName, composeAName, firstAName, appAName, choiceAName, loopAName :: Name
arrAName = varQual aRROW (fsLit "arr") arrAIdKey | 141 | arrAName = varQual aRROW (fsLit "arr") arrAIdKey | 64 | true | true | 0 | 7 | 33 | 35 | 23 | 12 | null | null |
Helium4Haskell/helium | lib/PreludeA.hs | gpl-3.0 | zipWith _ _ _ = [] | 30 | zipWith _ _ _ = [] | 30 | zipWith _ _ _ = [] | 30 | false | false | 1 | 6 | 17 | 16 | 6 | 10 | null | null |
authchir/haskell-wc | wc.hs | bsd-3-clause | runWithOptionsAndArgs :: [Flag] -> [String] -> IO ()
runWithOptionsAndArgs (Help:_) _ = printHelp | 97 | runWithOptionsAndArgs :: [Flag] -> [String] -> IO ()
runWithOptionsAndArgs (Help:_) _ = printHelp | 97 | runWithOptionsAndArgs (Help:_) _ = printHelp | 44 | false | true | 0 | 10 | 12 | 47 | 23 | 24 | null | null |
jsl/RunnyBabbot | test/RunnyBabbot/Spoonerize/Tests.hs | mit | test1 = H.assertEqual "Returns an annotated sentence"
[ WordInfo 1 "Hey" True, WordInfo 2 "u" False, WordInfo 3 "There" True]
(markedSentence "Hey u There") | 172 | test1 = H.assertEqual "Returns an annotated sentence"
[ WordInfo 1 "Hey" True, WordInfo 2 "u" False, WordInfo 3 "There" True]
(markedSentence "Hey u There") | 172 | test1 = H.assertEqual "Returns an annotated sentence"
[ WordInfo 1 "Hey" True, WordInfo 2 "u" False, WordInfo 3 "There" True]
(markedSentence "Hey u There") | 172 | false | false | 0 | 7 | 39 | 51 | 25 | 26 | null | null |
athanclark/markup | src/Data/Markup/Library.hs | mit | linkedJavaScriptBlaze :: T.Text -> HI.MarkupM ()
linkedJavaScriptBlaze link =
H.script (H.toHtml ("" :: T.Text)) H.! A.src (H.toValue link) | 141 | linkedJavaScriptBlaze :: T.Text -> HI.MarkupM ()
linkedJavaScriptBlaze link =
H.script (H.toHtml ("" :: T.Text)) H.! A.src (H.toValue link) | 141 | linkedJavaScriptBlaze link =
H.script (H.toHtml ("" :: T.Text)) H.! A.src (H.toValue link) | 92 | false | true | 0 | 10 | 19 | 67 | 33 | 34 | null | null |
vdweegen/UvA-Software_Testing | Lab5/Final/Lecture5NRC.hs | gpl-3.0 | bl :: Int -> [Int]
bl x = concat $ filter (elem x) blocks | 57 | bl :: Int -> [Int]
bl x = concat $ filter (elem x) blocks | 57 | bl x = concat $ filter (elem x) blocks | 38 | false | true | 2 | 8 | 13 | 44 | 19 | 25 | null | null |
blamario/grampa | grammatical-parsers/test/Test.hs | bsd-2-clause | --ignorable = recursiveOn [next] $ whiteSpace *> skipMany (next nameListGrammar *> whiteSpace <?> "ignorable1") <?> "ignorable"
--ignorable = whiteSpace *> (Parser.NonTerminal next *> ignorable <<|> pure ())
main = defaultMain tests | 233 | main = defaultMain tests | 24 | main = defaultMain tests | 24 | true | false | 1 | 5 | 31 | 15 | 6 | 9 | null | null |
rueshyna/gogol | gogol-mirror/gen/Network/Google/Mirror/Types/Product.hs | mpl-2.0 | -- | An opaque token sent to the subscriber in notifications so that it can
-- determine the ID of the user.
subUserToken :: Lens' Subscription (Maybe Text)
subUserToken
= lens _subUserToken (\ s a -> s{_subUserToken = a}) | 224 | subUserToken :: Lens' Subscription (Maybe Text)
subUserToken
= lens _subUserToken (\ s a -> s{_subUserToken = a}) | 115 | subUserToken
= lens _subUserToken (\ s a -> s{_subUserToken = a}) | 67 | true | true | 0 | 9 | 40 | 49 | 26 | 23 | null | null |
bergmark/purescript | src/Language/PureScript/Sugar/TypeClasses.hs | mit | memberToNameAndType :: Declaration -> (Ident, Type)
memberToNameAndType (TypeDeclaration ident ty) = (ident, ty) | 112 | memberToNameAndType :: Declaration -> (Ident, Type)
memberToNameAndType (TypeDeclaration ident ty) = (ident, ty) | 112 | memberToNameAndType (TypeDeclaration ident ty) = (ident, ty) | 60 | false | true | 0 | 7 | 12 | 38 | 21 | 17 | null | null |
Jon0/status | src/Template.hs | gpl-3.0 | generalForm :: String -> [HtmlContent] -> HtmlContent
generalForm a e = createForm [("action", a), ("method", "get")] e | 119 | generalForm :: String -> [HtmlContent] -> HtmlContent
generalForm a e = createForm [("action", a), ("method", "get")] e | 119 | generalForm a e = createForm [("action", a), ("method", "get")] e | 65 | false | true | 0 | 7 | 16 | 50 | 28 | 22 | null | null |
massysett/penny | penny/lib/Penny/Copper/Copperize.hs | bsd-3-clause | cRadixPerDigits :: Seq (D0'9 Char ()) -> RadixPerDigits Char ()
cRadixPerDigits ds = RadixPerDigits cRadixPer (D0'9'Star ds) | 124 | cRadixPerDigits :: Seq (D0'9 Char ()) -> RadixPerDigits Char ()
cRadixPerDigits ds = RadixPerDigits cRadixPer (D0'9'Star ds) | 124 | cRadixPerDigits ds = RadixPerDigits cRadixPer (D0'9'Star ds) | 60 | false | true | 0 | 9 | 16 | 49 | 23 | 26 | null | null |
harendra-kumar/asyncly | benchmark/StreamKOps.hs | bsd-3-clause | filterAllInNested
:: Monad m
=> Stream m Int -> m ()
filterAllInNested str = runStream $ do
x <- str
y <- str
let s = x + y
if s > 0
then return s
else S.nil
-------------------------------------------------------------------------------
-- Nested Composition Pure lists
-------------------------------------------------------------------------------
| 385 | filterAllInNested
:: Monad m
=> Stream m Int -> m ()
filterAllInNested str = runStream $ do
x <- str
y <- str
let s = x + y
if s > 0
then return s
else S.nil
-------------------------------------------------------------------------------
-- Nested Composition Pure lists
-------------------------------------------------------------------------------
| 385 | filterAllInNested str = runStream $ do
x <- str
y <- str
let s = x + y
if s > 0
then return s
else S.nil
-------------------------------------------------------------------------------
-- Nested Composition Pure lists
-------------------------------------------------------------------------------
| 324 | false | true | 0 | 11 | 79 | 92 | 44 | 48 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Type.hs | gpl-3.0 | instantiate (tp ::: tps) par = case instantiate tps par of
(ntps,Refl) -> (ctype tp par ::: ntps,Refl) | 104 | instantiate (tp ::: tps) par = case instantiate tps par of
(ntps,Refl) -> (ctype tp par ::: ntps,Refl) | 104 | instantiate (tp ::: tps) par = case instantiate tps par of
(ntps,Refl) -> (ctype tp par ::: ntps,Refl) | 104 | false | false | 0 | 10 | 19 | 55 | 28 | 27 | null | null |
gridaphobe/ghc | compiler/basicTypes/VarEnv.hs | bsd-3-clause | elemInScopeSet :: Var -> InScopeSet -> Bool
elemInScopeSet v (InScope in_scope _) = v `elemVarEnv` in_scope | 107 | elemInScopeSet :: Var -> InScopeSet -> Bool
elemInScopeSet v (InScope in_scope _) = v `elemVarEnv` in_scope | 107 | elemInScopeSet v (InScope in_scope _) = v `elemVarEnv` in_scope | 63 | false | true | 0 | 7 | 15 | 38 | 20 | 18 | null | null |
cdornan/keystore | examples/deploy/deploy.hs | bsd-3-clause | verify_ks :: Bool -> IC -> IO ()
verify_ks fatal ic = chk =<< catch (B.readFile ks_mac_fp >>= verifyKeystore ic sections) hdl
where
chk True = return ()
chk False | fatal = error msg
| otherwise = hPutStrLn stderr msg
hdl (se :: SomeException) =
error $ "failure during keystore verification: " ++ show se
msg = "the signature does not match the keystore" | 422 | verify_ks :: Bool -> IC -> IO ()
verify_ks fatal ic = chk =<< catch (B.readFile ks_mac_fp >>= verifyKeystore ic sections) hdl
where
chk True = return ()
chk False | fatal = error msg
| otherwise = hPutStrLn stderr msg
hdl (se :: SomeException) =
error $ "failure during keystore verification: " ++ show se
msg = "the signature does not match the keystore" | 422 | verify_ks fatal ic = chk =<< catch (B.readFile ks_mac_fp >>= verifyKeystore ic sections) hdl
where
chk True = return ()
chk False | fatal = error msg
| otherwise = hPutStrLn stderr msg
hdl (se :: SomeException) =
error $ "failure during keystore verification: " ++ show se
msg = "the signature does not match the keystore" | 389 | false | true | 1 | 10 | 131 | 144 | 63 | 81 | null | null |
shnarazk/mios | MultiConflict/SAT/Mios/Solver.hs | gpl-3.0 | valueVar :: Solver -> Var -> IO Int
valueVar = getNth . assigns | 63 | valueVar :: Solver -> Var -> IO Int
valueVar = getNth . assigns | 63 | valueVar = getNth . assigns | 27 | false | true | 0 | 7 | 12 | 26 | 13 | 13 | null | null |
anchor/haskell-netsuite | lib/Netsuite/Restlet.hs | bsd-3-clause | chunkableRestletExecute :: String -> NsRestletConfig -> IO RestletResponse
chunkableRestletExecute s cfg = chunkableRestletExecute' mempty False s cfg
where
-- | Chunked restlet execution function internal.
-- chunkableRestletExecute' :: RestletResponse -> Bool -> String -> NsRestletConfig -> IO RestletResponse
chunkableRestletExecute' lastR isChunking s' cfg' =
case configOK cfg' of
Just bd -> do
resp <- restletExecute' s' cfg' bd
case resp of
RestletErrorResp{} ->
case interpretError resp of
BeginChunking{} -> runAgain mempty -- Begin chunking
EndChunking{} -> return lastR -- End chunking
_ -> return resp -- Just return the error
_ ->
if isChunking
then runAgain (mappend lastR resp) -- Read another chunk
else return resp -- We have enough already
Nothing -> error "Configuration not valid"
runAgain newResp = chunkableRestletExecute' newResp True s cfg
-- | Checks to see if our URL config is valid.
-- @TODO: Add more checks. | 1,282 | chunkableRestletExecute :: String -> NsRestletConfig -> IO RestletResponse
chunkableRestletExecute s cfg = chunkableRestletExecute' mempty False s cfg
where
-- | Chunked restlet execution function internal.
-- chunkableRestletExecute' :: RestletResponse -> Bool -> String -> NsRestletConfig -> IO RestletResponse
chunkableRestletExecute' lastR isChunking s' cfg' =
case configOK cfg' of
Just bd -> do
resp <- restletExecute' s' cfg' bd
case resp of
RestletErrorResp{} ->
case interpretError resp of
BeginChunking{} -> runAgain mempty -- Begin chunking
EndChunking{} -> return lastR -- End chunking
_ -> return resp -- Just return the error
_ ->
if isChunking
then runAgain (mappend lastR resp) -- Read another chunk
else return resp -- We have enough already
Nothing -> error "Configuration not valid"
runAgain newResp = chunkableRestletExecute' newResp True s cfg
-- | Checks to see if our URL config is valid.
-- @TODO: Add more checks. | 1,282 | chunkableRestletExecute s cfg = chunkableRestletExecute' mempty False s cfg
where
-- | Chunked restlet execution function internal.
-- chunkableRestletExecute' :: RestletResponse -> Bool -> String -> NsRestletConfig -> IO RestletResponse
chunkableRestletExecute' lastR isChunking s' cfg' =
case configOK cfg' of
Just bd -> do
resp <- restletExecute' s' cfg' bd
case resp of
RestletErrorResp{} ->
case interpretError resp of
BeginChunking{} -> runAgain mempty -- Begin chunking
EndChunking{} -> return lastR -- End chunking
_ -> return resp -- Just return the error
_ ->
if isChunking
then runAgain (mappend lastR resp) -- Read another chunk
else return resp -- We have enough already
Nothing -> error "Configuration not valid"
runAgain newResp = chunkableRestletExecute' newResp True s cfg
-- | Checks to see if our URL config is valid.
-- @TODO: Add more checks. | 1,207 | false | true | 1 | 16 | 484 | 190 | 94 | 96 | null | null |
fatho/ninja | src/Graphics/Ninja/GL/Texture.hs | mit | activeTexture :: StateVar TextureUnit
activeTexture = makeStateVar g s where
g = fromIntegral <$> withPtrOut (glGetIntegerv GL_ACTIVE_TEXTURE)
s = glActiveTexture
-- | Changes the texture unit for the duration of the supplied action. | 238 | activeTexture :: StateVar TextureUnit
activeTexture = makeStateVar g s where
g = fromIntegral <$> withPtrOut (glGetIntegerv GL_ACTIVE_TEXTURE)
s = glActiveTexture
-- | Changes the texture unit for the duration of the supplied action. | 238 | activeTexture = makeStateVar g s where
g = fromIntegral <$> withPtrOut (glGetIntegerv GL_ACTIVE_TEXTURE)
s = glActiveTexture
-- | Changes the texture unit for the duration of the supplied action. | 200 | false | true | 4 | 6 | 37 | 60 | 24 | 36 | null | null |
sdiehl/ghc | testsuite/tests/polykinds/T15795.hs | bsd-3-clause | f :: forall k (b :: k). T b
f = error "urk" | 43 | f :: forall k (b :: k). T b
f = error "urk" | 43 | f = error "urk" | 15 | false | true | 0 | 8 | 12 | 35 | 17 | 18 | null | null |
laanwj/Purecoin | Purecoin/Core/Script.hs | mit | putOp OP_12 = putWord8 92 | 25 | putOp OP_12 = putWord8 92 | 25 | putOp OP_12 = putWord8 92 | 25 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Verbosity.hs | bsd-3-clause | --silent should stay silent
moreVerbose Normal = Verbose | 59 | moreVerbose Normal = Verbose | 31 | moreVerbose Normal = Verbose | 31 | true | false | 0 | 5 | 10 | 10 | 5 | 5 | null | null |
rolph-recto/liquidhaskell | src/Language/Haskell/Liquid/RefType.hs | bsd-3-clause | eqRSort _ _ (RHole _)
= True | 38 | eqRSort _ _ (RHole _)
= True | 38 | eqRSort _ _ (RHole _)
= True | 38 | false | false | 0 | 7 | 16 | 19 | 9 | 10 | null | null |
arekfu/project_euler | p0051/p0051.hs | mit | allEqual :: (Eq a) => [a] -> Bool
allEqual (x:y:xs) = x==y && allEqual (y:xs) | 77 | allEqual :: (Eq a) => [a] -> Bool
allEqual (x:y:xs) = x==y && allEqual (y:xs) | 77 | allEqual (x:y:xs) = x==y && allEqual (y:xs) | 43 | false | true | 3 | 7 | 14 | 63 | 32 | 31 | null | null |
dgvncsz0f/nws | src/Jerimum/PostgreSQL/Types.hs | bsd-3-clause | viewAllFieldset :: TxData -> Maybe Fieldset
viewAllFieldset txdata =
let mapf fieldset = maybe fieldset (M.union fieldset) $ viewOldKeys txdata
in mapf <$> viewFieldset txdata | 179 | viewAllFieldset :: TxData -> Maybe Fieldset
viewAllFieldset txdata =
let mapf fieldset = maybe fieldset (M.union fieldset) $ viewOldKeys txdata
in mapf <$> viewFieldset txdata | 179 | viewAllFieldset txdata =
let mapf fieldset = maybe fieldset (M.union fieldset) $ viewOldKeys txdata
in mapf <$> viewFieldset txdata | 135 | false | true | 0 | 13 | 28 | 62 | 28 | 34 | null | null |
moonKimura/vector-0.10.9.1 | Data/Vector/Fusion/Stream.hs | bsd-3-clause | scanl1' = M.scanl1' | 19 | scanl1' = M.scanl1' | 19 | scanl1' = M.scanl1' | 19 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
facebook/fbthrift | thrift/compiler/test/fixtures/includes/gen-hs/Transitive_Types.hs | apache-2.0 | -- | Default values for the 'Foo' struct
default_Foo :: Foo
default_Foo = Foo{
foo_a = 2} | 91 | default_Foo :: Foo
default_Foo = Foo{
foo_a = 2} | 50 | default_Foo = Foo{
foo_a = 2} | 31 | true | true | 0 | 6 | 18 | 20 | 12 | 8 | null | null |
HaskellCNOrg/snap-web | src/Models/Utils.hs | bsd-3-clause | sToBS :: String -> BS.ByteString
sToBS = T.encodeUtf8 . T.pack | 62 | sToBS :: String -> BS.ByteString
sToBS = T.encodeUtf8 . T.pack | 62 | sToBS = T.encodeUtf8 . T.pack | 29 | false | true | 0 | 6 | 9 | 25 | 13 | 12 | null | null |
uws-eresearch/docx2pandoc | src/Text/Pandoc/Readers/DocX.hs | gpl-2.0 | blkToCode :: Block -> String
blkToCode (Para []) = "" | 53 | blkToCode :: Block -> String
blkToCode (Para []) = "" | 53 | blkToCode (Para []) = "" | 24 | false | true | 0 | 8 | 9 | 26 | 13 | 13 | null | null |
mattias-lundell/timber-llvm | src/Interfaces.hs | bsd-3-clause | writeAPI modul ifc = writeFile (modul ++ ".html") (render(toHTML modul (ifc :: IFace))) | 99 | writeAPI modul ifc = writeFile (modul ++ ".html") (render(toHTML modul (ifc :: IFace))) | 99 | writeAPI modul ifc = writeFile (modul ++ ".html") (render(toHTML modul (ifc :: IFace))) | 99 | false | false | 1 | 10 | 24 | 47 | 22 | 25 | null | null |
AlexanderPankiv/ghc | libraries/base/GHC/Conc/Sync.hs | bsd-3-clause | -- | Returns the number of sparks currently in the local spark pool
numSparks :: IO Int
numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) | 161 | numSparks :: IO Int
numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) | 93 | numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) | 73 | true | true | 0 | 11 | 36 | 50 | 26 | 24 | null | null |
M42/mikrokosmos | source/Lambda.hs | gpl-3.0 | indexColor _ e = show e | 23 | indexColor _ e = show e | 23 | indexColor _ e = show e | 23 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
brendanhay/gogol | gogol-people/gen/Network/Google/Resource/People/People/CreateContact.hs | mpl-2.0 | -- | OAuth access token.
pccAccessToken :: Lens' PeopleCreateContact (Maybe Text)
pccAccessToken
= lens _pccAccessToken
(\ s a -> s{_pccAccessToken = a}) | 161 | pccAccessToken :: Lens' PeopleCreateContact (Maybe Text)
pccAccessToken
= lens _pccAccessToken
(\ s a -> s{_pccAccessToken = a}) | 136 | pccAccessToken
= lens _pccAccessToken
(\ s a -> s{_pccAccessToken = a}) | 79 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
ktvoelker/brick | src/Brick/Widgets/List.hs | bsd-3-clause | -- | Return a list's selected element, if any.
listSelectedElement :: List e -> Maybe (Int, e)
listSelectedElement l = do
sel <- l^.listSelectedL
return (sel, (l^.listElementsL) V.! sel)
-- Assuming `xs` is an existing list that we want to update to match the
-- state of `ys`. Given a selected index in `xs`, the goal is to compute
-- the corresponding index in `ys`. | 373 | listSelectedElement :: List e -> Maybe (Int, e)
listSelectedElement l = do
sel <- l^.listSelectedL
return (sel, (l^.listElementsL) V.! sel)
-- Assuming `xs` is an existing list that we want to update to match the
-- state of `ys`. Given a selected index in `xs`, the goal is to compute
-- the corresponding index in `ys`. | 326 | listSelectedElement l = do
sel <- l^.listSelectedL
return (sel, (l^.listElementsL) V.! sel)
-- Assuming `xs` is an existing list that we want to update to match the
-- state of `ys`. Given a selected index in `xs`, the goal is to compute
-- the corresponding index in `ys`. | 278 | true | true | 0 | 11 | 69 | 70 | 37 | 33 | null | null |
kelnage/tamarin-prover | lib/theory/src/Theory/Proof.hs | gpl-3.0 | proofStepStatus (ProofStep _ (Just _)) = CompleteProof | 62 | proofStepStatus (ProofStep _ (Just _)) = CompleteProof | 62 | proofStepStatus (ProofStep _ (Just _)) = CompleteProof | 62 | false | false | 0 | 9 | 14 | 23 | 11 | 12 | null | null |
well-typed/lens-sop | src/Generics/SOP/Lens/Computed.hs | bsd-3-clause | -- | Setter with possibility for "compile time" failure
setM :: (Monad m, Arrow w)
=> AbstractLens r w c a -> (forall x. c x => m x) -> m (w a a)
setM (AbstractLens l) mx =
mx >>= \x -> return $ GLens.set l . arr (\a -> (x, a)) | 234 | setM :: (Monad m, Arrow w)
=> AbstractLens r w c a -> (forall x. c x => m x) -> m (w a a)
setM (AbstractLens l) mx =
mx >>= \x -> return $ GLens.set l . arr (\a -> (x, a)) | 178 | setM (AbstractLens l) mx =
mx >>= \x -> return $ GLens.set l . arr (\a -> (x, a)) | 83 | true | true | 0 | 11 | 59 | 123 | 63 | 60 | null | null |
ngzax/urbit | pkg/hs/urbit-king/lib/Urbit/Vere/Log.hs | mit | eitherExn :: Exception e => Either a b -> (a -> e) -> IO b
eitherExn eat exn = either (throwIO . exn) pure eat | 110 | eitherExn :: Exception e => Either a b -> (a -> e) -> IO b
eitherExn eat exn = either (throwIO . exn) pure eat | 110 | eitherExn eat exn = either (throwIO . exn) pure eat | 51 | false | true | 0 | 9 | 24 | 60 | 29 | 31 | null | null |
peddie/fingertrees | src/Data/FingerTree.hs | bsd-3-clause | nodeToDigit (Node3 _ a b c) = Three a b c | 41 | nodeToDigit (Node3 _ a b c) = Three a b c | 41 | nodeToDigit (Node3 _ a b c) = Three a b c | 41 | false | false | 0 | 7 | 10 | 28 | 13 | 15 | null | null |
unisonweb/platform | unison-core/src/Unison/Paths.hs | mit | asTerm :: Target v -> Maybe (Term v)
asTerm (Term t) = Just t | 61 | asTerm :: Target v -> Maybe (Term v)
asTerm (Term t) = Just t | 61 | asTerm (Term t) = Just t | 24 | false | true | 0 | 8 | 13 | 39 | 18 | 21 | null | null |
truls/language-vhdl-quote | src/Language/VHDL/Parser/Internal.hs | mpl-2.0 | -- For parsing definite ranges (i.e. preceded by range kw)
range' :: Parser Range
range' =
choice
[ try
-- We have no way of parsing specifically parsing an attribute name so here
-- we go...
((expression <* notFollowedBy direction) >>= \case
PrimName (NAttr n@AttributeName {}) -> RAttr <$> pure n
_ -> fail "")
, RSimple <$> expression <*> direction <*> expression
] | 420 | range' :: Parser Range
range' =
choice
[ try
-- We have no way of parsing specifically parsing an attribute name so here
-- we go...
((expression <* notFollowedBy direction) >>= \case
PrimName (NAttr n@AttributeName {}) -> RAttr <$> pure n
_ -> fail "")
, RSimple <$> expression <*> direction <*> expression
] | 361 | range' =
choice
[ try
-- We have no way of parsing specifically parsing an attribute name so here
-- we go...
((expression <* notFollowedBy direction) >>= \case
PrimName (NAttr n@AttributeName {}) -> RAttr <$> pure n
_ -> fail "")
, RSimple <$> expression <*> direction <*> expression
] | 338 | true | true | 0 | 16 | 115 | 98 | 50 | 48 | null | null |
wangwangwar/cis194 | src/ch7/Ch7.hs | bsd-3-clause | treeMax :: (Ord a, Bounded a) => Tree a -> a
treeMax = treeFold minBound (\l x r -> l `max` x `max` r) | 102 | treeMax :: (Ord a, Bounded a) => Tree a -> a
treeMax = treeFold minBound (\l x r -> l `max` x `max` r) | 102 | treeMax = treeFold minBound (\l x r -> l `max` x `max` r) | 57 | false | true | 0 | 9 | 23 | 70 | 35 | 35 | null | null |
google/codeworld | codeworld-compiler/src/CodeWorld/Compile/Stages.hs | apache-2.0 | isGoodPatAppRhs (PTuple _ _ _) = True | 37 | isGoodPatAppRhs (PTuple _ _ _) = True | 37 | isGoodPatAppRhs (PTuple _ _ _) = True | 37 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
jbearer/hspl | test/Testing.hs | mit | shouldBeSubsetOf :: (HasCallStack, Show a, Eq a) => [a] -> [a] -> Expectation
shouldBeSubsetOf xs ys
| xs `isSubsetOf` ys = success
| otherwise = failure $ "Expected: " ++ show xs ++ "\nto be a subset of: " ++ show ys | 221 | shouldBeSubsetOf :: (HasCallStack, Show a, Eq a) => [a] -> [a] -> Expectation
shouldBeSubsetOf xs ys
| xs `isSubsetOf` ys = success
| otherwise = failure $ "Expected: " ++ show xs ++ "\nto be a subset of: " ++ show ys | 221 | shouldBeSubsetOf xs ys
| xs `isSubsetOf` ys = success
| otherwise = failure $ "Expected: " ++ show xs ++ "\nto be a subset of: " ++ show ys | 143 | false | true | 1 | 8 | 45 | 90 | 46 | 44 | null | null |
ezyang/ghc | compiler/utils/Pretty.hs | bsd-3-clause | above_ p g q = Above p g q | 30 | above_ p g q = Above p g q | 30 | above_ p g q = Above p g q | 30 | false | false | 0 | 5 | 12 | 20 | 9 | 11 | null | null |
seckcoder/lang-learn | haskell/samples/src/pattern_match.hs | unlicense | foo = fact 10
where fact 0 = 1
fact 1 = 1
fact n = n * (fact (n-1)) | 85 | foo = fact 10
where fact 0 = 1
fact 1 = 1
fact n = n * (fact (n-1)) | 85 | foo = fact 10
where fact 0 = 1
fact 1 = 1
fact n = n * (fact (n-1)) | 85 | false | false | 5 | 9 | 37 | 67 | 26 | 41 | null | null |
abakst/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Generic.hs | bsd-3-clause | unsafeTake n v = unsafeSlice 0 n v | 34 | unsafeTake n v = unsafeSlice 0 n v | 34 | unsafeTake n v = unsafeSlice 0 n v | 34 | false | false | 1 | 5 | 7 | 22 | 8 | 14 | null | null |
grnet/snf-ganeti | src/Ganeti/BasicTypes.hs | bsd-2-clause | genericResult _ g (Ok b) = g b | 30 | genericResult _ g (Ok b) = g b | 30 | genericResult _ g (Ok b) = g b | 30 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.