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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NorfairKing/the-notes
|
src/Cryptography/SystemAlgebra/AbstractSystems.hs
|
gpl-2.0
|
resourceDefinition :: Note
resourceDefinition = de $ do
lab resourceSystemDefinitionLabel
lab resourceDefinitionLabel
let i = mathcal "I"
s ["An", m i <> "-" <> resourceSystem', "or simply", m i <> "-" <> resource, "is a", system, "with", interfaceLabelSet, m i]
| 278 |
resourceDefinition :: Note
resourceDefinition = de $ do
lab resourceSystemDefinitionLabel
lab resourceDefinitionLabel
let i = mathcal "I"
s ["An", m i <> "-" <> resourceSystem', "or simply", m i <> "-" <> resource, "is a", system, "with", interfaceLabelSet, m i]
| 278 |
resourceDefinition = de $ do
lab resourceSystemDefinitionLabel
lab resourceDefinitionLabel
let i = mathcal "I"
s ["An", m i <> "-" <> resourceSystem', "or simply", m i <> "-" <> resource, "is a", system, "with", interfaceLabelSet, m i]
| 251 | false | true | 0 | 12 | 55 | 97 | 48 | 49 | null | null |
ndmitchell/safe
|
Safe/Exact.hs
|
bsd-3-clause
|
takeExact :: Partial => Int -> [a] -> [a]
takeExact i xs = withFrozenCallStack $ splitAtExact_ (addNote "" "takeExact") (const []) (:) i xs
| 139 |
takeExact :: Partial => Int -> [a] -> [a]
takeExact i xs = withFrozenCallStack $ splitAtExact_ (addNote "" "takeExact") (const []) (:) i xs
| 139 |
takeExact i xs = withFrozenCallStack $ splitAtExact_ (addNote "" "takeExact") (const []) (:) i xs
| 97 | false | true | 0 | 10 | 23 | 73 | 36 | 37 | null | null |
brendanhay/gogol
|
gogol-alertcenter/gen/Network/Google/Resource/AlertCenter/UpdateSettings.hs
|
mpl-2.0
|
-- | OAuth access token.
usAccessToken :: Lens' UpdateSettings (Maybe Text)
usAccessToken
= lens _usAccessToken
(\ s a -> s{_usAccessToken = a})
| 152 |
usAccessToken :: Lens' UpdateSettings (Maybe Text)
usAccessToken
= lens _usAccessToken
(\ s a -> s{_usAccessToken = a})
| 127 |
usAccessToken
= lens _usAccessToken
(\ s a -> s{_usAccessToken = a})
| 76 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
stevedonnelly/haskell
|
code/Geometry/Polygon.hs
|
mit
|
compatibleVertices = \gaussian_map quadrant -> let
(less, equal, greater) = (Map.splitLookup quadrant gaussian_map)
parallel = [LS.endpoint0 (fromJust equal), LS.endpoint1 (fromJust equal)]
result = [LS.endpoint1 (snd (Map.findMax less))]
in (ifElse (isJust equal) parallel result)
| 297 |
compatibleVertices = \gaussian_map quadrant -> let
(less, equal, greater) = (Map.splitLookup quadrant gaussian_map)
parallel = [LS.endpoint0 (fromJust equal), LS.endpoint1 (fromJust equal)]
result = [LS.endpoint1 (snd (Map.findMax less))]
in (ifElse (isJust equal) parallel result)
| 297 |
compatibleVertices = \gaussian_map quadrant -> let
(less, equal, greater) = (Map.splitLookup quadrant gaussian_map)
parallel = [LS.endpoint0 (fromJust equal), LS.endpoint1 (fromJust equal)]
result = [LS.endpoint1 (snd (Map.findMax less))]
in (ifElse (isJust equal) parallel result)
| 297 | false | false | 0 | 16 | 48 | 120 | 62 | 58 | null | null |
xfchen/Monud
|
src/InputParse.hs
|
bsd-3-clause
|
showVal :: InputVal -> String
showVal (Cmd c) = unpack c
| 56 |
showVal :: InputVal -> String
showVal (Cmd c) = unpack c
| 56 |
showVal (Cmd c) = unpack c
| 26 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
amccausl/Swish
|
Swish/HaskellRDF/RDFGraphTest.hs
|
lgpl-2.1
|
t04 = arc s1 p1 l1
| 18 |
t04 = arc s1 p1 l1
| 18 |
t04 = arc s1 p1 l1
| 18 | false | false | 1 | 5 | 5 | 16 | 6 | 10 | null | null |
OS2World/DEV-UTIL-HUGS
|
oldlib/PatriciaLoMap.hs
|
bsd-3-clause
|
delete k t@(B p m t0 t1) =
if matchPrefix k p m then
if zeroBit k m then lmakeB p m (delete k t0) t1
else rmakeB p m t0 (delete k t1)
else t
| 175 |
delete k t@(B p m t0 t1) =
if matchPrefix k p m then
if zeroBit k m then lmakeB p m (delete k t0) t1
else rmakeB p m t0 (delete k t1)
else t
| 175 |
delete k t@(B p m t0 t1) =
if matchPrefix k p m then
if zeroBit k m then lmakeB p m (delete k t0) t1
else rmakeB p m t0 (delete k t1)
else t
| 175 | false | false | 0 | 9 | 70 | 88 | 44 | 44 | null | null |
liamoc/sprig-hs
|
Graphics/UI/SDL/Sprig/Control.hs
|
bsd-3-clause
|
-- |Pop the antialias state from the stack, and return it.
popAA :: IO Bool
popAA = fmap word8ToBool spgPopAA
| 109 |
popAA :: IO Bool
popAA = fmap word8ToBool spgPopAA
| 50 |
popAA = fmap word8ToBool spgPopAA
| 33 | true | true | 1 | 5 | 19 | 23 | 10 | 13 | null | null |
copumpkin/picklers
|
src/Data/Pickler.hs
|
bsd-3-clause
|
int64le, int64be :: Pickle Int64
int64le = integral word64le
| 60 |
int64le, int64be :: Pickle Int64
int64le = integral word64le
| 60 |
int64le = integral word64le
| 27 | false | true | 0 | 5 | 8 | 19 | 10 | 9 | null | null |
FranklinChen/change-travis-stuff
|
app/Main.hs
|
bsd-3-clause
|
sudoRegex :: Regex
sudoRegex = compile "^\\s*sudo\\s*:" [utf8, multiline]
| 73 |
sudoRegex :: Regex
sudoRegex = compile "^\\s*sudo\\s*:" [utf8, multiline]
| 73 |
sudoRegex = compile "^\\s*sudo\\s*:" [utf8, multiline]
| 54 | false | true | 0 | 6 | 8 | 22 | 12 | 10 | null | null |
kelnage/tamarin-prover
|
src/Main/Environment.hs
|
gpl-3.0
|
------------------------------------------------------------------------------
-- Inspecting the environment
------------------------------------------------------------------------------
-- | Get the string constituting the command line.
getCommandLine :: IO String
getCommandLine = do
arguments <- getArgs
return . concat . intersperse " " $ programName : arguments
-- | Read the cpu info using a call to cat /proc/cpuinfo
| 430 |
getCommandLine :: IO String
getCommandLine = do
arguments <- getArgs
return . concat . intersperse " " $ programName : arguments
-- | Read the cpu info using a call to cat /proc/cpuinfo
| 190 |
getCommandLine = do
arguments <- getArgs
return . concat . intersperse " " $ programName : arguments
-- | Read the cpu info using a call to cat /proc/cpuinfo
| 162 | true | true | 0 | 10 | 53 | 54 | 26 | 28 | null | null |
brendanhay/gogol
|
gogol-admin-directory/gen/Network/Google/Resource/Directory/Groups/List.hs
|
mpl-2.0
|
-- | Query string search. Should be of the form \"\". Complete documentation
-- is at https:
-- \/\/developers.google.com\/admin-sdk\/directory\/v1\/guides\/search-groups
glQuery :: Lens' GroupsList (Maybe Text)
glQuery = lens _glQuery (\ s a -> s{_glQuery = a})
| 262 |
glQuery :: Lens' GroupsList (Maybe Text)
glQuery = lens _glQuery (\ s a -> s{_glQuery = a})
| 91 |
glQuery = lens _glQuery (\ s a -> s{_glQuery = a})
| 50 | true | true | 1 | 9 | 35 | 51 | 27 | 24 | null | null |
facebookincubator/duckling
|
Duckling/Time/KA/Rules.hs
|
bsd-3-clause
|
ruleLastWorkweekOfMonth :: Rule
ruleLastWorkweekOfMonth = Rule
{ name = "last workweek of <named-month>"
, pattern =
[ regex "αααα α‘ααα£α¨αα ?αααα αα‘?(α¨α)?"
, Predicate isAMonth
]
, prod = \case
(_:Token Time td2:_) -> tt $ predLastOf workweek td2
_ -> Nothing
}
| 291 |
ruleLastWorkweekOfMonth :: Rule
ruleLastWorkweekOfMonth = Rule
{ name = "last workweek of <named-month>"
, pattern =
[ regex "αααα α‘ααα£α¨αα ?αααα αα‘?(α¨α)?"
, Predicate isAMonth
]
, prod = \case
(_:Token Time td2:_) -> tt $ predLastOf workweek td2
_ -> Nothing
}
| 291 |
ruleLastWorkweekOfMonth = Rule
{ name = "last workweek of <named-month>"
, pattern =
[ regex "αααα α‘ααα£α¨αα ?αααα αα‘?(α¨α)?"
, Predicate isAMonth
]
, prod = \case
(_:Token Time td2:_) -> tt $ predLastOf workweek td2
_ -> Nothing
}
| 259 | false | true | 0 | 14 | 73 | 86 | 45 | 41 | null | null |
fffej/HS-Poker
|
LookupPatternMatch.hs
|
bsd-3-clause
|
getValueFromProduct 303646 = 4257
| 33 |
getValueFromProduct 303646 = 4257
| 33 |
getValueFromProduct 303646 = 4257
| 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
gseitz/oauth-provider-wai
|
src/Network/OAuth/Provider/OAuth1/Wai.hs
|
bsd-3-clause
|
-- | 'withOAuth' acts as a 'Middleware' and intercepts requests to check for
-- the validity of the provided OAuth parameters. The given 'PathParts' are
-- used as prefixes for paths that are only accessible with a valid OAuth request.
--
-- Notice that this just triggers "oauth-provider" to check whether the request
-- itself is a syntactically valid OAuth request with valid and authenticated tokens.
-- The actual authorization needs to be done by the application itself.
-- For this purpose, the extracted 'OAuthParams' can be accessed with the given
-- 'V.Key' 'OAuthParams' from the 'Request''s 'V.Vault' further down the line.
withOAuth ::
V.Key OAuthParams -- ^ The 'V.Key' with which the 'OAuthParams' can be
-- looked up in the request handling of an
-- 'Application' further down the line.
-> OAuthConfig IO -- ^ An 'OAuthConfig' is best created with one of the
-- provided functions 'oneLeggedConfig',
-- 'twoLeggedConfig', 'threeLeggedConfig'.
-> [PathParts] -- ^ These are the prefixes for request paths that need to
-- be authenticated OAuth requests.
-> Middleware
withOAuth paramsKey cfg prefixes app req =
if needsProtection
then convertAndExecute req executeOAuthRequest
else app req
where
-- check if any of the supplied paths is a prefix of the current request path
needsProtection = any (`isPrefixOf` pathInfo req) prefixes
setParams r p = r { vault = V.insert paramsKey p (vault r) }
executeOAuthRequest req' oauthReq = do
errorOrParams <- runOAuth (cfg, oauthReq) authenticated
either errorAsWaiResponse (app . setParams req') errorOrParams
-- | Converts the given 'Request' and executes the action function.
| 1,818 |
withOAuth ::
V.Key OAuthParams -- ^ The 'V.Key' with which the 'OAuthParams' can be
-- looked up in the request handling of an
-- 'Application' further down the line.
-> OAuthConfig IO -- ^ An 'OAuthConfig' is best created with one of the
-- provided functions 'oneLeggedConfig',
-- 'twoLeggedConfig', 'threeLeggedConfig'.
-> [PathParts] -- ^ These are the prefixes for request paths that need to
-- be authenticated OAuth requests.
-> Middleware
withOAuth paramsKey cfg prefixes app req =
if needsProtection
then convertAndExecute req executeOAuthRequest
else app req
where
-- check if any of the supplied paths is a prefix of the current request path
needsProtection = any (`isPrefixOf` pathInfo req) prefixes
setParams r p = r { vault = V.insert paramsKey p (vault r) }
executeOAuthRequest req' oauthReq = do
errorOrParams <- runOAuth (cfg, oauthReq) authenticated
either errorAsWaiResponse (app . setParams req') errorOrParams
-- | Converts the given 'Request' and executes the action function.
| 1,182 |
withOAuth paramsKey cfg prefixes app req =
if needsProtection
then convertAndExecute req executeOAuthRequest
else app req
where
-- check if any of the supplied paths is a prefix of the current request path
needsProtection = any (`isPrefixOf` pathInfo req) prefixes
setParams r p = r { vault = V.insert paramsKey p (vault r) }
executeOAuthRequest req' oauthReq = do
errorOrParams <- runOAuth (cfg, oauthReq) authenticated
either errorAsWaiResponse (app . setParams req') errorOrParams
-- | Converts the given 'Request' and executes the action function.
| 606 | true | true | 0 | 11 | 439 | 189 | 102 | 87 | null | null |
pushkinma/frag
|
src/Textures.hs
|
gpl-2.0
|
createTexture Nothing = return Nothing
| 38 |
createTexture Nothing = return Nothing
| 38 |
createTexture Nothing = return Nothing
| 38 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
ozgurakgun/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
defined (PParams _ _ ds) = concatMap defined ds
| 72 |
defined (PParams _ _ ds) = concatMap defined ds
| 72 |
defined (PParams _ _ ds) = concatMap defined ds
| 72 | false | false | 0 | 6 | 33 | 25 | 11 | 14 | null | null |
athanclark/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
termSmallerThan x (Proj tm _) = termSmallerThan (x-1) tm
| 56 |
termSmallerThan x (Proj tm _) = termSmallerThan (x-1) tm
| 56 |
termSmallerThan x (Proj tm _) = termSmallerThan (x-1) tm
| 56 | false | false | 0 | 7 | 8 | 31 | 15 | 16 | null | null |
michelshalom/jammittools
|
src/Sound/Jammit/Internal/Image.hs
|
gpl-3.0
|
partsToPages
:: [([FilePath], Integer)] -- ^ [(images, system height)]
-> Int -- ^ systems per page
-> TempIO [FilePath]
partsToPages parts n = let
sources = map (\(imgs, h) -> pngChunks (fromIntegral h) imgs) parts
in C.sequenceSources sources C.$$ chunksToPages n C.=$= sinkJPEG
| 290 |
partsToPages
:: [([FilePath], Integer)] -- ^ [(images, system height)]
-> Int -- ^ systems per page
-> TempIO [FilePath]
partsToPages parts n = let
sources = map (\(imgs, h) -> pngChunks (fromIntegral h) imgs) parts
in C.sequenceSources sources C.$$ chunksToPages n C.=$= sinkJPEG
| 290 |
partsToPages parts n = let
sources = map (\(imgs, h) -> pngChunks (fromIntegral h) imgs) parts
in C.sequenceSources sources C.$$ chunksToPages n C.=$= sinkJPEG
| 163 | false | true | 0 | 14 | 52 | 110 | 56 | 54 | null | null |
expipiplus1/vulkan
|
src/Vulkan/Extensions/VK_KHR_xcb_surface.hs
|
bsd-3-clause
|
-- | vkCreateXcbSurfaceKHR - Create a 'Vulkan.Extensions.Handles.SurfaceKHR'
-- object for a X11 window, using the XCB client-side library
--
-- == Valid Usage (Implicit)
--
-- - #VUID-vkCreateXcbSurfaceKHR-instance-parameter# @instance@ /must/ be
-- a valid 'Vulkan.Core10.Handles.Instance' handle
--
-- - #VUID-vkCreateXcbSurfaceKHR-pCreateInfo-parameter# @pCreateInfo@
-- /must/ be a valid pointer to a valid 'XcbSurfaceCreateInfoKHR'
-- structure
--
-- - #VUID-vkCreateXcbSurfaceKHR-pAllocator-parameter# If @pAllocator@ is
-- not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- - #VUID-vkCreateXcbSurfaceKHR-pSurface-parameter# @pSurface@ /must/ be
-- a valid pointer to a 'Vulkan.Extensions.Handles.SurfaceKHR' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
-- - 'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
-- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_xcb_surface VK_KHR_xcb_surface>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Instance',
-- 'Vulkan.Extensions.Handles.SurfaceKHR', 'XcbSurfaceCreateInfoKHR'
createXcbSurfaceKHR :: forall io
. (MonadIO io)
=> -- | @instance@ is the instance to associate the surface with.
Instance
-> -- | @pCreateInfo@ is a pointer to a 'XcbSurfaceCreateInfoKHR' structure
-- containing parameters affecting the creation of the surface object.
XcbSurfaceCreateInfoKHR
-> -- | @pAllocator@ is the allocator used for host memory allocated for the
-- surface object when there is no more specific allocator available (see
-- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
("allocator" ::: Maybe AllocationCallbacks)
-> io (SurfaceKHR)
createXcbSurfaceKHR instance' createInfo allocator = liftIO . evalContT $ do
let vkCreateXcbSurfaceKHRPtr = pVkCreateXcbSurfaceKHR (case instance' of Instance{instanceCmds} -> instanceCmds)
lift $ unless (vkCreateXcbSurfaceKHRPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkCreateXcbSurfaceKHR is null" Nothing Nothing
let vkCreateXcbSurfaceKHR' = mkVkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHRPtr
pCreateInfo <- ContT $ withCStruct (createInfo)
pAllocator <- case (allocator) of
Nothing -> pure nullPtr
Just j -> ContT $ withCStruct (j)
pPSurface <- ContT $ bracket (callocBytes @SurfaceKHR 8) free
r <- lift $ traceAroundEvent "vkCreateXcbSurfaceKHR" (vkCreateXcbSurfaceKHR' (instanceHandle (instance')) pCreateInfo pAllocator (pPSurface))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pSurface <- lift $ peek @SurfaceKHR pPSurface
pure $ (pSurface)
| 3,408 |
createXcbSurfaceKHR :: forall io
. (MonadIO io)
=> -- | @instance@ is the instance to associate the surface with.
Instance
-> -- | @pCreateInfo@ is a pointer to a 'XcbSurfaceCreateInfoKHR' structure
-- containing parameters affecting the creation of the surface object.
XcbSurfaceCreateInfoKHR
-> -- | @pAllocator@ is the allocator used for host memory allocated for the
-- surface object when there is no more specific allocator available (see
-- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>).
("allocator" ::: Maybe AllocationCallbacks)
-> io (SurfaceKHR)
createXcbSurfaceKHR instance' createInfo allocator = liftIO . evalContT $ do
let vkCreateXcbSurfaceKHRPtr = pVkCreateXcbSurfaceKHR (case instance' of Instance{instanceCmds} -> instanceCmds)
lift $ unless (vkCreateXcbSurfaceKHRPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkCreateXcbSurfaceKHR is null" Nothing Nothing
let vkCreateXcbSurfaceKHR' = mkVkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHRPtr
pCreateInfo <- ContT $ withCStruct (createInfo)
pAllocator <- case (allocator) of
Nothing -> pure nullPtr
Just j -> ContT $ withCStruct (j)
pPSurface <- ContT $ bracket (callocBytes @SurfaceKHR 8) free
r <- lift $ traceAroundEvent "vkCreateXcbSurfaceKHR" (vkCreateXcbSurfaceKHR' (instanceHandle (instance')) pCreateInfo pAllocator (pPSurface))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pSurface <- lift $ peek @SurfaceKHR pPSurface
pure $ (pSurface)
| 1,806 |
createXcbSurfaceKHR instance' createInfo allocator = liftIO . evalContT $ do
let vkCreateXcbSurfaceKHRPtr = pVkCreateXcbSurfaceKHR (case instance' of Instance{instanceCmds} -> instanceCmds)
lift $ unless (vkCreateXcbSurfaceKHRPtr /= nullFunPtr) $
throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkCreateXcbSurfaceKHR is null" Nothing Nothing
let vkCreateXcbSurfaceKHR' = mkVkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHRPtr
pCreateInfo <- ContT $ withCStruct (createInfo)
pAllocator <- case (allocator) of
Nothing -> pure nullPtr
Just j -> ContT $ withCStruct (j)
pPSurface <- ContT $ bracket (callocBytes @SurfaceKHR 8) free
r <- lift $ traceAroundEvent "vkCreateXcbSurfaceKHR" (vkCreateXcbSurfaceKHR' (instanceHandle (instance')) pCreateInfo pAllocator (pPSurface))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pSurface <- lift $ peek @SurfaceKHR pPSurface
pure $ (pSurface)
| 938 | true | true | 0 | 17 | 639 | 376 | 204 | 172 | null | null |
alanz/Alex
|
src/ParseMonad.hs
|
bsd-3-clause
|
-- hide compiler warning
alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
alexGetByte (p,c,(b:bs),s) = Just (b,(p,c,bs,s))
| 125 |
alexGetByte :: AlexInput -> Maybe (Byte,AlexInput)
alexGetByte (p,c,(b:bs),s) = Just (b,(p,c,bs,s))
| 99 |
alexGetByte (p,c,(b:bs),s) = Just (b,(p,c,bs,s))
| 48 | true | true | 0 | 8 | 15 | 68 | 40 | 28 | null | null |
yairchu/defend
|
src/defend.hs
|
gpl-3.0
|
drawText :: DefendFont -> String -> Image
drawText font text =
Image $ do
lighting $= Disabled
color $ Color4 0.25 0 0.5 (0.5 :: GLfloat)
renderPrimitive Triangles
. (forM_ . join) (renderText font text)
$ \(x, y) ->
vertex $ Vertex4 (x/2) (y/2) 0 1
| 281 |
drawText :: DefendFont -> String -> Image
drawText font text =
Image $ do
lighting $= Disabled
color $ Color4 0.25 0 0.5 (0.5 :: GLfloat)
renderPrimitive Triangles
. (forM_ . join) (renderText font text)
$ \(x, y) ->
vertex $ Vertex4 (x/2) (y/2) 0 1
| 281 |
drawText font text =
Image $ do
lighting $= Disabled
color $ Color4 0.25 0 0.5 (0.5 :: GLfloat)
renderPrimitive Triangles
. (forM_ . join) (renderText font text)
$ \(x, y) ->
vertex $ Vertex4 (x/2) (y/2) 0 1
| 239 | false | true | 0 | 13 | 77 | 127 | 64 | 63 | null | null |
v0lkan/learning-haskell
|
session-003/024-zip-recursive.hs
|
mit
|
zip2 :: [a] -> [b] -> [(a, b)]
zip2 _ [] = []
| 45 |
zip2 :: [a] -> [b] -> [(a, b)]
zip2 _ [] = []
| 45 |
zip2 _ [] = []
| 14 | false | true | 0 | 10 | 12 | 49 | 25 | 24 | null | null |
urbanslug/ghc
|
libraries/template-haskell/Language/Haskell/TH/Lib.hs
|
bsd-3-clause
|
newtypeInstD :: CxtQ -> Name -> [TypeQ] -> ConQ -> [Name] -> DecQ
newtypeInstD ctxt tc tys con derivs =
do
ctxt1 <- ctxt
tys1 <- sequence tys
con1 <- con
return (NewtypeInstD ctxt1 tc tys1 con1 derivs)
| 221 |
newtypeInstD :: CxtQ -> Name -> [TypeQ] -> ConQ -> [Name] -> DecQ
newtypeInstD ctxt tc tys con derivs =
do
ctxt1 <- ctxt
tys1 <- sequence tys
con1 <- con
return (NewtypeInstD ctxt1 tc tys1 con1 derivs)
| 221 |
newtypeInstD ctxt tc tys con derivs =
do
ctxt1 <- ctxt
tys1 <- sequence tys
con1 <- con
return (NewtypeInstD ctxt1 tc tys1 con1 derivs)
| 155 | false | true | 0 | 10 | 57 | 97 | 45 | 52 | null | null |
charringer/gonimo-back
|
src/Gonimo/Server/Effects.hs
|
agpl-3.0
|
genRandomBytes :: ServerConstraint r => Int -> Eff r ByteString
genRandomBytes = sendServer . GenRandomBytes
| 108 |
genRandomBytes :: ServerConstraint r => Int -> Eff r ByteString
genRandomBytes = sendServer . GenRandomBytes
| 108 |
genRandomBytes = sendServer . GenRandomBytes
| 44 | false | true | 0 | 7 | 14 | 31 | 15 | 16 | null | null |
romanb/amazonka
|
amazonka-autoscaling/gen/Network/AWS/AutoScaling/Types.hs
|
mpl-2.0
|
-- | The end time of this activity.
aEndTime :: Lens' Activity (Maybe UTCTime)
aEndTime = lens _aEndTime (\s a -> s { _aEndTime = a }) . mapping _Time
| 150 |
aEndTime :: Lens' Activity (Maybe UTCTime)
aEndTime = lens _aEndTime (\s a -> s { _aEndTime = a }) . mapping _Time
| 114 |
aEndTime = lens _aEndTime (\s a -> s { _aEndTime = a }) . mapping _Time
| 71 | true | true | 0 | 10 | 29 | 53 | 28 | 25 | null | null |
gridaphobe/ghc
|
compiler/types/Coercion.hs
|
bsd-3-clause
|
nthRole :: Role -> TyCon -> Int -> Role
nthRole Nominal _ _ = Nominal
| 69 |
nthRole :: Role -> TyCon -> Int -> Role
nthRole Nominal _ _ = Nominal
| 69 |
nthRole Nominal _ _ = Nominal
| 29 | false | true | 0 | 7 | 14 | 30 | 15 | 15 | null | null |
srenatus/avus
|
src/Avus/Scan.hs
|
mit
|
processData :: Maybe FilePath -- input, scan file
-> Maybe FilePath -- output
-> (Vuln -> IO Vuln)
-> IO () -- (Records Vuln)
processData fp out f = do
csvData <- readData fp
let (Right (hdr, rs)) = decodeByName csvData :: Either String (Header, Records Vuln)
vs <- mapM f rs -- :: Records Vuln
for_ vs (\x -> putStr out $ encodeByNameWith encodeOpts hdr [x])
-- putStrLn "done"
where
encodeOpts = defaultEncodeOptions
{ encUseCrLf = False
, encIncludeHeader = False
}
-- | Vulnerability processing function.
-- takes base, temp, and env score record update functions, and a
-- vulnerability finding, to lookup the CWE impacts, and apply the update
-- functions, to yield a vulnerability finding with an updated severity
| 821 |
processData :: Maybe FilePath -- input, scan file
-> Maybe FilePath -- output
-> (Vuln -> IO Vuln)
-> IO ()
processData fp out f = do
csvData <- readData fp
let (Right (hdr, rs)) = decodeByName csvData :: Either String (Header, Records Vuln)
vs <- mapM f rs -- :: Records Vuln
for_ vs (\x -> putStr out $ encodeByNameWith encodeOpts hdr [x])
-- putStrLn "done"
where
encodeOpts = defaultEncodeOptions
{ encUseCrLf = False
, encIncludeHeader = False
}
-- | Vulnerability processing function.
-- takes base, temp, and env score record update functions, and a
-- vulnerability finding, to lookup the CWE impacts, and apply the update
-- functions, to yield a vulnerability finding with an updated severity
| 803 |
processData fp out f = do
csvData <- readData fp
let (Right (hdr, rs)) = decodeByName csvData :: Either String (Header, Records Vuln)
vs <- mapM f rs -- :: Records Vuln
for_ vs (\x -> putStr out $ encodeByNameWith encodeOpts hdr [x])
-- putStrLn "done"
where
encodeOpts = defaultEncodeOptions
{ encUseCrLf = False
, encIncludeHeader = False
}
-- | Vulnerability processing function.
-- takes base, temp, and env score record update functions, and a
-- vulnerability finding, to lookup the CWE impacts, and apply the update
-- functions, to yield a vulnerability finding with an updated severity
| 657 | true | true | 1 | 12 | 223 | 190 | 94 | 96 | null | null |
thalerjonathan/phd
|
coding/libraries/chimera/examples/ABS/PolicyEffects/Run.hs
|
gpl-3.0
|
completeNetwork = Complete agentCount
| 37 |
completeNetwork = Complete agentCount
| 37 |
completeNetwork = Complete agentCount
| 37 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
sopvop/cabal
|
Cabal/Distribution/Simple/Build/Macros.hs
|
bsd-3-clause
|
line :: String -> HeaderLines
line str = str ++ "\n"
| 52 |
line :: String -> HeaderLines
line str = str ++ "\n"
| 52 |
line str = str ++ "\n"
| 22 | false | true | 2 | 7 | 10 | 29 | 12 | 17 | null | null |
lpeterse/koka
|
src/Common/NamePrim.hs
|
apache-2.0
|
nameTpAny = preludeName "any"
| 35 |
nameTpAny = preludeName "any"
| 35 |
nameTpAny = preludeName "any"
| 35 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
jwiegley/ghc-release
|
libraries/Cabal/cabal/Distribution/Simple/LocalBuildInfo.hs
|
gpl-3.0
|
-- | External package dependencies for the package as a whole. This is the
-- union of the individual 'componentPackageDeps', less any internal deps.
externalPackageDeps :: LocalBuildInfo -> [(InstalledPackageId, PackageId)]
externalPackageDeps lbi =
-- TODO: what about non-buildable components?
nub [ (ipkgid, pkgid)
| (_,clbi,_) <- componentsConfigs lbi
, (ipkgid, pkgid) <- componentPackageDeps clbi
, not (internal pkgid) ]
where
-- True if this dependency is an internal one (depends on the library
-- defined in the same package).
internal pkgid = pkgid == packageId (localPkgDescr lbi)
-- | The installed package Id we use for local packages registered in the local
-- package db. This is what is used for intra-package deps between components.
--
| 808 |
externalPackageDeps :: LocalBuildInfo -> [(InstalledPackageId, PackageId)]
externalPackageDeps lbi =
-- TODO: what about non-buildable components?
nub [ (ipkgid, pkgid)
| (_,clbi,_) <- componentsConfigs lbi
, (ipkgid, pkgid) <- componentPackageDeps clbi
, not (internal pkgid) ]
where
-- True if this dependency is an internal one (depends on the library
-- defined in the same package).
internal pkgid = pkgid == packageId (localPkgDescr lbi)
-- | The installed package Id we use for local packages registered in the local
-- package db. This is what is used for intra-package deps between components.
--
| 658 |
externalPackageDeps lbi =
-- TODO: what about non-buildable components?
nub [ (ipkgid, pkgid)
| (_,clbi,_) <- componentsConfigs lbi
, (ipkgid, pkgid) <- componentPackageDeps clbi
, not (internal pkgid) ]
where
-- True if this dependency is an internal one (depends on the library
-- defined in the same package).
internal pkgid = pkgid == packageId (localPkgDescr lbi)
-- | The installed package Id we use for local packages registered in the local
-- package db. This is what is used for intra-package deps between components.
--
| 583 | true | true | 0 | 10 | 168 | 121 | 67 | 54 | null | null |
thoughtpolice/hs-poly1305
|
benchmarks/bench1.hs
|
mit
|
main :: IO ()
main = do
let dummy = B.pack [1..512]
k = maybe (error "impossible") id (key $ B.pack [0..31])
msg = authenticate k dummy
defaultMain
[ bench "authenticate" $ nf (authenticate k) dummy
, bench "verify" $ nf (verify k) msg
, bench "roundtrip" $ nf (roundtrip k) dummy
]
| 338 |
main :: IO ()
main = do
let dummy = B.pack [1..512]
k = maybe (error "impossible") id (key $ B.pack [0..31])
msg = authenticate k dummy
defaultMain
[ bench "authenticate" $ nf (authenticate k) dummy
, bench "verify" $ nf (verify k) msg
, bench "roundtrip" $ nf (roundtrip k) dummy
]
| 338 |
main = do
let dummy = B.pack [1..512]
k = maybe (error "impossible") id (key $ B.pack [0..31])
msg = authenticate k dummy
defaultMain
[ bench "authenticate" $ nf (authenticate k) dummy
, bench "verify" $ nf (verify k) msg
, bench "roundtrip" $ nf (roundtrip k) dummy
]
| 324 | false | true | 0 | 15 | 108 | 155 | 73 | 82 | null | null |
wizzup/advent_of_code
|
2018/04/haskell/day_04.hs
|
mit
|
sleepTime :: (LogEntry, LogEntry) -> Int
sleepTime (LogEntry t0 _,LogEntry t1 _)
= round $ nominalDiffTimeToSeconds $ diffUTCTime t1 t0 / 60
| 142 |
sleepTime :: (LogEntry, LogEntry) -> Int
sleepTime (LogEntry t0 _,LogEntry t1 _)
= round $ nominalDiffTimeToSeconds $ diffUTCTime t1 t0 / 60
| 142 |
sleepTime (LogEntry t0 _,LogEntry t1 _)
= round $ nominalDiffTimeToSeconds $ diffUTCTime t1 t0 / 60
| 101 | false | true | 0 | 7 | 23 | 57 | 29 | 28 | null | null |
nevrenato/HetsAlloy
|
OMDoc/OMDocInterface.hs
|
gpl-2.0
|
mkCMP :: MText -> CMP
mkCMP = CMP
| 33 |
mkCMP :: MText -> CMP
mkCMP = CMP
| 33 |
mkCMP = CMP
| 11 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
dbp/shed
|
src/Shed/Blob/File.hs
|
isc
|
mimeMap :: M.Map String ByteString
mimeMap = M.fromList [
( ".asc" , "text/plain" ),
( ".asf" , "video/x-ms-asf" ),
( ".asx" , "video/x-ms-asf" ),
( ".avi" , "video/x-msvideo" ),
( ".bz2" , "application/x-bzip" ),
( ".c" , "text/plain" ),
( ".class" , "application/octet-stream" ),
( ".conf" , "text/plain" ),
( ".cpp" , "text/plain" ),
( ".css" , "text/css" ),
( ".cxx" , "text/plain" ),
( ".dtd" , "text/xml" ),
( ".dvi" , "application/x-dvi" ),
( ".gif" , "image/gif" ),
( ".gz" , "application/x-gzip" ),
( ".hs" , "text/plain" ),
( ".htm" , "text/html" ),
( ".html" , "text/html" ),
( ".ico" , "image/x-icon" ),
( ".jar" , "application/x-java-archive" ),
( ".jpeg" , "image/jpeg" ),
( ".jpg" , "image/jpeg" ),
( ".js" , "text/javascript" ),
( ".json" , "application/json" ),
( ".log" , "text/plain" ),
( ".m3u" , "audio/x-mpegurl" ),
( ".mov" , "video/quicktime" ),
( ".mp3" , "audio/mpeg" ),
( ".mpeg" , "video/mpeg" ),
( ".mpg" , "video/mpeg" ),
( ".ogg" , "application/ogg" ),
( ".pac" , "application/x-ns-proxy-autoconfig" ),
( ".pdf" , "application/pdf" ),
( ".png" , "image/png" ),
( ".ps" , "application/postscript" ),
( ".qt" , "video/quicktime" ),
( ".sig" , "application/pgp-signature" ),
( ".spl" , "application/futuresplash" ),
( ".svg" , "image/svg+xml" ),
( ".swf" , "application/x-shockwave-flash" ),
( ".tar" , "application/x-tar" ),
( ".tar.bz2" , "application/x-bzip-compressed-tar" ),
( ".tar.gz" , "application/x-tgz" ),
( ".tbz" , "application/x-bzip-compressed-tar" ),
( ".text" , "text/plain" ),
( ".tgz" , "application/x-tgz" ),
( ".torrent" , "application/x-bittorrent" ),
( ".ttf" , "application/x-font-truetype" ),
( ".txt" , "text/plain" ),
( ".wav" , "audio/x-wav" ),
( ".wax" , "audio/x-ms-wax" ),
( ".wma" , "audio/x-ms-wma" ),
( ".wmv" , "video/x-ms-wmv" ),
( ".xbm" , "image/x-xbitmap" ),
( ".xml" , "text/xml" ),
( ".xpm" , "image/x-xpixmap" ),
( ".xwd" , "image/x-xwindowdump" ),
( ".zip" , "application/zip" ) ]
| 3,307 |
mimeMap :: M.Map String ByteString
mimeMap = M.fromList [
( ".asc" , "text/plain" ),
( ".asf" , "video/x-ms-asf" ),
( ".asx" , "video/x-ms-asf" ),
( ".avi" , "video/x-msvideo" ),
( ".bz2" , "application/x-bzip" ),
( ".c" , "text/plain" ),
( ".class" , "application/octet-stream" ),
( ".conf" , "text/plain" ),
( ".cpp" , "text/plain" ),
( ".css" , "text/css" ),
( ".cxx" , "text/plain" ),
( ".dtd" , "text/xml" ),
( ".dvi" , "application/x-dvi" ),
( ".gif" , "image/gif" ),
( ".gz" , "application/x-gzip" ),
( ".hs" , "text/plain" ),
( ".htm" , "text/html" ),
( ".html" , "text/html" ),
( ".ico" , "image/x-icon" ),
( ".jar" , "application/x-java-archive" ),
( ".jpeg" , "image/jpeg" ),
( ".jpg" , "image/jpeg" ),
( ".js" , "text/javascript" ),
( ".json" , "application/json" ),
( ".log" , "text/plain" ),
( ".m3u" , "audio/x-mpegurl" ),
( ".mov" , "video/quicktime" ),
( ".mp3" , "audio/mpeg" ),
( ".mpeg" , "video/mpeg" ),
( ".mpg" , "video/mpeg" ),
( ".ogg" , "application/ogg" ),
( ".pac" , "application/x-ns-proxy-autoconfig" ),
( ".pdf" , "application/pdf" ),
( ".png" , "image/png" ),
( ".ps" , "application/postscript" ),
( ".qt" , "video/quicktime" ),
( ".sig" , "application/pgp-signature" ),
( ".spl" , "application/futuresplash" ),
( ".svg" , "image/svg+xml" ),
( ".swf" , "application/x-shockwave-flash" ),
( ".tar" , "application/x-tar" ),
( ".tar.bz2" , "application/x-bzip-compressed-tar" ),
( ".tar.gz" , "application/x-tgz" ),
( ".tbz" , "application/x-bzip-compressed-tar" ),
( ".text" , "text/plain" ),
( ".tgz" , "application/x-tgz" ),
( ".torrent" , "application/x-bittorrent" ),
( ".ttf" , "application/x-font-truetype" ),
( ".txt" , "text/plain" ),
( ".wav" , "audio/x-wav" ),
( ".wax" , "audio/x-ms-wax" ),
( ".wma" , "audio/x-ms-wma" ),
( ".wmv" , "video/x-ms-wmv" ),
( ".xbm" , "image/x-xbitmap" ),
( ".xml" , "text/xml" ),
( ".xpm" , "image/x-xpixmap" ),
( ".xwd" , "image/x-xwindowdump" ),
( ".zip" , "application/zip" ) ]
| 3,307 |
mimeMap = M.fromList [
( ".asc" , "text/plain" ),
( ".asf" , "video/x-ms-asf" ),
( ".asx" , "video/x-ms-asf" ),
( ".avi" , "video/x-msvideo" ),
( ".bz2" , "application/x-bzip" ),
( ".c" , "text/plain" ),
( ".class" , "application/octet-stream" ),
( ".conf" , "text/plain" ),
( ".cpp" , "text/plain" ),
( ".css" , "text/css" ),
( ".cxx" , "text/plain" ),
( ".dtd" , "text/xml" ),
( ".dvi" , "application/x-dvi" ),
( ".gif" , "image/gif" ),
( ".gz" , "application/x-gzip" ),
( ".hs" , "text/plain" ),
( ".htm" , "text/html" ),
( ".html" , "text/html" ),
( ".ico" , "image/x-icon" ),
( ".jar" , "application/x-java-archive" ),
( ".jpeg" , "image/jpeg" ),
( ".jpg" , "image/jpeg" ),
( ".js" , "text/javascript" ),
( ".json" , "application/json" ),
( ".log" , "text/plain" ),
( ".m3u" , "audio/x-mpegurl" ),
( ".mov" , "video/quicktime" ),
( ".mp3" , "audio/mpeg" ),
( ".mpeg" , "video/mpeg" ),
( ".mpg" , "video/mpeg" ),
( ".ogg" , "application/ogg" ),
( ".pac" , "application/x-ns-proxy-autoconfig" ),
( ".pdf" , "application/pdf" ),
( ".png" , "image/png" ),
( ".ps" , "application/postscript" ),
( ".qt" , "video/quicktime" ),
( ".sig" , "application/pgp-signature" ),
( ".spl" , "application/futuresplash" ),
( ".svg" , "image/svg+xml" ),
( ".swf" , "application/x-shockwave-flash" ),
( ".tar" , "application/x-tar" ),
( ".tar.bz2" , "application/x-bzip-compressed-tar" ),
( ".tar.gz" , "application/x-tgz" ),
( ".tbz" , "application/x-bzip-compressed-tar" ),
( ".text" , "text/plain" ),
( ".tgz" , "application/x-tgz" ),
( ".torrent" , "application/x-bittorrent" ),
( ".ttf" , "application/x-font-truetype" ),
( ".txt" , "text/plain" ),
( ".wav" , "audio/x-wav" ),
( ".wax" , "audio/x-ms-wax" ),
( ".wma" , "audio/x-ms-wma" ),
( ".wmv" , "video/x-ms-wmv" ),
( ".xbm" , "image/x-xbitmap" ),
( ".xml" , "text/xml" ),
( ".xpm" , "image/x-xpixmap" ),
( ".xwd" , "image/x-xwindowdump" ),
( ".zip" , "application/zip" ) ]
| 3,272 | false | true | 0 | 7 | 1,655 | 545 | 359 | 186 | null | null |
portnov/yaml-rpc
|
Network/YAML/TH/Client.hs
|
bsd-3-clause
|
methodType :: Name -> API.Method -> Q Type
methodType m (API.Method methodArgs methodRet) = go m (methodArgs ++ [methodRet])
where
go m [r] = do
r' <- convertType r
return $ AppT (VarT m) r'
go m (t: ts) = do
result <- go m ts
t' <- convertType t
return $ AppT (AppT ArrowT t') result
| 324 |
methodType :: Name -> API.Method -> Q Type
methodType m (API.Method methodArgs methodRet) = go m (methodArgs ++ [methodRet])
where
go m [r] = do
r' <- convertType r
return $ AppT (VarT m) r'
go m (t: ts) = do
result <- go m ts
t' <- convertType t
return $ AppT (AppT ArrowT t') result
| 324 |
methodType m (API.Method methodArgs methodRet) = go m (methodArgs ++ [methodRet])
where
go m [r] = do
r' <- convertType r
return $ AppT (VarT m) r'
go m (t: ts) = do
result <- go m ts
t' <- convertType t
return $ AppT (AppT ArrowT t') result
| 281 | false | true | 0 | 10 | 96 | 159 | 74 | 85 | null | null |
VictorDenisov/keystone
|
src/Keystone/Model/Mongo/User.hs
|
gpl-2.0
|
createUser :: User -> M.Action IO (Either E.Error M.ObjectId)
createUser u = (do
M.ObjId oid <- M.insert collectionName $ toBson u
return $ Right oid
) `catch` (\f -> do
case f of
M.WriteFailure duplicateE message ->
return $ Left $ E.conflict $ "Insert of user with the duplicate " ++ (nameBase 'name) ++ " is not allowed."
_ -> throwM f
)
| 378 |
createUser :: User -> M.Action IO (Either E.Error M.ObjectId)
createUser u = (do
M.ObjId oid <- M.insert collectionName $ toBson u
return $ Right oid
) `catch` (\f -> do
case f of
M.WriteFailure duplicateE message ->
return $ Left $ E.conflict $ "Insert of user with the duplicate " ++ (nameBase 'name) ++ " is not allowed."
_ -> throwM f
)
| 378 |
createUser u = (do
M.ObjId oid <- M.insert collectionName $ toBson u
return $ Right oid
) `catch` (\f -> do
case f of
M.WriteFailure duplicateE message ->
return $ Left $ E.conflict $ "Insert of user with the duplicate " ++ (nameBase 'name) ++ " is not allowed."
_ -> throwM f
)
| 316 | false | true | 0 | 18 | 100 | 150 | 72 | 78 | null | null |
dgonyeo/brandskell
|
Handler/EditEntryPics.hs
|
mit
|
editEntryDoodleForm :: Html -> MForm Handler (FormResult EntryPic, Widget)
editEntryDoodleForm = renderBootstrap3
(BootstrapHorizontalForm (ColSm 0)(ColSm 2)(ColSm 0)(ColSm 10))
$ editEntryPicsAForm
| 231 |
editEntryDoodleForm :: Html -> MForm Handler (FormResult EntryPic, Widget)
editEntryDoodleForm = renderBootstrap3
(BootstrapHorizontalForm (ColSm 0)(ColSm 2)(ColSm 0)(ColSm 10))
$ editEntryPicsAForm
| 231 |
editEntryDoodleForm = renderBootstrap3
(BootstrapHorizontalForm (ColSm 0)(ColSm 2)(ColSm 0)(ColSm 10))
$ editEntryPicsAForm
| 155 | false | true | 0 | 10 | 52 | 72 | 36 | 36 | null | null |
cchalmers/lens
|
src/Control/Lens/Lens.hs
|
bsd-3-clause
|
-- | Modify the target of a 'Lens' into your 'Monad''s state by raising it by a non-negative power
-- and return the /old/ value that was replaced.
--
-- When you do not need the result of the operation, ('Control.Lens.Setter.^=') is more flexible.
--
-- @
-- ('<<^=') :: ('MonadState' s m, 'Num' a, 'Integral' e) => 'Lens'' s a -> e -> m a
-- ('<<^=') :: ('MonadState' s m, 'Num' a, 'Integral' e) => 'Iso'' s a -> a -> m a
-- @
(<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a
l <<^= n = l %%= \a -> (a, a ^ n)
| 545 |
(<<^=) :: (MonadState s m, Num a, Integral e) => LensLike' ((,) a) s a -> e -> m a
l <<^= n = l %%= \a -> (a, a ^ n)
| 116 |
l <<^= n = l %%= \a -> (a, a ^ n)
| 33 | true | true | 0 | 11 | 118 | 97 | 55 | 42 | null | null |
rahulmutt/ghcvm
|
compiler/Eta/CodeGen/Prim.hs
|
bsd-3-clause
|
simpleOp IndexByteArrayOp_Word = Just $ byteArrayIndexOp jint mempty
| 68 |
simpleOp IndexByteArrayOp_Word = Just $ byteArrayIndexOp jint mempty
| 68 |
simpleOp IndexByteArrayOp_Word = Just $ byteArrayIndexOp jint mempty
| 68 | false | false | 0 | 6 | 7 | 18 | 8 | 10 | null | null |
slpopejoy/fadno-xml
|
src/Fadno/MusicXml/MusicXml30.hs
|
bsd-2-clause
|
-- | Smart constructor for 'StaffLayout'
mkStaffLayout :: StaffLayout
mkStaffLayout = StaffLayout Nothing Nothing
| 113 |
mkStaffLayout :: StaffLayout
mkStaffLayout = StaffLayout Nothing Nothing
| 72 |
mkStaffLayout = StaffLayout Nothing Nothing
| 43 | true | true | 0 | 5 | 13 | 17 | 9 | 8 | null | null |
mbakke/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- | Characters used for detecting user-written filters (see
-- L{_CheckFilter})
qlangFilterDetectionChars :: FrozenSet String
qlangFilterDetectionChars =
ConstantUtils.mkSet ["!", " ", "\"", "\'",
")", "(", "\x0b", "\n",
"\r", "\x0c", "/", "<",
"\t", ">", "=", "\\", "~"]
| 344 |
qlangFilterDetectionChars :: FrozenSet String
qlangFilterDetectionChars =
ConstantUtils.mkSet ["!", " ", "\"", "\'",
")", "(", "\x0b", "\n",
"\r", "\x0c", "/", "<",
"\t", ">", "=", "\\", "~"]
| 262 |
qlangFilterDetectionChars =
ConstantUtils.mkSet ["!", " ", "\"", "\'",
")", "(", "\x0b", "\n",
"\r", "\x0c", "/", "<",
"\t", ">", "=", "\\", "~"]
| 216 | true | true | 0 | 6 | 107 | 72 | 45 | 27 | null | null |
rahulmutt/ghcvm
|
compiler/Eta/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpInfo WordGtOp = mkCompare (fsLit "gtWord#") wordPrimTy
| 60 |
primOpInfo WordGtOp = mkCompare (fsLit "gtWord#") wordPrimTy
| 60 |
primOpInfo WordGtOp = mkCompare (fsLit "gtWord#") wordPrimTy
| 60 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
kim/amazonka
|
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types.hs
|
mpl-2.0
|
-- | A complex type that contains a Location element for each country in which you
-- want CloudFront either to distribute your content (whitelist) or not
-- distribute your content (blacklist). The Location element is a two-letter,
-- uppercase country code for a country that you want to include in your
-- blacklist or whitelist. Include one Location element for each country.
-- CloudFront and MaxMind both use ISO 3166 country codes. For the current list
-- of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the
-- International Organization for Standardization website. You can also refer to
-- the country list in the CloudFront console, which includes both country names
-- and codes.
grItems :: Lens' GeoRestriction [Text]
grItems = lens _grItems (\s a -> s { _grItems = a }) . _List
| 815 |
grItems :: Lens' GeoRestriction [Text]
grItems = lens _grItems (\s a -> s { _grItems = a }) . _List
| 99 |
grItems = lens _grItems (\s a -> s { _grItems = a }) . _List
| 60 | true | true | 0 | 10 | 136 | 56 | 35 | 21 | null | null |
DavidAlphaFox/darcs
|
src/Darcs/Repository/Ssh.hs
|
gpl-2.0
|
-- | Return the command and arguments needed to run an ssh command
-- First try the appropriate darcs environment variable and SSH_PORT
-- defaulting to "ssh" and no specified port.
getSSH :: SSHCmd
-> IO (String, [String])
getSSH cmd = do
port <- (portFlag cmd `fmap` getEnv "SSH_PORT") `catchall` return []
let (ssh, ssh_args) = breakCommand command
return (ssh, ssh_args ++ port)
where
command = fromSshCmd defaultSsh cmd
portFlag SSH x = ["-p", x]
portFlag SCP x = ["-P", x]
portFlag SFTP x = ["-oPort=" ++ x]
| 556 |
getSSH :: SSHCmd
-> IO (String, [String])
getSSH cmd = do
port <- (portFlag cmd `fmap` getEnv "SSH_PORT") `catchall` return []
let (ssh, ssh_args) = breakCommand command
return (ssh, ssh_args ++ port)
where
command = fromSshCmd defaultSsh cmd
portFlag SSH x = ["-p", x]
portFlag SCP x = ["-P", x]
portFlag SFTP x = ["-oPort=" ++ x]
| 370 |
getSSH cmd = do
port <- (portFlag cmd `fmap` getEnv "SSH_PORT") `catchall` return []
let (ssh, ssh_args) = breakCommand command
return (ssh, ssh_args ++ port)
where
command = fromSshCmd defaultSsh cmd
portFlag SSH x = ["-p", x]
portFlag SCP x = ["-P", x]
portFlag SFTP x = ["-oPort=" ++ x]
| 321 | true | true | 0 | 11 | 130 | 163 | 86 | 77 | null | null |
phischu/fragnix
|
benchmarks/containers/Data.Map.Base.hs
|
bsd-3-clause
|
{--------------------------------------------------------------------
Building trees from ascending/descending lists can be done in linear time.
Note that if [xs] is ascending that:
fromAscList xs == fromList xs
fromAscListWith f xs == fromListWith f xs
--------------------------------------------------------------------}
-- | /O(n)/. Build a map from an ascending list in linear time.
-- /The precondition (input list is ascending) is not checked./
--
-- > fromAscList [(3,"b"), (5,"a")] == fromList [(3, "b"), (5, "a")]
-- > fromAscList [(3,"b"), (5,"a"), (5,"b")] == fromList [(3, "b"), (5, "b")]
-- > valid (fromAscList [(3,"b"), (5,"a"), (5,"b")]) == True
-- > valid (fromAscList [(5,"a"), (3,"b"), (5,"b")]) == False
fromAscList :: Eq k => [(k,a)] -> Map k a
fromAscList xs
= fromAscListWithKey (\_ x _ -> x) xs
| 850 |
fromAscList :: Eq k => [(k,a)] -> Map k a
fromAscList xs
= fromAscListWithKey (\_ x _ -> x) xs
| 96 |
fromAscList xs
= fromAscListWithKey (\_ x _ -> x) xs
| 54 | true | true | 0 | 9 | 147 | 70 | 38 | 32 | null | null |
plumlife/cabal
|
Cabal/Distribution/Simple/LocalBuildInfo.hs
|
bsd-3-clause
|
foldComponent :: (Library -> a)
-> (Executable -> a)
-> (TestSuite -> a)
-> (Benchmark -> a)
-> Component
-> a
foldComponent f _ _ _ (CLib lib) = f lib
| 223 |
foldComponent :: (Library -> a)
-> (Executable -> a)
-> (TestSuite -> a)
-> (Benchmark -> a)
-> Component
-> a
foldComponent f _ _ _ (CLib lib) = f lib
| 223 |
foldComponent f _ _ _ (CLib lib) = f lib
| 42 | false | true | 0 | 13 | 102 | 85 | 42 | 43 | null | null |
clanehin/priority-sync
|
PrioritySync/Internal/Queue.hs
|
bsd-3-clause
|
setTopOfQueue :: (Ord a) => Queue a -> Bool -> STM Bool
setTopOfQueue q t =
do m_min <- liftM PSQ.findMin $ readTVar (pending_tasks q)
case m_min of
Nothing -> return True
Just (task :-> _) ->
do previous_t <- readTVar (is_top_of_queue task)
writeTVar (is_top_of_queue task) t
return previous_t
| 379 |
setTopOfQueue :: (Ord a) => Queue a -> Bool -> STM Bool
setTopOfQueue q t =
do m_min <- liftM PSQ.findMin $ readTVar (pending_tasks q)
case m_min of
Nothing -> return True
Just (task :-> _) ->
do previous_t <- readTVar (is_top_of_queue task)
writeTVar (is_top_of_queue task) t
return previous_t
| 379 |
setTopOfQueue q t =
do m_min <- liftM PSQ.findMin $ readTVar (pending_tasks q)
case m_min of
Nothing -> return True
Just (task :-> _) ->
do previous_t <- readTVar (is_top_of_queue task)
writeTVar (is_top_of_queue task) t
return previous_t
| 323 | false | true | 0 | 15 | 133 | 132 | 60 | 72 | null | null |
thdtjsdn/language-javascript
|
src/Language/JavaScript/Parser/ParserMonad.hs
|
bsd-3-clause
|
setLocation :: AlexPosn -> P ()
setLocation loc = modify $ \s -> s { alex_pos = loc }
| 85 |
setLocation :: AlexPosn -> P ()
setLocation loc = modify $ \s -> s { alex_pos = loc }
| 85 |
setLocation loc = modify $ \s -> s { alex_pos = loc }
| 53 | false | true | 0 | 8 | 18 | 40 | 21 | 19 | null | null |
rcook/seahug-slides
|
snippets/folds-part-1.hs
|
mit
|
main :: IO ()
main = do
let ctx = Context 1000
(items, ctx') = tagItems (["one", "two", "three"], ctx)
putStrLn $ show items
-- Yields: [("one",1000),("two",1001),("three",1002)]
| 188 |
main :: IO ()
main = do
let ctx = Context 1000
(items, ctx') = tagItems (["one", "two", "three"], ctx)
putStrLn $ show items
-- Yields: [("one",1000),("two",1001),("three",1002)]
| 188 |
main = do
let ctx = Context 1000
(items, ctx') = tagItems (["one", "two", "three"], ctx)
putStrLn $ show items
-- Yields: [("one",1000),("two",1001),("three",1002)]
| 174 | false | true | 0 | 13 | 36 | 75 | 37 | 38 | null | null |
beni55/fay
|
src/Fay/Convert.hs
|
bsd-3-clause
|
-- | Parse a bool.
parseBool :: Value -> Either String Bool
parseBool value = case value of
Bool n -> return n
_ -> badData value
-- | Parse a string.
| 155 |
parseBool :: Value -> Either String Bool
parseBool value = case value of
Bool n -> return n
_ -> badData value
-- | Parse a string.
| 136 |
parseBool value = case value of
Bool n -> return n
_ -> badData value
-- | Parse a string.
| 95 | true | true | 0 | 8 | 36 | 54 | 25 | 29 | null | null |
sgillespie/ghc
|
compiler/basicTypes/Var.hs
|
bsd-3-clause
|
isCoVar _ = False
| 45 |
isCoVar _ = False
| 45 |
isCoVar _ = False
| 45 | false | false | 0 | 4 | 31 | 10 | 4 | 6 | null | null |
feuerbach/tasty-html
|
Test/Tasty/Runners/Html.hs
|
mit
|
-- ** Test folding
-- | To be used for an individual test when when folding the final 'TestTree'.
runTest :: IsTest t
=> StatusMap -> OptionSet -> TestName -> t -> SummaryTraversal
runTest statusMap _ testName _ = Traversal $ Compose $ do
ix <- State.get
result <- lift $ atomically $ do
status <- readTVar $
fromMaybe (error "Attempted to lookup test by index outside bounds") $
IntMap.lookup ix statusMap
case status of
-- If the test is done, return the result
Done result -> return result
-- Otherwise the test has either not been started or is currently
-- executing
_ -> STM.retry
-- Generate HTML for the test
msg <- liftIO . Tasty.formatMessage . Tasty.resultDescription $ result
let time = Tasty.resultTime result
summary = if Tasty.resultSuccessful result
then mkSuccess (testName, time) msg
else mkFailure (testName, time) msg
Const summary <$ State.modify (+1)
-- | To be used for a 'TestGroup' when folding the final 'TestTree'.
| 1,055 |
runTest :: IsTest t
=> StatusMap -> OptionSet -> TestName -> t -> SummaryTraversal
runTest statusMap _ testName _ = Traversal $ Compose $ do
ix <- State.get
result <- lift $ atomically $ do
status <- readTVar $
fromMaybe (error "Attempted to lookup test by index outside bounds") $
IntMap.lookup ix statusMap
case status of
-- If the test is done, return the result
Done result -> return result
-- Otherwise the test has either not been started or is currently
-- executing
_ -> STM.retry
-- Generate HTML for the test
msg <- liftIO . Tasty.formatMessage . Tasty.resultDescription $ result
let time = Tasty.resultTime result
summary = if Tasty.resultSuccessful result
then mkSuccess (testName, time) msg
else mkFailure (testName, time) msg
Const summary <$ State.modify (+1)
-- | To be used for a 'TestGroup' when folding the final 'TestTree'.
| 956 |
runTest statusMap _ testName _ = Traversal $ Compose $ do
ix <- State.get
result <- lift $ atomically $ do
status <- readTVar $
fromMaybe (error "Attempted to lookup test by index outside bounds") $
IntMap.lookup ix statusMap
case status of
-- If the test is done, return the result
Done result -> return result
-- Otherwise the test has either not been started or is currently
-- executing
_ -> STM.retry
-- Generate HTML for the test
msg <- liftIO . Tasty.formatMessage . Tasty.resultDescription $ result
let time = Tasty.resultTime result
summary = if Tasty.resultSuccessful result
then mkSuccess (testName, time) msg
else mkFailure (testName, time) msg
Const summary <$ State.modify (+1)
-- | To be used for a 'TestGroup' when folding the final 'TestTree'.
| 865 | true | true | 0 | 17 | 272 | 236 | 117 | 119 | null | null |
rahulmutt/ghcvm
|
compiler/Eta/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpOutOfLine MkWeakOp = True
| 31 |
primOpOutOfLine MkWeakOp = True
| 31 |
primOpOutOfLine MkWeakOp = True
| 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bgamari/datalogger-web
|
WebApp.hs
|
bsd-3-clause
|
getPutSetting :: (ToJSON a, Parsable a)
=> String -> DL.Setting a -> ScottyM ()
getPutSetting name setting = do
getSetting name setting
putSetting name setting False
| 201 |
getPutSetting :: (ToJSON a, Parsable a)
=> String -> DL.Setting a -> ScottyM ()
getPutSetting name setting = do
getSetting name setting
putSetting name setting False
| 201 |
getPutSetting name setting = do
getSetting name setting
putSetting name setting False
| 107 | false | true | 0 | 10 | 61 | 72 | 32 | 40 | null | null |
benkolera/haskell-opaleye
|
src/Opaleye/Manipulation.hs
|
bsd-3-clause
|
runUpdate :: PGS.Connection -> T.Table columnsW columnsR
-> (columnsR -> columnsW) -> (columnsR -> Column PGBool)
-> IO Int64
runUpdate conn = PGS.execute_ conn . fromString .:. arrangeUpdateSql
| 214 |
runUpdate :: PGS.Connection -> T.Table columnsW columnsR
-> (columnsR -> columnsW) -> (columnsR -> Column PGBool)
-> IO Int64
runUpdate conn = PGS.execute_ conn . fromString .:. arrangeUpdateSql
| 214 |
runUpdate conn = PGS.execute_ conn . fromString .:. arrangeUpdateSql
| 68 | false | true | 0 | 11 | 47 | 72 | 35 | 37 | null | null |
abakst/liquidhaskell
|
benchmarks/vector-0.10.0.1/Data/Vector/Fusion/Stream/Monadic.hs
|
bsd-3-clause
|
prescanl' f = prescanlM' (\a b -> return (f a b))
| 49 |
prescanl' f = prescanlM' (\a b -> return (f a b))
| 49 |
prescanl' f = prescanlM' (\a b -> return (f a b))
| 49 | false | false | 0 | 10 | 10 | 33 | 16 | 17 | null | null |
hvr/vector
|
Data/Vector/Generic.hs
|
bsd-3-clause
|
prescanl' f z = unstream . inplace (S.prescanl' f z) id . stream
| 64 |
prescanl' f z = unstream . inplace (S.prescanl' f z) id . stream
| 64 |
prescanl' f z = unstream . inplace (S.prescanl' f z) id . stream
| 64 | false | false | 0 | 10 | 12 | 34 | 16 | 18 | null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/maximum_1.hs
|
mit
|
otherwise :: MyBool;
otherwise = MyTrue
| 39 |
otherwise :: MyBool
otherwise = MyTrue
| 38 |
otherwise = MyTrue
| 18 | false | true | 0 | 4 | 5 | 12 | 7 | 5 | null | null |
ssaavedra/liquidhaskell
|
src/Language/Haskell/Liquid/Constraint/Split.hs
|
bsd-3-clause
|
-- forallExprReftLookup :: CGEnv -> F.Symbol -> Int
forallExprReftLookup Ξ³ x = snap <$> F.lookupSEnv x (syenv Ξ³)
where
snap = mapFourth4 ignoreOblig . bkArrow . fourth4 . bkUniv . lookup
lookup z = fromMaybe (panicUnbound Ξ³ z) (Ξ³ ?= F.symbol z)
--------------------------------------------------------------------------------
| 341 |
forallExprReftLookup Ξ³ x = snap <$> F.lookupSEnv x (syenv Ξ³)
where
snap = mapFourth4 ignoreOblig . bkArrow . fourth4 . bkUniv . lookup
lookup z = fromMaybe (panicUnbound Ξ³ z) (Ξ³ ?= F.symbol z)
--------------------------------------------------------------------------------
| 289 |
forallExprReftLookup Ξ³ x = snap <$> F.lookupSEnv x (syenv Ξ³)
where
snap = mapFourth4 ignoreOblig . bkArrow . fourth4 . bkUniv . lookup
lookup z = fromMaybe (panicUnbound Ξ³ z) (Ξ³ ?= F.symbol z)
--------------------------------------------------------------------------------
| 289 | true | false | 0 | 9 | 58 | 90 | 44 | 46 | null | null |
jdimond/firehose
|
src/Data/ListenerTree.hs
|
bsd-3-clause
|
empty :: ListenerTree p l
empty = Tree HM.empty HS.empty
| 56 |
empty :: ListenerTree p l
empty = Tree HM.empty HS.empty
| 56 |
empty = Tree HM.empty HS.empty
| 30 | false | true | 0 | 6 | 9 | 25 | 12 | 13 | null | null |
Mathnerd314/lamdu
|
src/Lamdu/CodeEdit/ExpressionEdit/ExpressionGui.hs
|
gpl-3.0
|
wrapDelegated ::
(MonadA f, MonadA m) =>
FocusDelegator.Config -> FocusDelegator.IsDelegating ->
(Widget.Id -> ExprGuiM m (ExpressionGui f)) ->
Widget.Id -> ExprGuiM m (ExpressionGui f)
wrapDelegated fdConfig isDelegating =
ExprGuiM.wrapDelegated fdConfig isDelegating (egWidget %~)
| 292 |
wrapDelegated ::
(MonadA f, MonadA m) =>
FocusDelegator.Config -> FocusDelegator.IsDelegating ->
(Widget.Id -> ExprGuiM m (ExpressionGui f)) ->
Widget.Id -> ExprGuiM m (ExpressionGui f)
wrapDelegated fdConfig isDelegating =
ExprGuiM.wrapDelegated fdConfig isDelegating (egWidget %~)
| 292 |
wrapDelegated fdConfig isDelegating =
ExprGuiM.wrapDelegated fdConfig isDelegating (egWidget %~)
| 98 | false | true | 0 | 14 | 42 | 101 | 50 | 51 | null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
setMetaTyVarTcLevel :: TcTyVar -> TcLevel -> TcTyVar
setMetaTyVarTcLevel tv tclvl
= ASSERT( isTcTyVar tv )
case tcTyVarDetails tv of
details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl })
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
| 268 |
setMetaTyVarTcLevel :: TcTyVar -> TcLevel -> TcTyVar
setMetaTyVarTcLevel tv tclvl
= ASSERT( isTcTyVar tv )
case tcTyVarDetails tv of
details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl })
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
| 268 |
setMetaTyVarTcLevel tv tclvl
= ASSERT( isTcTyVar tv )
case tcTyVarDetails tv of
details@(MetaTv {}) -> setTcTyVarDetails tv (details { mtv_tclvl = tclvl })
_ -> pprPanic "metaTyVarTcLevel" (ppr tv)
| 215 | false | true | 0 | 11 | 53 | 92 | 46 | 46 | null | null |
jcaldwell/monadserv
|
src/MonadServ/JSON.hs
|
bsd-2-clause
|
array :: Parser [Value]
array = between (tok (char '[')) (char ']') $
tok value `sepBy` tok (char ',')
| 112 |
array :: Parser [Value]
array = between (tok (char '[')) (char ']') $
tok value `sepBy` tok (char ',')
| 112 |
array = between (tok (char '[')) (char ']') $
tok value `sepBy` tok (char ',')
| 88 | false | true | 0 | 11 | 28 | 62 | 31 | 31 | null | null |
JAnthelme/relation-tool
|
src/Relvar/Pretty.hs
|
bsd-3-clause
|
table pm bss ixs = punctuateH left (vline (border_bot pm) hs (length ixs)) rws''
where ixs' = take (length bss) ixs -- so that ixs = [0..] is ok
bss' = take (length ixs') $ drop (head ixs') bss
hs = map (maximum . map rows) bss'
bss'' = transpose $ bss'
ws = map (maximum . map cols) bss''
rws'' = map f3 $ zip ws bss'' -- with the horizontal lines
f3 (n, bs) = xs'
where bx = hline $ max n (col_width_min pm)
xs = punctuateV (col_align pm) bx bs
xs' = case border_bot pm of
True -> vcat (col_align pm) $ [xs,bx]
False -> xs
| 729 |
table pm bss ixs = punctuateH left (vline (border_bot pm) hs (length ixs)) rws''
where ixs' = take (length bss) ixs -- so that ixs = [0..] is ok
bss' = take (length ixs') $ drop (head ixs') bss
hs = map (maximum . map rows) bss'
bss'' = transpose $ bss'
ws = map (maximum . map cols) bss''
rws'' = map f3 $ zip ws bss'' -- with the horizontal lines
f3 (n, bs) = xs'
where bx = hline $ max n (col_width_min pm)
xs = punctuateV (col_align pm) bx bs
xs' = case border_bot pm of
True -> vcat (col_align pm) $ [xs,bx]
False -> xs
| 729 |
table pm bss ixs = punctuateH left (vline (border_bot pm) hs (length ixs)) rws''
where ixs' = take (length bss) ixs -- so that ixs = [0..] is ok
bss' = take (length ixs') $ drop (head ixs') bss
hs = map (maximum . map rows) bss'
bss'' = transpose $ bss'
ws = map (maximum . map cols) bss''
rws'' = map f3 $ zip ws bss'' -- with the horizontal lines
f3 (n, bs) = xs'
where bx = hline $ max n (col_width_min pm)
xs = punctuateV (col_align pm) bx bs
xs' = case border_bot pm of
True -> vcat (col_align pm) $ [xs,bx]
False -> xs
| 729 | false | false | 0 | 15 | 314 | 254 | 128 | 126 | null | null |
brendanhay/gogol
|
gogol-firebase-rules/gen/Network/Google/Resource/FirebaseRules/Projects/Rulesets/Create.hs
|
mpl-2.0
|
-- | OAuth access token.
prcAccessToken :: Lens' ProjectsRulesetsCreate (Maybe Text)
prcAccessToken
= lens _prcAccessToken
(\ s a -> s{_prcAccessToken = a})
| 164 |
prcAccessToken :: Lens' ProjectsRulesetsCreate (Maybe Text)
prcAccessToken
= lens _prcAccessToken
(\ s a -> s{_prcAccessToken = a})
| 139 |
prcAccessToken
= lens _prcAccessToken
(\ s a -> s{_prcAccessToken = a})
| 79 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
rueshyna/gogol
|
gogol-resourcemanager/gen/Network/Google/ResourceManager/Types/Product.hs
|
mpl-2.0
|
-- | True if the project can be retrieved using GetProject. No other
-- operations on the project are guaranteed to work until the project
-- creation is complete.
pcsGettable :: Lens' ProjectCreationStatus (Maybe Bool)
pcsGettable
= lens _pcsGettable (\ s a -> s{_pcsGettable = a})
| 284 |
pcsGettable :: Lens' ProjectCreationStatus (Maybe Bool)
pcsGettable
= lens _pcsGettable (\ s a -> s{_pcsGettable = a})
| 120 |
pcsGettable
= lens _pcsGettable (\ s a -> s{_pcsGettable = a})
| 64 | true | true | 1 | 9 | 47 | 52 | 27 | 25 | null | null |
shlevy/ghc
|
compiler/profiling/CostCentre.hs
|
bsd-3-clause
|
mkAutoCC :: Id -> Module -> IsCafCC -> CostCentre
mkAutoCC id mod is_caf
= NormalCC { cc_key = getKey (getUnique id),
cc_name = str, cc_mod = mod,
cc_loc = nameSrcSpan (getName id),
cc_is_caf = is_caf
}
where
name = getName id
-- beware: only external names are guaranteed to have unique
-- Occnames. If the name is not external, we must append its
-- Unique.
-- See bug #249, tests prof001, prof002, also #2411
str | isExternalName name = occNameFS (getOccName id)
| otherwise = occNameFS (getOccName id)
`appendFS`
mkFastString ('_' : show (getUnique name))
| 757 |
mkAutoCC :: Id -> Module -> IsCafCC -> CostCentre
mkAutoCC id mod is_caf
= NormalCC { cc_key = getKey (getUnique id),
cc_name = str, cc_mod = mod,
cc_loc = nameSrcSpan (getName id),
cc_is_caf = is_caf
}
where
name = getName id
-- beware: only external names are guaranteed to have unique
-- Occnames. If the name is not external, we must append its
-- Unique.
-- See bug #249, tests prof001, prof002, also #2411
str | isExternalName name = occNameFS (getOccName id)
| otherwise = occNameFS (getOccName id)
`appendFS`
mkFastString ('_' : show (getUnique name))
| 757 |
mkAutoCC id mod is_caf
= NormalCC { cc_key = getKey (getUnique id),
cc_name = str, cc_mod = mod,
cc_loc = nameSrcSpan (getName id),
cc_is_caf = is_caf
}
where
name = getName id
-- beware: only external names are guaranteed to have unique
-- Occnames. If the name is not external, we must append its
-- Unique.
-- See bug #249, tests prof001, prof002, also #2411
str | isExternalName name = occNameFS (getOccName id)
| otherwise = occNameFS (getOccName id)
`appendFS`
mkFastString ('_' : show (getUnique name))
| 707 | false | true | 0 | 12 | 292 | 161 | 84 | 77 | null | null |
GRACeFUL-project/GRACe
|
src/Compile1.hs
|
bsd-3-clause
|
genCall :: ComprehensionMonad (CPExp a) -> String -> IntermMonad (HZ.Expr)
genCall m call = do
(bexpr, s) <- runWriterT (compileComprehension m)
bexprc <- compileCPExp' bexpr
return $ HZast.forall s call bexprc
| 228 |
genCall :: ComprehensionMonad (CPExp a) -> String -> IntermMonad (HZ.Expr)
genCall m call = do
(bexpr, s) <- runWriterT (compileComprehension m)
bexprc <- compileCPExp' bexpr
return $ HZast.forall s call bexprc
| 228 |
genCall m call = do
(bexpr, s) <- runWriterT (compileComprehension m)
bexprc <- compileCPExp' bexpr
return $ HZast.forall s call bexprc
| 153 | false | true | 0 | 10 | 48 | 89 | 42 | 47 | null | null |
AndrewRademacher/hasql-postgres
|
library/Hasql/Postgres/ErrorCode.hs
|
mit
|
-- | Code \"42501\".
insufficient_privilege :: ErrorCode = "42501"
| 96 |
insufficient_privilege :: ErrorCode = "42501"
| 75 |
insufficient_privilege :: ErrorCode = "42501"
| 75 | true | false | 0 | 5 | 38 | 12 | 6 | 6 | null | null |
dysinger/amazonka
|
amazonka-datapipeline/gen/Network/AWS/DataPipeline/PutPipelineDefinition.hs
|
mpl-2.0
|
-- | A list of the validation warnings that are associated with the objects
-- defined in 'pipelineObjects'.
ppdrValidationWarnings :: Lens' PutPipelineDefinitionResponse [ValidationWarning]
ppdrValidationWarnings =
lens _ppdrValidationWarnings (\s a -> s { _ppdrValidationWarnings = a })
. _List
| 308 |
ppdrValidationWarnings :: Lens' PutPipelineDefinitionResponse [ValidationWarning]
ppdrValidationWarnings =
lens _ppdrValidationWarnings (\s a -> s { _ppdrValidationWarnings = a })
. _List
| 199 |
ppdrValidationWarnings =
lens _ppdrValidationWarnings (\s a -> s { _ppdrValidationWarnings = a })
. _List
| 117 | true | true | 0 | 10 | 49 | 48 | 27 | 21 | null | null |
Cipherwraith/alacrity
|
src/Helpers.hs
|
gpl-3.0
|
makePath :: IndexSettings -> FilePath -> FilePath
makePath !(IndexSettings !False _ ) !fp = rakedPath fp
| 104 |
makePath :: IndexSettings -> FilePath -> FilePath
makePath !(IndexSettings !False _ ) !fp = rakedPath fp
| 104 |
makePath !(IndexSettings !False _ ) !fp = rakedPath fp
| 54 | false | true | 0 | 9 | 15 | 38 | 17 | 21 | null | null |
Motions/motions
|
src/Bio/Motions/Utils/Geometry.hs
|
apache-2.0
|
-- |Tests whether a point is (not necessarily strictly) inside a triangle.
-- Assumes that the three points defining the triangle are pairwise different.
-- Works well when the triangle is actually a segment.
-- Assumes that the point and the triangle are coplanar.
-- Warning: possible integer overflows with large distances.
pointInsideTriangle2D :: Point -> Triangle -> Bool
pointInsideTriangle2D p Triangle{..} =
vectorInsideAngle p1p (Angle p1p2 p1p3) &&
vectorInsideAngle p2p (Angle p2p1 p2p3) &&
vectorInsideAngle p3p (Angle p3p1 p3p2)
where
p1p = p - p1
p2p = p - p2
p3p = p - p3
p1p2 = p2 - p1
p1p3 = p3 - p1
p2p3 = p3 - p2
p2p1 = - p1p2
p3p1 = - p1p3
p3p2 = - p2p3
-- |Tests whether a vector is (not necessarily strictly) inside an angle.
-- When any of the angle vectors is zero or the angle vectors have opposing directions,
-- returns true for all vectors.
-- Warning: possible integer overflows with large distances.
| 981 |
pointInsideTriangle2D :: Point -> Triangle -> Bool
pointInsideTriangle2D p Triangle{..} =
vectorInsideAngle p1p (Angle p1p2 p1p3) &&
vectorInsideAngle p2p (Angle p2p1 p2p3) &&
vectorInsideAngle p3p (Angle p3p1 p3p2)
where
p1p = p - p1
p2p = p - p2
p3p = p - p3
p1p2 = p2 - p1
p1p3 = p3 - p1
p2p3 = p3 - p2
p2p1 = - p1p2
p3p1 = - p1p3
p3p2 = - p2p3
-- |Tests whether a vector is (not necessarily strictly) inside an angle.
-- When any of the angle vectors is zero or the angle vectors have opposing directions,
-- returns true for all vectors.
-- Warning: possible integer overflows with large distances.
| 654 |
pointInsideTriangle2D p Triangle{..} =
vectorInsideAngle p1p (Angle p1p2 p1p3) &&
vectorInsideAngle p2p (Angle p2p1 p2p3) &&
vectorInsideAngle p3p (Angle p3p1 p3p2)
where
p1p = p - p1
p2p = p - p2
p3p = p - p3
p1p2 = p2 - p1
p1p3 = p3 - p1
p2p3 = p3 - p2
p2p1 = - p1p2
p3p1 = - p1p3
p3p2 = - p2p3
-- |Tests whether a vector is (not necessarily strictly) inside an angle.
-- When any of the angle vectors is zero or the angle vectors have opposing directions,
-- returns true for all vectors.
-- Warning: possible integer overflows with large distances.
| 603 | true | true | 3 | 9 | 215 | 173 | 89 | 84 | null | null |
CindyLinz/Haskell.js
|
trans/src/Desugar/String.hs
|
mit
|
deStringExp (XExpTag l exp) = XExpTag (id l) (deStringExp exp)
| 62 |
deStringExp (XExpTag l exp) = XExpTag (id l) (deStringExp exp)
| 62 |
deStringExp (XExpTag l exp) = XExpTag (id l) (deStringExp exp)
| 62 | false | false | 0 | 7 | 9 | 34 | 16 | 18 | null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\xF9B1' = "\x9234"
| 33 |
decomposeChar '\xF9B1' = "\x9234"
| 33 |
decomposeChar '\xF9B1' = "\x9234"
| 33 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
TomMD/ghc
|
compiler/types/TypeRep.hs
|
bsd-3-clause
|
---------------
tidyOpenTyVars :: TidyEnv -> [TyVar] -> (TidyEnv, [TyVar])
tidyOpenTyVars env tyvars = mapAccumL tidyOpenTyVar env tyvars
| 137 |
tidyOpenTyVars :: TidyEnv -> [TyVar] -> (TidyEnv, [TyVar])
tidyOpenTyVars env tyvars = mapAccumL tidyOpenTyVar env tyvars
| 121 |
tidyOpenTyVars env tyvars = mapAccumL tidyOpenTyVar env tyvars
| 62 | true | true | 0 | 8 | 16 | 44 | 24 | 20 | null | null |
randen/haddock
|
haddock-api/src/Haddock/Interface/Create.hs
|
bsd-2-clause
|
lookupModuleDyn ::
DynFlags -> Maybe UnitId -> ModuleName -> Module
lookupModuleDyn _ (Just pkgId) mdlName =
Module.mkModule pkgId mdlName
| 142 |
lookupModuleDyn ::
DynFlags -> Maybe UnitId -> ModuleName -> Module
lookupModuleDyn _ (Just pkgId) mdlName =
Module.mkModule pkgId mdlName
| 142 |
lookupModuleDyn _ (Just pkgId) mdlName =
Module.mkModule pkgId mdlName
| 72 | false | true | 0 | 7 | 22 | 46 | 22 | 24 | null | null |
singingwolfboy/citeproc-hs
|
src/Text/CSL/Eval/Common.hs
|
bsd-3-clause
|
getAgents' :: String -> State EvalState [Agent]
getAgents' s
= do
mv <- withRefMap (lookup s)
case mv of
Just v -> case fromValue v of
Just x -> return x
_ -> return []
_ -> return []
| 265 |
getAgents' :: String -> State EvalState [Agent]
getAgents' s
= do
mv <- withRefMap (lookup s)
case mv of
Just v -> case fromValue v of
Just x -> return x
_ -> return []
_ -> return []
| 265 |
getAgents' s
= do
mv <- withRefMap (lookup s)
case mv of
Just v -> case fromValue v of
Just x -> return x
_ -> return []
_ -> return []
| 217 | false | true | 0 | 15 | 120 | 104 | 46 | 58 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.