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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tolysz/hs-tls
|
core/Network/TLS/Struct.hs
|
bsd-3-clause
|
bigNumToInteger :: BigNum -> Integer
bigNumToInteger (BigNum b) = os2ip b
| 73
|
bigNumToInteger :: BigNum -> Integer
bigNumToInteger (BigNum b) = os2ip b
| 73
|
bigNumToInteger (BigNum b) = os2ip b
| 36
| false
| true
| 0
| 7
| 10
| 27
| 13
| 14
| null | null |
medik/lang-hack
|
Haskell/haskell-tuts.hs
|
gpl-3.0
|
example = 5 + 4 - 6 * 7 / 10
| 28
|
example = 5 + 4 - 6 * 7 / 10
| 28
|
example = 5 + 4 - 6 * 7 / 10
| 28
| false
| false
| 0
| 8
| 10
| 22
| 11
| 11
| null | null |
brendanhay/gogol
|
gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'GoogleDevtoolsCloudbuildV2OperationMetadata' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gdcvomAPIVersion'
--
-- * 'gdcvomRequestedCancellation'
--
-- * 'gdcvomStatusMessage'
--
-- * 'gdcvomEndTime'
--
-- * 'gdcvomVerb'
--
-- * 'gdcvomTarget'
--
-- * 'gdcvomCreateTime'
googleDevtoolsCloudbuildV2OperationMetadata
:: GoogleDevtoolsCloudbuildV2OperationMetadata
googleDevtoolsCloudbuildV2OperationMetadata =
GoogleDevtoolsCloudbuildV2OperationMetadata'
{ _gdcvomAPIVersion = Nothing
, _gdcvomRequestedCancellation = Nothing
, _gdcvomStatusMessage = Nothing
, _gdcvomEndTime = Nothing
, _gdcvomVerb = Nothing
, _gdcvomTarget = Nothing
, _gdcvomCreateTime = Nothing
}
| 817
|
googleDevtoolsCloudbuildV2OperationMetadata
:: GoogleDevtoolsCloudbuildV2OperationMetadata
googleDevtoolsCloudbuildV2OperationMetadata =
GoogleDevtoolsCloudbuildV2OperationMetadata'
{ _gdcvomAPIVersion = Nothing
, _gdcvomRequestedCancellation = Nothing
, _gdcvomStatusMessage = Nothing
, _gdcvomEndTime = Nothing
, _gdcvomVerb = Nothing
, _gdcvomTarget = Nothing
, _gdcvomCreateTime = Nothing
}
| 432
|
googleDevtoolsCloudbuildV2OperationMetadata =
GoogleDevtoolsCloudbuildV2OperationMetadata'
{ _gdcvomAPIVersion = Nothing
, _gdcvomRequestedCancellation = Nothing
, _gdcvomStatusMessage = Nothing
, _gdcvomEndTime = Nothing
, _gdcvomVerb = Nothing
, _gdcvomTarget = Nothing
, _gdcvomCreateTime = Nothing
}
| 337
| true
| true
| 1
| 7
| 130
| 79
| 53
| 26
| null | null |
cliffano/swaggy-jenkins
|
clients/haskell-http-client/generated/lib/SwaggyJenkins/ModelLens.hs
|
mit
|
-- | 'freeStyleProjectLastFailedBuild' Lens
freeStyleProjectLastFailedBuildL :: Lens_' FreeStyleProject (Maybe Text)
freeStyleProjectLastFailedBuildL f FreeStyleProject{..} = (\freeStyleProjectLastFailedBuild -> FreeStyleProject { freeStyleProjectLastFailedBuild, ..} ) <$> f freeStyleProjectLastFailedBuild
| 307
|
freeStyleProjectLastFailedBuildL :: Lens_' FreeStyleProject (Maybe Text)
freeStyleProjectLastFailedBuildL f FreeStyleProject{..} = (\freeStyleProjectLastFailedBuild -> FreeStyleProject { freeStyleProjectLastFailedBuild, ..} ) <$> f freeStyleProjectLastFailedBuild
| 263
|
freeStyleProjectLastFailedBuildL f FreeStyleProject{..} = (\freeStyleProjectLastFailedBuild -> FreeStyleProject { freeStyleProjectLastFailedBuild, ..} ) <$> f freeStyleProjectLastFailedBuild
| 190
| true
| true
| 0
| 8
| 23
| 57
| 30
| 27
| null | null |
ezyang/ghc
|
compiler/cmm/PprC.hs
|
bsd-3-clause
|
pprLit1 lit@(CmmFloat _ _) = parens (pprLit lit)
| 51
|
pprLit1 lit@(CmmFloat _ _) = parens (pprLit lit)
| 51
|
pprLit1 lit@(CmmFloat _ _) = parens (pprLit lit)
| 51
| false
| false
| 0
| 8
| 10
| 29
| 14
| 15
| null | null |
ublubu/shapes
|
shapes/src/Utils/Utils.hs
|
mit
|
findOrInsert :: IM.Key -> a -> IM.IntMap a -> (Maybe a, IM.IntMap a)
findOrInsert = IM.insertLookupWithKey (\_ _ a -> a)
| 120
|
findOrInsert :: IM.Key -> a -> IM.IntMap a -> (Maybe a, IM.IntMap a)
findOrInsert = IM.insertLookupWithKey (\_ _ a -> a)
| 120
|
findOrInsert = IM.insertLookupWithKey (\_ _ a -> a)
| 51
| false
| true
| 0
| 10
| 20
| 61
| 31
| 30
| null | null |
Lythimus/lptv
|
sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Readers/HTML.hs
|
gpl-2.0
|
{-
inlineHtmlTags :: [[Char]]
inlineHtmlTags = ["a", "abbr", "acronym", "b", "basefont", "bdo", "big",
"br", "cite", "code", "dfn", "em", "font", "i", "img",
"input", "kbd", "label", "q", "s", "samp", "select",
"small", "span", "strike", "strong", "sub", "sup",
"textarea", "tt", "u", "var"]
-}
blockHtmlTags :: [String]
blockHtmlTags = ["address", "blockquote", "body", "center", "dir", "div",
"dl", "fieldset", "form", "h1", "h2", "h3", "h4",
"h5", "h6", "head", "hr", "html", "isindex", "menu",
"noframes", "noscript", "ol", "p", "pre", "table", "ul", "dd",
"dt", "frameset", "li", "tbody", "td", "tfoot",
"th", "thead", "tr", "script", "style"]
| 806
|
blockHtmlTags :: [String]
blockHtmlTags = ["address", "blockquote", "body", "center", "dir", "div",
"dl", "fieldset", "form", "h1", "h2", "h3", "h4",
"h5", "h6", "head", "hr", "html", "isindex", "menu",
"noframes", "noscript", "ol", "p", "pre", "table", "ul", "dd",
"dt", "frameset", "li", "tbody", "td", "tfoot",
"th", "thead", "tr", "script", "style"]
| 438
|
blockHtmlTags = ["address", "blockquote", "body", "center", "dir", "div",
"dl", "fieldset", "form", "h1", "h2", "h3", "h4",
"h5", "h6", "head", "hr", "html", "isindex", "menu",
"noframes", "noscript", "ol", "p", "pre", "table", "ul", "dd",
"dt", "frameset", "li", "tbody", "td", "tfoot",
"th", "thead", "tr", "script", "style"]
| 412
| true
| true
| 0
| 5
| 240
| 132
| 87
| 45
| null | null |
typelead/epm
|
Cabal/Distribution/Simple/BuildTarget.hs
|
bsd-3-clause
|
componentModules (CTest test) = testModules test
| 50
|
componentModules (CTest test) = testModules test
| 50
|
componentModules (CTest test) = testModules test
| 50
| false
| false
| 0
| 7
| 7
| 18
| 8
| 10
| null | null |
jacekszymanski/wxHaskell
|
samples/wxcore/BouncingBalls.hs
|
lgpl-2.1
|
maxX = 300
| 12
|
maxX = 300
| 12
|
maxX = 300
| 12
| false
| false
| 0
| 4
| 4
| 6
| 3
| 3
| null | null |
lomeo/my
|
src/My/Data/Tuple.hs
|
mit
|
onFst :: (a -> c) -> (a, b) -> (c, b)
onFst f (x, y) = (f x, y)
| 64
|
onFst :: (a -> c) -> (a, b) -> (c, b)
onFst f (x, y) = (f x, y)
| 64
|
onFst f (x, y) = (f x, y)
| 25
| false
| true
| 0
| 7
| 19
| 58
| 33
| 25
| null | null |
rehno-lindeque/elm-reactor
|
src/backend/Socket.hs
|
bsd-3-clause
|
watchFile :: FilePath -> WS.PendingConnection -> IO ()
watchFile watchedFile pendingConnection =
do connection <- WS.acceptRequest pendingConnection
Notify.withManager $ \mgmt ->
do stop <- Notify.treeExtAny mgmt "." ".elm" print
tend connection
stop
| 293
|
watchFile :: FilePath -> WS.PendingConnection -> IO ()
watchFile watchedFile pendingConnection =
do connection <- WS.acceptRequest pendingConnection
Notify.withManager $ \mgmt ->
do stop <- Notify.treeExtAny mgmt "." ".elm" print
tend connection
stop
| 293
|
watchFile watchedFile pendingConnection =
do connection <- WS.acceptRequest pendingConnection
Notify.withManager $ \mgmt ->
do stop <- Notify.treeExtAny mgmt "." ".elm" print
tend connection
stop
| 238
| false
| true
| 0
| 13
| 74
| 84
| 38
| 46
| null | null |
nevrenato/Hets_Fork
|
utils/DtdToHaskell-src/current/TypeDef.hs
|
gpl-2.0
|
-- | Prefix a field name with its enclosing element name.
name_f :: String -> String -> Name
name_f e n = Name { xName = n
, hName = manglef e ++ mangle n }
| 174
|
name_f :: String -> String -> Name
name_f e n = Name { xName = n
, hName = manglef e ++ mangle n }
| 116
|
name_f e n = Name { xName = n
, hName = manglef e ++ mangle n }
| 81
| true
| true
| 0
| 9
| 53
| 58
| 28
| 30
| null | null |
Tener/personal-library-yesod
|
Handler/File.hs
|
bsd-2-clause
|
getFileViewR :: FileId -> Handler RepHtml
getFileViewR fid = do
linkUser <- mkDisplayUserWidget
file <- runDB $ get404 fid
defaultLayout $ do
setTitle "File description."
$(widgetFile "file/view")
-- download
| 231
|
getFileViewR :: FileId -> Handler RepHtml
getFileViewR fid = do
linkUser <- mkDisplayUserWidget
file <- runDB $ get404 fid
defaultLayout $ do
setTitle "File description."
$(widgetFile "file/view")
-- download
| 231
|
getFileViewR fid = do
linkUser <- mkDisplayUserWidget
file <- runDB $ get404 fid
defaultLayout $ do
setTitle "File description."
$(widgetFile "file/view")
-- download
| 189
| false
| true
| 0
| 12
| 51
| 66
| 29
| 37
| null | null |
vikraman/ghc
|
compiler/simplCore/OccurAnal.hs
|
bsd-3-clause
|
-- It's OK to use nonDetFoldUFM here because addIdOcc commutes
addIdOcc :: Id -> UsageDetails -> UsageDetails
addIdOcc v u | isId v = addOneOcc u v NoOccInfo
| otherwise = u
| 190
|
addIdOcc :: Id -> UsageDetails -> UsageDetails
addIdOcc v u | isId v = addOneOcc u v NoOccInfo
| otherwise = u
| 126
|
addIdOcc v u | isId v = addOneOcc u v NoOccInfo
| otherwise = u
| 79
| true
| true
| 0
| 8
| 48
| 50
| 23
| 27
| null | null |
dongarerahul/edx-haskell
|
monads.hs
|
apache-2.0
|
{--
-- http://www.cs.nott.ac.uk/~pszgmh/monads
class Monad m where
(>>=) :: m a -> (a -> m b) -> m b -- bind
return :: a -> m a -- return while completing do block
3 laws that all monads should satisfy
return a >>= f = f a
m >>= return = m
(m >>= f) >>= g = m >>= (\x -> f x >>= g)
3 laws in do notation
do x <- m
return x
= do m
do y <- return x
f y
= do f x
do b <- do a <- m
f a
= do a <- m
b <- f a
g b
= do a <- m
do b <- f a
g b
auxilary operation defined in terms of bind i.e. >>=
(>>) :: Monad m => m a -> m b -> m b
m >> k = m >>= (\_ -> k)
Monad provides uniform interface to 3 very different but fundamental ideas :
- FAILURE : handling errors / exceptions' situation
- COLLECTIONS :
- EFFECTS :
--}
{--
sequence' [Just 1, Just 2] => Just [1, 2]
sequence' [Just 1, Just 2, Nothing] => Nothing
sequence' here allow us to collect series of computation results
which can possibly fail or yield aggregated values if they all succeeded
--}
sequence' :: Monad m => [m a] -> m [a]
sequence' = foldr mcons (return [])
| 1,156
|
sequence' :: Monad m => [m a] -> m [a]
sequence' = foldr mcons (return [])
| 74
|
sequence' = foldr mcons (return [])
| 35
| true
| true
| 0
| 8
| 373
| 49
| 25
| 24
| null | null |
GaloisInc/halvm-ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
isTyVarExposed tv (AppTy fun arg) = isTyVarExposed tv fun
|| isTyVarExposed tv arg
| 115
|
isTyVarExposed tv (AppTy fun arg) = isTyVarExposed tv fun
|| isTyVarExposed tv arg
| 115
|
isTyVarExposed tv (AppTy fun arg) = isTyVarExposed tv fun
|| isTyVarExposed tv arg
| 115
| false
| false
| 0
| 6
| 45
| 35
| 15
| 20
| null | null |
gentoo-haskell/hackport
|
Status.hs
|
gpl-3.0
|
runStatus :: Cabal.Verbosity -> FilePath -> FilePath -> StatusDirection -> [String] -> CabalInstall.RepoContext -> IO ()
runStatus verbosity portdir overlaydir direction pkgs repoContext = do
let pkgFilter = case direction of
OverlayToPortage -> toPortageFilter
PortagePlusOverlay -> id
HackageToOverlay -> fromHackageFilter
pkgs' <- forM pkgs $ \p ->
case simpleParsec p of
Nothing -> Cabal.die' verbosity ("Could not parse package name: " ++ p ++ ". Format cat/pkg")
Just pn -> return pn
tree0 <- status verbosity portdir overlaydir repoContext
let tree = pkgFilter tree0
if (null pkgs')
then statusPrinter tree
else forM_ pkgs' $ \pkg -> statusPrinter (Map.filterWithKey (\k _ -> k == pkg) tree)
-- |Only return packages that seems interesting to sync to portage;
--
-- * Ebuild differs, or
-- * Newer version in overlay than in portage
| 972
|
runStatus :: Cabal.Verbosity -> FilePath -> FilePath -> StatusDirection -> [String] -> CabalInstall.RepoContext -> IO ()
runStatus verbosity portdir overlaydir direction pkgs repoContext = do
let pkgFilter = case direction of
OverlayToPortage -> toPortageFilter
PortagePlusOverlay -> id
HackageToOverlay -> fromHackageFilter
pkgs' <- forM pkgs $ \p ->
case simpleParsec p of
Nothing -> Cabal.die' verbosity ("Could not parse package name: " ++ p ++ ". Format cat/pkg")
Just pn -> return pn
tree0 <- status verbosity portdir overlaydir repoContext
let tree = pkgFilter tree0
if (null pkgs')
then statusPrinter tree
else forM_ pkgs' $ \pkg -> statusPrinter (Map.filterWithKey (\k _ -> k == pkg) tree)
-- |Only return packages that seems interesting to sync to portage;
--
-- * Ebuild differs, or
-- * Newer version in overlay than in portage
| 972
|
runStatus verbosity portdir overlaydir direction pkgs repoContext = do
let pkgFilter = case direction of
OverlayToPortage -> toPortageFilter
PortagePlusOverlay -> id
HackageToOverlay -> fromHackageFilter
pkgs' <- forM pkgs $ \p ->
case simpleParsec p of
Nothing -> Cabal.die' verbosity ("Could not parse package name: " ++ p ++ ". Format cat/pkg")
Just pn -> return pn
tree0 <- status verbosity portdir overlaydir repoContext
let tree = pkgFilter tree0
if (null pkgs')
then statusPrinter tree
else forM_ pkgs' $ \pkg -> statusPrinter (Map.filterWithKey (\k _ -> k == pkg) tree)
-- |Only return packages that seems interesting to sync to portage;
--
-- * Ebuild differs, or
-- * Newer version in overlay than in portage
| 851
| false
| true
| 0
| 16
| 263
| 244
| 120
| 124
| null | null |
ducis/haAni
|
hs/common/Graphics/Rendering/OpenGL/GL/PixelRectangles/ColorTable.hs
|
gpl-2.0
|
marshalProxyColorTable Proxy x = case x of
ColorTable -> Just gl_PROXY_COLOR_TABLE
PostConvolutionColorTable -> Just gl_PROXY_POST_CONVOLUTION_COLOR_TABLE
PostColorMatrixColorTable -> Just gl_PROXY_POST_COLOR_MATRIX_COLOR_TABLE
Texture1DColorTable -> Just gl_PROXY_TEXTURE_1D
Texture2DColorTable -> Just gl_PROXY_TEXTURE_2D
Texture3DColorTable -> Just gl_PROXY_TEXTURE_3D
TextureCubeMapColorTable -> Just gl_PROXY_TEXTURE_CUBE_MAP
-- TODO: Use PROXY_TEXTURE_COLOR_TABLE_SGI from SGI_texture_color_table extension
TextureColorTable -> Just 0x80bd
SharedTexturePalette -> Nothing
--------------------------------------------------------------------------------
| 691
|
marshalProxyColorTable Proxy x = case x of
ColorTable -> Just gl_PROXY_COLOR_TABLE
PostConvolutionColorTable -> Just gl_PROXY_POST_CONVOLUTION_COLOR_TABLE
PostColorMatrixColorTable -> Just gl_PROXY_POST_COLOR_MATRIX_COLOR_TABLE
Texture1DColorTable -> Just gl_PROXY_TEXTURE_1D
Texture2DColorTable -> Just gl_PROXY_TEXTURE_2D
Texture3DColorTable -> Just gl_PROXY_TEXTURE_3D
TextureCubeMapColorTable -> Just gl_PROXY_TEXTURE_CUBE_MAP
-- TODO: Use PROXY_TEXTURE_COLOR_TABLE_SGI from SGI_texture_color_table extension
TextureColorTable -> Just 0x80bd
SharedTexturePalette -> Nothing
--------------------------------------------------------------------------------
| 691
|
marshalProxyColorTable Proxy x = case x of
ColorTable -> Just gl_PROXY_COLOR_TABLE
PostConvolutionColorTable -> Just gl_PROXY_POST_CONVOLUTION_COLOR_TABLE
PostColorMatrixColorTable -> Just gl_PROXY_POST_COLOR_MATRIX_COLOR_TABLE
Texture1DColorTable -> Just gl_PROXY_TEXTURE_1D
Texture2DColorTable -> Just gl_PROXY_TEXTURE_2D
Texture3DColorTable -> Just gl_PROXY_TEXTURE_3D
TextureCubeMapColorTable -> Just gl_PROXY_TEXTURE_CUBE_MAP
-- TODO: Use PROXY_TEXTURE_COLOR_TABLE_SGI from SGI_texture_color_table extension
TextureColorTable -> Just 0x80bd
SharedTexturePalette -> Nothing
--------------------------------------------------------------------------------
| 691
| false
| false
| 9
| 5
| 82
| 104
| 44
| 60
| null | null |
fmapfmapfmap/amazonka
|
amazonka-codepipeline/gen/Network/AWS/CodePipeline/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'CurrentRevision' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'crRevision'
--
-- * 'crChangeIdentifier'
currentRevision
:: Text -- ^ 'crRevision'
-> Text -- ^ 'crChangeIdentifier'
-> CurrentRevision
currentRevision pRevision_ pChangeIdentifier_ =
CurrentRevision'
{ _crRevision = pRevision_
, _crChangeIdentifier = pChangeIdentifier_
}
| 476
|
currentRevision
:: Text -- ^ 'crRevision'
-> Text -- ^ 'crChangeIdentifier'
-> CurrentRevision
currentRevision pRevision_ pChangeIdentifier_ =
CurrentRevision'
{ _crRevision = pRevision_
, _crChangeIdentifier = pChangeIdentifier_
}
| 259
|
currentRevision pRevision_ pChangeIdentifier_ =
CurrentRevision'
{ _crRevision = pRevision_
, _crChangeIdentifier = pChangeIdentifier_
}
| 152
| true
| true
| 0
| 8
| 92
| 56
| 32
| 24
| null | null |
psibi/persistent
|
persistent/Database/Persist.hs
|
mit
|
(||.) :: forall v. [Filter v] -> [Filter v] -> [Filter v]
-- | The OR of two lists of filters. For example:
--
-- > selectList
-- > ([ PersonAge >. 25
-- > , PersonAge <. 30 ] ||.
-- > [ PersonIncome >. 15000
-- > , PersonIncome <. 25000 ])
-- > []
--
-- will filter records where a person's age is between 25 and 30 /or/ a
-- person's income is between (15000 and 25000).
--
-- If you are looking for an @(&&.)@ operator to do @(A AND B AND (C OR D))@
-- you can use the @(++)@ operator instead as there is no @(&&.)@. For
-- example:
--
-- > selectList
-- > ([ PersonAge >. 25
-- > , PersonAge <. 30 ] ++
-- > ([PersonCategory ==. 1] ||.
-- > [PersonCategory ==. 5]))
-- > []
--
-- will filter records where a person's age is between 25 and 30 /and/
-- (person's category is either 1 or 5).
a ||. b = [FilterOr [FilterAnd a, FilterAnd b]]
| 887
|
(||.) :: forall v. [Filter v] -> [Filter v] -> [Filter v]
a ||. b = [FilterOr [FilterAnd a, FilterAnd b]]
| 106
|
a ||. b = [FilterOr [FilterAnd a, FilterAnd b]]
| 48
| true
| true
| 0
| 12
| 226
| 94
| 60
| 34
| null | null |
DougBurke/swish
|
tests/GraphTest.hs
|
lgpl-2.1
|
b3_1 = makeScopedLabel 1 b3
| 27
|
b3_1 = makeScopedLabel 1 b3
| 27
|
b3_1 = makeScopedLabel 1 b3
| 27
| false
| false
| 1
| 5
| 4
| 14
| 5
| 9
| null | null |
SneakingCat/fay-ticker
|
src/CanvasAPI.hs
|
gpl-3.0
|
fillRect' :: Context -> Double -> Double -> Double -> Double -> Fay ()
fillRect' = ffi "%1['fillRect'](%2,%3,%4,%5)"
| 116
|
fillRect' :: Context -> Double -> Double -> Double -> Double -> Fay ()
fillRect' = ffi "%1['fillRect'](%2,%3,%4,%5)"
| 116
|
fillRect' = ffi "%1['fillRect'](%2,%3,%4,%5)"
| 45
| false
| true
| 0
| 11
| 17
| 39
| 19
| 20
| null | null |
antonlogvinenko/javelin
|
src/Javelin/Lib/ByteCode/ConstantPool.hs
|
mit
|
longInfoParser = ByteCode.LongInfo <$> Unsafe.unsafeCoerce <$> Get.getWord64be
| 78
|
longInfoParser = ByteCode.LongInfo <$> Unsafe.unsafeCoerce <$> Get.getWord64be
| 78
|
longInfoParser = ByteCode.LongInfo <$> Unsafe.unsafeCoerce <$> Get.getWord64be
| 78
| false
| false
| 1
| 7
| 6
| 24
| 10
| 14
| null | null |
Helium4Haskell/helium
|
src/Helium/CodeGeneration/DerivingShow.hs
|
gpl-3.0
|
-- Convert a data type constructor to a Core alternative
makeAlt :: ImportEnvironment -> UHA.Constructor -> Alt
makeAlt env c = Alt (constructorToPat ident types) (showConstructor env ident types)
where
(ident, types) = nameAndTypes c
nameAndTypes :: UHA.Constructor -> (Id, [UHA.Type])
nameAndTypes c' =
case c' of
UHA.Constructor_Constructor _ n ts -> (idFromName n, map annotatedTypeToType ts )
UHA.Constructor_Infix _ t1 n t2 -> (idFromName n, map annotatedTypeToType [t1, t2])
UHA.Constructor_Record _ _ _ -> error "not supported"
constructorToPat :: Id -> [UHA.Type] -> Pat
constructorToPat ident' ts =
PatCon (ConId ident') [ idFromNumber i | i <- [1..length ts] ]
annotatedTypeToType :: UHA.AnnotatedType -> UHA.Type
annotatedTypeToType (UHA.AnnotatedType_AnnotatedType _ _ t) = t
-- Show expression for one constructor
| 947
|
makeAlt :: ImportEnvironment -> UHA.Constructor -> Alt
makeAlt env c = Alt (constructorToPat ident types) (showConstructor env ident types)
where
(ident, types) = nameAndTypes c
nameAndTypes :: UHA.Constructor -> (Id, [UHA.Type])
nameAndTypes c' =
case c' of
UHA.Constructor_Constructor _ n ts -> (idFromName n, map annotatedTypeToType ts )
UHA.Constructor_Infix _ t1 n t2 -> (idFromName n, map annotatedTypeToType [t1, t2])
UHA.Constructor_Record _ _ _ -> error "not supported"
constructorToPat :: Id -> [UHA.Type] -> Pat
constructorToPat ident' ts =
PatCon (ConId ident') [ idFromNumber i | i <- [1..length ts] ]
annotatedTypeToType :: UHA.AnnotatedType -> UHA.Type
annotatedTypeToType (UHA.AnnotatedType_AnnotatedType _ _ t) = t
-- Show expression for one constructor
| 890
|
makeAlt env c = Alt (constructorToPat ident types) (showConstructor env ident types)
where
(ident, types) = nameAndTypes c
nameAndTypes :: UHA.Constructor -> (Id, [UHA.Type])
nameAndTypes c' =
case c' of
UHA.Constructor_Constructor _ n ts -> (idFromName n, map annotatedTypeToType ts )
UHA.Constructor_Infix _ t1 n t2 -> (idFromName n, map annotatedTypeToType [t1, t2])
UHA.Constructor_Record _ _ _ -> error "not supported"
constructorToPat :: Id -> [UHA.Type] -> Pat
constructorToPat ident' ts =
PatCon (ConId ident') [ idFromNumber i | i <- [1..length ts] ]
annotatedTypeToType :: UHA.AnnotatedType -> UHA.Type
annotatedTypeToType (UHA.AnnotatedType_AnnotatedType _ _ t) = t
-- Show expression for one constructor
| 835
| true
| true
| 0
| 10
| 238
| 302
| 147
| 155
| null | null |
abakst/liquidhaskell
|
benchmarks/bytestring-0.9.2.1/Data/ByteString/Lazy.hs
|
bsd-3-clause
|
revChunks :: [S.ByteString] -> ByteString
--LIQUID INLINE revChunks cs = L.foldl' (flip chunk) Empty cs
revChunks cs = go Empty cs
{-@ Decrease go 2 @-}
where go acc [] = acc
go acc (c:cs) = go (chunk c acc) cs
{-@ qualif Blah(v:int, l:int, p:Ptr a): (v + (plen p)) >= l @-}
-- | 'findIndexOrEnd' is a variant of findIndex, that returns the length
-- of the string if no element is found, rather than Nothing.
| 439
|
revChunks :: [S.ByteString] -> ByteString
revChunks cs = go Empty cs
{-@ Decrease go 2 @-}
where go acc [] = acc
go acc (c:cs) = go (chunk c acc) cs
{-@ qualif Blah(v:int, l:int, p:Ptr a): (v + (plen p)) >= l @-}
-- | 'findIndexOrEnd' is a variant of findIndex, that returns the length
-- of the string if no element is found, rather than Nothing.
| 377
|
revChunks cs = go Empty cs
{-@ Decrease go 2 @-}
where go acc [] = acc
go acc (c:cs) = go (chunk c acc) cs
{-@ qualif Blah(v:int, l:int, p:Ptr a): (v + (plen p)) >= l @-}
-- | 'findIndexOrEnd' is a variant of findIndex, that returns the length
-- of the string if no element is found, rather than Nothing.
| 335
| true
| true
| 1
| 7
| 107
| 77
| 41
| 36
| null | null |
mettekou/ghc
|
compiler/coreSyn/CoreArity.hs
|
bsd-3-clause
|
floatIn :: Bool -> ArityType -> ArityType
-- We have something like (let x = E in b),
-- where b has the given arity type.
floatIn _ (ABot n) = ABot n
| 155
|
floatIn :: Bool -> ArityType -> ArityType
floatIn _ (ABot n) = ABot n
| 74
|
floatIn _ (ABot n) = ABot n
| 32
| true
| true
| 0
| 7
| 37
| 35
| 18
| 17
| null | null |
alfpark/bond
|
compiler/src/Language/Bond/Util.hs
|
mit
|
-- | If the 3rd argument is not 'mempty' the function wraps it between the
-- first and second argument using 'mappend', otherwise it return 'mempty'.
between :: (Monoid a, Eq a) => a -> a -> a -> a
between l r m
| m == mempty = mempty
| otherwise = l <> m <> r
| 269
|
between :: (Monoid a, Eq a) => a -> a -> a -> a
between l r m
| m == mempty = mempty
| otherwise = l <> m <> r
| 118
|
between l r m
| m == mempty = mempty
| otherwise = l <> m <> r
| 70
| true
| true
| 0
| 8
| 65
| 74
| 37
| 37
| null | null |
bitemyapp/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
wayGeneralFlags _ WayPar = [Opt_Parallel]
| 46
|
wayGeneralFlags _ WayPar = [Opt_Parallel]
| 46
|
wayGeneralFlags _ WayPar = [Opt_Parallel]
| 46
| false
| false
| 1
| 6
| 9
| 16
| 7
| 9
| null | null |
alexander-at-github/eta
|
compiler/ETA/HsSyn/HsTypes.hs
|
bsd-3-clause
|
-- Before printing a type
-- (a) Remove outermost HsParTy parens
-- (b) Drop top-level for-all type variables in user style
-- since they are implicit in Haskell
prepare :: PprStyle -> HsType name -> HsType name
prepare sty (HsParTy ty) = prepare sty (unLoc ty)
| 274
|
prepare :: PprStyle -> HsType name -> HsType name
prepare sty (HsParTy ty) = prepare sty (unLoc ty)
| 108
|
prepare sty (HsParTy ty) = prepare sty (unLoc ty)
| 58
| true
| true
| 0
| 7
| 58
| 56
| 27
| 29
| null | null |
dongy7/raytracer
|
src/Geometry/Vector.hs
|
mit
|
computeBisector :: Vector -> Vector -> Vector
computeBisector x y = mult sumVec (1/sumMag)
where sumVec = x <+> y
sumMag = mag sumVec
-- ray-direction surface-normal
-- returns the reflection direction
| 212
|
computeBisector :: Vector -> Vector -> Vector
computeBisector x y = mult sumVec (1/sumMag)
where sumVec = x <+> y
sumMag = mag sumVec
-- ray-direction surface-normal
-- returns the reflection direction
| 212
|
computeBisector x y = mult sumVec (1/sumMag)
where sumVec = x <+> y
sumMag = mag sumVec
-- ray-direction surface-normal
-- returns the reflection direction
| 166
| false
| true
| 4
| 8
| 42
| 72
| 31
| 41
| null | null |
willdonnelly/simple-dialog
|
Graphics/UI/Dialog/Simple.hs
|
bsd-3-clause
|
showOptionDialog :: String -> String -> [String] -> IO (Maybe String)
showOptionDialog title prompt options = do
inputDialog (\dialog -> do
input <- comboBoxNewText
mapM (comboBoxAppendText input) options
return input)
(\input -> do
idx <- comboBoxGetActive input
let index = if idx < 0 then 0 else idx
return $ options !! index)
title prompt
-- | Ask the user to enter a password. Returns Nothing if cancelled.
| 568
|
showOptionDialog :: String -> String -> [String] -> IO (Maybe String)
showOptionDialog title prompt options = do
inputDialog (\dialog -> do
input <- comboBoxNewText
mapM (comboBoxAppendText input) options
return input)
(\input -> do
idx <- comboBoxGetActive input
let index = if idx < 0 then 0 else idx
return $ options !! index)
title prompt
-- | Ask the user to enter a password. Returns Nothing if cancelled.
| 568
|
showOptionDialog title prompt options = do
inputDialog (\dialog -> do
input <- comboBoxNewText
mapM (comboBoxAppendText input) options
return input)
(\input -> do
idx <- comboBoxGetActive input
let index = if idx < 0 then 0 else idx
return $ options !! index)
title prompt
-- | Ask the user to enter a password. Returns Nothing if cancelled.
| 498
| false
| true
| 0
| 17
| 224
| 145
| 69
| 76
| null | null |
lostbean/radio-fm69
|
src/WiringHs.hs
|
bsd-3-clause
|
physPinToGpio :: Int -> IO Int
physPinToGpio physPin = fmap fromIntegral $ c_physPinToGpio (fromIntegral physPin)
| 113
|
physPinToGpio :: Int -> IO Int
physPinToGpio physPin = fmap fromIntegral $ c_physPinToGpio (fromIntegral physPin)
| 113
|
physPinToGpio physPin = fmap fromIntegral $ c_physPinToGpio (fromIntegral physPin)
| 82
| false
| true
| 0
| 8
| 14
| 37
| 17
| 20
| null | null |
acowley/language-c
|
src/Language/C/Analysis/TravMonad.hs
|
bsd-3-clause
|
leaveBlockScope :: (MonadSymtab m) => m ()
leaveBlockScope = updDefTable (ST.leaveBlockScope)
| 93
|
leaveBlockScope :: (MonadSymtab m) => m ()
leaveBlockScope = updDefTable (ST.leaveBlockScope)
| 93
|
leaveBlockScope = updDefTable (ST.leaveBlockScope)
| 50
| false
| true
| 0
| 8
| 10
| 38
| 18
| 20
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F19.hs
|
bsd-3-clause
|
ptr_glPathSubCommandsNV :: FunPtr (GLuint -> GLsizei -> GLsizei -> GLsizei -> Ptr GLubyte -> GLsizei -> GLenum -> Ptr a -> IO ())
ptr_glPathSubCommandsNV = unsafePerformIO $ getCommand "glPathSubCommandsNV"
| 206
|
ptr_glPathSubCommandsNV :: FunPtr (GLuint -> GLsizei -> GLsizei -> GLsizei -> Ptr GLubyte -> GLsizei -> GLenum -> Ptr a -> IO ())
ptr_glPathSubCommandsNV = unsafePerformIO $ getCommand "glPathSubCommandsNV"
| 206
|
ptr_glPathSubCommandsNV = unsafePerformIO $ getCommand "glPathSubCommandsNV"
| 76
| false
| true
| 1
| 16
| 28
| 70
| 32
| 38
| null | null |
modeswitch/barrelfish
|
tools/mackerel/ShiftDriver.hs
|
mit
|
--
-- Given a field width in bits, return the C snprintf format
-- specifying to correctly format it.
--
field_fmt_str size
| size <= 8 = "PRIx8"
| size <= 16 = "PRIx16"
| size <= 32 = "PRIx32"
| otherwise = "PRIx64"
| 237
|
field_fmt_str size
| size <= 8 = "PRIx8"
| size <= 16 = "PRIx16"
| size <= 32 = "PRIx32"
| otherwise = "PRIx64"
| 128
|
field_fmt_str size
| size <= 8 = "PRIx8"
| size <= 16 = "PRIx16"
| size <= 32 = "PRIx32"
| otherwise = "PRIx64"
| 128
| true
| false
| 0
| 8
| 64
| 58
| 28
| 30
| null | null |
sergv/vector
|
Data/Vector.hs
|
bsd-3-clause
|
take = G.take
| 13
|
take = G.take
| 13
|
take = G.take
| 13
| false
| false
| 0
| 5
| 2
| 8
| 4
| 4
| null | null |
grammarware/slps
|
topics/semantics/while/eval-incomplete/while.hs
|
bsd-3-clause
|
{-
y:=2;
x:=(y+4);
if (y = 2 ^ x = 6)
then
z := y
else
z := 1000;
while x≤10 do x := (x + 1)
-}
test = SList (Assign "y" (Number 2))
(SList (Assign "x" (Add (Identifier "y") (Number 4)))
(SList (IfThenElse (And (Equals (Identifier "y") (Number 2)) (Equals (Identifier "x") (Number 6)))
(Assign "z" (Identifier "y"))
(Assign "z" (Number 1000)))
(While (LessThanOrEqual (Identifier "x") (Number 10))
(Assign "x" (Add (Identifier "x") (Number 1))))))
| 535
|
test = SList (Assign "y" (Number 2))
(SList (Assign "x" (Add (Identifier "y") (Number 4)))
(SList (IfThenElse (And (Equals (Identifier "y") (Number 2)) (Equals (Identifier "x") (Number 6)))
(Assign "z" (Identifier "y"))
(Assign "z" (Number 1000)))
(While (LessThanOrEqual (Identifier "x") (Number 10))
(Assign "x" (Add (Identifier "x") (Number 1))))))
| 432
|
test = SList (Assign "y" (Number 2))
(SList (Assign "x" (Add (Identifier "y") (Number 4)))
(SList (IfThenElse (And (Equals (Identifier "y") (Number 2)) (Equals (Identifier "x") (Number 6)))
(Assign "z" (Identifier "y"))
(Assign "z" (Number 1000)))
(While (LessThanOrEqual (Identifier "x") (Number 10))
(Assign "x" (Add (Identifier "x") (Number 1))))))
| 432
| true
| false
| 0
| 17
| 164
| 212
| 106
| 106
| null | null |
danr/hipspec
|
examples/old-examples/hip/ProductiveUseOfFailure.hs
|
gpl-3.0
|
prop_T9 :: Nat -> Nat -> [a] -> Nat -> Prop [a]
prop_T9 x y z w = drop w (drop x (drop y z)) =:= drop y (drop x (drop w z))
| 123
|
prop_T9 :: Nat -> Nat -> [a] -> Nat -> Prop [a]
prop_T9 x y z w = drop w (drop x (drop y z)) =:= drop y (drop x (drop w z))
| 123
|
prop_T9 x y z w = drop w (drop x (drop y z)) =:= drop y (drop x (drop w z))
| 75
| false
| true
| 0
| 11
| 32
| 96
| 46
| 50
| null | null |
phischu/fragnix
|
tests/packages/scotty/Data.IntMap.hs
|
bsd-3-clause
|
foldWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> b
foldWithKey = foldrWithKey
| 84
|
foldWithKey :: (Key -> a -> b -> b) -> b -> IntMap a -> b
foldWithKey = foldrWithKey
| 84
|
foldWithKey = foldrWithKey
| 26
| false
| true
| 0
| 10
| 18
| 48
| 22
| 26
| null | null |
mudphone/HaskellBook
|
src/Seventeen.hs
|
mit
|
-- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
combos :: [a] -> [b] -> [c] -> [(a, b, c)]
combos = liftA3 (,,)
| 141
|
combos :: [a] -> [b] -> [c] -> [(a, b, c)]
combos = liftA3 (,,)
| 63
|
combos = liftA3 (,,)
| 20
| true
| true
| 0
| 11
| 40
| 58
| 32
| 26
| null | null |
fmapfmapfmap/amazonka
|
amazonka-s3/gen/Network/AWS/S3/Types/Product.hs
|
mpl-2.0
|
-- | Indicates at what date the object is to be moved or deleted. Should be
-- in GMT ISO 8601 Format.
leDate :: Lens' LifecycleExpiration (Maybe UTCTime)
leDate = lens _leDate (\ s a -> s{_leDate = a}) . mapping _Time
| 218
|
leDate :: Lens' LifecycleExpiration (Maybe UTCTime)
leDate = lens _leDate (\ s a -> s{_leDate = a}) . mapping _Time
| 115
|
leDate = lens _leDate (\ s a -> s{_leDate = a}) . mapping _Time
| 63
| true
| true
| 1
| 9
| 41
| 59
| 29
| 30
| null | null |
apirogov/MoneyStacks
|
MoneyStacks/Core.hs
|
mit
|
-- |Generate human-readable transfer logs for a given config and date range (inclusive)
showTransfersFromTo :: MoneyConf -> Day -> Day -> [String]
showTransfersFromTo c s d = map (showTransfer True) $ dropWhile (\x -> tDate x < s)
$ takeWhile (\x -> tDate x <= d)
$ merge (cTransfers c) (cImported c)
| 388
|
showTransfersFromTo :: MoneyConf -> Day -> Day -> [String]
showTransfersFromTo c s d = map (showTransfer True) $ dropWhile (\x -> tDate x < s)
$ takeWhile (\x -> tDate x <= d)
$ merge (cTransfers c) (cImported c)
| 300
|
showTransfersFromTo c s d = map (showTransfer True) $ dropWhile (\x -> tDate x < s)
$ takeWhile (\x -> tDate x <= d)
$ merge (cTransfers c) (cImported c)
| 241
| true
| true
| 0
| 12
| 139
| 108
| 54
| 54
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/aeson/Data/Aeson/TH.hs
|
bsd-3-clause
|
predMentionsName = mentionsName
| 31
|
predMentionsName = mentionsName
| 31
|
predMentionsName = mentionsName
| 31
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
ekmett/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
emitPrimOp _ [res] PopCnt32Op [w] = emitPopCntCall res w W32
| 65
|
emitPrimOp _ [res] PopCnt32Op [w] = emitPopCntCall res w W32
| 65
|
emitPrimOp _ [res] PopCnt32Op [w] = emitPopCntCall res w W32
| 65
| false
| false
| 0
| 6
| 14
| 28
| 14
| 14
| null | null |
reuleaux/pire
|
exe/Infer.hs
|
bsd-3-clause
|
-- | Run the constraint solver
runSolve :: [Constraint] -> Either TypeError Subst
runSolve cs = runIdentity $ runExceptT $ solver st
where st = (emptySubst, cs)
| 162
|
runSolve :: [Constraint] -> Either TypeError Subst
runSolve cs = runIdentity $ runExceptT $ solver st
where st = (emptySubst, cs)
| 131
|
runSolve cs = runIdentity $ runExceptT $ solver st
where st = (emptySubst, cs)
| 80
| true
| true
| 0
| 6
| 28
| 52
| 27
| 25
| null | null |
j3h/doc-review
|
test/Main.hs
|
bsd-3-clause
|
choice :: [a] -> IO a
choice xs = (xs !!) <$> getRandomR (0, length xs - 1)
| 75
|
choice :: [a] -> IO a
choice xs = (xs !!) <$> getRandomR (0, length xs - 1)
| 75
|
choice xs = (xs !!) <$> getRandomR (0, length xs - 1)
| 53
| false
| true
| 2
| 8
| 17
| 53
| 26
| 27
| null | null |
mjakob/hgrib
|
test/HLint.hs
|
gpl-3.0
|
main :: IO ()
main = do
hints <- hlint ["src", "test"]
if null hints then exitSuccess else exitFailure
| 106
|
main :: IO ()
main = do
hints <- hlint ["src", "test"]
if null hints then exitSuccess else exitFailure
| 106
|
main = do
hints <- hlint ["src", "test"]
if null hints then exitSuccess else exitFailure
| 92
| false
| true
| 0
| 9
| 22
| 46
| 23
| 23
| null | null |
mstksg/hledger
|
hledger-lib/Hledger/Query.hs
|
gpl-3.0
|
-- | Does the match expression match this (simple) amount ?
matchesAmount :: Query -> Amount -> Bool
matchesAmount (Not q) a = not $ q `matchesAmount` a
| 152
|
matchesAmount :: Query -> Amount -> Bool
matchesAmount (Not q) a = not $ q `matchesAmount` a
| 92
|
matchesAmount (Not q) a = not $ q `matchesAmount` a
| 51
| true
| true
| 0
| 7
| 27
| 41
| 22
| 19
| null | null |
TomMD/io-streams
|
src/System/IO/Streams/Internal.hs
|
bsd-3-clause
|
------------------------------------------------------------------------------
-- | Feeds a value to an 'OutputStream'. Values of type @c@ are written in an
-- 'OutputStream' by wrapping them in 'Just', and the end of the stream is
-- indicated by supplying 'Nothing'.
--
write :: Maybe a -> OutputStream a -> IO ()
write = flip _write
| 335
|
write :: Maybe a -> OutputStream a -> IO ()
write = flip _write
| 63
|
write = flip _write
| 19
| true
| true
| 0
| 9
| 50
| 44
| 21
| 23
| null | null |
maple-shaft/HaskellTetris
|
src/HConsole.hs
|
mit
|
holdBlockLocation, holdBoxLocation, holdTextLocation :: (Float,Float)
holdBoxBackgroundColor = black
| 101
|
holdBlockLocation, holdBoxLocation, holdTextLocation :: (Float,Float)
holdBoxBackgroundColor = black
| 100
|
holdBoxBackgroundColor = black
| 30
| false
| true
| 3
| 5
| 8
| 29
| 14
| 15
| null | null |
rimmington/unordered-containers
|
Data/HashMap/Base.hs
|
bsd-3-clause
|
-- | /O(n)/ Filter this map by retaining only elements which values
-- satisfy a predicate.
filter :: (v -> Bool) -> HashMap k v -> HashMap k v
filter p = filterWithKey (\_ v -> p v)
| 182
|
filter :: (v -> Bool) -> HashMap k v -> HashMap k v
filter p = filterWithKey (\_ v -> p v)
| 90
|
filter p = filterWithKey (\_ v -> p v)
| 38
| true
| true
| 0
| 8
| 37
| 57
| 29
| 28
| null | null |
Lainepress/easy
|
Text/RE/PCRE/RE.hs
|
bsd-3-clause
|
reMultilineInsensitive = re' $ Just MultilineInsensitive
| 59
|
reMultilineInsensitive = re' $ Just MultilineInsensitive
| 59
|
reMultilineInsensitive = re' $ Just MultilineInsensitive
| 59
| false
| false
| 0
| 6
| 8
| 13
| 6
| 7
| null | null |
NickAger/LearningHaskell
|
HaskellProgrammingFromFirstPrinciples/Chapter16.hsproj/Either.hs
|
mit
|
showEither' :: Show a => Either e a -> Either e String
showEither' = fmap show
| 78
|
showEither' :: Show a => Either e a -> Either e String
showEither' = fmap show
| 78
|
showEither' = fmap show
| 23
| false
| true
| 0
| 7
| 15
| 35
| 16
| 19
| null | null |
eklinkhammer/haskell-vision
|
src/ImageProcessing/RepaExamples.hs
|
mit
|
derivativeX :: Stencil DIM2 Double
derivativeX =
[stencil2| (-1) 0 1
(-2) 0 2
(-1) 0 1 |]
| 123
|
derivativeX :: Stencil DIM2 Double
derivativeX =
[stencil2| (-1) 0 1
(-2) 0 2
(-1) 0 1 |]
| 123
|
derivativeX =
[stencil2| (-1) 0 1
(-2) 0 2
(-1) 0 1 |]
| 88
| false
| true
| 0
| 5
| 51
| 20
| 12
| 8
| null | null |
brendanhay/gogol
|
gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'RefreshDataSourceResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rdsrStatuses'
refreshDataSourceResponse
:: RefreshDataSourceResponse
refreshDataSourceResponse = RefreshDataSourceResponse' {_rdsrStatuses = Nothing}
| 339
|
refreshDataSourceResponse
:: RefreshDataSourceResponse
refreshDataSourceResponse = RefreshDataSourceResponse' {_rdsrStatuses = Nothing}
| 139
|
refreshDataSourceResponse = RefreshDataSourceResponse' {_rdsrStatuses = Nothing}
| 80
| true
| true
| 0
| 7
| 46
| 31
| 17
| 14
| null | null |
yliu120/K3
|
src/Language/K3/Analysis/Provenance/Inference.hs
|
apache-2.0
|
localLog :: (Functor m, Monad m) => String -> m ()
localLog = logVoid prvTraceLogging
| 85
|
localLog :: (Functor m, Monad m) => String -> m ()
localLog = logVoid prvTraceLogging
| 85
|
localLog = logVoid prvTraceLogging
| 34
| false
| true
| 0
| 8
| 14
| 38
| 19
| 19
| null | null |
mzhou/opaldist
|
src/Opal/Distance/Tracks.hs
|
agpl-3.0
|
-- Page 74, via RegentsPark
{-
glenfieldCentralIwDists :: [Dist]
glenfieldCentralIwDists = [
(Central, 0),
(Glenfield, 38320),
(MacquarieFields, 40270),
(Ingleburn, 42100),
(Minto, 46150),
(Leumeah, 49020),
(Campbelltown, 51100)
(MenanglePark, 59280),
(Menangle, 61760),
(DouglasPark, 69750),
(Picton, 81670),
(Tahmoor, 91000),
(Bargo, 100000),
(Yerrinbool, 113000),
(Mittagong, 129000),
(Bowral, 133000),
(Burradoo, 136000),
(MossVale, 143000),
(Exeter, 153000),
(Bundanoon, 159000),
(Penrose, 168000),
(Wingello, 174000),
(Tallong, 182000),
(Murulan, 190000),
(Goulburn, 222000)]
-}
-- Page 74, via East Hills
-- TODO
-- Page 75
bondiKingsCrossDists :: [Dist]
bondiKingsCrossDists = [
(KingsCross, 0),
(Edgecliff, 1420),
(BondiJunction, 3400)]
| 859
|
bondiKingsCrossDists :: [Dist]
bondiKingsCrossDists = [
(KingsCross, 0),
(Edgecliff, 1420),
(BondiJunction, 3400)]
| 126
|
bondiKingsCrossDists = [
(KingsCross, 0),
(Edgecliff, 1420),
(BondiJunction, 3400)]
| 95
| true
| true
| 0
| 6
| 199
| 46
| 31
| 15
| null | null |
Kyly/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
dataConSymbol :: DataCon -> Symbol
dataConSymbol = symbol . dataConWorkId
| 74
|
dataConSymbol :: DataCon -> Symbol
dataConSymbol = symbol . dataConWorkId
| 74
|
dataConSymbol = symbol . dataConWorkId
| 38
| false
| true
| 0
| 5
| 10
| 19
| 10
| 9
| null | null |
DavidAlphaFox/ghc
|
libraries/containers/Data/Map/Base.hs
|
bsd-3-clause
|
-- insertMin and insertMax don't perform potentially expensive comparisons.
insertMax,insertMin :: k -> a -> Map k a -> Map k a
insertMax kx x t
= case t of
Tip -> singleton kx x
Bin _ ky y l r
-> balanceR ky y l (insertMax kx x r)
| 255
|
insertMax,insertMin :: k -> a -> Map k a -> Map k a
insertMax kx x t
= case t of
Tip -> singleton kx x
Bin _ ky y l r
-> balanceR ky y l (insertMax kx x r)
| 179
|
insertMax kx x t
= case t of
Tip -> singleton kx x
Bin _ ky y l r
-> balanceR ky y l (insertMax kx x r)
| 127
| true
| true
| 0
| 10
| 73
| 94
| 46
| 48
| null | null |
kim/amazonka
|
amazonka-ecs/gen/Network/AWS/ECS/Types.hs
|
mpl-2.0
|
-- | The name of the key value pair.
kvpName :: Lens' KeyValuePair (Maybe Text)
kvpName = lens _kvpName (\s a -> s { _kvpName = a })
| 132
|
kvpName :: Lens' KeyValuePair (Maybe Text)
kvpName = lens _kvpName (\s a -> s { _kvpName = a })
| 95
|
kvpName = lens _kvpName (\s a -> s { _kvpName = a })
| 52
| true
| true
| 0
| 9
| 27
| 46
| 25
| 21
| null | null |
junjihashimoto/img-vector
|
Data/Vector/Image/Image.hs
|
bsd-3-clause
|
createImgI :: Int -- ^ Width of image
-> Int -- ^ Height of image
-> (Int -> Int -> RGB Int) -- ^ Pixel Generator
-> Image8
createImgI w h func = Image w h $ V.fromList $ do
y <- [0..(h-1)]
x <- [0..(w-1)]
return $ fmap fromIntegral $ fmap (\v -> if v < 0 then 0 else if v > 255 then 255 else v) $ func x y
| 345
|
createImgI :: Int -- ^ Width of image
-> Int -- ^ Height of image
-> (Int -> Int -> RGB Int) -- ^ Pixel Generator
-> Image8
createImgI w h func = Image w h $ V.fromList $ do
y <- [0..(h-1)]
x <- [0..(w-1)]
return $ fmap fromIntegral $ fmap (\v -> if v < 0 then 0 else if v > 255 then 255 else v) $ func x y
| 345
|
createImgI w h func = Image w h $ V.fromList $ do
y <- [0..(h-1)]
x <- [0..(w-1)]
return $ fmap fromIntegral $ fmap (\v -> if v < 0 then 0 else if v > 255 then 255 else v) $ func x y
| 188
| false
| true
| 0
| 16
| 111
| 164
| 83
| 81
| null | null |
andyfriesen/hs-sajson
|
src/Sajson.hs
|
mit
|
getObjectValue :: Object -> Word -> Value
getObjectValue (Object (Value parserPtr valPtr)) index = unsafePerformIO $
withForeignPtr valPtr $ \vp -> do
result <- sj_value_get_object_value vp index
mkValue parserPtr result
| 240
|
getObjectValue :: Object -> Word -> Value
getObjectValue (Object (Value parserPtr valPtr)) index = unsafePerformIO $
withForeignPtr valPtr $ \vp -> do
result <- sj_value_get_object_value vp index
mkValue parserPtr result
| 240
|
getObjectValue (Object (Value parserPtr valPtr)) index = unsafePerformIO $
withForeignPtr valPtr $ \vp -> do
result <- sj_value_get_object_value vp index
mkValue parserPtr result
| 198
| false
| true
| 0
| 10
| 49
| 74
| 35
| 39
| null | null |
tcrs/lit
|
src/Code.hs
|
gpl-2.0
|
generate :: [Chunk] -> T.Text
generate = expand . merge . (filter isDef)
| 72
|
generate :: [Chunk] -> T.Text
generate = expand . merge . (filter isDef)
| 72
|
generate = expand . merge . (filter isDef)
| 42
| false
| true
| 0
| 7
| 12
| 34
| 18
| 16
| null | null |
futufeld/eclogues
|
eclogues-impl/gen-hs/AuroraSchedulerManager_Client.hs
|
bsd-3-clause
|
send_descheduleCronJob op arg_job arg_lock arg_session = do
seq <- seqid
seqn <- R.readIORef seq
T.writeMessageBegin op ("descheduleCronJob", T.M_CALL, seqn)
write_DescheduleCronJob_args op (DescheduleCronJob_args{descheduleCronJob_args_job=arg_job,descheduleCronJob_args_lock=arg_lock,descheduleCronJob_args_session=arg_session})
T.writeMessageEnd op
T.tFlush (T.getTransport op)
| 392
|
send_descheduleCronJob op arg_job arg_lock arg_session = do
seq <- seqid
seqn <- R.readIORef seq
T.writeMessageBegin op ("descheduleCronJob", T.M_CALL, seqn)
write_DescheduleCronJob_args op (DescheduleCronJob_args{descheduleCronJob_args_job=arg_job,descheduleCronJob_args_lock=arg_lock,descheduleCronJob_args_session=arg_session})
T.writeMessageEnd op
T.tFlush (T.getTransport op)
| 392
|
send_descheduleCronJob op arg_job arg_lock arg_session = do
seq <- seqid
seqn <- R.readIORef seq
T.writeMessageBegin op ("descheduleCronJob", T.M_CALL, seqn)
write_DescheduleCronJob_args op (DescheduleCronJob_args{descheduleCronJob_args_job=arg_job,descheduleCronJob_args_lock=arg_lock,descheduleCronJob_args_session=arg_session})
T.writeMessageEnd op
T.tFlush (T.getTransport op)
| 392
| false
| false
| 0
| 10
| 38
| 113
| 54
| 59
| null | null |
nh2/quickcheck
|
Test/QuickCheck/Property.hs
|
bsd-3-clause
|
cover False _ _ = property
| 26
|
cover False _ _ = property
| 26
|
cover False _ _ = property
| 26
| false
| false
| 0
| 5
| 5
| 13
| 6
| 7
| null | null |
jaalonso/I1M-Cod-Temas
|
src/Tema_1.hs
|
gpl-2.0
|
-- prop_doble se verifica si para todo par de números x e y, el doble de x más
-- y es el doble de x más el doble de y. Por ejemplo,
-- λ> quickCheck prop_doble
-- +++ OK, passed 100 tests.
prop_doble :: Integer -> Integer -> Bool
prop_doble x y = doble (x+y) == (doble x) + (doble y)
| 290
|
prop_doble :: Integer -> Integer -> Bool
prop_doble x y = doble (x+y) == (doble x) + (doble y)
| 94
|
prop_doble x y = doble (x+y) == (doble x) + (doble y)
| 53
| true
| true
| 0
| 9
| 66
| 58
| 31
| 27
| null | null |
tonyfloatersu/solution-haskell-craft-of-FP
|
SetADT.hs
|
mit
|
diffls :: Ord a => [a] -> [a] -> [a]
diffls (x : xs) (y : ys)
| x < y = x : diffls xs (y : ys)
| x == y = diffls xs ys
| otherwise = diffls (x : xs) ys
| 179
|
diffls :: Ord a => [a] -> [a] -> [a]
diffls (x : xs) (y : ys)
| x < y = x : diffls xs (y : ys)
| x == y = diffls xs ys
| otherwise = diffls (x : xs) ys
| 179
|
diffls (x : xs) (y : ys)
| x < y = x : diffls xs (y : ys)
| x == y = diffls xs ys
| otherwise = diffls (x : xs) ys
| 142
| false
| true
| 2
| 9
| 72
| 117
| 59
| 58
| null | null |
eijian/picfinder
|
src/Finder.hs
|
bsd-3-clause
|
matchImage t s (x:[]) = []
| 26
|
matchImage t s (x:[]) = []
| 26
|
matchImage t s (x:[]) = []
| 26
| false
| false
| 0
| 7
| 5
| 27
| 12
| 15
| null | null |
Teaspot-Studio/bmstu-binary-genetics
|
src/Util.hs
|
mit
|
binToInt::Chromosome->Int
binToInt chromosome = binToInt' 0 base chromosome
where base = 2^(length chromosome-1)
| 116
|
binToInt::Chromosome->Int
binToInt chromosome = binToInt' 0 base chromosome
where base = 2^(length chromosome-1)
| 116
|
binToInt chromosome = binToInt' 0 base chromosome
where base = 2^(length chromosome-1)
| 90
| false
| true
| 0
| 8
| 16
| 47
| 23
| 24
| null | null |
dec9ue/jhc_copygc
|
src/Options.hs
|
gpl-2.0
|
stop "deps" = StopParse
| 23
|
stop "deps" = StopParse
| 23
|
stop "deps" = StopParse
| 23
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/WebGLRenderingContextBase.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContextBase.cullFace Mozilla WebGLRenderingContextBase.cullFace documentation>
cullFace ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> GLenum -> m ()
cullFace self mode
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "cullFace"
[toJSVal mode]))
| 388
|
cullFace ::
(MonadDOM m, IsWebGLRenderingContextBase self) =>
self -> GLenum -> m ()
cullFace self mode
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "cullFace"
[toJSVal mode]))
| 239
|
cullFace self mode
= liftDOM
(void
((toWebGLRenderingContextBase self) ^. jsf "cullFace"
[toJSVal mode]))
| 134
| true
| true
| 0
| 12
| 81
| 83
| 40
| 43
| null | null |
aycanirican/network-transport-tcp
|
src/Network/Transport/TCP/Mock/Socket.hs
|
bsd-3-clause
|
socketPeer :: Accessor SocketState (Maybe Socket)
socketPeer = accessor _socketPeer (\peer st -> st { _socketPeer = peer })
| 123
|
socketPeer :: Accessor SocketState (Maybe Socket)
socketPeer = accessor _socketPeer (\peer st -> st { _socketPeer = peer })
| 123
|
socketPeer = accessor _socketPeer (\peer st -> st { _socketPeer = peer })
| 73
| false
| true
| 0
| 9
| 18
| 45
| 24
| 21
| null | null |
geophf/1HaskellADay
|
exercises/HAD/Rosalind/Genotypes.hs
|
mit
|
{--
Now, in conjugation, each parent gene donates either allele with equal
likelihood to the child gene.
So, for example, you have two parents, one with genotype Aa, the other
with genotype AA, the child has one of the following four possible genes:
Aa x AA = (AA, AA, Aa, Aa) or, simplifying: (AA, Aa) each option equally likely
So, today's Haskell problem. Given a genotype, one from each parent, define
the function, cross, that gives a probability distribution of the resulting
genotype in the offspring.
--}
-- to do this, we re-present a genotype as a probability distribution
gene2prob :: Genotype -> Prob Char
gene2prob = uniform . alleles
| 654
|
gene2prob :: Genotype -> Prob Char
gene2prob = uniform . alleles
| 64
|
gene2prob = uniform . alleles
| 29
| true
| true
| 0
| 6
| 116
| 24
| 13
| 11
| null | null |
svenssonjoel/EmbArBB
|
Samples/matrix_vector.hs
|
bsd-3-clause
|
matVec :: Exp (DVector Dim2 Float) -> Exp (DVector Dim1 Float) -> Exp (DVector Dim1 Float)
matVec m v = addReduce rows
$ m * (repeatRow (getNRows m) v)
| 166
|
matVec :: Exp (DVector Dim2 Float) -> Exp (DVector Dim1 Float) -> Exp (DVector Dim1 Float)
matVec m v = addReduce rows
$ m * (repeatRow (getNRows m) v)
| 165
|
matVec m v = addReduce rows
$ m * (repeatRow (getNRows m) v)
| 74
| false
| true
| 0
| 9
| 43
| 82
| 39
| 43
| null | null |
dsorokin/aivika-experiment-chart
|
examples/QuarryOperations/Experiment.hs
|
bsd-3-clause
|
crusherQueueCount = T.queueCount crusherQueue
| 50
|
crusherQueueCount = T.queueCount crusherQueue
| 50
|
crusherQueueCount = T.queueCount crusherQueue
| 50
| false
| false
| 0
| 6
| 8
| 11
| 5
| 6
| null | null |
ttylec/QLogic
|
research/counterexample2.hs
|
gpl-3.0
|
complement' els a = filter isGood . filter (freeDisj logics a) $ els
where
isGood b = case supIn logic a b of
Just o -> one === o
otherwise -> False
(===) = equalIn logic
| 216
|
complement' els a = filter isGood . filter (freeDisj logics a) $ els
where
isGood b = case supIn logic a b of
Just o -> one === o
otherwise -> False
(===) = equalIn logic
| 216
|
complement' els a = filter isGood . filter (freeDisj logics a) $ els
where
isGood b = case supIn logic a b of
Just o -> one === o
otherwise -> False
(===) = equalIn logic
| 216
| false
| false
| 0
| 10
| 81
| 83
| 40
| 43
| null | null |
romanb/amazonka
|
amazonka-sqs/gen/Network/AWS/SQS/ChangeMessageVisibilityBatch.hs
|
mpl-2.0
|
-- | A list of receipt handles of the messages for which the visibility timeout
-- must be changed.
cmvbEntries :: Lens' ChangeMessageVisibilityBatch [ChangeMessageVisibilityBatchRequestEntry]
cmvbEntries = lens _cmvbEntries (\s a -> s { _cmvbEntries = a }) . _List
| 265
|
cmvbEntries :: Lens' ChangeMessageVisibilityBatch [ChangeMessageVisibilityBatchRequestEntry]
cmvbEntries = lens _cmvbEntries (\s a -> s { _cmvbEntries = a }) . _List
| 165
|
cmvbEntries = lens _cmvbEntries (\s a -> s { _cmvbEntries = a }) . _List
| 72
| true
| true
| 0
| 10
| 38
| 48
| 27
| 21
| null | null |
phaazon/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
|
bsd-3-clause
|
gl_LINE_TO_NV :: GLubyte
gl_LINE_TO_NV = 0x04
| 45
|
gl_LINE_TO_NV :: GLubyte
gl_LINE_TO_NV = 0x04
| 45
|
gl_LINE_TO_NV = 0x04
| 20
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
kbiscanic/PUH
|
lectures/puh-lecture6.hs
|
mit
|
addThree x y z = x + y + z
| 26
|
addThree x y z = x + y + z
| 26
|
addThree x y z = x + y + z
| 26
| false
| false
| 0
| 6
| 9
| 21
| 10
| 11
| null | null |
uduki/hsQt
|
Qtc/Enums/Gui/QGradient.hs
|
bsd-2-clause
|
eConicalGradient :: QGradientType
eConicalGradient
= ieQGradientType $ 2
| 74
|
eConicalGradient :: QGradientType
eConicalGradient
= ieQGradientType $ 2
| 74
|
eConicalGradient
= ieQGradientType $ 2
| 40
| false
| true
| 2
| 6
| 9
| 23
| 9
| 14
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/simplCore/CSE.hs
|
bsd-3-clause
|
cseExpr env (App f a) = App (cseExpr env f) (tryForCSE env a)
| 74
|
cseExpr env (App f a) = App (cseExpr env f) (tryForCSE env a)
| 74
|
cseExpr env (App f a) = App (cseExpr env f) (tryForCSE env a)
| 74
| false
| false
| 0
| 7
| 25
| 40
| 19
| 21
| null | null |
timtylin/scholdoc-texmath
|
lib/mmldict/generateMMLDict.hs
|
gpl-2.0
|
f :: Element -> Maybe Operator
f e = Operator <$> c <*> d <*> f <*> p <*> ls <*> rs <*> ps
where
c = toChar e
d = findAttrQ "description" e
f = mapForm <$> findAttrQ "form" e
p = read <$> findAttrQ "priority" e
ls = read <$> findAttrQ "lspace" e
rs = read <$> findAttrQ "rspace" e
ps = return $ fromMaybe [] (words <$> findAttrQ "properties" e)
| 375
|
f :: Element -> Maybe Operator
f e = Operator <$> c <*> d <*> f <*> p <*> ls <*> rs <*> ps
where
c = toChar e
d = findAttrQ "description" e
f = mapForm <$> findAttrQ "form" e
p = read <$> findAttrQ "priority" e
ls = read <$> findAttrQ "lspace" e
rs = read <$> findAttrQ "rspace" e
ps = return $ fromMaybe [] (words <$> findAttrQ "properties" e)
| 375
|
f e = Operator <$> c <*> d <*> f <*> p <*> ls <*> rs <*> ps
where
c = toChar e
d = findAttrQ "description" e
f = mapForm <$> findAttrQ "form" e
p = read <$> findAttrQ "priority" e
ls = read <$> findAttrQ "lspace" e
rs = read <$> findAttrQ "rspace" e
ps = return $ fromMaybe [] (words <$> findAttrQ "properties" e)
| 344
| false
| true
| 6
| 11
| 103
| 175
| 77
| 98
| null | null |
mk12/luminosity
|
src/Luminosity/Intersect.hs
|
mit
|
-- | Calculate the position vector of a point on a ray given its distance from
-- the ray's initial point.
extend :: Scalar -> Ray -> Vector
extend t (Ray x v) = x <+> t *> v
| 174
|
extend :: Scalar -> Ray -> Vector
extend t (Ray x v) = x <+> t *> v
| 67
|
extend t (Ray x v) = x <+> t *> v
| 33
| true
| true
| 2
| 10
| 38
| 48
| 23
| 25
| null | null |
expipiplus1/spir-v
|
generate/src/ConvertHTML.hs
|
mit
|
-- | Escape the angled brackets in <id>
pandoc2512 :: String -> String
pandoc2512 = regexReplace "<em><id/?>(s?)</em>" "<em><id>\\1</em>"
| 143
|
pandoc2512 :: String -> String
pandoc2512 = regexReplace "<em><id/?>(s?)</em>" "<em><id>\\1</em>"
| 103
|
pandoc2512 = regexReplace "<em><id/?>(s?)</em>" "<em><id>\\1</em>"
| 72
| true
| true
| 0
| 5
| 17
| 21
| 11
| 10
| null | null |
travitch/dalvik
|
src/Dalvik/SSA/Internal/Labeling.hs
|
bsd-3-clause
|
-- | Create a new empty SSA labeling environment. This includes
-- computing CFG information.
emptyEnv :: [(BS.ByteString, Word16)] -> [ExceptionRange] -> Vector Instruction -> LabelEnv
emptyEnv argRegs ers ivec =
LabelEnv { envInstructionStream = ivec
, envBasicBlocks = findBasicBlocks ivec ers
, envRegisterAssignment =
fst $ L.foldl' allocateArgLabel (M.empty, 0) argRegs
}
where
allocateArgLabel (m, lno) (name, reg) =
(M.insert reg (ArgumentLabel name lno) m, lno + 1)
-- | Create a new empty state. This state is initialized to account
-- for method arguments, which occupy the last @length argRegs@
-- registers. Wide arguments take two registers, but we only need to
-- worry about the first register in the pair (since the second is
-- never explicitly accessed).
| 837
|
emptyEnv :: [(BS.ByteString, Word16)] -> [ExceptionRange] -> Vector Instruction -> LabelEnv
emptyEnv argRegs ers ivec =
LabelEnv { envInstructionStream = ivec
, envBasicBlocks = findBasicBlocks ivec ers
, envRegisterAssignment =
fst $ L.foldl' allocateArgLabel (M.empty, 0) argRegs
}
where
allocateArgLabel (m, lno) (name, reg) =
(M.insert reg (ArgumentLabel name lno) m, lno + 1)
-- | Create a new empty state. This state is initialized to account
-- for method arguments, which occupy the last @length argRegs@
-- registers. Wide arguments take two registers, but we only need to
-- worry about the first register in the pair (since the second is
-- never explicitly accessed).
| 742
|
emptyEnv argRegs ers ivec =
LabelEnv { envInstructionStream = ivec
, envBasicBlocks = findBasicBlocks ivec ers
, envRegisterAssignment =
fst $ L.foldl' allocateArgLabel (M.empty, 0) argRegs
}
where
allocateArgLabel (m, lno) (name, reg) =
(M.insert reg (ArgumentLabel name lno) m, lno + 1)
-- | Create a new empty state. This state is initialized to account
-- for method arguments, which occupy the last @length argRegs@
-- registers. Wide arguments take two registers, but we only need to
-- worry about the first register in the pair (since the second is
-- never explicitly accessed).
| 650
| true
| true
| 0
| 10
| 184
| 161
| 88
| 73
| null | null |
meiersi/blaze-builder
|
benchmarks/Throughput/Memory.hs
|
bsd-3-clause
|
memBench :: Int -> IO ()
memBench mb = do
let bytes = mb * 2^20
allocaBytes bytes $ \ptr -> do
let bench label test = do
seconds <- time $ test (castPtr ptr) (fromIntegral bytes)
let throughput = fromIntegral mb / seconds
putStrLn $ show mb ++ "MB of " ++ label
++ " in " ++ showFFloat (Just 3) seconds "s, at: "
++ showFFloat (Just 1) throughput "MB/s"
bench "setup " c_wordwrite
putStrLn ""
putStrLn "C memory throughput benchmarks:"
bench "bytes written " c_bytewrite
bench "bytes read " c_byteread
bench "words written " c_wordwrite
bench "words read " c_wordread
putStrLn ""
putStrLn "Haskell memory throughput benchmarks:"
bench "bytes written " hs_bytewrite
bench "bytes written (loop unrolled once)" hs_bytewrite2
bench "bytes read " hs_byteread
bench "words written " hs_wordwrite
bench "words read " hs_wordread
| 1,130
|
memBench :: Int -> IO ()
memBench mb = do
let bytes = mb * 2^20
allocaBytes bytes $ \ptr -> do
let bench label test = do
seconds <- time $ test (castPtr ptr) (fromIntegral bytes)
let throughput = fromIntegral mb / seconds
putStrLn $ show mb ++ "MB of " ++ label
++ " in " ++ showFFloat (Just 3) seconds "s, at: "
++ showFFloat (Just 1) throughput "MB/s"
bench "setup " c_wordwrite
putStrLn ""
putStrLn "C memory throughput benchmarks:"
bench "bytes written " c_bytewrite
bench "bytes read " c_byteread
bench "words written " c_wordwrite
bench "words read " c_wordread
putStrLn ""
putStrLn "Haskell memory throughput benchmarks:"
bench "bytes written " hs_bytewrite
bench "bytes written (loop unrolled once)" hs_bytewrite2
bench "bytes read " hs_byteread
bench "words written " hs_wordwrite
bench "words read " hs_wordread
| 1,130
|
memBench mb = do
let bytes = mb * 2^20
allocaBytes bytes $ \ptr -> do
let bench label test = do
seconds <- time $ test (castPtr ptr) (fromIntegral bytes)
let throughput = fromIntegral mb / seconds
putStrLn $ show mb ++ "MB of " ++ label
++ " in " ++ showFFloat (Just 3) seconds "s, at: "
++ showFFloat (Just 1) throughput "MB/s"
bench "setup " c_wordwrite
putStrLn ""
putStrLn "C memory throughput benchmarks:"
bench "bytes written " c_bytewrite
bench "bytes read " c_byteread
bench "words written " c_wordwrite
bench "words read " c_wordread
putStrLn ""
putStrLn "Haskell memory throughput benchmarks:"
bench "bytes written " hs_bytewrite
bench "bytes written (loop unrolled once)" hs_bytewrite2
bench "bytes read " hs_byteread
bench "words written " hs_wordwrite
bench "words read " hs_wordread
| 1,105
| false
| true
| 0
| 23
| 445
| 278
| 117
| 161
| null | null |
Twinside/ClosureExternalProducer
|
clos_test.hs
|
bsd-3-clause
|
defaultTFunctions :: TFunctions
defaultTFunctions = TFunctions
{ simpleFunc = \_ -> "ok"
, nestedFun = \_ -> True
, complax = \_ -> defaultTRecord
, yoDawg = \_ -> False
, mapTest = M.empty
, listo = []
}
| 232
|
defaultTFunctions :: TFunctions
defaultTFunctions = TFunctions
{ simpleFunc = \_ -> "ok"
, nestedFun = \_ -> True
, complax = \_ -> defaultTRecord
, yoDawg = \_ -> False
, mapTest = M.empty
, listo = []
}
| 232
|
defaultTFunctions = TFunctions
{ simpleFunc = \_ -> "ok"
, nestedFun = \_ -> True
, complax = \_ -> defaultTRecord
, yoDawg = \_ -> False
, mapTest = M.empty
, listo = []
}
| 200
| false
| true
| 0
| 7
| 66
| 73
| 45
| 28
| null | null |
mbakke/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- | Entity not found
errorsEcodeNoent :: String
errorsEcodeNoent = "unknown_entity"
| 84
|
errorsEcodeNoent :: String
errorsEcodeNoent = "unknown_entity"
| 62
|
errorsEcodeNoent = "unknown_entity"
| 35
| true
| true
| 0
| 4
| 10
| 12
| 7
| 5
| null | null |
tomahawkins/trs
|
Language/TRS/Language.hs
|
bsd-3-clause
|
nextId :: System Int
nextId = do
db <- get
put $ db { sysNextId = sysNextId db + 1 }
return $ sysNextId db
-- | Addition.
| 128
|
nextId :: System Int
nextId = do
db <- get
put $ db { sysNextId = sysNextId db + 1 }
return $ sysNextId db
-- | Addition.
| 128
|
nextId = do
db <- get
put $ db { sysNextId = sysNextId db + 1 }
return $ sysNextId db
-- | Addition.
| 107
| false
| true
| 0
| 12
| 34
| 60
| 27
| 33
| null | null |
dimara/ganeti
|
src/Ganeti/Objects/Disk.hs
|
bsd-2-clause
|
-- | Custom encoder for DiskLogicalId (logical id only).
encodeDLId :: DiskLogicalId -> JSValue
encodeDLId (LIDPlain (LogicalVolume vg lv)) =
JSArray [showJSON vg, showJSON lv]
| 178
|
encodeDLId :: DiskLogicalId -> JSValue
encodeDLId (LIDPlain (LogicalVolume vg lv)) =
JSArray [showJSON vg, showJSON lv]
| 121
|
encodeDLId (LIDPlain (LogicalVolume vg lv)) =
JSArray [showJSON vg, showJSON lv]
| 82
| true
| true
| 0
| 9
| 26
| 48
| 24
| 24
| null | null |
k-bx/snap-server
|
src/Snap/Internal/Http/Server/Parser.hs
|
bsd-3-clause
|
------------------------------------------------------------------------------
contentLengthTag, hostTag, transferEncodingTag, cookieTag, contentTypeTag,
connectionTag, nStandardHeaders :: Int
contentLengthTag = 0
| 218
|
contentLengthTag, hostTag, transferEncodingTag, cookieTag, contentTypeTag,
connectionTag, nStandardHeaders :: Int
contentLengthTag = 0
| 139
|
contentLengthTag = 0
| 23
| true
| true
| 0
| 4
| 17
| 24
| 19
| 5
| null | null |
kagamilove0707/F2
|
src/Language/F2/TypeInterface.hs
|
mit
|
tinf' env (BoolLit _) = return (env, TBool, [])
| 47
|
tinf' env (BoolLit _) = return (env, TBool, [])
| 47
|
tinf' env (BoolLit _) = return (env, TBool, [])
| 47
| false
| false
| 0
| 6
| 8
| 33
| 16
| 17
| null | null |
FranklinChen/twenty-four-days2015-of-hackage
|
src/VectorFusionExample.hs
|
bsd-3-clause
|
-- | 256, in our case.
numPossibleValues :: Int
numPossibleValues = fromIntegral (maxBound :: Value) + 1
| 104
|
numPossibleValues :: Int
numPossibleValues = fromIntegral (maxBound :: Value) + 1
| 81
|
numPossibleValues = fromIntegral (maxBound :: Value) + 1
| 56
| true
| true
| 0
| 7
| 16
| 25
| 14
| 11
| null | null |
christiaanb/Idris-dev
|
src/IRTS/CodegenC.hs
|
bsd-3-clause
|
bcc i (TAILCALL n) = indent i ++ "TAILCALL(" ++ cname n ++ ");\n"
| 65
|
bcc i (TAILCALL n) = indent i ++ "TAILCALL(" ++ cname n ++ ");\n"
| 65
|
bcc i (TAILCALL n) = indent i ++ "TAILCALL(" ++ cname n ++ ");\n"
| 65
| false
| false
| 0
| 8
| 13
| 37
| 16
| 21
| null | null |
cyruscousins/HarmLang
|
src/HarmLang/InitialBasis.hs
|
mit
|
interpretNamedInterval "5th" = Interval 7
| 41
|
interpretNamedInterval "5th" = Interval 7
| 41
|
interpretNamedInterval "5th" = Interval 7
| 41
| false
| false
| 0
| 5
| 4
| 12
| 5
| 7
| null | null |
lukexi/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
-- | Test whether a 'GeneralFlag' is set
gopt :: GeneralFlag -> DynFlags -> Bool
gopt f dflags = fromEnum f `IntSet.member` generalFlags dflags
| 144
|
gopt :: GeneralFlag -> DynFlags -> Bool
gopt f dflags = fromEnum f `IntSet.member` generalFlags dflags
| 103
|
gopt f dflags = fromEnum f `IntSet.member` generalFlags dflags
| 63
| true
| true
| 0
| 6
| 24
| 43
| 21
| 22
| null | null |
spell-music/temporal-music-notation-demo
|
src/Temporal/Music/Demo/GeneralMidi.hs
|
bsd-3-clause
|
gunshot = instr 127
| 19
|
gunshot = instr 127
| 19
|
gunshot = instr 127
| 19
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
beni55/libmpd-haskell
|
src/Network/MPD/Commands/CurrentPlaylist.hs
|
mit
|
-- | Swap the positions of two songs (Id version)
swapId :: MonadMPD m => Id -> Id -> m ()
swapId id1 = A.runCommand . A.swapId id1
| 131
|
swapId :: MonadMPD m => Id -> Id -> m ()
swapId id1 = A.runCommand . A.swapId id1
| 81
|
swapId id1 = A.runCommand . A.swapId id1
| 40
| true
| true
| 0
| 9
| 27
| 46
| 22
| 24
| null | null |
fmthoma/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
cmpPred :: PredType -> PredType -> Ordering
cmpPred p1 p2 = cmpTypeX rn_env p1 p2
where
rn_env = mkRnEnv2 (mkInScopeSet (tyVarsOfType p1 `unionVarSet` tyVarsOfType p2))
| 174
|
cmpPred :: PredType -> PredType -> Ordering
cmpPred p1 p2 = cmpTypeX rn_env p1 p2
where
rn_env = mkRnEnv2 (mkInScopeSet (tyVarsOfType p1 `unionVarSet` tyVarsOfType p2))
| 174
|
cmpPred p1 p2 = cmpTypeX rn_env p1 p2
where
rn_env = mkRnEnv2 (mkInScopeSet (tyVarsOfType p1 `unionVarSet` tyVarsOfType p2))
| 130
| false
| true
| 0
| 10
| 30
| 67
| 32
| 35
| null | null |
fserb/ccs
|
Naming.hs
|
bsd-3-clause
|
setAlbum :: Block -> String -> IO ()
setAlbum b s =
do
tagfile <- TL.open s
tag <- maybe (return Nothing) TL.tag tagfile
case tag of
Nothing -> return ()
Just t -> do
TL.setAlbum t "CCS"
maybe (return 0) TL.save tagfile
return ()
| 300
|
setAlbum :: Block -> String -> IO ()
setAlbum b s =
do
tagfile <- TL.open s
tag <- maybe (return Nothing) TL.tag tagfile
case tag of
Nothing -> return ()
Just t -> do
TL.setAlbum t "CCS"
maybe (return 0) TL.save tagfile
return ()
| 300
|
setAlbum b s =
do
tagfile <- TL.open s
tag <- maybe (return Nothing) TL.tag tagfile
case tag of
Nothing -> return ()
Just t -> do
TL.setAlbum t "CCS"
maybe (return 0) TL.save tagfile
return ()
| 263
| false
| true
| 0
| 16
| 115
| 132
| 57
| 75
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.