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
uuhan/Idris-dev
src/Idris/IdrisDoc.hs
bsd-3-clause
extract :: PTerm -- ^ Where to extract names from -> [Name] -- ^ Extracted names extract = extractPTermNames
147
extract :: PTerm -- ^ Where to extract names from -> [Name] extract = extractPTermNames
126
extract = extractPTermNames
57
true
true
0
6
57
20
12
8
null
null
eugenkiss/loopgotowhile
src/Language/LoopGotoWhile/While/Transform.hs
bsd-3-clause
renameVar :: VarIdent -> VarIdent -> Stat -> Stat renameVar from to ast = case ast of Assign var aexp -> Assign (r var) (rAExp aexp) While bexp stat -> While (rBExp bexp) (rVar stat) If bexp s1 Nothing -> If (rBExp bexp) (rVar s1) Nothing If bexp s1 (Just s2) -> If (rBExp bexp) (rVar s1) (Just (rVar s2)) Seq stats -> Seq (map rVar stats) where rVar = renameVar from to rAExp = renameVarInAExp from to rBExp = renameVarInBExp from to r var | var == from = to | otherwise = var -- | Analyze the AST and return a list without duplicates of all used variable -- names.
642
renameVar :: VarIdent -> VarIdent -> Stat -> Stat renameVar from to ast = case ast of Assign var aexp -> Assign (r var) (rAExp aexp) While bexp stat -> While (rBExp bexp) (rVar stat) If bexp s1 Nothing -> If (rBExp bexp) (rVar s1) Nothing If bexp s1 (Just s2) -> If (rBExp bexp) (rVar s1) (Just (rVar s2)) Seq stats -> Seq (map rVar stats) where rVar = renameVar from to rAExp = renameVarInAExp from to rBExp = renameVarInBExp from to r var | var == from = to | otherwise = var -- | Analyze the AST and return a list without duplicates of all used variable -- names.
642
renameVar from to ast = case ast of Assign var aexp -> Assign (r var) (rAExp aexp) While bexp stat -> While (rBExp bexp) (rVar stat) If bexp s1 Nothing -> If (rBExp bexp) (rVar s1) Nothing If bexp s1 (Just s2) -> If (rBExp bexp) (rVar s1) (Just (rVar s2)) Seq stats -> Seq (map rVar stats) where rVar = renameVar from to rAExp = renameVarInAExp from to rBExp = renameVarInBExp from to r var | var == from = to | otherwise = var -- | Analyze the AST and return a list without duplicates of all used variable -- names.
592
false
true
10
9
187
242
121
121
null
null
vTurbine/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
57
enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
57
enumFromThenClassOpKey = mkPreludeMiscIdUnique 164
57
false
false
0
5
10
9
4
5
null
null
danidiaz/lens
src/Control/Lens/Fold.hs
bsd-3-clause
-- | Retrieve the 'Last' entry of a 'Fold' or 'Traversal' or retrieve 'Just' the result -- from a 'Getter' or 'Lens'. -- -- The answer is computed in a manner that leaks space less than @'ala' 'Last' '.' 'foldMapOf'@ -- and gives you back access to the outermost 'Just' constructor more quickly, but may have worse -- constant factors. -- -- >>> lastOf traverse [1..10] -- Just 10 -- -- >>> lastOf both (1,2) -- Just 2 -- -- >>> lastOf ignored () -- Nothing -- -- @ -- 'lastOf' :: 'Getter' s a -> s -> 'Maybe' a -- 'lastOf' :: 'Fold' s a -> s -> 'Maybe' a -- 'lastOf' :: 'Lens'' s a -> s -> 'Maybe' a -- 'lastOf' :: 'Iso'' s a -> s -> 'Maybe' a -- 'lastOf' :: 'Traversal'' s a -> s -> 'Maybe' a -- @ lastOf :: Getting (Rightmost a) s a -> s -> Maybe a lastOf l = getRightmost . foldMapOf l RLeaf
816
lastOf :: Getting (Rightmost a) s a -> s -> Maybe a lastOf l = getRightmost . foldMapOf l RLeaf
95
lastOf l = getRightmost . foldMapOf l RLeaf
43
true
true
0
8
186
70
45
25
null
null
hguenther/smtlib2
Language/SMTLib2/Internals/Type.hs
gpl-3.0
ctype (ParameterRepr p) par = List.index par p
46
ctype (ParameterRepr p) par = List.index par p
46
ctype (ParameterRepr p) par = List.index par p
46
false
false
0
6
7
25
11
14
null
null
joeyadams/haskell-iocp
IOCP/Manager.hs
bsd-3-clause
fromTimeout (Just sec) | sec > 120 = 120000 | sec > 0 = ceiling (sec * 1000) | otherwise = 0
143
fromTimeout (Just sec) | sec > 120 = 120000 | sec > 0 = ceiling (sec * 1000) | otherwise = 0
143
fromTimeout (Just sec) | sec > 120 = 120000 | sec > 0 = ceiling (sec * 1000) | otherwise = 0
143
false
false
0
8
72
58
26
32
null
null
rawlep/EQS
sourceCode/HMDIFPrelude.hs
mit
nterL' = foldl (\as (x,xs) -> as ++ map (\a -> (x,[a])) xs) []
64
interL' = foldl (\as (x,xs) -> as ++ map (\a -> (x,[a])) xs) []
64
interL' = foldl (\as (x,xs) -> as ++ map (\a -> (x,[a])) xs) []
64
false
false
1
13
15
59
31
28
null
null
atsukotakahashi/wi
src/library/Yi/Buffer/HighLevel.hs
gpl-2.0
scrollCursorToBottomB :: BufferM () scrollCursorToBottomB = do MarkSet _ i _ <- markLines r <- winRegionB t <- lineOf (regionEnd r - 1) scrollB $ i - t -- | Scroll by n lines.
192
scrollCursorToBottomB :: BufferM () scrollCursorToBottomB = do MarkSet _ i _ <- markLines r <- winRegionB t <- lineOf (regionEnd r - 1) scrollB $ i - t -- | Scroll by n lines.
192
scrollCursorToBottomB = do MarkSet _ i _ <- markLines r <- winRegionB t <- lineOf (regionEnd r - 1) scrollB $ i - t -- | Scroll by n lines.
156
false
true
1
11
50
73
32
41
null
null
leksah/leksah-server
src/IDE/Utils/Project.hs
gpl-2.0
pjDir (CustomTool p) = pjCustomDir p
36
pjDir (CustomTool p) = pjCustomDir p
36
pjDir (CustomTool p) = pjCustomDir p
36
false
false
0
7
5
18
8
10
null
null
Lemmih/fvg
site/Main.hs
bsd-3-clause
codeBox :: MonadWidget t m => Event t T.Text -> m (Dynamic t (Either E.SomeException Expr)) codeBox setText = divClass "code-box" $ do pb <- getPostBuild t <- fmap value $ textArea $ def & textAreaConfig_attributes .~ constDyn ("style" =: "width:500px;height:500px;") & textAreaConfig_setValue .~ setText & textAreaConfig_initialValue .~ code0 let evalTime = leftmost [tag (current t) pb, updated t] evals <- performEvent $ ffor evalTime $ \code -> liftJSM . liftIO . E.try . E.evaluate . runScript $ T.unpack code res <- holdDyn (Left $ E.SomeException (error "e" :: E.IOException)) evals divClass "error-message" $ dynText $ bool "" "There is a problem" . isLeft <$> res return res
824
codeBox :: MonadWidget t m => Event t T.Text -> m (Dynamic t (Either E.SomeException Expr)) codeBox setText = divClass "code-box" $ do pb <- getPostBuild t <- fmap value $ textArea $ def & textAreaConfig_attributes .~ constDyn ("style" =: "width:500px;height:500px;") & textAreaConfig_setValue .~ setText & textAreaConfig_initialValue .~ code0 let evalTime = leftmost [tag (current t) pb, updated t] evals <- performEvent $ ffor evalTime $ \code -> liftJSM . liftIO . E.try . E.evaluate . runScript $ T.unpack code res <- holdDyn (Left $ E.SomeException (error "e" :: E.IOException)) evals divClass "error-message" $ dynText $ bool "" "There is a problem" . isLeft <$> res return res
824
codeBox setText = divClass "code-box" $ do pb <- getPostBuild t <- fmap value $ textArea $ def & textAreaConfig_attributes .~ constDyn ("style" =: "width:500px;height:500px;") & textAreaConfig_setValue .~ setText & textAreaConfig_initialValue .~ code0 let evalTime = leftmost [tag (current t) pb, updated t] evals <- performEvent $ ffor evalTime $ \code -> liftJSM . liftIO . E.try . E.evaluate . runScript $ T.unpack code res <- holdDyn (Left $ E.SomeException (error "e" :: E.IOException)) evals divClass "error-message" $ dynText $ bool "" "There is a problem" . isLeft <$> res return res
720
false
true
0
18
248
278
129
149
null
null
anttisalonen/freekick2
src/Listings.hs
gpl-3.0
showTeamNation 48 = "Chile"
27
showTeamNation 48 = "Chile"
27
showTeamNation 48 = "Chile"
27
false
false
1
5
3
13
4
9
null
null
ezyang/ghc
libraries/base/System/IO.hs
bsd-3-clause
rw_flags = output_flags .|. o_RDWR
38
rw_flags = output_flags .|. o_RDWR
38
rw_flags = output_flags .|. o_RDWR
38
false
false
1
5
8
13
5
8
null
null
expipiplus1/vulkan
src/Vulkan/Core10/Pass.hs
bsd-3-clause
-- | vkCreateRenderPass - Create a new render pass object -- -- == Valid Usage (Implicit) -- -- - #VUID-vkCreateRenderPass-device-parameter# @device@ /must/ be a -- valid 'Vulkan.Core10.Handles.Device' handle -- -- - #VUID-vkCreateRenderPass-pCreateInfo-parameter# @pCreateInfo@ /must/ -- be a valid pointer to a valid 'RenderPassCreateInfo' structure -- -- - #VUID-vkCreateRenderPass-pAllocator-parameter# If @pAllocator@ is -- not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid -- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure -- -- - #VUID-vkCreateRenderPass-pRenderPass-parameter# @pRenderPass@ /must/ -- be a valid pointer to a 'Vulkan.Core10.Handles.RenderPass' 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_VERSION_1_0 VK_VERSION_1_0>, -- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks', -- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.RenderPass', -- 'RenderPassCreateInfo' createRenderPass :: forall a io . (Extendss RenderPassCreateInfo a, PokeChain a, MonadIO io) => -- | @device@ is the logical device that creates the render pass. Device -> -- | @pCreateInfo@ is a pointer to a 'RenderPassCreateInfo' structure -- describing the parameters of the render pass. (RenderPassCreateInfo a) -> -- | @pAllocator@ controls host memory allocation as described in the -- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation> -- chapter. ("allocator" ::: Maybe AllocationCallbacks) -> io (RenderPass) createRenderPass device createInfo allocator = liftIO . evalContT $ do let vkCreateRenderPassPtr = pVkCreateRenderPass (case device of Device{deviceCmds} -> deviceCmds) lift $ unless (vkCreateRenderPassPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkCreateRenderPass is null" Nothing Nothing let vkCreateRenderPass' = mkVkCreateRenderPass vkCreateRenderPassPtr pCreateInfo <- ContT $ withCStruct (createInfo) pAllocator <- case (allocator) of Nothing -> pure nullPtr Just j -> ContT $ withCStruct (j) pPRenderPass <- ContT $ bracket (callocBytes @RenderPass 8) free r <- lift $ traceAroundEvent "vkCreateRenderPass" (vkCreateRenderPass' (deviceHandle (device)) (forgetExtensions pCreateInfo) pAllocator (pPRenderPass)) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pRenderPass <- lift $ peek @RenderPass pPRenderPass pure $ (pRenderPass) -- | A convenience wrapper to make a compatible pair of calls to -- 'createRenderPass' and 'destroyRenderPass' -- -- To ensure that 'destroyRenderPass' is always called: pass -- 'Control.Exception.bracket' (or the allocate function from your -- favourite resource management library) as the last argument. -- To just extract the pair pass '(,)' as the last argument. --
3,563
createRenderPass :: forall a io . (Extendss RenderPassCreateInfo a, PokeChain a, MonadIO io) => -- | @device@ is the logical device that creates the render pass. Device -> -- | @pCreateInfo@ is a pointer to a 'RenderPassCreateInfo' structure -- describing the parameters of the render pass. (RenderPassCreateInfo a) -> -- | @pAllocator@ controls host memory allocation as described in the -- <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation> -- chapter. ("allocator" ::: Maybe AllocationCallbacks) -> io (RenderPass) createRenderPass device createInfo allocator = liftIO . evalContT $ do let vkCreateRenderPassPtr = pVkCreateRenderPass (case device of Device{deviceCmds} -> deviceCmds) lift $ unless (vkCreateRenderPassPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkCreateRenderPass is null" Nothing Nothing let vkCreateRenderPass' = mkVkCreateRenderPass vkCreateRenderPassPtr pCreateInfo <- ContT $ withCStruct (createInfo) pAllocator <- case (allocator) of Nothing -> pure nullPtr Just j -> ContT $ withCStruct (j) pPRenderPass <- ContT $ bracket (callocBytes @RenderPass 8) free r <- lift $ traceAroundEvent "vkCreateRenderPass" (vkCreateRenderPass' (deviceHandle (device)) (forgetExtensions pCreateInfo) pAllocator (pPRenderPass)) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pRenderPass <- lift $ peek @RenderPass pPRenderPass pure $ (pRenderPass) -- | A convenience wrapper to make a compatible pair of calls to -- 'createRenderPass' and 'destroyRenderPass' -- -- To ensure that 'destroyRenderPass' is always called: pass -- 'Control.Exception.bracket' (or the allocate function from your -- favourite resource management library) as the last argument. -- To just extract the pair pass '(,)' as the last argument. --
2,085
createRenderPass device createInfo allocator = liftIO . evalContT $ do let vkCreateRenderPassPtr = pVkCreateRenderPass (case device of Device{deviceCmds} -> deviceCmds) lift $ unless (vkCreateRenderPassPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkCreateRenderPass is null" Nothing Nothing let vkCreateRenderPass' = mkVkCreateRenderPass vkCreateRenderPassPtr pCreateInfo <- ContT $ withCStruct (createInfo) pAllocator <- case (allocator) of Nothing -> pure nullPtr Just j -> ContT $ withCStruct (j) pPRenderPass <- ContT $ bracket (callocBytes @RenderPass 8) free r <- lift $ traceAroundEvent "vkCreateRenderPass" (vkCreateRenderPass' (deviceHandle (device)) (forgetExtensions pCreateInfo) pAllocator (pPRenderPass)) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pRenderPass <- lift $ peek @RenderPass pPRenderPass pure $ (pRenderPass) -- | A convenience wrapper to make a compatible pair of calls to -- 'createRenderPass' and 'destroyRenderPass' -- -- To ensure that 'destroyRenderPass' is always called: pass -- 'Control.Exception.bracket' (or the allocate function from your -- favourite resource management library) as the last argument. -- To just extract the pair pass '(,)' as the last argument. --
1,296
true
true
0
17
646
409
224
185
null
null
zaxtax/hakaru-old
Language/Hakaru/Types.hs
bsd-3-clause
fromLebesgue _ = error "got a discrete sampler"
58
fromLebesgue _ = error "got a discrete sampler"
58
fromLebesgue _ = error "got a discrete sampler"
58
false
false
0
5
18
12
5
7
null
null
mrd/camfort
src/Camfort/Functionality.hs
apache-2.0
-- * Wrappers on all of the features ast d excludes = do xs <- readParseSrcDir d excludes print (map (\(_, _, p) -> p) xs)
130
ast d excludes = do xs <- readParseSrcDir d excludes print (map (\(_, _, p) -> p) xs)
93
ast d excludes = do xs <- readParseSrcDir d excludes print (map (\(_, _, p) -> p) xs)
93
true
false
1
13
33
60
28
32
null
null
synsem/texhs
src/Text/TeX/Parser/Types.hs
gpl-3.0
isNewline _ = False
19
isNewline _ = False
19
isNewline _ = False
19
false
false
0
5
3
9
4
5
null
null
tek/proteome
packages/test/test/Proteome/Test/InitTest.hs
mit
test_init :: UnitTest test_init = vars >>= testWithDef initSpec
65
test_init :: UnitTest test_init = vars >>= testWithDef initSpec
65
test_init = vars >>= testWithDef initSpec
43
false
true
2
6
10
26
11
15
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\x1E77' = "\x0075\x032D"
39
decomposeChar '\x1E77' = "\x0075\x032D"
39
decomposeChar '\x1E77' = "\x0075\x032D"
39
false
false
1
5
3
13
4
9
null
null
joshcough/L5-Haskell
src/L/ReplTools.hs
mit
quickCompileL4 :: String -> String quickCompileL4 = quickCompileString l4Compiler
81
quickCompileL4 :: String -> String quickCompileL4 = quickCompileString l4Compiler
81
quickCompileL4 = quickCompileString l4Compiler
46
false
true
0
7
8
24
10
14
null
null
mrkkrp/stack
src/Stack/Build/ConstructPlan.hs
bsd-3-clause
-- | Get all of the dependencies for a given package, including guessed build -- tool dependencies. packageDepsWithTools :: Package -> M (Map PackageName VersionRange) packageDepsWithTools p = do ctx <- ask -- TODO: it would be cool to defer these warnings until there's an -- actual issue building the package. let toEither (Cabal.Dependency (Cabal.PackageName name) _) mp = case Map.toList mp of [] -> Left (NoToolFound name (packageName p)) [_] -> Right mp xs -> Left (AmbiguousToolsFound name (packageName p) (map fst xs)) (warnings0, toolDeps) = partitionEithers $ map (\dep -> toEither dep (toolToPackages ctx dep)) (packageTools p) -- Check whether the tool is on the PATH before warning about it. warnings <- fmap catMaybes $ forM warnings0 $ \warning -> do let toolName = case warning of NoToolFound tool _ -> tool AmbiguousToolsFound tool _ _ -> tool config <- view configL menv <- liftIO $ configEnvOverride config minimalEnvSettings { esIncludeLocals = True } mfound <- findExecutable menv toolName case mfound of Nothing -> return (Just warning) Just _ -> return Nothing tell mempty { wWarnings = (map toolWarningText warnings ++) } when (any isNoToolFound warnings) $ do let msg = T.unlines [ "Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps." , "This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595" ] tell mempty { wWarnings = (msg:) } return $ Map.unionsWith intersectVersionRanges $ packageDeps p : toolDeps
1,832
packageDepsWithTools :: Package -> M (Map PackageName VersionRange) packageDepsWithTools p = do ctx <- ask -- TODO: it would be cool to defer these warnings until there's an -- actual issue building the package. let toEither (Cabal.Dependency (Cabal.PackageName name) _) mp = case Map.toList mp of [] -> Left (NoToolFound name (packageName p)) [_] -> Right mp xs -> Left (AmbiguousToolsFound name (packageName p) (map fst xs)) (warnings0, toolDeps) = partitionEithers $ map (\dep -> toEither dep (toolToPackages ctx dep)) (packageTools p) -- Check whether the tool is on the PATH before warning about it. warnings <- fmap catMaybes $ forM warnings0 $ \warning -> do let toolName = case warning of NoToolFound tool _ -> tool AmbiguousToolsFound tool _ _ -> tool config <- view configL menv <- liftIO $ configEnvOverride config minimalEnvSettings { esIncludeLocals = True } mfound <- findExecutable menv toolName case mfound of Nothing -> return (Just warning) Just _ -> return Nothing tell mempty { wWarnings = (map toolWarningText warnings ++) } when (any isNoToolFound warnings) $ do let msg = T.unlines [ "Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps." , "This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595" ] tell mempty { wWarnings = (msg:) } return $ Map.unionsWith intersectVersionRanges $ packageDeps p : toolDeps
1,732
packageDepsWithTools p = do ctx <- ask -- TODO: it would be cool to defer these warnings until there's an -- actual issue building the package. let toEither (Cabal.Dependency (Cabal.PackageName name) _) mp = case Map.toList mp of [] -> Left (NoToolFound name (packageName p)) [_] -> Right mp xs -> Left (AmbiguousToolsFound name (packageName p) (map fst xs)) (warnings0, toolDeps) = partitionEithers $ map (\dep -> toEither dep (toolToPackages ctx dep)) (packageTools p) -- Check whether the tool is on the PATH before warning about it. warnings <- fmap catMaybes $ forM warnings0 $ \warning -> do let toolName = case warning of NoToolFound tool _ -> tool AmbiguousToolsFound tool _ _ -> tool config <- view configL menv <- liftIO $ configEnvOverride config minimalEnvSettings { esIncludeLocals = True } mfound <- findExecutable menv toolName case mfound of Nothing -> return (Just warning) Just _ -> return Nothing tell mempty { wWarnings = (map toolWarningText warnings ++) } when (any isNoToolFound warnings) $ do let msg = T.unlines [ "Missing build-tools may be caused by dependencies of the build-tool being overridden by extra-deps." , "This should be fixed soon - see this issue https://github.com/commercialhaskell/stack/issues/595" ] tell mempty { wWarnings = (msg:) } return $ Map.unionsWith intersectVersionRanges $ packageDeps p : toolDeps
1,664
true
true
0
18
548
445
215
230
null
null
flowbox-public/cufft
Setup.hs
bsd-3-clause
getCudaIncludePath :: CudaPath -> FilePath getCudaIncludePath (CudaPath path) = path </> "include"
98
getCudaIncludePath :: CudaPath -> FilePath getCudaIncludePath (CudaPath path) = path </> "include"
98
getCudaIncludePath (CudaPath path) = path </> "include"
55
false
true
0
7
11
28
14
14
null
null
locaweb/leela
src/warpdrive/src/Leela/Data/LQL/Read.hs
apache-2.0
parseTree :: Parser (Maybe User, Tree) parseTree = do name <- qstring 512 0x28 0x29 buildResult (L.break (== 0x3a) name) where buildResult (left, right) | L.null right = return (Nothing, Tree left) | otherwise = case (L.take 2 right) of "::" -> liftM2 (,) (Just <$> User <$> (validate left)) (Tree <$> (validate $ L.drop 2 right)) _ -> fail "parseTree: syntax error" validate s | 0x3a `L.elem` s = fail "parseTree: syntax error" | otherwise = return s
598
parseTree :: Parser (Maybe User, Tree) parseTree = do name <- qstring 512 0x28 0x29 buildResult (L.break (== 0x3a) name) where buildResult (left, right) | L.null right = return (Nothing, Tree left) | otherwise = case (L.take 2 right) of "::" -> liftM2 (,) (Just <$> User <$> (validate left)) (Tree <$> (validate $ L.drop 2 right)) _ -> fail "parseTree: syntax error" validate s | 0x3a `L.elem` s = fail "parseTree: syntax error" | otherwise = return s
598
parseTree = do name <- qstring 512 0x28 0x29 buildResult (L.break (== 0x3a) name) where buildResult (left, right) | L.null right = return (Nothing, Tree left) | otherwise = case (L.take 2 right) of "::" -> liftM2 (,) (Just <$> User <$> (validate left)) (Tree <$> (validate $ L.drop 2 right)) _ -> fail "parseTree: syntax error" validate s | 0x3a `L.elem` s = fail "parseTree: syntax error" | otherwise = return s
559
false
true
1
15
225
215
106
109
null
null
TK009/loyly
Mixins.hs
mit
bg = dissolve 0.2 . c
21
bg = dissolve 0.2 . c
21
bg = dissolve 0.2 . c
21
false
false
1
6
5
17
6
11
null
null
kadena-io/pact
src/Pact/Types/Type.hs
bsd-3-clause
isSubPartial AnySubschema _ = True
34
isSubPartial AnySubschema _ = True
34
isSubPartial AnySubschema _ = True
34
false
false
0
5
4
11
5
6
null
null
Chobbes/Juicy.Pixels
src/Codec/Picture/ColorQuant.hs
bsd-3-clause
toRGB8 :: PixelRGBF -> PixelRGB8 toRGB8 (PixelRGBF r g b) = PixelRGB8 (round r) (round g) (round b)
101
toRGB8 :: PixelRGBF -> PixelRGB8 toRGB8 (PixelRGBF r g b) = PixelRGB8 (round r) (round g) (round b)
101
toRGB8 (PixelRGBF r g b) = PixelRGB8 (round r) (round g) (round b)
68
false
true
0
7
19
53
26
27
null
null
Crossroadsman/ProgrammingInHaskell
04/disjunction.hs
apache-2.0
dis2 False False = False
24
dis2 False False = False
24
dis2 False False = False
24
false
false
1
5
4
16
5
11
null
null
vikraman/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
-- | Extract a suitable CtOrigin from a MatchGroup matchesCtOrigin :: MatchGroup Name (LHsExpr Name) -> CtOrigin matchesCtOrigin (MG { mg_alts = alts }) | L _ [L _ match] <- alts , Match { m_grhss = grhss } <- match = grhssCtOrigin grhss | otherwise = Shouldn'tHappenOrigin "multi-way match"
302
matchesCtOrigin :: MatchGroup Name (LHsExpr Name) -> CtOrigin matchesCtOrigin (MG { mg_alts = alts }) | L _ [L _ match] <- alts , Match { m_grhss = grhss } <- match = grhssCtOrigin grhss | otherwise = Shouldn'tHappenOrigin "multi-way match"
251
matchesCtOrigin (MG { mg_alts = alts }) | L _ [L _ match] <- alts , Match { m_grhss = grhss } <- match = grhssCtOrigin grhss | otherwise = Shouldn'tHappenOrigin "multi-way match"
189
true
true
2
11
60
103
48
55
null
null
jcristovao/persistent
persistent/Database/Persist/Sql/Raw.hs
mit
rawExecute :: MonadIO m => Text -- ^ SQL statement, possibly with placeholders. -> [PersistValue] -- ^ Values to fill the placeholders. -> ReaderT SqlBackend m () rawExecute x y = liftM (const ()) $ rawExecuteCount x y
263
rawExecute :: MonadIO m => Text -- ^ SQL statement, possibly with placeholders. -> [PersistValue] -- ^ Values to fill the placeholders. -> ReaderT SqlBackend m () rawExecute x y = liftM (const ()) $ rawExecuteCount x y
263
rawExecute x y = liftM (const ()) $ rawExecuteCount x y
55
false
true
0
9
82
65
32
33
null
null
jeroennoels/exact-real
src/Ternary/List/FiniteExact.hs
mit
finitizeMult :: Binop Exact -> Binop FiniteExact finitizeMult (**) x y = takeFinite cutoff infinite where infinite = infiniteExact x ** infiniteExact y cutoff = finiteLength x + finiteLength y + 1
208
finitizeMult :: Binop Exact -> Binop FiniteExact finitizeMult (**) x y = takeFinite cutoff infinite where infinite = infiniteExact x ** infiniteExact y cutoff = finiteLength x + finiteLength y + 1
208
finitizeMult (**) x y = takeFinite cutoff infinite where infinite = infiniteExact x ** infiniteExact y cutoff = finiteLength x + finiteLength y + 1
159
false
true
2
7
43
83
35
48
null
null
nyson/kagamin
Kagamin/Modules/Markov.hs
mit
dontKnow :: ChannelId -> Slack s () dontKnow cid = do msg <- oneOf [ "hur ska jag kunna veta det?!", "idiotfråga!!", "varför skulle jag svara på dina frågor?!", "idiot!", "jag är inte din googleslav!", "skärp dig!" ] st <- liftIO randomIO sendMessage cid (if st then stutter msg else msg)
334
dontKnow :: ChannelId -> Slack s () dontKnow cid = do msg <- oneOf [ "hur ska jag kunna veta det?!", "idiotfråga!!", "varför skulle jag svara på dina frågor?!", "idiot!", "jag är inte din googleslav!", "skärp dig!" ] st <- liftIO randomIO sendMessage cid (if st then stutter msg else msg)
334
dontKnow cid = do msg <- oneOf [ "hur ska jag kunna veta det?!", "idiotfråga!!", "varför skulle jag svara på dina frågor?!", "idiot!", "jag är inte din googleslav!", "skärp dig!" ] st <- liftIO randomIO sendMessage cid (if st then stutter msg else msg)
298
false
true
0
11
96
90
44
46
null
null
thielema/optparse-applicative
Options/Applicative/Builder.hs
bsd-3-clause
-- | Add a bash completion action. Common actions include @file@ and -- @directory@. See -- http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#Programmable-Completion-Builtins -- for a complete list. action :: HasCompleter f => String -> Mod f a action act = completer (bashCompleter act)
325
action :: HasCompleter f => String -> Mod f a action act = completer (bashCompleter act)
88
action act = completer (bashCompleter act)
42
true
true
0
8
37
48
23
25
null
null
acowley/ghc
compiler/types/Type.hs
bsd-3-clause
cmpTypeX env (TyConApp tc1 tys1) (TyConApp tc2 tys2) = (tc1 `cmpTc` tc2) `thenCmp` cmpTypesX env tys1 tys2
106
cmpTypeX env (TyConApp tc1 tys1) (TyConApp tc2 tys2) = (tc1 `cmpTc` tc2) `thenCmp` cmpTypesX env tys1 tys2
106
cmpTypeX env (TyConApp tc1 tys1) (TyConApp tc2 tys2) = (tc1 `cmpTc` tc2) `thenCmp` cmpTypesX env tys1 tys2
106
false
false
1
8
16
55
27
28
null
null
hiratara/hs-rtb-bidder
src/Web/RTBBidder/Protocol/Adx/BidRequest/Video/VideoProtocol.hs
bsd-3-clause
toMaybe'Enum 8 = Prelude'.Just VAST_4_0_WRAPPER
47
toMaybe'Enum 8 = Prelude'.Just VAST_4_0_WRAPPER
47
toMaybe'Enum 8 = Prelude'.Just VAST_4_0_WRAPPER
47
false
false
0
6
4
14
6
8
null
null
ezyang/ghc
compiler/nativeGen/RegAlloc/Graph/Main.hs
bsd-3-clause
seqRealRegList :: [RealReg] -> () seqRealRegList rs = case rs of [] -> () (r : rs) -> seqRealReg r `seq` seqRealRegList rs
159
seqRealRegList :: [RealReg] -> () seqRealRegList rs = case rs of [] -> () (r : rs) -> seqRealReg r `seq` seqRealRegList rs
159
seqRealRegList rs = case rs of [] -> () (r : rs) -> seqRealReg r `seq` seqRealRegList rs
125
false
true
2
6
59
64
32
32
null
null
mdsteele/fallback
src/Fallback/State/Creature/Base.hs
gpl-3.0
tickCreatureAnim (HurtAnim n) = if n > 1 then HurtAnim (n - 1) else NoAnim
74
tickCreatureAnim (HurtAnim n) = if n > 1 then HurtAnim (n - 1) else NoAnim
74
tickCreatureAnim (HurtAnim n) = if n > 1 then HurtAnim (n - 1) else NoAnim
74
false
false
0
8
14
37
19
18
null
null
pbl64k/HackerRank-Contests
2014-06-20-FP/BoleynSalary/bs.merge.hs
bsd-2-clause
spsnd (Sp _ x) = x
18
spsnd (Sp _ x) = x
18
spsnd (Sp _ x) = x
18
false
false
0
7
5
17
8
9
null
null
ezyang/ghc
testsuite/tests/rts/flags/T12870g.hs
bsd-3-clause
main :: IO () main = do gcFlags <- getGCFlags putStr . show $ generations gcFlags
89
main :: IO () main = do gcFlags <- getGCFlags putStr . show $ generations gcFlags
89
main = do gcFlags <- getGCFlags putStr . show $ generations gcFlags
75
false
true
0
9
23
43
18
25
null
null
ekr/tamarin-prover
lib/utils/src/Data/Color.hs
gpl-3.0
-- | From a list of group sizes build a function assigning every element a -- unique color, nicely distributed such that they are well differentiated both -- using color and monochrome displays. genColorGroups :: RealFrac t => ColorParams t -> [Int] -- ^ List of group sizes. -> [((Int,Int),(HSV t))] genColorGroups (ColorParams { cpScale = scale , cpZeroHue = zeroHue , cpVBottom = vBot, cpVRange = vRan , cpSBottom = sBot, cpSRange = sRan }) groups = do (groupIdx, groupSize) <- zip [0.. ] groups elemIdx <- [0..groupSize - 1] let h = toShiftedGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) v = vBot + vRan * toGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) s = sBot + sRan * toGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) color = HSV (360*h) s v return ((groupIdx, elemIdx), color) where nGroups :: Int nGroups = length groups toGroupHue g h = ( fromIntegral g + -- base position 0.5 * (1 - scale) + -- left margin (h * scale) -- position in margin ) / (fromIntegral nGroups) toShiftedGroupHue g h = snd . properFraction $ toGroupHue g h + 1 + (zeroHue/360) - toGroupHue 0 0.5 -- | A good default style for the 'genColorGroups' color palette function. The -- parameter shifts the hue for the first group.
1,502
genColorGroups :: RealFrac t => ColorParams t -> [Int] -- ^ List of group sizes. -> [((Int,Int),(HSV t))] genColorGroups (ColorParams { cpScale = scale , cpZeroHue = zeroHue , cpVBottom = vBot, cpVRange = vRan , cpSBottom = sBot, cpSRange = sRan }) groups = do (groupIdx, groupSize) <- zip [0.. ] groups elemIdx <- [0..groupSize - 1] let h = toShiftedGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) v = vBot + vRan * toGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) s = sBot + sRan * toGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) color = HSV (360*h) s v return ((groupIdx, elemIdx), color) where nGroups :: Int nGroups = length groups toGroupHue g h = ( fromIntegral g + -- base position 0.5 * (1 - scale) + -- left margin (h * scale) -- position in margin ) / (fromIntegral nGroups) toShiftedGroupHue g h = snd . properFraction $ toGroupHue g h + 1 + (zeroHue/360) - toGroupHue 0 0.5 -- | A good default style for the 'genColorGroups' color palette function. The -- parameter shifts the hue for the first group.
1,307
genColorGroups (ColorParams { cpScale = scale , cpZeroHue = zeroHue , cpVBottom = vBot, cpVRange = vRan , cpSBottom = sBot, cpSRange = sRan }) groups = do (groupIdx, groupSize) <- zip [0.. ] groups elemIdx <- [0..groupSize - 1] let h = toShiftedGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) v = vBot + vRan * toGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) s = sBot + sRan * toGroupHue groupIdx (fromIntegral elemIdx / fromIntegral groupSize) color = HSV (360*h) s v return ((groupIdx, elemIdx), color) where nGroups :: Int nGroups = length groups toGroupHue g h = ( fromIntegral g + -- base position 0.5 * (1 - scale) + -- left margin (h * scale) -- position in margin ) / (fromIntegral nGroups) toShiftedGroupHue g h = snd . properFraction $ toGroupHue g h + 1 + (zeroHue/360) - toGroupHue 0 0.5 -- | A good default style for the 'genColorGroups' color palette function. The -- parameter shifts the hue for the first group.
1,138
true
true
3
16
452
389
206
183
null
null
sgillis/HaskHull
src/Update.hs
gpl-3.0
processEvent :: Event -> App processEvent e = do win <- asks envWindow case e of (EventError _ _) -> liftIO $ G.setWindowShouldClose win True (EventKey _ G.Key'Escape _ G.KeyState'Pressed _) -> liftIO $ G.setWindowShouldClose win True (EventKey _ G.Key'S _ _ _) -> moveViewer (V3 0 0 1 ) (EventKey _ G.Key'W _ _ _) -> moveViewer (V3 0 0 (-1)) (EventKey _ G.Key'A _ _ _) -> moveViewer (V3 1 0 0 ) (EventKey _ G.Key'D _ _ _) -> moveViewer (V3 (-1) 0 0 ) (EventKey _ G.Key'Space _ _ _) -> moveViewer (V3 0 1 0 ) (EventKey _ G.Key'LeftShift _ _ _) -> moveViewer (V3 0 (-1) 0 ) (EventCursor x y) -> setViewerDirection x y _ -> return () -------------------------------------------------------------------------------
882
processEvent :: Event -> App processEvent e = do win <- asks envWindow case e of (EventError _ _) -> liftIO $ G.setWindowShouldClose win True (EventKey _ G.Key'Escape _ G.KeyState'Pressed _) -> liftIO $ G.setWindowShouldClose win True (EventKey _ G.Key'S _ _ _) -> moveViewer (V3 0 0 1 ) (EventKey _ G.Key'W _ _ _) -> moveViewer (V3 0 0 (-1)) (EventKey _ G.Key'A _ _ _) -> moveViewer (V3 1 0 0 ) (EventKey _ G.Key'D _ _ _) -> moveViewer (V3 (-1) 0 0 ) (EventKey _ G.Key'Space _ _ _) -> moveViewer (V3 0 1 0 ) (EventKey _ G.Key'LeftShift _ _ _) -> moveViewer (V3 0 (-1) 0 ) (EventCursor x y) -> setViewerDirection x y _ -> return () -------------------------------------------------------------------------------
882
processEvent e = do win <- asks envWindow case e of (EventError _ _) -> liftIO $ G.setWindowShouldClose win True (EventKey _ G.Key'Escape _ G.KeyState'Pressed _) -> liftIO $ G.setWindowShouldClose win True (EventKey _ G.Key'S _ _ _) -> moveViewer (V3 0 0 1 ) (EventKey _ G.Key'W _ _ _) -> moveViewer (V3 0 0 (-1)) (EventKey _ G.Key'A _ _ _) -> moveViewer (V3 1 0 0 ) (EventKey _ G.Key'D _ _ _) -> moveViewer (V3 (-1) 0 0 ) (EventKey _ G.Key'Space _ _ _) -> moveViewer (V3 0 1 0 ) (EventKey _ G.Key'LeftShift _ _ _) -> moveViewer (V3 0 (-1) 0 ) (EventCursor x y) -> setViewerDirection x y _ -> return () -------------------------------------------------------------------------------
853
false
true
0
15
296
357
172
185
null
null
ml9951/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
57
decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
57
decodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 100
57
false
false
0
5
8
9
4
5
null
null
tom-szczarkowski/matasano-crypto-puzzles-solutions
third-party/galois/Data/Digest/Pure/SHA.hs
mit
processSHA256Block :: SHA256State -> Get SHA256State processSHA256Block !s00@(SHA256S a00 b00 c00 d00 e00 f00 g00 h00) = do (SHA256Sched w00 w01 w02 w03 w04 w05 w06 w07 w08 w09 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 w31 w32 w33 w34 w35 w36 w37 w38 w39 w40 w41 w42 w43 w44 w45 w46 w47 w48 w49 w50 w51 w52 w53 w54 w55 w56 w57 w58 w59 w60 w61 w62 w63) <- getSHA256Sched let s01 = step256 s00 0x428a2f98 w00 s02 = step256 s01 0x71374491 w01 s03 = step256 s02 0xb5c0fbcf w02 s04 = step256 s03 0xe9b5dba5 w03 s05 = step256 s04 0x3956c25b w04 s06 = step256 s05 0x59f111f1 w05 s07 = step256 s06 0x923f82a4 w06 s08 = step256 s07 0xab1c5ed5 w07 s09 = step256 s08 0xd807aa98 w08 s10 = step256 s09 0x12835b01 w09 s11 = step256 s10 0x243185be w10 s12 = step256 s11 0x550c7dc3 w11 s13 = step256 s12 0x72be5d74 w12 s14 = step256 s13 0x80deb1fe w13 s15 = step256 s14 0x9bdc06a7 w14 s16 = step256 s15 0xc19bf174 w15 s17 = step256 s16 0xe49b69c1 w16 s18 = step256 s17 0xefbe4786 w17 s19 = step256 s18 0x0fc19dc6 w18 s20 = step256 s19 0x240ca1cc w19 s21 = step256 s20 0x2de92c6f w20 s22 = step256 s21 0x4a7484aa w21 s23 = step256 s22 0x5cb0a9dc w22 s24 = step256 s23 0x76f988da w23 s25 = step256 s24 0x983e5152 w24 s26 = step256 s25 0xa831c66d w25 s27 = step256 s26 0xb00327c8 w26 s28 = step256 s27 0xbf597fc7 w27 s29 = step256 s28 0xc6e00bf3 w28 s30 = step256 s29 0xd5a79147 w29 s31 = step256 s30 0x06ca6351 w30 s32 = step256 s31 0x14292967 w31 s33 = step256 s32 0x27b70a85 w32 s34 = step256 s33 0x2e1b2138 w33 s35 = step256 s34 0x4d2c6dfc w34 s36 = step256 s35 0x53380d13 w35 s37 = step256 s36 0x650a7354 w36 s38 = step256 s37 0x766a0abb w37 s39 = step256 s38 0x81c2c92e w38 s40 = step256 s39 0x92722c85 w39 s41 = step256 s40 0xa2bfe8a1 w40 s42 = step256 s41 0xa81a664b w41 s43 = step256 s42 0xc24b8b70 w42 s44 = step256 s43 0xc76c51a3 w43 s45 = step256 s44 0xd192e819 w44 s46 = step256 s45 0xd6990624 w45 s47 = step256 s46 0xf40e3585 w46 s48 = step256 s47 0x106aa070 w47 s49 = step256 s48 0x19a4c116 w48 s50 = step256 s49 0x1e376c08 w49 s51 = step256 s50 0x2748774c w50 s52 = step256 s51 0x34b0bcb5 w51 s53 = step256 s52 0x391c0cb3 w52 s54 = step256 s53 0x4ed8aa4a w53 s55 = step256 s54 0x5b9cca4f w54 s56 = step256 s55 0x682e6ff3 w55 s57 = step256 s56 0x748f82ee w56 s58 = step256 s57 0x78a5636f w57 s59 = step256 s58 0x84c87814 w58 s60 = step256 s59 0x8cc70208 w59 s61 = step256 s60 0x90befffa w60 s62 = step256 s61 0xa4506ceb w61 s63 = step256 s62 0xbef9a3f7 w62 s64 = step256 s63 0xc67178f2 w63 SHA256S a64 b64 c64 d64 e64 f64 g64 h64 = s64 return $! SHA256S (a00 + a64) (b00 + b64) (c00 + c64) (d00 + d64) (e00 + e64) (f00 + f64) (g00 + g64) (h00 + h64)
3,189
processSHA256Block :: SHA256State -> Get SHA256State processSHA256Block !s00@(SHA256S a00 b00 c00 d00 e00 f00 g00 h00) = do (SHA256Sched w00 w01 w02 w03 w04 w05 w06 w07 w08 w09 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 w31 w32 w33 w34 w35 w36 w37 w38 w39 w40 w41 w42 w43 w44 w45 w46 w47 w48 w49 w50 w51 w52 w53 w54 w55 w56 w57 w58 w59 w60 w61 w62 w63) <- getSHA256Sched let s01 = step256 s00 0x428a2f98 w00 s02 = step256 s01 0x71374491 w01 s03 = step256 s02 0xb5c0fbcf w02 s04 = step256 s03 0xe9b5dba5 w03 s05 = step256 s04 0x3956c25b w04 s06 = step256 s05 0x59f111f1 w05 s07 = step256 s06 0x923f82a4 w06 s08 = step256 s07 0xab1c5ed5 w07 s09 = step256 s08 0xd807aa98 w08 s10 = step256 s09 0x12835b01 w09 s11 = step256 s10 0x243185be w10 s12 = step256 s11 0x550c7dc3 w11 s13 = step256 s12 0x72be5d74 w12 s14 = step256 s13 0x80deb1fe w13 s15 = step256 s14 0x9bdc06a7 w14 s16 = step256 s15 0xc19bf174 w15 s17 = step256 s16 0xe49b69c1 w16 s18 = step256 s17 0xefbe4786 w17 s19 = step256 s18 0x0fc19dc6 w18 s20 = step256 s19 0x240ca1cc w19 s21 = step256 s20 0x2de92c6f w20 s22 = step256 s21 0x4a7484aa w21 s23 = step256 s22 0x5cb0a9dc w22 s24 = step256 s23 0x76f988da w23 s25 = step256 s24 0x983e5152 w24 s26 = step256 s25 0xa831c66d w25 s27 = step256 s26 0xb00327c8 w26 s28 = step256 s27 0xbf597fc7 w27 s29 = step256 s28 0xc6e00bf3 w28 s30 = step256 s29 0xd5a79147 w29 s31 = step256 s30 0x06ca6351 w30 s32 = step256 s31 0x14292967 w31 s33 = step256 s32 0x27b70a85 w32 s34 = step256 s33 0x2e1b2138 w33 s35 = step256 s34 0x4d2c6dfc w34 s36 = step256 s35 0x53380d13 w35 s37 = step256 s36 0x650a7354 w36 s38 = step256 s37 0x766a0abb w37 s39 = step256 s38 0x81c2c92e w38 s40 = step256 s39 0x92722c85 w39 s41 = step256 s40 0xa2bfe8a1 w40 s42 = step256 s41 0xa81a664b w41 s43 = step256 s42 0xc24b8b70 w42 s44 = step256 s43 0xc76c51a3 w43 s45 = step256 s44 0xd192e819 w44 s46 = step256 s45 0xd6990624 w45 s47 = step256 s46 0xf40e3585 w46 s48 = step256 s47 0x106aa070 w47 s49 = step256 s48 0x19a4c116 w48 s50 = step256 s49 0x1e376c08 w49 s51 = step256 s50 0x2748774c w50 s52 = step256 s51 0x34b0bcb5 w51 s53 = step256 s52 0x391c0cb3 w52 s54 = step256 s53 0x4ed8aa4a w53 s55 = step256 s54 0x5b9cca4f w54 s56 = step256 s55 0x682e6ff3 w55 s57 = step256 s56 0x748f82ee w56 s58 = step256 s57 0x78a5636f w57 s59 = step256 s58 0x84c87814 w58 s60 = step256 s59 0x8cc70208 w59 s61 = step256 s60 0x90befffa w60 s62 = step256 s61 0xa4506ceb w61 s63 = step256 s62 0xbef9a3f7 w62 s64 = step256 s63 0xc67178f2 w63 SHA256S a64 b64 c64 d64 e64 f64 g64 h64 = s64 return $! SHA256S (a00 + a64) (b00 + b64) (c00 + c64) (d00 + d64) (e00 + e64) (f00 + f64) (g00 + g64) (h00 + h64)
3,189
processSHA256Block !s00@(SHA256S a00 b00 c00 d00 e00 f00 g00 h00) = do (SHA256Sched w00 w01 w02 w03 w04 w05 w06 w07 w08 w09 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 w31 w32 w33 w34 w35 w36 w37 w38 w39 w40 w41 w42 w43 w44 w45 w46 w47 w48 w49 w50 w51 w52 w53 w54 w55 w56 w57 w58 w59 w60 w61 w62 w63) <- getSHA256Sched let s01 = step256 s00 0x428a2f98 w00 s02 = step256 s01 0x71374491 w01 s03 = step256 s02 0xb5c0fbcf w02 s04 = step256 s03 0xe9b5dba5 w03 s05 = step256 s04 0x3956c25b w04 s06 = step256 s05 0x59f111f1 w05 s07 = step256 s06 0x923f82a4 w06 s08 = step256 s07 0xab1c5ed5 w07 s09 = step256 s08 0xd807aa98 w08 s10 = step256 s09 0x12835b01 w09 s11 = step256 s10 0x243185be w10 s12 = step256 s11 0x550c7dc3 w11 s13 = step256 s12 0x72be5d74 w12 s14 = step256 s13 0x80deb1fe w13 s15 = step256 s14 0x9bdc06a7 w14 s16 = step256 s15 0xc19bf174 w15 s17 = step256 s16 0xe49b69c1 w16 s18 = step256 s17 0xefbe4786 w17 s19 = step256 s18 0x0fc19dc6 w18 s20 = step256 s19 0x240ca1cc w19 s21 = step256 s20 0x2de92c6f w20 s22 = step256 s21 0x4a7484aa w21 s23 = step256 s22 0x5cb0a9dc w22 s24 = step256 s23 0x76f988da w23 s25 = step256 s24 0x983e5152 w24 s26 = step256 s25 0xa831c66d w25 s27 = step256 s26 0xb00327c8 w26 s28 = step256 s27 0xbf597fc7 w27 s29 = step256 s28 0xc6e00bf3 w28 s30 = step256 s29 0xd5a79147 w29 s31 = step256 s30 0x06ca6351 w30 s32 = step256 s31 0x14292967 w31 s33 = step256 s32 0x27b70a85 w32 s34 = step256 s33 0x2e1b2138 w33 s35 = step256 s34 0x4d2c6dfc w34 s36 = step256 s35 0x53380d13 w35 s37 = step256 s36 0x650a7354 w36 s38 = step256 s37 0x766a0abb w37 s39 = step256 s38 0x81c2c92e w38 s40 = step256 s39 0x92722c85 w39 s41 = step256 s40 0xa2bfe8a1 w40 s42 = step256 s41 0xa81a664b w41 s43 = step256 s42 0xc24b8b70 w42 s44 = step256 s43 0xc76c51a3 w43 s45 = step256 s44 0xd192e819 w44 s46 = step256 s45 0xd6990624 w45 s47 = step256 s46 0xf40e3585 w46 s48 = step256 s47 0x106aa070 w47 s49 = step256 s48 0x19a4c116 w48 s50 = step256 s49 0x1e376c08 w49 s51 = step256 s50 0x2748774c w50 s52 = step256 s51 0x34b0bcb5 w51 s53 = step256 s52 0x391c0cb3 w52 s54 = step256 s53 0x4ed8aa4a w53 s55 = step256 s54 0x5b9cca4f w54 s56 = step256 s55 0x682e6ff3 w55 s57 = step256 s56 0x748f82ee w56 s58 = step256 s57 0x78a5636f w57 s59 = step256 s58 0x84c87814 w58 s60 = step256 s59 0x8cc70208 w59 s61 = step256 s60 0x90befffa w60 s62 = step256 s61 0xa4506ceb w61 s63 = step256 s62 0xbef9a3f7 w62 s64 = step256 s63 0xc67178f2 w63 SHA256S a64 b64 c64 d64 e64 f64 g64 h64 = s64 return $! SHA256S (a00 + a64) (b00 + b64) (c00 + c64) (d00 + d64) (e00 + e64) (f00 + f64) (g00 + g64) (h00 + h64)
3,136
false
true
1
10
1,009
1,066
532
534
null
null
nakamuray/htig
HTIG/Utils.hs
bsd-3-clause
sendWelcome :: HTIG () sendWelcome = do sname <- gsServerName <$> getGlobal Just nick <- sNick <$> getLocal Just user <- sUserName <$> getLocal Just hname <- sHostName <$> getLocal let fullname = nick ++. "!" ++. user ++. "@" ++. hname writeServerCommand $ NumericCmd rPL_WELCOME [nick, "Welcome to " ++. sname ++." server " ++. fullname] writeServerCommand $ NumericCmd rPL_YOURHOST [nick, "Your host is " ++. sname ++. ", running " ++. appName ++. "-" ++. appVersion] cd <- gsServerCreated <$> getGlobal writeServerCommand $ NumericCmd rPL_CREATED [nick, "This server was created on " ++. (B.pack $ show cd)]
724
sendWelcome :: HTIG () sendWelcome = do sname <- gsServerName <$> getGlobal Just nick <- sNick <$> getLocal Just user <- sUserName <$> getLocal Just hname <- sHostName <$> getLocal let fullname = nick ++. "!" ++. user ++. "@" ++. hname writeServerCommand $ NumericCmd rPL_WELCOME [nick, "Welcome to " ++. sname ++." server " ++. fullname] writeServerCommand $ NumericCmd rPL_YOURHOST [nick, "Your host is " ++. sname ++. ", running " ++. appName ++. "-" ++. appVersion] cd <- gsServerCreated <$> getGlobal writeServerCommand $ NumericCmd rPL_CREATED [nick, "This server was created on " ++. (B.pack $ show cd)]
724
sendWelcome = do sname <- gsServerName <$> getGlobal Just nick <- sNick <$> getLocal Just user <- sUserName <$> getLocal Just hname <- sHostName <$> getLocal let fullname = nick ++. "!" ++. user ++. "@" ++. hname writeServerCommand $ NumericCmd rPL_WELCOME [nick, "Welcome to " ++. sname ++." server " ++. fullname] writeServerCommand $ NumericCmd rPL_YOURHOST [nick, "Your host is " ++. sname ++. ", running " ++. appName ++. "-" ++. appVersion] cd <- gsServerCreated <$> getGlobal writeServerCommand $ NumericCmd rPL_CREATED [nick, "This server was created on " ++. (B.pack $ show cd)]
701
false
true
0
14
212
207
99
108
null
null
wavewave/misc-utils
oldcode/exe/haddockreplace.hs
bsd-2-clause
takeFile x | otherwise = Nothing
32
takeFile x | otherwise = Nothing
32
takeFile x | otherwise = Nothing
32
false
false
0
7
5
15
6
9
null
null
joelburget/haste-compiler
src/Haste/Linker.hs
bsd-3-clause
runDep :: Config -> (String, String) -> DepM a -> IO (AST Stm) runDep cfg mainmod m = do res <- runStateT (runEitherT m) (initState cfg mainmod) case res of (Right _, st) -> return $ defs st nullRet (Left (Name f (Just (p, m))), _) -> do error $ msg m f where msg "Main" "main" = "Unable to locate a main function.\n" ++ "If your main function is not `Main.main' you must specify it using " ++ "`-main-is',\n" ++ "for instance, `-main-is MyModule.myMain'.\n" ++ "If your progam intentionally has no main function," ++ " please use `--dont-link' to avoid this error." msg m f = "Unable to locate function `" ++ f ++ "' in module `" ++ m ++ "'!" -- | Return the module the given variable resides in.
786
runDep :: Config -> (String, String) -> DepM a -> IO (AST Stm) runDep cfg mainmod m = do res <- runStateT (runEitherT m) (initState cfg mainmod) case res of (Right _, st) -> return $ defs st nullRet (Left (Name f (Just (p, m))), _) -> do error $ msg m f where msg "Main" "main" = "Unable to locate a main function.\n" ++ "If your main function is not `Main.main' you must specify it using " ++ "`-main-is',\n" ++ "for instance, `-main-is MyModule.myMain'.\n" ++ "If your progam intentionally has no main function," ++ " please use `--dont-link' to avoid this error." msg m f = "Unable to locate function `" ++ f ++ "' in module `" ++ m ++ "'!" -- | Return the module the given variable resides in.
786
runDep cfg mainmod m = do res <- runStateT (runEitherT m) (initState cfg mainmod) case res of (Right _, st) -> return $ defs st nullRet (Left (Name f (Just (p, m))), _) -> do error $ msg m f where msg "Main" "main" = "Unable to locate a main function.\n" ++ "If your main function is not `Main.main' you must specify it using " ++ "`-main-is',\n" ++ "for instance, `-main-is MyModule.myMain'.\n" ++ "If your progam intentionally has no main function," ++ " please use `--dont-link' to avoid this error." msg m f = "Unable to locate function `" ++ f ++ "' in module `" ++ m ++ "'!" -- | Return the module the given variable resides in.
723
false
true
1
16
221
212
105
107
null
null
meiersi/scyther-proof
src/Extension/Prelude.hs
gpl-3.0
-- | Gather all error free computations and ensure that at least one was error -- free. errorFree1 :: MonadPlus m => [m a] -> m [a] errorFree1 ms = do ms' <- errorFree ms if null ms' then mzero else return ms'
217
errorFree1 :: MonadPlus m => [m a] -> m [a] errorFree1 ms = do ms' <- errorFree ms if null ms' then mzero else return ms'
129
errorFree1 ms = do ms' <- errorFree ms if null ms' then mzero else return ms'
85
true
true
0
9
50
71
33
38
null
null
chemist/fixmon
src/Check/Http.hs
bsd-3-clause
checkUrl :: Dyn -> Either String Dyn checkUrl (String x) = Right (String x)
75
checkUrl :: Dyn -> Either String Dyn checkUrl (String x) = Right (String x)
75
checkUrl (String x) = Right (String x)
38
false
true
0
7
13
38
18
20
null
null
gbwey/persistentold
persistent-mysql/Database/Persist/MySQL.hs
mit
parseType "text" = return SqlString
41
parseType "text" = return SqlString
41
parseType "text" = return SqlString
41
false
false
0
5
10
12
5
7
null
null
joelburget/daily-typecheckers
src/Day13.hs
bsd-3-clause
done :: Term -> Bool done (Var _) = True
40
done :: Term -> Bool done (Var _) = True
40
done (Var _) = True
19
false
true
0
7
9
24
12
12
null
null
tdammers/ginger
src/Text/Ginger/Parse.hs
mit
indentHeadP :: Monad m => Parser m (Expression SourcePos) indentHeadP = (expressionP <|> (StringLiteralE <$> getPosition <*> pure " ")) <* spacesOrComment
159
indentHeadP :: Monad m => Parser m (Expression SourcePos) indentHeadP = (expressionP <|> (StringLiteralE <$> getPosition <*> pure " ")) <* spacesOrComment
159
indentHeadP = (expressionP <|> (StringLiteralE <$> getPosition <*> pure " ")) <* spacesOrComment
101
false
true
0
10
26
54
27
27
null
null
pepeiborra/muterm-framework-charts
MuTerm/Framework/GraphViz.hs
bsd-3-clause
dotProof = dotProof' DotProof{showFailedPaths=False}
52
dotProof = dotProof' DotProof{showFailedPaths=False}
52
dotProof = dotProof' DotProof{showFailedPaths=False}
52
false
false
0
7
3
17
9
8
null
null
JohnLato/iterx
src/Foo.hs
bsd-3-clause
flipper = streamG f False where f False e = (True,[e]) f True _ = (False,[])
87
flipper = streamG f False where f False e = (True,[e]) f True _ = (False,[])
87
flipper = streamG f False where f False e = (True,[e]) f True _ = (False,[])
87
false
false
2
7
26
62
27
35
null
null
plaprade/haskoin
haskoin-wallet/src/Network/Haskoin/Wallet/Client/Commands.hs
unlicense
cmdSignOffline :: String -> Handler () cmdSignOffline name = do inputM <- Haskeline.runInputT Haskeline.defaultSettings $ Haskeline.getInputLine "" case S.decode =<< B64.decode . cs =<< maybeToEither "" inputM of Right (OfflineTxData tx dat) -> do masterM <- askSigningKeys name resE <- sendZmq (SignOfflineTxReq (T.pack name) masterM tx dat) handleResponse resE $ \(TxCompleteRes sTx _) -> liftIO $ putStrLn $ cs $ encodeHex $ S.encode sTx _ -> error "Could not decode input data"
565
cmdSignOffline :: String -> Handler () cmdSignOffline name = do inputM <- Haskeline.runInputT Haskeline.defaultSettings $ Haskeline.getInputLine "" case S.decode =<< B64.decode . cs =<< maybeToEither "" inputM of Right (OfflineTxData tx dat) -> do masterM <- askSigningKeys name resE <- sendZmq (SignOfflineTxReq (T.pack name) masterM tx dat) handleResponse resE $ \(TxCompleteRes sTx _) -> liftIO $ putStrLn $ cs $ encodeHex $ S.encode sTx _ -> error "Could not decode input data"
565
cmdSignOffline name = do inputM <- Haskeline.runInputT Haskeline.defaultSettings $ Haskeline.getInputLine "" case S.decode =<< B64.decode . cs =<< maybeToEither "" inputM of Right (OfflineTxData tx dat) -> do masterM <- askSigningKeys name resE <- sendZmq (SignOfflineTxReq (T.pack name) masterM tx dat) handleResponse resE $ \(TxCompleteRes sTx _) -> liftIO $ putStrLn $ cs $ encodeHex $ S.encode sTx _ -> error "Could not decode input data"
526
false
true
0
18
155
184
85
99
null
null
muhbaasu/pfennig-server
src/Pfennig/View.hs
mit
register :: Html () register = div_ [class_ "center"] $ form_ [class_ "registration column", method_ "post", action_ "/register"] $ do h3_ "Register" div_ [class_ "mdl-textfield mdl-js-textfield mdl-textfield--floating-label"] $ do input_ [id_ "email", class_ "mdl-textfield__input", name_ "email", type_ "email", required_ "", autofocus_] label_ [class_ "mdl-textfield__label", for_ "email"] "E-Mail" div_ [class_ "mdl-textfield mdl-js-textfield mdl-textfield--floating-label"] $ do input_ [id_ "pass", class_ "mdl-textfield__input", name_ "pass", pattern_ ".{5,128}", required_ "", type_ "password"] label_ [class_ "mdl-textfield__label", for_ "pass"] "Password" span_ [class_"mdl-textfield__error"] "Password must contain at least five characters" div_ [class_ "row"] $ button_ [type_ "submit", class_ "frm-btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored", value_ "submit"] "Register"
1,235
register :: Html () register = div_ [class_ "center"] $ form_ [class_ "registration column", method_ "post", action_ "/register"] $ do h3_ "Register" div_ [class_ "mdl-textfield mdl-js-textfield mdl-textfield--floating-label"] $ do input_ [id_ "email", class_ "mdl-textfield__input", name_ "email", type_ "email", required_ "", autofocus_] label_ [class_ "mdl-textfield__label", for_ "email"] "E-Mail" div_ [class_ "mdl-textfield mdl-js-textfield mdl-textfield--floating-label"] $ do input_ [id_ "pass", class_ "mdl-textfield__input", name_ "pass", pattern_ ".{5,128}", required_ "", type_ "password"] label_ [class_ "mdl-textfield__label", for_ "pass"] "Password" span_ [class_"mdl-textfield__error"] "Password must contain at least five characters" div_ [class_ "row"] $ button_ [type_ "submit", class_ "frm-btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored", value_ "submit"] "Register"
1,235
register = div_ [class_ "center"] $ form_ [class_ "registration column", method_ "post", action_ "/register"] $ do h3_ "Register" div_ [class_ "mdl-textfield mdl-js-textfield mdl-textfield--floating-label"] $ do input_ [id_ "email", class_ "mdl-textfield__input", name_ "email", type_ "email", required_ "", autofocus_] label_ [class_ "mdl-textfield__label", for_ "email"] "E-Mail" div_ [class_ "mdl-textfield mdl-js-textfield mdl-textfield--floating-label"] $ do input_ [id_ "pass", class_ "mdl-textfield__input", name_ "pass", pattern_ ".{5,128}", required_ "", type_ "password"] label_ [class_ "mdl-textfield__label", for_ "pass"] "Password" span_ [class_"mdl-textfield__error"] "Password must contain at least five characters" div_ [class_ "row"] $ button_ [type_ "submit", class_ "frm-btn mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored", value_ "submit"] "Register"
1,215
false
true
0
13
405
266
123
143
null
null
cmc-haskell-2016/reversi
src/GameLogic.hs
bsd-3-clause
possibPos _ _ _ _ _ = undefined
31
possibPos _ _ _ _ _ = undefined
31
possibPos _ _ _ _ _ = undefined
31
false
false
0
5
7
17
8
9
null
null
k-bx/snap-server
test/Test/Common/TestHandler.hs
bsd-3-clause
rot13Handler :: Snap () rot13Handler = transformRequestBody (Streams.map rot13)
79
rot13Handler :: Snap () rot13Handler = transformRequestBody (Streams.map rot13)
79
rot13Handler = transformRequestBody (Streams.map rot13)
55
false
true
0
8
8
27
13
14
null
null
smobs/99Problems
src/Solutions/Lists.hs
bsd-3-clause
solution15 :: [a] -> Int -> [a] solution15 = undefined
54
solution15 :: [a] -> Int -> [a] solution15 = undefined
54
solution15 = undefined
22
false
true
0
7
9
25
14
11
null
null
cem3394/haskell
tensorflow-mnist-input-data/src/TensorFlow/Examples/MNIST/InputData.hs
apache-2.0
testImageData, testLabelData :: IO FilePath testImageData = getDataFileName "t10k-images-idx3-ubyte.gz"
103
testImageData, testLabelData :: IO FilePath testImageData = getDataFileName "t10k-images-idx3-ubyte.gz"
103
testImageData = getDataFileName "t10k-images-idx3-ubyte.gz"
59
false
true
0
5
8
19
10
9
null
null
imalsogreg/reffit
src/Reffit/AcidTypes.hs
gpl-3.0
addDocument :: Maybe User -> Document -> Update PersistentState () addDocument user' doc = do -- HandleNewPaper now finds a good Id modify (over documents (Map.insert (docId doc) doc)) case user' of Just user -> modify (over users (Map.insert (userName user) user { userHistory = PostedDocument (docId doc) : (userHistory user) })) Nothing -> return ()
444
addDocument :: Maybe User -> Document -> Update PersistentState () addDocument user' doc = do -- HandleNewPaper now finds a good Id modify (over documents (Map.insert (docId doc) doc)) case user' of Just user -> modify (over users (Map.insert (userName user) user { userHistory = PostedDocument (docId doc) : (userHistory user) })) Nothing -> return ()
444
addDocument user' doc = do -- HandleNewPaper now finds a good Id modify (over documents (Map.insert (docId doc) doc)) case user' of Just user -> modify (over users (Map.insert (userName user) user { userHistory = PostedDocument (docId doc) : (userHistory user) })) Nothing -> return ()
377
false
true
0
21
147
151
71
80
null
null
amccausl/Swish
Swish/HaskellRDF/RDFDatatypeXsdIntegerTest.hs
lgpl-2.1
testVarModifySum03 = testVmod3 "testVarModifySum03" (getDTMod dmodXsdIntegerSum rdfDatatypeValXsdInteger) [makeBVI [("a","33"),("c","11")]] [makeBVI [("a","33"),("b","22"),("c","11")]]
248
testVarModifySum03 = testVmod3 "testVarModifySum03" (getDTMod dmodXsdIntegerSum rdfDatatypeValXsdInteger) [makeBVI [("a","33"),("c","11")]] [makeBVI [("a","33"),("b","22"),("c","11")]]
248
testVarModifySum03 = testVmod3 "testVarModifySum03" (getDTMod dmodXsdIntegerSum rdfDatatypeValXsdInteger) [makeBVI [("a","33"),("c","11")]] [makeBVI [("a","33"),("b","22"),("c","11")]]
248
false
false
0
9
74
80
47
33
null
null
dmp1ce/Haskell-Programming-Exercises
Chapter 17/Exercises3.hs
unlicense
x :: Maybe Int x = elemIndex 3 [1,2,3,4,5]
42
x :: Maybe Int x = elemIndex 3 [1,2,3,4,5]
42
x = elemIndex 3 [1,2,3,4,5]
27
false
true
0
6
8
40
20
20
null
null
slspeek/hephem
src/HEphem/Data.hs
gpl-3.0
printDeg :: Deg -> String printDeg deg = printf "%d\x00B0 %d\"%d'" d m s where (d, m, s) = toMinutesSeconds deg
117
printDeg :: Deg -> String printDeg deg = printf "%d\x00B0 %d\"%d'" d m s where (d, m, s) = toMinutesSeconds deg
117
printDeg deg = printf "%d\x00B0 %d\"%d'" d m s where (d, m, s) = toMinutesSeconds deg
91
false
true
0
6
26
47
24
23
null
null
tel/hs-cuke
src/Test/Cuke.hs
mit
parseGroups :: Monad m => Atto.Parser a -> FreeT (Producer S.ByteString m) m r -> Producer (Either String a) m r parseGroups p = folds go (Atto.parse p S.empty) end where go f@Atto.Fail{} _ = f go d@Atto.Done{} _ = d go (Atto.Partial f) a = f a end (Atto.Fail lf ctx e) = Left e end Atto.Partial{} = Left "incomplete" end (Atto.Done _ a) = Right a
385
parseGroups :: Monad m => Atto.Parser a -> FreeT (Producer S.ByteString m) m r -> Producer (Either String a) m r parseGroups p = folds go (Atto.parse p S.empty) end where go f@Atto.Fail{} _ = f go d@Atto.Done{} _ = d go (Atto.Partial f) a = f a end (Atto.Fail lf ctx e) = Left e end Atto.Partial{} = Left "incomplete" end (Atto.Done _ a) = Right a
385
parseGroups p = folds go (Atto.parse p S.empty) end where go f@Atto.Fail{} _ = f go d@Atto.Done{} _ = d go (Atto.Partial f) a = f a end (Atto.Fail lf ctx e) = Left e end Atto.Partial{} = Left "incomplete" end (Atto.Done _ a) = Right a
272
false
true
0
11
105
206
100
106
null
null
plaprade/haskoin
haskoin-core/test/Network/Haskoin/Script/Tests.hs
unlicense
parseHex' [_] = Nothing
23
parseHex' [_] = Nothing
23
parseHex' [_] = Nothing
23
false
false
0
5
3
13
6
7
null
null
rahulmutt/ghcvm
compiler/Eta/Iface/IfaceEnv.hs
bsd-3-clause
-- | Set the 'Module' of a 'Name'. setNameModule :: Maybe Module -> Name -> TcRnIf m n Name setNameModule Nothing n = return n
126
setNameModule :: Maybe Module -> Name -> TcRnIf m n Name setNameModule Nothing n = return n
91
setNameModule Nothing n = return n
34
true
true
0
8
24
42
19
23
null
null
sumitsahrawat/calculator
src/Model/Arithmetic.hs
gpl-2.0
factor :: Parser Double factor = parseFactor <|> parseNumber
60
factor :: Parser Double factor = parseFactor <|> parseNumber
60
factor = parseFactor <|> parseNumber
36
false
true
0
5
8
18
9
9
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/IDBTransaction.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction.error Mozilla IDBTransaction.error documentation> getError :: (MonadDOM m) => IDBTransaction -> m DOMError getError self = liftDOM ((self ^. js "error") >>= fromJSValUnchecked)
249
getError :: (MonadDOM m) => IDBTransaction -> m DOMError getError self = liftDOM ((self ^. js "error") >>= fromJSValUnchecked)
128
getError self = liftDOM ((self ^. js "error") >>= fromJSValUnchecked)
71
true
true
0
10
27
56
27
29
null
null
nevrenato/Hets_Fork
RDF/Parse.hs
gpl-2.0
parseBase :: CharParser st Base parseBase = do pkeyword "@base" base <- skips uriP skips $ char '.' return $ Base base
134
parseBase :: CharParser st Base parseBase = do pkeyword "@base" base <- skips uriP skips $ char '.' return $ Base base
134
parseBase = do pkeyword "@base" base <- skips uriP skips $ char '.' return $ Base base
102
false
true
1
9
37
56
22
34
null
null
ppenzin/up
src/Main.hs
bsd-2-clause
-- |Update ports tree fetch = portsnapFetchUpdate
49
fetch = portsnapFetchUpdate
27
fetch = portsnapFetchUpdate
27
true
false
0
4
6
7
4
3
null
null
andrewthad/yesod
yesod-bin/GhcBuild.hs
mit
-- isInterpretiveMode: byte-code compiler involved isInterpretiveMode :: PostLoadMode -> Bool isInterpretiveMode DoInteractive = True
133
isInterpretiveMode :: PostLoadMode -> Bool isInterpretiveMode DoInteractive = True
82
isInterpretiveMode DoInteractive = True
39
true
true
0
5
13
19
10
9
null
null
jwiegley/hackports
Main.hs
bsd-3-clause
groupOn :: Ord key => (a -> key) -> [a] -> [(key,[a])] groupOn key = map (\xs -> (key (head xs), xs)) . groupBy (equating key) . sortBy (comparing key)
175
groupOn :: Ord key => (a -> key) -> [a] -> [(key,[a])] groupOn key = map (\xs -> (key (head xs), xs)) . groupBy (equating key) . sortBy (comparing key)
175
groupOn key = map (\xs -> (key (head xs), xs)) . groupBy (equating key) . sortBy (comparing key)
120
false
true
0
13
53
103
54
49
null
null
nikita-volkov/hasql
library/Hasql/Private/Decoders/Row.hs
mit
run :: Row a -> (LibPQ.Result, LibPQ.Row, LibPQ.Column, Bool) -> IO (Either (Int, RowError) a) run (Row impl) (result, row, columnsAmount, integerDatetimes) = do columnRef <- newIORef 0 runExceptT (runReaderT impl (Env result row columnsAmount integerDatetimes columnRef)) >>= \case Left e -> do LibPQ.Col col <- readIORef columnRef -- -1 because succ is applied before the error is returned pure $ Left (fromIntegral col - 1, e) Right x -> pure $ Right x
503
run :: Row a -> (LibPQ.Result, LibPQ.Row, LibPQ.Column, Bool) -> IO (Either (Int, RowError) a) run (Row impl) (result, row, columnsAmount, integerDatetimes) = do columnRef <- newIORef 0 runExceptT (runReaderT impl (Env result row columnsAmount integerDatetimes columnRef)) >>= \case Left e -> do LibPQ.Col col <- readIORef columnRef -- -1 because succ is applied before the error is returned pure $ Left (fromIntegral col - 1, e) Right x -> pure $ Right x
503
run (Row impl) (result, row, columnsAmount, integerDatetimes) = do columnRef <- newIORef 0 runExceptT (runReaderT impl (Env result row columnsAmount integerDatetimes columnRef)) >>= \case Left e -> do LibPQ.Col col <- readIORef columnRef -- -1 because succ is applied before the error is returned pure $ Left (fromIntegral col - 1, e) Right x -> pure $ Right x
408
false
true
0
17
121
192
94
98
null
null
NCrashed/pohodnik-ration
src/Ration/Util.hs
bsd-3-clause
jsMouseY :: JMouse -> IO Int jsMouseY (JMouse jsany) = ffi "(function(m) {return m.y;})" jsany
94
jsMouseY :: JMouse -> IO Int jsMouseY (JMouse jsany) = ffi "(function(m) {return m.y;})" jsany
94
jsMouseY (JMouse jsany) = ffi "(function(m) {return m.y;})" jsany
65
false
true
0
7
14
32
15
17
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/Cabal/tests/PackageTests/PackageTester.hs
bsd-3-clause
ghcPkgPackageDBParams :: Version -> PackageDBStack -> [String] ghcPkgPackageDBParams version dbs = concatMap convert dbs where convert :: PackageDB -> [String] -- Ignoring global/user is dodgy but there's no way good -- way to give ghc-pkg the correct flags in this case. convert GlobalPackageDB = [] convert UserPackageDB = [] convert (SpecificPackageDB path) | version >= Version [7,6] [] = ["--package-db=" ++ path] | otherwise = ["--package-conf=" ++ path] ------------------------------------------------------------------------ -- * Running other things -- | Run an executable that was produced by cabal. The @exe_name@ -- is precisely the name of the executable section in the file.
768
ghcPkgPackageDBParams :: Version -> PackageDBStack -> [String] ghcPkgPackageDBParams version dbs = concatMap convert dbs where convert :: PackageDB -> [String] -- Ignoring global/user is dodgy but there's no way good -- way to give ghc-pkg the correct flags in this case. convert GlobalPackageDB = [] convert UserPackageDB = [] convert (SpecificPackageDB path) | version >= Version [7,6] [] = ["--package-db=" ++ path] | otherwise = ["--package-conf=" ++ path] ------------------------------------------------------------------------ -- * Running other things -- | Run an executable that was produced by cabal. The @exe_name@ -- is precisely the name of the executable section in the file.
768
ghcPkgPackageDBParams version dbs = concatMap convert dbs where convert :: PackageDB -> [String] -- Ignoring global/user is dodgy but there's no way good -- way to give ghc-pkg the correct flags in this case. convert GlobalPackageDB = [] convert UserPackageDB = [] convert (SpecificPackageDB path) | version >= Version [7,6] [] = ["--package-db=" ++ path] | otherwise = ["--package-conf=" ++ path] ------------------------------------------------------------------------ -- * Running other things -- | Run an executable that was produced by cabal. The @exe_name@ -- is precisely the name of the executable section in the file.
705
false
true
0
10
176
131
70
61
null
null
xpika/boolean-list
Data/BooleanList.hs
gpl-3.0
booleanListToInteger' False = littleEndianBooleanListToInteger
62
booleanListToInteger' False = littleEndianBooleanListToInteger
62
booleanListToInteger' False = littleEndianBooleanListToInteger
62
false
false
0
5
3
9
4
5
null
null
andreagenso/java2scala
src/J2s/Scanner/Lexical.hs
apache-2.0
specialSimbol :: [SpecialSimbol] specialSimbol = [",",";","{","}","<%","%>",".","(",")","=","[","]","@"]
104
specialSimbol :: [SpecialSimbol] specialSimbol = [",",";","{","}","<%","%>",".","(",")","=","[","]","@"]
104
specialSimbol = [",",";","{","}","<%","%>",".","(",")","=","[","]","@"]
71
false
true
0
5
5
53
34
19
null
null
syoyo/lucille
rnd/HaskellRSLCompiler/RSL/Sema.hs
bsd-3-clause
checkArgTy (SymBuiltinFunc name _ fargTys Nothing) argTys = (fargTys == argTys)
79
checkArgTy (SymBuiltinFunc name _ fargTys Nothing) argTys = (fargTys == argTys)
79
checkArgTy (SymBuiltinFunc name _ fargTys Nothing) argTys = (fargTys == argTys)
79
false
false
0
7
10
30
15
15
null
null
rodamber/haskell-tic-tac-toe
src/TicTacToe/Internal/Matrix.hs
bsd-3-clause
columnsOf :: Matrix -> [[C.Cell]] columnsOf = transpose . rowsOf
64
columnsOf :: Matrix -> [[C.Cell]] columnsOf = transpose . rowsOf
64
columnsOf = transpose . rowsOf
30
false
true
0
8
9
27
15
12
null
null
edom/sound
src/Sound/Table.hs
bsd-3-clause
tmap :: (Vu.Unbox a, Vu.Unbox b) => (a -> b) -> Tab a -> Tab b tmap f = MkTab . Vu.map f . _untab
97
tmap :: (Vu.Unbox a, Vu.Unbox b) => (a -> b) -> Tab a -> Tab b tmap f = MkTab . Vu.map f . _untab
97
tmap f = MkTab . Vu.map f . _untab
34
false
true
0
8
24
67
33
34
null
null
GaloisInc/halvm-ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
failMClassOpKey_preMFP = mkPreludeMiscIdUnique 170
57
failMClassOpKey_preMFP = mkPreludeMiscIdUnique 170
57
failMClassOpKey_preMFP = mkPreludeMiscIdUnique 170
57
false
false
0
5
10
9
4
5
null
null
andreagenso/java2scala
test/J2s/Parser/Test.hs
apache-2.0
tsp198 = parser (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/198enumDeclaration.java")
102
tsp198 = parser (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/198enumDeclaration.java")
102
tsp198 = parser (path ++ "workspaceclipse_haskell/java2scala/test/J2s/Parser/198enumDeclaration.java")
102
false
false
0
7
5
16
8
8
null
null
athanclark/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reifyRaw t@(P _ n _) | n == reflm "RType" = return $ RType
67
reifyRaw t@(P _ n _) | n == reflm "RType" = return $ RType
67
reifyRaw t@(P _ n _) | n == reflm "RType" = return $ RType
67
false
false
0
9
22
39
18
21
null
null
tnrangwi/grill
src/Data/Sheet.hs
mit
requestHeader :: (SmallVersion, SmallVersion, SmallVersion) -- ^ Format of this sheet -> (SmallVersion, SmallVersion, SmallVersion) -- ^ Level of calculation engine -> String -- ^ Checksum -- FIXME: use a typedef for that -> String -- ^ Sheet name -> Either String Header -- ^ Error message or header requestHeader format calc _ name = -- checksum not needed up to now case V.checkFormat format of Just err -> Left err Nothing -> case V.checkGrill calc of Just err -> Left err Nothing -> Right $ RHeader RawHeader { hFormatVersion = format , hCalcVersion = calc , hChecksum = "" , hName = name , hFileName = "" , hExtended = Map.empty } -- | Add properties to header.
1,060
requestHeader :: (SmallVersion, SmallVersion, SmallVersion) -- ^ Format of this sheet -> (SmallVersion, SmallVersion, SmallVersion) -- ^ Level of calculation engine -> String -- ^ Checksum -- FIXME: use a typedef for that -> String -- ^ Sheet name -> Either String Header requestHeader format calc _ name = -- checksum not needed up to now case V.checkFormat format of Just err -> Left err Nothing -> case V.checkGrill calc of Just err -> Left err Nothing -> Right $ RHeader RawHeader { hFormatVersion = format , hCalcVersion = calc , hChecksum = "" , hName = name , hFileName = "" , hExtended = Map.empty } -- | Add properties to header.
1,031
requestHeader format calc _ name = -- checksum not needed up to now case V.checkFormat format of Just err -> Left err Nothing -> case V.checkGrill calc of Just err -> Left err Nothing -> Right $ RHeader RawHeader { hFormatVersion = format , hCalcVersion = calc , hChecksum = "" , hName = name , hFileName = "" , hExtended = Map.empty } -- | Add properties to header.
703
true
true
0
15
511
167
92
75
null
null
davdar/quals
src/FP/Pretty.hs
bsd-3-clause
formatChunk :: Chunk -> String formatChunk (Text s) = s
55
formatChunk :: Chunk -> String formatChunk (Text s) = s
55
formatChunk (Text s) = s
24
false
true
0
9
9
30
13
17
null
null
ierton/vsim
src/Data/IORefEx.hs
bsd-3-clause
writeRef :: (MonadReader r m, MonadIO m) => (r -> IORef a) -> a -> m () writeRef f x = modifyRef f $ const x
109
writeRef :: (MonadReader r m, MonadIO m) => (r -> IORef a) -> a -> m () writeRef f x = modifyRef f $ const x
108
writeRef f x = modifyRef f $ const x
36
false
true
0
9
26
66
32
34
null
null
scolobb/fgl
Data/Graph/Inductive/Internal/Heap.hs
bsd-3-clause
toList :: (Ord a) => Heap a b -> [(a,b)] toList Empty = []
58
toList :: (Ord a) => Heap a b -> [(a,b)] toList Empty = []
58
toList Empty = []
17
false
true
0
8
13
43
23
20
null
null
chlablak/platinum-parsing
src/PP/Builders/Nfa.hs
bsd-3-clause
buildClasses Any = RegExpr [ Value c | c <- [minBound..maxBound] , C.isAscii c]
166
buildClasses Any = RegExpr [ Value c | c <- [minBound..maxBound] , C.isAscii c]
166
buildClasses Any = RegExpr [ Value c | c <- [minBound..maxBound] , C.isAscii c]
166
false
false
0
9
100
40
19
21
null
null
ihc/futhark
src/Futhark/Representation/Kernels/Simplify.hs
isc
simplifyKernelExp (GroupReduce w lam input) = do arrs' <- mapM Engine.simplify arrs nes' <- mapM Engine.simplify nes w' <- Engine.simplify w lam' <- Engine.simplifyLambdaSeq lam (Just nes') (map (const Nothing) arrs') return $ GroupReduce w' lam' $ zip nes' arrs' where (nes,arrs) = unzip input
306
simplifyKernelExp (GroupReduce w lam input) = do arrs' <- mapM Engine.simplify arrs nes' <- mapM Engine.simplify nes w' <- Engine.simplify w lam' <- Engine.simplifyLambdaSeq lam (Just nes') (map (const Nothing) arrs') return $ GroupReduce w' lam' $ zip nes' arrs' where (nes,arrs) = unzip input
306
simplifyKernelExp (GroupReduce w lam input) = do arrs' <- mapM Engine.simplify arrs nes' <- mapM Engine.simplify nes w' <- Engine.simplify w lam' <- Engine.simplifyLambdaSeq lam (Just nes') (map (const Nothing) arrs') return $ GroupReduce w' lam' $ zip nes' arrs' where (nes,arrs) = unzip input
306
false
false
0
12
56
134
61
73
null
null
nlim/haskell-playground
src/Euler89.hs
mit
parseNumerals :: String -> Maybe [Numeral] parseNumerals = mapM charMapping
75
parseNumerals :: String -> Maybe [Numeral] parseNumerals = mapM charMapping
75
parseNumerals = mapM charMapping
32
false
true
0
8
9
30
13
17
null
null
ntc2/cryptol
src/Cryptol/Transform/Specialize.hs
bsd-3-clause
reifyName :: Name -> [Type] -> String reifyName name tys = intercalate "_" (showName name : concatMap showT tys) where tvInt (TVFree i _ _ _) = i tvInt (TVBound i _) = i showT typ = case typ of TCon tc ts -> showTCon tc : concatMap showT ts TUser _ _ t -> showT t TVar tv -> [ "a" ++ show (tvInt tv) ] TRec tr -> "rec" : concatMap showRecFld tr showTCon tCon = case tCon of TC tc -> showTC tc PC pc -> showPC pc TF tf -> showTF tf showPC pc = case pc of PEqual -> "eq" PNeq -> "neq" PGeq -> "geq" PFin -> "fin" PHas sel -> "sel_" ++ showSel sel PArith -> "arith" PCmp -> "cmp" showTC tc = case tc of TCNum n -> show n TCInf -> "inf" TCBit -> "bit" TCSeq -> "seq" TCFun -> "fun" TCTuple n -> "t" ++ show n TCNewtype _ -> "user" showSel sel = intercalate "_" $ case sel of TupleSel _ sig -> "tup" : maybe [] ((:[]) . show) sig RecordSel x sig -> "rec" : showName x : map showName (maybe [] id sig) ListSel _ sig -> "list" : maybe [] ((:[]) . show) sig showName nm = case nm of Name s -> s NewName _ n -> "x" ++ show n showTF tf = case tf of TCAdd -> "add" TCSub -> "sub" TCMul -> "mul" TCDiv -> "div" TCMod -> "mod" TCExp -> "exp" TCWidth -> "width" TCMin -> "min" TCMax -> "max" TCLenFromThen -> "len_from_then" TCLenFromThenTo -> "len_from_then_to" showRecFld (nm,t) = showName nm : showT t
1,831
reifyName :: Name -> [Type] -> String reifyName name tys = intercalate "_" (showName name : concatMap showT tys) where tvInt (TVFree i _ _ _) = i tvInt (TVBound i _) = i showT typ = case typ of TCon tc ts -> showTCon tc : concatMap showT ts TUser _ _ t -> showT t TVar tv -> [ "a" ++ show (tvInt tv) ] TRec tr -> "rec" : concatMap showRecFld tr showTCon tCon = case tCon of TC tc -> showTC tc PC pc -> showPC pc TF tf -> showTF tf showPC pc = case pc of PEqual -> "eq" PNeq -> "neq" PGeq -> "geq" PFin -> "fin" PHas sel -> "sel_" ++ showSel sel PArith -> "arith" PCmp -> "cmp" showTC tc = case tc of TCNum n -> show n TCInf -> "inf" TCBit -> "bit" TCSeq -> "seq" TCFun -> "fun" TCTuple n -> "t" ++ show n TCNewtype _ -> "user" showSel sel = intercalate "_" $ case sel of TupleSel _ sig -> "tup" : maybe [] ((:[]) . show) sig RecordSel x sig -> "rec" : showName x : map showName (maybe [] id sig) ListSel _ sig -> "list" : maybe [] ((:[]) . show) sig showName nm = case nm of Name s -> s NewName _ n -> "x" ++ show n showTF tf = case tf of TCAdd -> "add" TCSub -> "sub" TCMul -> "mul" TCDiv -> "div" TCMod -> "mod" TCExp -> "exp" TCWidth -> "width" TCMin -> "min" TCMax -> "max" TCLenFromThen -> "len_from_then" TCLenFromThenTo -> "len_from_then_to" showRecFld (nm,t) = showName nm : showT t
1,831
reifyName name tys = intercalate "_" (showName name : concatMap showT tys) where tvInt (TVFree i _ _ _) = i tvInt (TVBound i _) = i showT typ = case typ of TCon tc ts -> showTCon tc : concatMap showT ts TUser _ _ t -> showT t TVar tv -> [ "a" ++ show (tvInt tv) ] TRec tr -> "rec" : concatMap showRecFld tr showTCon tCon = case tCon of TC tc -> showTC tc PC pc -> showPC pc TF tf -> showTF tf showPC pc = case pc of PEqual -> "eq" PNeq -> "neq" PGeq -> "geq" PFin -> "fin" PHas sel -> "sel_" ++ showSel sel PArith -> "arith" PCmp -> "cmp" showTC tc = case tc of TCNum n -> show n TCInf -> "inf" TCBit -> "bit" TCSeq -> "seq" TCFun -> "fun" TCTuple n -> "t" ++ show n TCNewtype _ -> "user" showSel sel = intercalate "_" $ case sel of TupleSel _ sig -> "tup" : maybe [] ((:[]) . show) sig RecordSel x sig -> "rec" : showName x : map showName (maybe [] id sig) ListSel _ sig -> "list" : maybe [] ((:[]) . show) sig showName nm = case nm of Name s -> s NewName _ n -> "x" ++ show n showTF tf = case tf of TCAdd -> "add" TCSub -> "sub" TCMul -> "mul" TCDiv -> "div" TCMod -> "mod" TCExp -> "exp" TCWidth -> "width" TCMin -> "min" TCMax -> "max" TCLenFromThen -> "len_from_then" TCLenFromThenTo -> "len_from_then_to" showRecFld (nm,t) = showName nm : showT t
1,793
false
true
6
15
814
535
271
264
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_MULTISAMPLE_BUFFER_BIT3_QCOM :: GLbitfield gl_MULTISAMPLE_BUFFER_BIT3_QCOM = 0x08000000
90
gl_MULTISAMPLE_BUFFER_BIT3_QCOM :: GLbitfield gl_MULTISAMPLE_BUFFER_BIT3_QCOM = 0x08000000
90
gl_MULTISAMPLE_BUFFER_BIT3_QCOM = 0x08000000
44
false
true
0
4
5
11
6
5
null
null
FranklinChen/write-you-a-haskell
chapter7/poly_constraints/src/Infer.hs
mit
unifies :: Type -> Type -> Solve Subst unifies t1 t2 | t1 == t2 = return emptySubst
83
unifies :: Type -> Type -> Solve Subst unifies t1 t2 | t1 == t2 = return emptySubst
83
unifies t1 t2 | t1 == t2 = return emptySubst
44
false
true
0
8
17
40
18
22
null
null
ekmett/wxHaskell
wxdirect/src/CompileClasses.hs
lgpl-2.1
haskellTypePar :: Int -> Type -> String haskellTypePar i tp = parenType (haskellType i) tp
92
haskellTypePar :: Int -> Type -> String haskellTypePar i tp = parenType (haskellType i) tp
92
haskellTypePar i tp = parenType (haskellType i) tp
52
false
true
0
8
16
41
18
23
null
null
tjakway/ghcjvm
compiler/cmm/CLabel.hs
bsd-3-clause
mkLocalEntryLabel name c = IdLabel name c LocalEntry
60
mkLocalEntryLabel name c = IdLabel name c LocalEntry
60
mkLocalEntryLabel name c = IdLabel name c LocalEntry
60
false
false
0
5
15
18
8
10
null
null
formrre/yi
yi-core/src/Yi/Search.hs
gpl-2.0
map3 f ((a, b, c):xs) = (f a, b, c) : map3 f xs
47
map3 f ((a, b, c):xs) = (f a, b, c) : map3 f xs
47
map3 f ((a, b, c):xs) = (f a, b, c) : map3 f xs
47
false
false
0
7
13
50
26
24
null
null
ocean0yohsuke/deepcontrol
test/unit_MonadMorph-bind2.hs
bsd-3-clause
program :: MaybeT IO a program = a |>= \x -> b |>= \y -> (|*|) (f x y)
84
program :: MaybeT IO a program = a |>= \x -> b |>= \y -> (|*|) (f x y)
84
program = a |>= \x -> b |>= \y -> (|*|) (f x y)
61
false
true
0
11
32
47
25
22
null
null
gthar/dotfiles
.xmonad/xmonad.hs
unlicense
uglyDmenuRunLocal :: MonadIO m => m () uglyDmenuRunLocal = dmenu "/home/rilla/bin/ugly_dmenu_run"
97
uglyDmenuRunLocal :: MonadIO m => m () uglyDmenuRunLocal = dmenu "/home/rilla/bin/ugly_dmenu_run"
97
uglyDmenuRunLocal = dmenu "/home/rilla/bin/ugly_dmenu_run"
58
false
true
0
7
10
26
12
14
null
null
rodrigogribeiro/mptc
src/Iface/IfaceWriter.hs
bsd-3-clause
isClassKind e = idty e == IdClass
33
isClassKind e = idty e == IdClass
33
isClassKind e = idty e == IdClass
33
false
false
0
6
6
16
7
9
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
4067 = 4066
11
4067 = 4066
11
4067 = 4066
11
false
false
1
5
2
10
3
7
null
null
clarissalittler/pi-calculus
PureLam.hs
mit
interpLam (Var n) = error "whoops, unbound variable"
52
interpLam (Var n) = error "whoops, unbound variable"
52
interpLam (Var n) = error "whoops, unbound variable"
52
false
false
0
6
7
19
8
11
null
null
rohitjha/DiMPL
src/Tree.hs
bsd-2-clause
addDigraphDotStructure :: String -> String addDigraphDotStructure s = "digraph G\n{\n" ++ s ++ "}"
98
addDigraphDotStructure :: String -> String addDigraphDotStructure s = "digraph G\n{\n" ++ s ++ "}"
98
addDigraphDotStructure s = "digraph G\n{\n" ++ s ++ "}"
55
false
true
0
6
13
26
13
13
null
null