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
bitemyapp/roshask
src/Ros/Node.hs
bsd-3-clause
-- |Apply any matching renames to a given name. remapName :: String -> Node String remapName name = asks (maybe name id . lookup name . nodeRemaps)
147
remapName :: String -> Node String remapName name = asks (maybe name id . lookup name . nodeRemaps)
99
remapName name = asks (maybe name id . lookup name . nodeRemaps)
64
true
true
0
9
26
44
21
23
null
null
nikita-volkov/smtps-gmail
Network/Mail/Client/Gmail.hs
bsd-3-clause
recvSMTPS :: Context -> Int -> B.ByteString -> IO () recvSMTPS ctx micros code = runResourceT $ source $$ sink code where source = forever $ liftIO chunk >>= yield chunk = timeout micros $ recvData ctx -- | -- Render an email using the RFC 2822 message format.
274
recvSMTPS :: Context -> Int -> B.ByteString -> IO () recvSMTPS ctx micros code = runResourceT $ source $$ sink code where source = forever $ liftIO chunk >>= yield chunk = timeout micros $ recvData ctx -- | -- Render an email using the RFC 2822 message format.
274
recvSMTPS ctx micros code = runResourceT $ source $$ sink code where source = forever $ liftIO chunk >>= yield chunk = timeout micros $ recvData ctx -- | -- Render an email using the RFC 2822 message format.
221
false
true
0
9
62
84
41
43
null
null
nushio3/ghc
compiler/basicTypes/DataCon.hs
bsd-3-clause
-- | Substitute in an 'EqSpec'. Precondition: if the LHS of the EqSpec -- is mapped in the substitution, it is mapped to a type variable, not -- a full type. substEqSpec :: TCvSubst -> EqSpec -> EqSpec substEqSpec subst (EqSpec tv ty) = EqSpec tv' (substTy subst ty) where tv' = getTyVar "substEqSpec" (substTyVar subst tv)
331
substEqSpec :: TCvSubst -> EqSpec -> EqSpec substEqSpec subst (EqSpec tv ty) = EqSpec tv' (substTy subst ty) where tv' = getTyVar "substEqSpec" (substTyVar subst tv)
173
substEqSpec subst (EqSpec tv ty) = EqSpec tv' (substTy subst ty) where tv' = getTyVar "substEqSpec" (substTyVar subst tv)
129
true
true
0
7
64
69
35
34
null
null
elieux/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
stableNamePrimTyConKey = mkPreludeTyConUnique 51
65
stableNamePrimTyConKey = mkPreludeTyConUnique 51
65
stableNamePrimTyConKey = mkPreludeTyConUnique 51
65
false
false
0
5
20
9
4
5
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qStyleOptionRubberBandAddFinalizer :: QStyleOptionRubberBand a -> IO () qStyleOptionRubberBandAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QStyleOptionRubberBand_getFinalizer fp
188
qStyleOptionRubberBandAddFinalizer :: QStyleOptionRubberBand a -> IO () qStyleOptionRubberBandAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QStyleOptionRubberBand_getFinalizer fp
188
qStyleOptionRubberBandAddFinalizer (Object fp) = addForeignPtrFinalizer qtc_QStyleOptionRubberBand_getFinalizer fp
116
false
true
0
7
15
37
17
20
null
null
databrary/databrary
src/View/Html.hs
agpl-3.0
unsafeBuilder :: BSB.Builder -> H.Markup unsafeBuilder = H.unsafeLazyByteString . BSB.toLazyByteString
102
unsafeBuilder :: BSB.Builder -> H.Markup unsafeBuilder = H.unsafeLazyByteString . BSB.toLazyByteString
102
unsafeBuilder = H.unsafeLazyByteString . BSB.toLazyByteString
61
false
true
0
6
9
27
14
13
null
null
input-output-hk/pos-haskell-prototype
node/test/Translation.hs
mit
trDsl1 = DSL.Transaction { trFresh = 2 :: DSL.Value , trIns = Set.fromList [inDsl1] , trOuts = [oDsl1] , trFee = 3 :: DSL.Value , trHash = 54209842 :: Int , trExtra = [] }
225
trDsl1 = DSL.Transaction { trFresh = 2 :: DSL.Value , trIns = Set.fromList [inDsl1] , trOuts = [oDsl1] , trFee = 3 :: DSL.Value , trHash = 54209842 :: Int , trExtra = [] }
225
trDsl1 = DSL.Transaction { trFresh = 2 :: DSL.Value , trIns = Set.fromList [inDsl1] , trOuts = [oDsl1] , trFee = 3 :: DSL.Value , trHash = 54209842 :: Int , trExtra = [] }
225
false
false
0
8
88
72
44
28
null
null
AlexanderPankiv/ghc
libraries/base/GHC/Natural.hs
bsd-3-clause
enumNegDeltaToNatural :: Natural -> Natural -> Natural -> [Natural] enumNegDeltaToNatural x0 ndelta lim = go x0 where go x | x < lim = [] | x >= ndelta = x : go (x-ndelta) | otherwise = [x] ----------------------------------------------------------------------------
297
enumNegDeltaToNatural :: Natural -> Natural -> Natural -> [Natural] enumNegDeltaToNatural x0 ndelta lim = go x0 where go x | x < lim = [] | x >= ndelta = x : go (x-ndelta) | otherwise = [x] ----------------------------------------------------------------------------
297
enumNegDeltaToNatural x0 ndelta lim = go x0 where go x | x < lim = [] | x >= ndelta = x : go (x-ndelta) | otherwise = [x] ----------------------------------------------------------------------------
229
false
true
0
9
69
99
48
51
null
null
steveshogren/gitStats
src/LookupGitDirs.hs
bsd-3-clause
filterFor :: [String] -> FindClause Bool filterFor = addIgnored (fileName ==? ".git")
85
filterFor :: [String] -> FindClause Bool filterFor = addIgnored (fileName ==? ".git")
85
filterFor = addIgnored (fileName ==? ".git")
44
false
true
0
7
11
31
16
15
null
null
kojiromike/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
getExps :: [PArg] -> [PTerm] getExps [] = []
44
getExps :: [PArg] -> [PTerm] getExps [] = []
44
getExps [] = []
15
false
true
0
8
8
34
16
18
null
null
orome/crypto-enigma
Crypto/Enigma.hs
bsd-3-clause
{-| The 'Component' with the specified 'Name'. -} component :: Name -> Component component n = fromMaybe (Component n (foldr plug letters (splitOn "." n)) "") (M.lookup n comps_) -- Either lookup the rotor or reflector by name, or use the plugboard spec to -- generate a component with wiring in which the specified letter pairs are exchanged. where plug [p1,p2] = map (\ch -> if ch == p1 then p2 else if ch == p2 then p1 else ch) plug _ = id -- Anything but a .-separated pair will have no effect (configEnigma assertion) -- Machine configurations and transitions ------------------------------------ {-| The (zero-based) index of the processing stage occupied by a 'Component' in an 'EngmaConfig'. See 'stages'. -}
767
component :: Name -> Component component n = fromMaybe (Component n (foldr plug letters (splitOn "." n)) "") (M.lookup n comps_) -- Either lookup the rotor or reflector by name, or use the plugboard spec to -- generate a component with wiring in which the specified letter pairs are exchanged. where plug [p1,p2] = map (\ch -> if ch == p1 then p2 else if ch == p2 then p1 else ch) plug _ = id -- Anything but a .-separated pair will have no effect (configEnigma assertion) -- Machine configurations and transitions ------------------------------------ {-| The (zero-based) index of the processing stage occupied by a 'Component' in an 'EngmaConfig'. See 'stages'. -}
717
component n = fromMaybe (Component n (foldr plug letters (splitOn "." n)) "") (M.lookup n comps_) -- Either lookup the rotor or reflector by name, or use the plugboard spec to -- generate a component with wiring in which the specified letter pairs are exchanged. where plug [p1,p2] = map (\ch -> if ch == p1 then p2 else if ch == p2 then p1 else ch) plug _ = id -- Anything but a .-separated pair will have no effect (configEnigma assertion) -- Machine configurations and transitions ------------------------------------ {-| The (zero-based) index of the processing stage occupied by a 'Component' in an 'EngmaConfig'. See 'stages'. -}
686
true
true
0
11
170
136
70
66
null
null
snoyberg/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
tcLhsId :: TcSigFun -> LetBndrSpec -> Name -> TcM MonoBindInfo tcLhsId sig_fn no_gen name | Just (TcIdSig sig) <- sig_fn name = -- A partial type signature on a FunBind, in a mixed group -- e.g. f :: _ -> _ -- f x = ...g... -- Just g = ...f... -- Hence always typechecked with InferGen; hence LetLclBndr -- -- A compelete type sig on a FunBind is checked with CheckGen -- and does not go via tcLhsId do { inst_sig <- tcInstSig sig ; the_id <- newSigLetBndr no_gen name inst_sig ; return (MBI { mbi_poly_name = name , mbi_sig = Just inst_sig , mbi_mono_id = the_id }) } | otherwise = -- No type signature, plan InferGen (LetLclBndr) or NoGen (LetGblBndr) do { mono_ty <- newOpenFlexiTyVarTy ; mono_id <- newLetBndr no_gen name mono_ty ; return (MBI { mbi_poly_name = name , mbi_sig = Nothing , mbi_mono_id = mono_id }) }
1,017
tcLhsId :: TcSigFun -> LetBndrSpec -> Name -> TcM MonoBindInfo tcLhsId sig_fn no_gen name | Just (TcIdSig sig) <- sig_fn name = -- A partial type signature on a FunBind, in a mixed group -- e.g. f :: _ -> _ -- f x = ...g... -- Just g = ...f... -- Hence always typechecked with InferGen; hence LetLclBndr -- -- A compelete type sig on a FunBind is checked with CheckGen -- and does not go via tcLhsId do { inst_sig <- tcInstSig sig ; the_id <- newSigLetBndr no_gen name inst_sig ; return (MBI { mbi_poly_name = name , mbi_sig = Just inst_sig , mbi_mono_id = the_id }) } | otherwise = -- No type signature, plan InferGen (LetLclBndr) or NoGen (LetGblBndr) do { mono_ty <- newOpenFlexiTyVarTy ; mono_id <- newLetBndr no_gen name mono_ty ; return (MBI { mbi_poly_name = name , mbi_sig = Nothing , mbi_mono_id = mono_id }) }
1,017
tcLhsId sig_fn no_gen name | Just (TcIdSig sig) <- sig_fn name = -- A partial type signature on a FunBind, in a mixed group -- e.g. f :: _ -> _ -- f x = ...g... -- Just g = ...f... -- Hence always typechecked with InferGen; hence LetLclBndr -- -- A compelete type sig on a FunBind is checked with CheckGen -- and does not go via tcLhsId do { inst_sig <- tcInstSig sig ; the_id <- newSigLetBndr no_gen name inst_sig ; return (MBI { mbi_poly_name = name , mbi_sig = Just inst_sig , mbi_mono_id = the_id }) } | otherwise = -- No type signature, plan InferGen (LetLclBndr) or NoGen (LetGblBndr) do { mono_ty <- newOpenFlexiTyVarTy ; mono_id <- newLetBndr no_gen name mono_ty ; return (MBI { mbi_poly_name = name , mbi_sig = Nothing , mbi_mono_id = mono_id }) }
954
false
true
0
12
349
190
101
89
null
null
Yuras/hfd
src/IMsg.hs
bsd-3-clause
akeAMFValue 2 = do (str, ln) <- takeStr return (AMFString (bs2s str), ln)
78
takeAMFValue 2 = do (str, ln) <- takeStr return (AMFString (bs2s str), ln)
78
takeAMFValue 2 = do (str, ln) <- takeStr return (AMFString (bs2s str), ln)
78
false
false
0
11
17
43
21
22
null
null
gnn/Hets
Common/Doc.hs
gpl-2.0
keyword, topSigKey, topKey, indexed, structId :: String -> Doc keyword = Text Keyword
85
keyword, topSigKey, topKey, indexed, structId :: String -> Doc keyword = Text Keyword
85
keyword = Text Keyword
22
false
true
7
5
12
42
17
25
null
null
ghorn/classy-dvda
src/Classy/Differentiation.hs
bsd-3-clause
ddtNp (RelativePoint p0 vec) = ddtN vec + ddtNp p0
50
ddtNp (RelativePoint p0 vec) = ddtN vec + ddtNp p0
50
ddtNp (RelativePoint p0 vec) = ddtN vec + ddtNp p0
50
false
false
0
6
9
28
12
16
null
null
ktvoelker/FLang
src/Main.hs
gpl-3.0
parsePhase = lexPhase' >=> mapM (uncurry parse) where lexPhase' xs = fmap (zip $ map fst xs) . lexPhase $ xs
114
parsePhase = lexPhase' >=> mapM (uncurry parse) where lexPhase' xs = fmap (zip $ map fst xs) . lexPhase $ xs
114
parsePhase = lexPhase' >=> mapM (uncurry parse) where lexPhase' xs = fmap (zip $ map fst xs) . lexPhase $ xs
114
false
false
0
10
26
52
25
27
null
null
gbataille/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
exportsResults :: [(String, String)] -> Bool exportsResults attrs = ("rundoc-exports", "results") `elem` attrs || ("rundoc-exports", "both") `elem` attrs
176
exportsResults :: [(String, String)] -> Bool exportsResults attrs = ("rundoc-exports", "results") `elem` attrs || ("rundoc-exports", "both") `elem` attrs
176
exportsResults attrs = ("rundoc-exports", "results") `elem` attrs || ("rundoc-exports", "both") `elem` attrs
131
false
true
0
8
40
55
33
22
null
null
cfr/burningbar
src/Checker.hs
unlicense
validSuper sup = if all isSwiftId names then Nothing else Just ("invalid proto " ⧺ fromJust sup) where names = separateBy ',' (fromMaybe [] sup) ≫= trim
171
validSuper sup = if all isSwiftId names then Nothing else Just ("invalid proto " ⧺ fromJust sup) where names = separateBy ',' (fromMaybe [] sup) ≫= trim
171
validSuper sup = if all isSwiftId names then Nothing else Just ("invalid proto " ⧺ fromJust sup) where names = separateBy ',' (fromMaybe [] sup) ≫= trim
171
false
false
0
9
45
62
30
32
null
null
rueshyna/gogol
gogol-datastore/gen/Network/Google/Resource/Datastore/Projects/Lookup.hs
mpl-2.0
-- | Multipart request metadata. plPayload :: Lens' ProjectsLookup LookupRequest plPayload = lens _plPayload (\ s a -> s{_plPayload = a})
139
plPayload :: Lens' ProjectsLookup LookupRequest plPayload = lens _plPayload (\ s a -> s{_plPayload = a})
106
plPayload = lens _plPayload (\ s a -> s{_plPayload = a})
58
true
true
0
9
22
42
22
20
null
null
ashnikel/haskellbook
ch10/ch10.10_ex.hs
mit
-- 9 squishAgain :: [[a]] -> [a] squishAgain = squishMap id
59
squishAgain :: [[a]] -> [a] squishAgain = squishMap id
54
squishAgain = squishMap id
26
true
true
0
8
10
35
17
18
null
null
TomMD/llvm-pretty
src/Text/LLVM/AST.hs
bsd-3-clause
-- Type Elimination ------------------------------------------------------------ elimFunTy :: MonadPlus m => Type -> m (Type,[Type],Bool) elimFunTy (FunTy ret args va) = return (ret,args,va)
191
elimFunTy :: MonadPlus m => Type -> m (Type,[Type],Bool) elimFunTy (FunTy ret args va) = return (ret,args,va)
109
elimFunTy (FunTy ret args va) = return (ret,args,va)
52
true
true
0
9
21
63
34
29
null
null
ardumont/haskell-lab
test/BSTTests.hs
gpl-2.0
testMirrors :: Test testMirrors = TestList["testMirror1" ~: testMirror1, "testMirror2" ~: testMirror2, "testMirror3" ~: testMirror3, "testMirror4" ~: testMirror4]
231
testMirrors :: Test testMirrors = TestList["testMirror1" ~: testMirror1, "testMirror2" ~: testMirror2, "testMirror3" ~: testMirror3, "testMirror4" ~: testMirror4]
231
testMirrors = TestList["testMirror1" ~: testMirror1, "testMirror2" ~: testMirror2, "testMirror3" ~: testMirror3, "testMirror4" ~: testMirror4]
211
false
true
0
7
85
42
23
19
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isBuilding TerranBunker = False
31
isBuilding TerranBunker = False
31
isBuilding TerranBunker = False
31
false
false
0
5
3
9
4
5
null
null
rlpowell/hblog
lib/HBlog/HBlog.hs
mit
-- Construct our $ replacement stuff for the special case of the -- redirects file insideRedirectCtx :: Context Redirect insideRedirectCtx = mconcat [ field "path" $ return . redirPath . itemBody , field "category" $ return . redirCategory . itemBody , field "redirect" $ return . redirPattern . itemBody , constField "homeURL" baseURL , missingField ]
376
insideRedirectCtx :: Context Redirect insideRedirectCtx = mconcat [ field "path" $ return . redirPath . itemBody , field "category" $ return . redirCategory . itemBody , field "redirect" $ return . redirPattern . itemBody , constField "homeURL" baseURL , missingField ]
293
insideRedirectCtx = mconcat [ field "path" $ return . redirPath . itemBody , field "category" $ return . redirCategory . itemBody , field "redirect" $ return . redirPattern . itemBody , constField "homeURL" baseURL , missingField ]
255
true
true
0
10
79
84
43
41
null
null
florianpilz/autotool
src/Prolog/Data.hs
gpl-2.0
peek :: Term -> Position -> Term peek t [] = t
46
peek :: Term -> Position -> Term peek t [] = t
46
peek t [] = t
13
false
true
0
6
11
26
13
13
null
null
ikirill/ComputationalMathematics
Cube/Cube.hs
gpl-3.0
scMoveDown2 :: Int -> Int scMoveDown2 n | 1 <= n && n <= 9 = n+18 | otherwise = undefined
89
scMoveDown2 :: Int -> Int scMoveDown2 n | 1 <= n && n <= 9 = n+18 | otherwise = undefined
89
scMoveDown2 n | 1 <= n && n <= 9 = n+18 | otherwise = undefined
63
false
true
0
10
20
49
23
26
null
null
Abandos/tutoride
doc/files/hs/RedBlackTree.hs
gpl-3.0
app (Node Black a x b) (Node Black c y d) = case app b c of Node Red b' z c' -> Node Red(Node Black a x b') z (Node Black c' y d) bc -> balleft a x (Node Black bc y d)
187
app (Node Black a x b) (Node Black c y d) = case app b c of Node Red b' z c' -> Node Red(Node Black a x b') z (Node Black c' y d) bc -> balleft a x (Node Black bc y d)
187
app (Node Black a x b) (Node Black c y d) = case app b c of Node Red b' z c' -> Node Red(Node Black a x b') z (Node Black c' y d) bc -> balleft a x (Node Black bc y d)
187
false
false
0
10
64
119
56
63
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxLC_ICON :: Int wxLC_ICON = 4
30
wxLC_ICON :: Int wxLC_ICON = 4
30
wxLC_ICON = 4
13
false
true
0
6
5
18
7
11
null
null
michalkonecny/polypaver
main/polypaver.hs
bsd-3-clause
mkProblems :: (String, Form (), [(Int, (Rational, Rational), Bool)]) -> [(String, Problem)] mkProblems (name, vc, box) = map mkProb $ zip [1..] subvcs where mkProb (conclusionNumber, subvc) = (name ++ " conclusion " ++ show (conclusionNumber :: Int), Problem box subvc) subvcs = splitConclusion vc
339
mkProblems :: (String, Form (), [(Int, (Rational, Rational), Bool)]) -> [(String, Problem)] mkProblems (name, vc, box) = map mkProb $ zip [1..] subvcs where mkProb (conclusionNumber, subvc) = (name ++ " conclusion " ++ show (conclusionNumber :: Int), Problem box subvc) subvcs = splitConclusion vc
339
mkProblems (name, vc, box) = map mkProb $ zip [1..] subvcs where mkProb (conclusionNumber, subvc) = (name ++ " conclusion " ++ show (conclusionNumber :: Int), Problem box subvc) subvcs = splitConclusion vc
231
false
true
0
9
86
136
76
60
null
null
lancelotsix/hs-tls
core/Network/TLS/Record/Types.hs
bsd-3-clause
onRecordFragment :: Record a -> (Fragment a -> RecordM (Fragment b)) -> RecordM (Record b) onRecordFragment (Record pt ver frag) f = Record pt ver <$> f frag
157
onRecordFragment :: Record a -> (Fragment a -> RecordM (Fragment b)) -> RecordM (Record b) onRecordFragment (Record pt ver frag) f = Record pt ver <$> f frag
157
onRecordFragment (Record pt ver frag) f = Record pt ver <$> f frag
66
false
true
0
11
27
77
36
41
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/original/Diagnostics.hs
bsd-3-clause
------------------------------------------------------------------------------ -- Internal error reporting ------------------------------------------------------------------------------ -- | Signals an internal compiler error. -- Call with module name, name of function, and error message -- to report internal errors; i.e., things that should not happen. internalError :: String -> String -> String -> a internalError m f msg = error ("[Internal Error] " ++ m ++ "." ++ f ++ ": " ++ msg )
495
internalError :: String -> String -> String -> a internalError m f msg = error ("[Internal Error] " ++ m ++ "." ++ f ++ ": " ++ msg )
137
internalError m f msg = error ("[Internal Error] " ++ m ++ "." ++ f ++ ": " ++ msg )
88
true
true
0
11
70
62
34
28
null
null
brendanhay/gogol
gogol-testing/gen/Network/Google/Testing/Types/Product.hs
mpl-2.0
-- | Location of the file on the device, inside the app\'s sandboxed -- filesystem idfDevicePath :: Lens' IosDeviceFile (Maybe Text) idfDevicePath = lens _idfDevicePath (\ s a -> s{_idfDevicePath = a})
209
idfDevicePath :: Lens' IosDeviceFile (Maybe Text) idfDevicePath = lens _idfDevicePath (\ s a -> s{_idfDevicePath = a})
126
idfDevicePath = lens _idfDevicePath (\ s a -> s{_idfDevicePath = a})
76
true
true
0
8
39
50
26
24
null
null
mmarx/owlstat
Main.hs
gpl-3.0
countWords :: [Text] -> Count countWords lst = go lst mempty where go [] cnt = cnt go (w:ws) cnt = go ws $! unionWith (+) (countWord w) cnt
149
countWords :: [Text] -> Count countWords lst = go lst mempty where go [] cnt = cnt go (w:ws) cnt = go ws $! unionWith (+) (countWord w) cnt
149
countWords lst = go lst mempty where go [] cnt = cnt go (w:ws) cnt = go ws $! unionWith (+) (countWord w) cnt
119
false
true
1
8
38
79
40
39
null
null
ramaciotti/dependent-types
src/lib/DependentTypes/Semantic.hs
gpl-3.0
checkCallSigs :: Map String Toplevel -> [(String, Signature)] -> [Expression] -> Either String () checkCallSigs e ss exp@((ExpId expId):_) = forM_ ss checkCallSigs' where checkCallSigs' (name, (Signature ss)) = when (name == expId && (not $ isTypeAssignable e exp ss)) $ Left expId -- | Evaluates an expression.
324
checkCallSigs :: Map String Toplevel -> [(String, Signature)] -> [Expression] -> Either String () checkCallSigs e ss exp@((ExpId expId):_) = forM_ ss checkCallSigs' where checkCallSigs' (name, (Signature ss)) = when (name == expId && (not $ isTypeAssignable e exp ss)) $ Left expId -- | Evaluates an expression.
324
checkCallSigs e ss exp@((ExpId expId):_) = forM_ ss checkCallSigs' where checkCallSigs' (name, (Signature ss)) = when (name == expId && (not $ isTypeAssignable e exp ss)) $ Left expId -- | Evaluates an expression.
226
false
true
0
11
60
133
69
64
null
null
erochest/greek
SplitXml.hs
apache-2.0
_elementAttributes :: Lens' Element [(Name, [Content])] _elementAttributes = lens elementAttributes $ \e a -> e { elementAttributes = a }
137
_elementAttributes :: Lens' Element [(Name, [Content])] _elementAttributes = lens elementAttributes $ \e a -> e { elementAttributes = a }
137
_elementAttributes = lens elementAttributes $ \e a -> e { elementAttributes = a }
81
false
true
0
8
19
50
28
22
null
null
frenetic-lang/netcore-1.0
examples/UpdateTest.hs
bsd-3-clause
physical a = Physical $ fromInteger a
37
physical a = Physical $ fromInteger a
37
physical a = Physical $ fromInteger a
37
false
false
0
6
6
16
7
9
null
null
gimbo/cabal-macosx
Distribution/MacOSX.hs
bsd-3-clause
maybeCopyIcon :: FilePath -- ^ Path to application bundle root. -> MacApp -> IO () maybeCopyIcon appPath app = case appIcon app of Just icPath -> do putStrLn $ "Copying " ++ icPath ++ " to app's icon" copyFile icPath $ appPath </> "Contents/Resources" </> takeFileName icPath Nothing -> return () -- | Perform various magical OS X incantations for turning the app -- directory into a bundle proper.
446
maybeCopyIcon :: FilePath -- ^ Path to application bundle root. -> MacApp -> IO () maybeCopyIcon appPath app = case appIcon app of Just icPath -> do putStrLn $ "Copying " ++ icPath ++ " to app's icon" copyFile icPath $ appPath </> "Contents/Resources" </> takeFileName icPath Nothing -> return () -- | Perform various magical OS X incantations for turning the app -- directory into a bundle proper.
446
maybeCopyIcon appPath app = case appIcon app of Just icPath -> do putStrLn $ "Copying " ++ icPath ++ " to app's icon" copyFile icPath $ appPath </> "Contents/Resources" </> takeFileName icPath Nothing -> return () -- | Perform various magical OS X incantations for turning the app -- directory into a bundle proper.
359
false
true
0
13
116
96
45
51
null
null
beni55/egison
hs-src/Language/Egison/Desugar.hs
mit
desugar (MatchExpr expr0 expr1 clauses) = do expr0' <- desugar expr0 expr1' <- desugar expr1 clauses' <- desugarMatchClauses clauses return (MatchExpr expr0' expr1' clauses')
184
desugar (MatchExpr expr0 expr1 clauses) = do expr0' <- desugar expr0 expr1' <- desugar expr1 clauses' <- desugarMatchClauses clauses return (MatchExpr expr0' expr1' clauses')
184
desugar (MatchExpr expr0 expr1 clauses) = do expr0' <- desugar expr0 expr1' <- desugar expr1 clauses' <- desugarMatchClauses clauses return (MatchExpr expr0' expr1' clauses')
184
false
false
0
9
33
66
28
38
null
null
ulricha/dsh-tpc-h
gen/FlowGen.hs
bsd-3-clause
genFlows :: Options -> Host -> Host -> Timestamp -> Seq Packet -> Int -> IO (Seq Packet) genFlows _ _ _ _ ps 0 = return ps
135
genFlows :: Options -> Host -> Host -> Timestamp -> Seq Packet -> Int -> IO (Seq Packet) genFlows _ _ _ _ ps 0 = return ps
135
genFlows _ _ _ _ ps 0 = return ps
46
false
true
0
13
40
63
30
33
null
null
Teaspot-Studio/Urho3D-Haskell
src/Graphics/Urho3D/Input/InputConstants.hs
mit
controllerButtonBack :: Int controllerButtonBack = fromIntegral [C.pure| int { CONTROLLER_BUTTON_BACK } |]
106
controllerButtonBack :: Int controllerButtonBack = fromIntegral [C.pure| int { CONTROLLER_BUTTON_BACK } |]
106
controllerButtonBack = fromIntegral [C.pure| int { CONTROLLER_BUTTON_BACK } |]
78
false
true
0
6
11
20
12
8
null
null
CanvasHS/Canvas.hs
canvashs-module/CanvasHs/Protocol/ShapeOutput.hs
lgpl-2.1
shapeEncodeTextData :: D.Point -> String -> D.TextData -> JSONShapeData shapeEncodeTextData ps s (D.TextData{D.font = f, D.size = si, D.alignment = a, D.bold = b, D.italic = i}) = result where pointData = shapeEncodePoint ps al = case a of D.AlignLeft -> Just "left" D.AlignCenter -> Just "center" D.AlignRight -> Just "right" text = pointData{text= Just $ BU.fromString $ s} result = text{fontFamily=Just $ BU.fromString f, fontSize=Just si, align =al, bold=Just b, italic=Just i} -- | A helper function which encodes EventData into JSONEcentData, -- it can either update an existing JSONEventData (Just e) or create a new one (Nothing)
772
shapeEncodeTextData :: D.Point -> String -> D.TextData -> JSONShapeData shapeEncodeTextData ps s (D.TextData{D.font = f, D.size = si, D.alignment = a, D.bold = b, D.italic = i}) = result where pointData = shapeEncodePoint ps al = case a of D.AlignLeft -> Just "left" D.AlignCenter -> Just "center" D.AlignRight -> Just "right" text = pointData{text= Just $ BU.fromString $ s} result = text{fontFamily=Just $ BU.fromString f, fontSize=Just si, align =al, bold=Just b, italic=Just i} -- | A helper function which encodes EventData into JSONEcentData, -- it can either update an existing JSONEventData (Just e) or create a new one (Nothing)
772
shapeEncodeTextData ps s (D.TextData{D.font = f, D.size = si, D.alignment = a, D.bold = b, D.italic = i}) = result where pointData = shapeEncodePoint ps al = case a of D.AlignLeft -> Just "left" D.AlignCenter -> Just "center" D.AlignRight -> Just "right" text = pointData{text= Just $ BU.fromString $ s} result = text{fontFamily=Just $ BU.fromString f, fontSize=Just si, align =al, bold=Just b, italic=Just i} -- | A helper function which encodes EventData into JSONEcentData, -- it can either update an existing JSONEventData (Just e) or create a new one (Nothing)
700
false
true
8
12
233
224
114
110
null
null
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs
mpl-2.0
-- | (Postgres only) Whether point in time recovery is enabled. bcPointInTimeRecoveryEnabled :: Lens' BackupConfiguration (Maybe Bool) bcPointInTimeRecoveryEnabled = lens _bcPointInTimeRecoveryEnabled (\ s a -> s{_bcPointInTimeRecoveryEnabled = a})
256
bcPointInTimeRecoveryEnabled :: Lens' BackupConfiguration (Maybe Bool) bcPointInTimeRecoveryEnabled = lens _bcPointInTimeRecoveryEnabled (\ s a -> s{_bcPointInTimeRecoveryEnabled = a})
192
bcPointInTimeRecoveryEnabled = lens _bcPointInTimeRecoveryEnabled (\ s a -> s{_bcPointInTimeRecoveryEnabled = a})
121
true
true
0
8
35
49
25
24
null
null
Numberartificial/workflow
snipets/src/Craft/Pictures.hs
mit
-- Inverting the colours in a picture; done pointwise by invert... invertColour :: Picture -> Picture invertColour = map (map invert)
135
invertColour :: Picture -> Picture invertColour = map (map invert)
66
invertColour = map (map invert)
31
true
true
0
7
22
31
14
17
null
null
conal/hermit
src/HERMIT/PrettyPrinter/Clean.hs
bsd-2-clause
------------------------------------------------------------------------------------------------ cleanParens :: DocH -> DocH cleanParens e = symbol '(' <> e <> symbol ')'
171
cleanParens :: DocH -> DocH cleanParens e = symbol '(' <> e <> symbol ')'
73
cleanParens e = symbol '(' <> e <> symbol ')'
45
true
true
0
7
16
38
17
21
null
null
phischu/fragnix
tests/packages/scotty/Data.ByteString.Builder.Prim.ASCII.hs
bsd-3-clause
int32HexFixed :: FixedPrim Int32 int32HexFixed = fromIntegral >$< word32HexFixed
80
int32HexFixed :: FixedPrim Int32 int32HexFixed = fromIntegral >$< word32HexFixed
80
int32HexFixed = fromIntegral >$< word32HexFixed
47
false
true
0
5
8
18
9
9
null
null
databrary/databrary
src/Model/Funding.hs
agpl-3.0
removeVolumeFunder :: MonadDB c m => Volume -> Id Funder -> m Bool removeVolumeFunder v f = dbExecute1 -- [pgSQL|DELETE FROM volume_funding WHERE volume = ${volumeId $ volumeRow v} AND funder = ${f}|] (mapQuery (Data.ByteString.concat [Data.String.fromString "DELETE FROM volume_funding WHERE volume = ", Database.PostgreSQL.Typed.Types.pgEscapeParameter unknownPGTypeEnv (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") (volumeId $ volumeRow v), Data.String.fromString " AND funder = ", Database.PostgreSQL.Typed.Types.pgEscapeParameter unknownPGTypeEnv (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "bigint") f]) (\[] -> ()))
926
removeVolumeFunder :: MonadDB c m => Volume -> Id Funder -> m Bool removeVolumeFunder v f = dbExecute1 -- [pgSQL|DELETE FROM volume_funding WHERE volume = ${volumeId $ volumeRow v} AND funder = ${f}|] (mapQuery (Data.ByteString.concat [Data.String.fromString "DELETE FROM volume_funding WHERE volume = ", Database.PostgreSQL.Typed.Types.pgEscapeParameter unknownPGTypeEnv (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") (volumeId $ volumeRow v), Data.String.fromString " AND funder = ", Database.PostgreSQL.Typed.Types.pgEscapeParameter unknownPGTypeEnv (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "bigint") f]) (\[] -> ()))
926
removeVolumeFunder v f = dbExecute1 -- [pgSQL|DELETE FROM volume_funding WHERE volume = ${volumeId $ volumeRow v} AND funder = ${f}|] (mapQuery (Data.ByteString.concat [Data.String.fromString "DELETE FROM volume_funding WHERE volume = ", Database.PostgreSQL.Typed.Types.pgEscapeParameter unknownPGTypeEnv (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "integer") (volumeId $ volumeRow v), Data.String.fromString " AND funder = ", Database.PostgreSQL.Typed.Types.pgEscapeParameter unknownPGTypeEnv (Database.PostgreSQL.Typed.Types.PGTypeProxy :: Database.PostgreSQL.Typed.Types.PGTypeName "bigint") f]) (\[] -> ()))
859
false
true
0
13
269
168
95
73
null
null
urbanslug/ghc
libraries/base/Data/Typeable/Internal.hs
bsd-3-clause
typeOf3 :: forall t (a :: *) (b :: *) (c :: *). Typeable t => t a b c -> TypeRep typeOf3 _ = typeRep (Proxy :: Proxy t)
127
typeOf3 :: forall t (a :: *) (b :: *) (c :: *). Typeable t => t a b c -> TypeRep typeOf3 _ = typeRep (Proxy :: Proxy t)
127
typeOf3 _ = typeRep (Proxy :: Proxy t)
38
false
true
0
9
37
75
40
35
null
null
hephaestus-pl/hephaestus
alexandre/util/src/BasicTypes.hs
mit
precedence' (p:ps) ls = let px = [x | x <- ls, fst p == fst x] py = [y | y <- ls, snd p == fst y] in case (px,py) of ([x],[y]) -> precedence' ps [if (fst y == fst l) then (fst y, (+1) (snd x)) else l | l <- ls] otherwise -> ls
243
precedence' (p:ps) ls = let px = [x | x <- ls, fst p == fst x] py = [y | y <- ls, snd p == fst y] in case (px,py) of ([x],[y]) -> precedence' ps [if (fst y == fst l) then (fst y, (+1) (snd x)) else l | l <- ls] otherwise -> ls
243
precedence' (p:ps) ls = let px = [x | x <- ls, fst p == fst x] py = [y | y <- ls, snd p == fst y] in case (px,py) of ([x],[y]) -> precedence' ps [if (fst y == fst l) then (fst y, (+1) (snd x)) else l | l <- ls] otherwise -> ls
243
false
false
0
16
74
177
92
85
null
null
f1u77y/xmonad-contrib
XMonad/Layout/Groups.hs
bsd-3-clause
onZipper :: (Zipper a -> Zipper a) -> Group l a -> Group l a onZipper f g = g { gZipper = f $ gZipper g }
105
onZipper :: (Zipper a -> Zipper a) -> Group l a -> Group l a onZipper f g = g { gZipper = f $ gZipper g }
105
onZipper f g = g { gZipper = f $ gZipper g }
44
false
true
0
9
27
67
31
36
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Bibtex.hs
gpl-2.0
pEndLine = do updateState $ \st -> st{ synStPrevNonspace = False } context <- currentContext contexts <- synStContexts `fmap` getState st <- getState if length contexts >= 2 then case context of _ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False } ("BibTeX","Normal") -> return () ("BibTeX","PreambleCommand") -> return () ("BibTeX","StringCommand") -> return () ("BibTeX","Entry") -> return () ("BibTeX","Field") -> return () ("BibTeX","CurlyBracket") -> return () ("BibTeX","QuotedText") -> return () _ -> return () else return ()
632
pEndLine = do updateState $ \st -> st{ synStPrevNonspace = False } context <- currentContext contexts <- synStContexts `fmap` getState st <- getState if length contexts >= 2 then case context of _ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False } ("BibTeX","Normal") -> return () ("BibTeX","PreambleCommand") -> return () ("BibTeX","StringCommand") -> return () ("BibTeX","Entry") -> return () ("BibTeX","Field") -> return () ("BibTeX","CurlyBracket") -> return () ("BibTeX","QuotedText") -> return () _ -> return () else return ()
632
pEndLine = do updateState $ \st -> st{ synStPrevNonspace = False } context <- currentContext contexts <- synStContexts `fmap` getState st <- getState if length contexts >= 2 then case context of _ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False } ("BibTeX","Normal") -> return () ("BibTeX","PreambleCommand") -> return () ("BibTeX","StringCommand") -> return () ("BibTeX","Entry") -> return () ("BibTeX","Field") -> return () ("BibTeX","CurlyBracket") -> return () ("BibTeX","QuotedText") -> return () _ -> return () else return ()
632
false
false
0
15
152
242
124
118
null
null
Lemmih/haskell-tc
src/Language/Haskell/TypeCheck/Unify.hs
mit
unifyList :: Rho s -> TI s (Sigma s) unifyList (TcList elt) = return elt
72
unifyList :: Rho s -> TI s (Sigma s) unifyList (TcList elt) = return elt
72
unifyList (TcList elt) = return elt
35
false
true
0
8
14
45
20
25
null
null
k-bx/riak-haskell-client
src/Network/Riak/Response.hs
apache-2.0
getBucket :: GetBucketResponse -> BucketProps getBucket = props
63
getBucket :: GetBucketResponse -> BucketProps getBucket = props
63
getBucket = props
17
false
true
0
5
7
15
8
7
null
null
olsner/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
ifDensity :: TickDensity -> TM a -> TM a -> TM a ifDensity d th el = do d0 <- getDensity; if d == d0 then th else el
116
ifDensity :: TickDensity -> TM a -> TM a -> TM a ifDensity d th el = do d0 <- getDensity; if d == d0 then th else el
116
ifDensity d th el = do d0 <- getDensity; if d == d0 then th else el
67
false
true
0
8
28
62
30
32
null
null
colah/ImplicitCAD
tests/Graphics/Implicit/Test/Utils.hs
agpl-3.0
randomGroups :: [a] -> Gen [[a]] randomGroups [] = pure []
58
randomGroups :: [a] -> Gen [[a]] randomGroups [] = pure []
58
randomGroups [] = pure []
25
false
true
0
9
10
42
20
22
null
null
chrisdone/haskelldb-demo
lib/haskelldb/test/TestCases.hs
bsd-3-clause
testInsertOnly ins tbl r = dbtest name $ \db -> ins db tbl (constantRecord r) where name = "rearrange " ++ tableName tbl -- * Delete
138
testInsertOnly ins tbl r = dbtest name $ \db -> ins db tbl (constantRecord r) where name = "rearrange " ++ tableName tbl -- * Delete
138
testInsertOnly ins tbl r = dbtest name $ \db -> ins db tbl (constantRecord r) where name = "rearrange " ++ tableName tbl -- * Delete
138
false
false
0
7
31
56
26
30
null
null
trenttobler/hs-asteroids
src/Asteroids/GameLogic/KeyAction.hs
bsd-3-clause
actionName :: KeyAction -> String actionName k = gameActionName' $ findAction k where gameActionName' Nothing = "(Not Implemented)" gameActionName' (Just ga) = gameActionName ga
190
actionName :: KeyAction -> String actionName k = gameActionName' $ findAction k where gameActionName' Nothing = "(Not Implemented)" gameActionName' (Just ga) = gameActionName ga
189
actionName k = gameActionName' $ findAction k where gameActionName' Nothing = "(Not Implemented)" gameActionName' (Just ga) = gameActionName ga
155
false
true
0
7
36
60
26
34
null
null
mitochon/hexercise
src/haskellbook/ch17/ch17.applicative.hs
mit
fold :: ( a -> b -> b) -> b -> List a -> b fold _ b Nil = b
59
fold :: ( a -> b -> b) -> b -> List a -> b fold _ b Nil = b
59
fold _ b Nil = b
16
false
true
0
9
20
50
23
27
null
null
abakst/symmetry
checker/src/Symmetry/SymbEx.hs
mit
symOr p q = SE $ do pp <- runSE p qq <- runSE q case (pp, qq) of (APred _ (Just e1), APred _ (Just e2)) -> return $ APred Nothing (Just (IL.ILOr e1 e2)) _ -> runSE arb -------------------------------------------------
290
symOr p q = SE $ do pp <- runSE p qq <- runSE q case (pp, qq) of (APred _ (Just e1), APred _ (Just e2)) -> return $ APred Nothing (Just (IL.ILOr e1 e2)) _ -> runSE arb -------------------------------------------------
290
symOr p q = SE $ do pp <- runSE p qq <- runSE q case (pp, qq) of (APred _ (Just e1), APred _ (Just e2)) -> return $ APred Nothing (Just (IL.ILOr e1 e2)) _ -> runSE arb -------------------------------------------------
290
false
false
3
17
113
123
56
67
null
null
elginer/Delve
src/DHelper.hs
gpl-3.0
primative_gte = logic_op (>=)
29
primative_gte = logic_op (>=)
29
primative_gte = logic_op (>=)
29
false
false
0
5
3
11
6
5
null
null
lukexi/ghc-7.8-arm64
compiler/cmm/CmmOpt.hs
bsd-3-clause
cmmMachOpFoldM _ (MO_Add _) [CmmLit (CmmInt i rep), CmmLit lit] = Just $ CmmLit (cmmOffsetLit lit (fromIntegral (narrowU rep i)))
131
cmmMachOpFoldM _ (MO_Add _) [CmmLit (CmmInt i rep), CmmLit lit] = Just $ CmmLit (cmmOffsetLit lit (fromIntegral (narrowU rep i)))
131
cmmMachOpFoldM _ (MO_Add _) [CmmLit (CmmInt i rep), CmmLit lit] = Just $ CmmLit (cmmOffsetLit lit (fromIntegral (narrowU rep i)))
131
false
false
0
12
21
68
33
35
null
null
ekalosak/haskell-practice
Tree.hs
lgpl-3.0
rchild (Branch _ _ x) = x
25
rchild (Branch _ _ x) = x
25
rchild (Branch _ _ x) = x
25
false
false
0
6
6
20
9
11
null
null
unsw-comp4181/accelerate-c-stub
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
nonNumScalarToC (TypeCSChar _) x = [cexp|$char:(chr (fromIntegral x))|]
71
nonNumScalarToC (TypeCSChar _) x = [cexp|$char:(chr (fromIntegral x))|]
71
nonNumScalarToC (TypeCSChar _) x = [cexp|$char:(chr (fromIntegral x))|]
71
false
false
0
7
7
21
12
9
null
null
rvion/lamdu
Lamdu/GUI/VersionControl.hs
gpl-3.0
choiceWidgetConfig :: VersionControl.Config -> Anim.Layer -> Choice.Config choiceWidgetConfig VersionControl.Config{..} choiceBGLayer = Choice.Config { Choice.cwcFDConfig = FocusDelegator.Config { FocusDelegator.focusChildKeys = [ModKey mempty GLFW.Key'Enter] , FocusDelegator.focusChildDoc = E.Doc ["Branches", "Select"] , FocusDelegator.focusParentKeys = [ModKey mempty GLFW.Key'Enter] , FocusDelegator.focusParentDoc = E.Doc ["Branches", "Choose selected"] } , Choice.cwcExpandMode = Choice.AutoExpand selectedBranchColor , Choice.cwcOrientation = Box.vertical , Choice.cwcBgLayer = choiceBGLayer }
669
choiceWidgetConfig :: VersionControl.Config -> Anim.Layer -> Choice.Config choiceWidgetConfig VersionControl.Config{..} choiceBGLayer = Choice.Config { Choice.cwcFDConfig = FocusDelegator.Config { FocusDelegator.focusChildKeys = [ModKey mempty GLFW.Key'Enter] , FocusDelegator.focusChildDoc = E.Doc ["Branches", "Select"] , FocusDelegator.focusParentKeys = [ModKey mempty GLFW.Key'Enter] , FocusDelegator.focusParentDoc = E.Doc ["Branches", "Choose selected"] } , Choice.cwcExpandMode = Choice.AutoExpand selectedBranchColor , Choice.cwcOrientation = Box.vertical , Choice.cwcBgLayer = choiceBGLayer }
669
choiceWidgetConfig VersionControl.Config{..} choiceBGLayer = Choice.Config { Choice.cwcFDConfig = FocusDelegator.Config { FocusDelegator.focusChildKeys = [ModKey mempty GLFW.Key'Enter] , FocusDelegator.focusChildDoc = E.Doc ["Branches", "Select"] , FocusDelegator.focusParentKeys = [ModKey mempty GLFW.Key'Enter] , FocusDelegator.focusParentDoc = E.Doc ["Branches", "Choose selected"] } , Choice.cwcExpandMode = Choice.AutoExpand selectedBranchColor , Choice.cwcOrientation = Box.vertical , Choice.cwcBgLayer = choiceBGLayer }
594
false
true
0
12
123
163
89
74
null
null
janrain/riak-haskell-client
src/Network/Riak/Value.hs
apache-2.0
-- | Store a single value. This may return multiple conflicting -- siblings. Choosing among them, and storing a new value, is your -- responsibility. -- -- You should /only/ supply 'Nothing' as a 'T.VClock' if you are sure -- that the given bucket+key combination does not already exist. If -- you omit a 'T.VClock' but the bucket+key /does/ exist, your value -- will not be stored. put :: (IsContent c) => Connection -> Bucket -> Key -> Maybe VClock -> c -> W -> DW -> IO ([c], VClock) put conn bucket key mvclock val w dw = putResp =<< exchange conn (Req.put bucket key mvclock (toContent val) w dw True)
629
put :: (IsContent c) => Connection -> Bucket -> Key -> Maybe VClock -> c -> W -> DW -> IO ([c], VClock) put conn bucket key mvclock val w dw = putResp =<< exchange conn (Req.put bucket key mvclock (toContent val) w dw True)
243
put conn bucket key mvclock val w dw = putResp =<< exchange conn (Req.put bucket key mvclock (toContent val) w dw True)
135
true
true
2
16
134
124
66
58
null
null
ihc/futhark
src/Futhark/Optimise/MemoryBlockMerging/Miscellaneous.hs
isc
(<&&>) :: Monad m => m Bool -> m Bool -> m Bool m <&&> n = (&&) <$> m <*> n
75
(<&&>) :: Monad m => m Bool -> m Bool -> m Bool m <&&> n = (&&) <$> m <*> n
75
m <&&> n = (&&) <$> m <*> n
27
false
true
0
10
21
53
26
27
null
null
kinoru/unbreak
lib/Unbreak/Run.hs
agpl-3.0
runList :: IO () runList = getConf f withArgs where f errmsg = B.putStrLn ("Failed: " ++ errmsg) *> exitFailure withArgs Conf{..} Session{..} = do result <- runRead "ssh" [host, "ls", docdir] case result of Left c -> B.putStrLn (mconcat ["ssh ls failed. (", int c, ")"]) *> exitFailure Right b -> B.putStrLn $ B.intercalate "\n" $ map (decryptFileName master . B64.decodeLenient) $ split b where (host, docdir) = sshHost (T.encodeUtf8 remote) split = filter (/= "") . B.split '\n' -- utility functions
606
runList :: IO () runList = getConf f withArgs where f errmsg = B.putStrLn ("Failed: " ++ errmsg) *> exitFailure withArgs Conf{..} Session{..} = do result <- runRead "ssh" [host, "ls", docdir] case result of Left c -> B.putStrLn (mconcat ["ssh ls failed. (", int c, ")"]) *> exitFailure Right b -> B.putStrLn $ B.intercalate "\n" $ map (decryptFileName master . B64.decodeLenient) $ split b where (host, docdir) = sshHost (T.encodeUtf8 remote) split = filter (/= "") . B.split '\n' -- utility functions
606
runList = getConf f withArgs where f errmsg = B.putStrLn ("Failed: " ++ errmsg) *> exitFailure withArgs Conf{..} Session{..} = do result <- runRead "ssh" [host, "ls", docdir] case result of Left c -> B.putStrLn (mconcat ["ssh ls failed. (", int c, ")"]) *> exitFailure Right b -> B.putStrLn $ B.intercalate "\n" $ map (decryptFileName master . B64.decodeLenient) $ split b where (host, docdir) = sshHost (T.encodeUtf8 remote) split = filter (/= "") . B.split '\n' -- utility functions
589
false
true
0
15
187
227
112
115
null
null
nushio3/orgmode-parse
src/Data/OrgMode/Parse/Attoparsec/Time.hs
bsd-3-clause
parseDay :: TP.Parser Text Text parseDay = pack <$> some (TP.satisfyElem isDayChar) where isDayChar :: Char -> Bool isDayChar = (`notElem` nonDayChars) nonDayChars :: String nonDayChars = "]+0123456789>\r\n -" -- The above syntax is based on [^]+0-9>\r\n -]+ -- a part of regexp named org-ts-regexp0 -- in org.el .
344
parseDay :: TP.Parser Text Text parseDay = pack <$> some (TP.satisfyElem isDayChar) where isDayChar :: Char -> Bool isDayChar = (`notElem` nonDayChars) nonDayChars :: String nonDayChars = "]+0123456789>\r\n -" -- The above syntax is based on [^]+0-9>\r\n -]+ -- a part of regexp named org-ts-regexp0 -- in org.el .
344
parseDay = pack <$> some (TP.satisfyElem isDayChar) where isDayChar :: Char -> Bool isDayChar = (`notElem` nonDayChars) nonDayChars :: String nonDayChars = "]+0123456789>\r\n -" -- The above syntax is based on [^]+0-9>\r\n -]+ -- a part of regexp named org-ts-regexp0 -- in org.el .
312
false
true
4
9
78
73
39
34
null
null
alexbiehl/hoop
hadoop-protos/src/Hadoop/Protos/DatanodeProtocolProtos/DatanodeCommandProto/Type.hs
mit
toMaybe'Enum 2 = Prelude'.Just BlockRecoveryCommand
51
toMaybe'Enum 2 = Prelude'.Just BlockRecoveryCommand
51
toMaybe'Enum 2 = Prelude'.Just BlockRecoveryCommand
51
false
false
0
6
4
14
6
8
null
null
GaloisInc/saw-script
saw-core/src/Verifier/SAW/Name.hs
bsd-3-clause
-- | Create a module name given a list of strings with the top-most -- module name given first. mkModuleName :: [Text] -> ModuleName mkModuleName [] = error "internal: mkModuleName given empty module name"
205
mkModuleName :: [Text] -> ModuleName mkModuleName [] = error "internal: mkModuleName given empty module name"
109
mkModuleName [] = error "internal: mkModuleName given empty module name"
72
true
true
0
6
33
28
15
13
null
null
geophf/1HaskellADay
exercises/HAD/Y2017/M09/D04/Solution.hs
mit
wf :: URL -> Directory -> [FileName] -> Bag ByteString -> IO (Bag ByteString) wf _ _ [] ans = pure ans
108
wf :: URL -> Directory -> [FileName] -> Bag ByteString -> IO (Bag ByteString) wf _ _ [] ans = pure ans
108
wf _ _ [] ans = pure ans
30
false
true
0
12
27
60
28
32
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/GHC/Internal.hs
bsd-3-clause
filterGhciFlags :: [String] -> [String] filterGhciFlags = filter supported where supported ('-':'O':_) = False supported "-debug" = False supported "-threaded" = False supported "-ticky" = False supported "-eventlog" = False supported "-prof" = False supported "-unreg" = False supported _ = True
353
filterGhciFlags :: [String] -> [String] filterGhciFlags = filter supported where supported ('-':'O':_) = False supported "-debug" = False supported "-threaded" = False supported "-ticky" = False supported "-eventlog" = False supported "-prof" = False supported "-unreg" = False supported _ = True
353
filterGhciFlags = filter supported where supported ('-':'O':_) = False supported "-debug" = False supported "-threaded" = False supported "-ticky" = False supported "-eventlog" = False supported "-prof" = False supported "-unreg" = False supported _ = True
313
false
true
6
8
98
129
53
76
null
null
d0kt0r0/Tidal
src/Sound/Tidal/Params.hs
gpl-3.0
lfodelay :: Pattern Double -> ControlPattern lfodelay = pF "lfodelay"
69
lfodelay :: Pattern Double -> ControlPattern lfodelay = pF "lfodelay"
69
lfodelay = pF "lfodelay"
24
false
true
0
6
9
21
10
11
null
null
mithrandi/advent2016
Day19.hs
mit
elves :: Int -> [Elf] elves n = map (`Elf` 1) [1..n]
52
elves :: Int -> [Elf] elves n = map (`Elf` 1) [1..n]
52
elves n = map (`Elf` 1) [1..n]
30
false
true
0
8
11
44
22
22
null
null
m4dc4p/haskelldb
src/Database/HaskellDB/Sql/SQLite.hs
bsd-3-clause
literal l = defaultSqlLiteral generator l
41
literal l = defaultSqlLiteral generator l
41
literal l = defaultSqlLiteral generator l
41
false
false
0
5
5
14
6
8
null
null
remyoudompheng/hs-language-go
Language/Go/Parser/Tokens.hs
gpl-3.0
goTokFunc = token $ GoTokFunc
33
goTokFunc = token $ GoTokFunc
33
goTokFunc = token $ GoTokFunc
33
false
false
3
5
8
15
5
10
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/inRange_3.hs
mit
esEsOrdering EQ EQ = MyTrue
27
esEsOrdering EQ EQ = MyTrue
27
esEsOrdering EQ EQ = MyTrue
27
false
false
0
5
4
11
5
6
null
null
IreneKnapp/Faction
libfaction/Distribution/PackageDescription.hs
bsd-3-clause
emptyExecutable :: Executable emptyExecutable = mempty
54
emptyExecutable :: Executable emptyExecutable = mempty
54
emptyExecutable = mempty
24
false
true
0
4
5
11
6
5
null
null
ndmitchell/tagsoup
src/Text/HTML/TagSoup/Specification.hs
bsd-3-clause
charRefAlpha2 resume att S{..} = case hd of _ | alphaChar hd -> hd & charRefAlpha2 resume att tl ';' -> EntityEnd True & resume tl _ | att -> EntityEnd False & resume s _ -> EntityEnd False & errWant ";" & resume s
230
charRefAlpha2 resume att S{..} = case hd of _ | alphaChar hd -> hd & charRefAlpha2 resume att tl ';' -> EntityEnd True & resume tl _ | att -> EntityEnd False & resume s _ -> EntityEnd False & errWant ";" & resume s
230
charRefAlpha2 resume att S{..} = case hd of _ | alphaChar hd -> hd & charRefAlpha2 resume att tl ';' -> EntityEnd True & resume tl _ | att -> EntityEnd False & resume s _ -> EntityEnd False & errWant ";" & resume s
230
false
false
0
11
60
110
48
62
null
null
sproctor/dirtywater
src/LuaHelpers.hs
gpl-2.0
loadLuaFile :: LuaState -> (LuaState -> String -> IO a) -> String -> FilePath -> IO a -- loadLuaFile _ _ objId file | trace ("loadLuaFile luaState f " ++ objId ++ " " ++ show file) False = undefined loadLuaFile luaState loadFun objId file = do startstacksize <- Lua.gettop luaState -- putStrLn $ "Stack size: " ++ show startstacksize status <- Lua.loadfile luaState file if status == 0 then do Lua.call luaState 0 Lua.multret result <- loadFun luaState objId endstacksize <- Lua.gettop luaState when (startstacksize /= endstacksize) (error $ "Stack size changed when processing " ++ show file) return result else do putStrLn "Got an error!" errMsg <- Lua.tostring luaState (-1) error $ "ERROR: " ++ (UTF8.toString errMsg)
785
loadLuaFile :: LuaState -> (LuaState -> String -> IO a) -> String -> FilePath -> IO a loadLuaFile luaState loadFun objId file = do startstacksize <- Lua.gettop luaState -- putStrLn $ "Stack size: " ++ show startstacksize status <- Lua.loadfile luaState file if status == 0 then do Lua.call luaState 0 Lua.multret result <- loadFun luaState objId endstacksize <- Lua.gettop luaState when (startstacksize /= endstacksize) (error $ "Stack size changed when processing " ++ show file) return result else do putStrLn "Got an error!" errMsg <- Lua.tostring luaState (-1) error $ "ERROR: " ++ (UTF8.toString errMsg)
672
loadLuaFile luaState loadFun objId file = do startstacksize <- Lua.gettop luaState -- putStrLn $ "Stack size: " ++ show startstacksize status <- Lua.loadfile luaState file if status == 0 then do Lua.call luaState 0 Lua.multret result <- loadFun luaState objId endstacksize <- Lua.gettop luaState when (startstacksize /= endstacksize) (error $ "Stack size changed when processing " ++ show file) return result else do putStrLn "Got an error!" errMsg <- Lua.tostring luaState (-1) error $ "ERROR: " ++ (UTF8.toString errMsg)
586
true
true
0
13
182
213
99
114
null
null
TOSPIO/yi
src/library/Yi/Buffer/Misc.hs
gpl-2.0
-- | Execute a @BufferM@ value on a given buffer, using a dummy window. The new state of -- the buffer is discarded. runBufferDummyWindow :: FBuffer -> BufferM a -> a runBufferDummyWindow b = fst . runBuffer (dummyWindow $ bkey b) b
233
runBufferDummyWindow :: FBuffer -> BufferM a -> a runBufferDummyWindow b = fst . runBuffer (dummyWindow $ bkey b) b
115
runBufferDummyWindow b = fst . runBuffer (dummyWindow $ bkey b) b
65
true
true
0
9
42
46
23
23
null
null
jaspervdj/b-tree
src/Data/BTree/Array/Util.hs
bsd-3-clause
unsafePut :: Int -- ^ Size of the new array -> Int -- ^ Index -> a -- ^ Value -> Array a -- ^ Array to modify -> Array a -- ^ Modified array unsafePut s i x ar = A.run $ do mar <- A.new s A.unsafeCopy ar 0 mar 0 s A.unsafeWrite mar i x return mar
322
unsafePut :: Int -- ^ Size of the new array -> Int -- ^ Index -> a -- ^ Value -> Array a -- ^ Array to modify -> Array a unsafePut s i x ar = A.run $ do mar <- A.new s A.unsafeCopy ar 0 mar 0 s A.unsafeWrite mar i x return mar
301
unsafePut s i x ar = A.run $ do mar <- A.new s A.unsafeCopy ar 0 mar 0 s A.unsafeWrite mar i x return mar
122
true
true
0
10
135
99
47
52
null
null
maximilianhuber/innovation
lib/Game/Innovation/Types.hs
bsd-3-clause
getSplayState :: PlayStack -> SplayState getSplayState (PlayStack _ ss) = ss
76
getSplayState :: PlayStack -> SplayState getSplayState (PlayStack _ ss) = ss
76
getSplayState (PlayStack _ ss) = ss
35
false
true
0
7
10
26
13
13
null
null
uduki/hsQt
Qtc/Enums/Gui/QPaintEngine.hs
bsd-2-clause
fDirtyPen :: DirtyFlags fDirtyPen = ifDirtyFlags $ 1
54
fDirtyPen :: DirtyFlags fDirtyPen = ifDirtyFlags $ 1
54
fDirtyPen = ifDirtyFlags $ 1
30
false
true
0
6
9
22
9
13
null
null
ledyba/language-krkr
lib/Language/KAG/Parser.hs
gpl-3.0
kagLabel :: Parser Kag kagLabel = withSpan $ do void (try (string "*")) name <- many1 (satisfy (\t -> not(isKagSpace t || t == '\r' || t == '\n' || t == '|'))) desc <- P.optionMaybe $ do void (try(string "|")) desc <- many1 (satisfy (\t -> not(t == '\r' || t == '\n'))) return (T.pack desc) void newline return (KagLabel (T.pack name) desc)
362
kagLabel :: Parser Kag kagLabel = withSpan $ do void (try (string "*")) name <- many1 (satisfy (\t -> not(isKagSpace t || t == '\r' || t == '\n' || t == '|'))) desc <- P.optionMaybe $ do void (try(string "|")) desc <- many1 (satisfy (\t -> not(t == '\r' || t == '\n'))) return (T.pack desc) void newline return (KagLabel (T.pack name) desc)
362
kagLabel = withSpan $ do void (try (string "*")) name <- many1 (satisfy (\t -> not(isKagSpace t || t == '\r' || t == '\n' || t == '|'))) desc <- P.optionMaybe $ do void (try(string "|")) desc <- many1 (satisfy (\t -> not(t == '\r' || t == '\n'))) return (T.pack desc) void newline return (KagLabel (T.pack name) desc)
339
false
true
1
23
85
212
98
114
null
null
jswiergo/atomspace
opencog/haskell/OpenCog/AtomSpace/Api.hs
agpl-3.0
-- | 'remove' deletes an atom from the atomspace. -- Returns True in success or False if it couldn't locate the specified atom. remove :: Atom a -> AtomSpace Bool remove i = do asRef <- getAtomSpace m <- getWithHandle $ toRaw i case m of Just (_,handle) -> liftIO $ toBool <$> c_atomspace_remove asRef handle _ -> return False --------------------------------------------------------------------------------
446
remove :: Atom a -> AtomSpace Bool remove i = do asRef <- getAtomSpace m <- getWithHandle $ toRaw i case m of Just (_,handle) -> liftIO $ toBool <$> c_atomspace_remove asRef handle _ -> return False --------------------------------------------------------------------------------
318
remove i = do asRef <- getAtomSpace m <- getWithHandle $ toRaw i case m of Just (_,handle) -> liftIO $ toBool <$> c_atomspace_remove asRef handle _ -> return False --------------------------------------------------------------------------------
283
true
true
0
12
99
97
45
52
null
null
OlegTheCat/eight-x-eight
src/Render.hs
mit
cellCoordsToTerminalCoords :: Coords -> Coords cellCoordsToTerminalCoords (x, y) = (x * (cellWidth-1), y * (cellHeight-1))
122
cellCoordsToTerminalCoords :: Coords -> Coords cellCoordsToTerminalCoords (x, y) = (x * (cellWidth-1), y * (cellHeight-1))
122
cellCoordsToTerminalCoords (x, y) = (x * (cellWidth-1), y * (cellHeight-1))
75
false
true
0
8
14
52
29
23
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
luxiReqSubmitJobToDrainedQueue :: String luxiReqSubmitJobToDrainedQueue = "SubmitJobToDrainedQueue"
99
luxiReqSubmitJobToDrainedQueue :: String luxiReqSubmitJobToDrainedQueue = "SubmitJobToDrainedQueue"
99
luxiReqSubmitJobToDrainedQueue = "SubmitJobToDrainedQueue"
58
false
true
0
4
5
11
6
5
null
null
vito/atomo
src/Atomo/Helpers.hs
bsd-3-clause
-- | `findValue' for `Block' findBlock :: Value -> VM Value findBlock v | isBlock v = return v | otherwise = findValue "Block" isBlock v
144
findBlock :: Value -> VM Value findBlock v | isBlock v = return v | otherwise = findValue "Block" isBlock v
115
findBlock v | isBlock v = return v | otherwise = findValue "Block" isBlock v
84
true
true
0
8
33
56
24
32
null
null
Kyarigwo/ki-component-store
test/Kyarigwo/TutorialTest.hs
gpl-3.0
emptyStore :: CStore Contents emptyStore = empty
50
emptyStore :: CStore Contents emptyStore = empty
50
emptyStore = empty
20
false
true
0
6
8
20
8
12
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_NNCRONTAB_COMMENT :: Int wxSTC_NNCRONTAB_COMMENT = 1
58
wxSTC_NNCRONTAB_COMMENT :: Int wxSTC_NNCRONTAB_COMMENT = 1
58
wxSTC_NNCRONTAB_COMMENT = 1
27
false
true
0
6
5
18
7
11
null
null
gridaphobe/ghc
compiler/basicTypes/VarEnv.hs
bsd-3-clause
delBndrsL, delBndrsR :: RnEnv2 -> [Var] -> RnEnv2 delBndrsL rn@(RV2 { envL = env, in_scope = in_scope }) v = rn { envL = env `delVarEnvList` v, in_scope = in_scope `extendInScopeSetList` v }
192
delBndrsL, delBndrsR :: RnEnv2 -> [Var] -> RnEnv2 delBndrsL rn@(RV2 { envL = env, in_scope = in_scope }) v = rn { envL = env `delVarEnvList` v, in_scope = in_scope `extendInScopeSetList` v }
192
delBndrsL rn@(RV2 { envL = env, in_scope = in_scope }) v = rn { envL = env `delVarEnvList` v, in_scope = in_scope `extendInScopeSetList` v }
142
false
true
0
10
34
76
46
30
null
null
audetto/andsoft
haskell/Elves/Exp.hs
gpl-3.0
addD (LitFloat a) (LitFloat b) = LitFloat (a + b)
52
addD (LitFloat a) (LitFloat b) = LitFloat (a + b)
52
addD (LitFloat a) (LitFloat b) = LitFloat (a + b)
52
false
false
0
7
12
35
16
19
null
null
mumuki/mulang
src/Language/Mulang/Inspector/Logic.hs
gpl-3.0
usesUnificationOperator :: Inspection usesUnificationOperator = uses (named "=")
80
usesUnificationOperator :: Inspection usesUnificationOperator = uses (named "=")
80
usesUnificationOperator = uses (named "=")
42
false
true
0
7
7
20
10
10
null
null
michalrus/kornel
src/Kornel/LineHandler/Google.hs
apache-2.0
findUrls :: ByteString -> [Text] findUrls input = filter (not . ("http://webcache.googleusercontent.com/search" `isPrefixOf`)) urls where urls :: [Text] = mapMaybe (\case [_, a] -> Just (URI.decodeBSToText a) _ -> Nothing) urlMatches urlMatches :: [[ByteString]] = input =~ ("(?i)href=\"/url\\?q=([^&]+)" :: ByteString)
389
findUrls :: ByteString -> [Text] findUrls input = filter (not . ("http://webcache.googleusercontent.com/search" `isPrefixOf`)) urls where urls :: [Text] = mapMaybe (\case [_, a] -> Just (URI.decodeBSToText a) _ -> Nothing) urlMatches urlMatches :: [[ByteString]] = input =~ ("(?i)href=\"/url\\?q=([^&]+)" :: ByteString)
389
findUrls input = filter (not . ("http://webcache.googleusercontent.com/search" `isPrefixOf`)) urls where urls :: [Text] = mapMaybe (\case [_, a] -> Just (URI.decodeBSToText a) _ -> Nothing) urlMatches urlMatches :: [[ByteString]] = input =~ ("(?i)href=\"/url\\?q=([^&]+)" :: ByteString)
356
false
true
2
14
109
118
65
53
null
null
ocean0yohsuke/Simply-Typed-Lambda
src/Lambda/Compiler.hs
bsd-3-clause
toTerm (E.LIST g msp) = localMSPBy msp $ LIST |$> mapM toTerm g |* msp
70
toTerm (E.LIST g msp) = localMSPBy msp $ LIST |$> mapM toTerm g |* msp
70
toTerm (E.LIST g msp) = localMSPBy msp $ LIST |$> mapM toTerm g |* msp
70
false
false
0
8
14
40
18
22
null
null
asi1024/haling
src/Syntax.hs
mit
showTy _ Undefty = "undef"
30
showTy _ Undefty = "undef"
30
showTy _ Undefty = "undef"
30
false
false
1
5
8
13
5
8
null
null
rueshyna/gogol
gogol-useraccounts/gen/Network/Google/UserAccounts/Types/Product.hs
mpl-2.0
-- | [Output Only] Type of resource. Always clouduseraccounts#userList for -- lists of users. ulKind :: Lens' UserList Text ulKind = lens _ulKind (\ s a -> s{_ulKind = a})
171
ulKind :: Lens' UserList Text ulKind = lens _ulKind (\ s a -> s{_ulKind = a})
77
ulKind = lens _ulKind (\ s a -> s{_ulKind = a})
47
true
true
0
9
29
41
23
18
null
null
ckirkendall/hlisp
Functions.hs
gpl-2.0
mergeMacroArgs ((Identifier x):xs) (y:ys) fnEnv = mergeMacroArgs xs ys (insert x y fnEnv)
89
mergeMacroArgs ((Identifier x):xs) (y:ys) fnEnv = mergeMacroArgs xs ys (insert x y fnEnv)
89
mergeMacroArgs ((Identifier x):xs) (y:ys) fnEnv = mergeMacroArgs xs ys (insert x y fnEnv)
89
false
false
0
9
12
50
25
25
null
null
isomorphism/hackage2
Distribution/Server/Features/Users.hs
bsd-3-clause
initGroupIndex :: MonadIO m => Cache.Cache GroupIndex -> UserList -> String -> GroupDescription -> m () initGroupIndex users ulist uri desc = Cache.modifyCache users $ adjustGroupIndex (IntMap.unionWith Set.union (IntMap.fromList . map mkEntry $ Group.enumerate ulist)) (Map.insert uri desc) where mkEntry (UserId uid) = (uid, Set.singleton uri)
367
initGroupIndex :: MonadIO m => Cache.Cache GroupIndex -> UserList -> String -> GroupDescription -> m () initGroupIndex users ulist uri desc = Cache.modifyCache users $ adjustGroupIndex (IntMap.unionWith Set.union (IntMap.fromList . map mkEntry $ Group.enumerate ulist)) (Map.insert uri desc) where mkEntry (UserId uid) = (uid, Set.singleton uri)
367
initGroupIndex users ulist uri desc = Cache.modifyCache users $ adjustGroupIndex (IntMap.unionWith Set.union (IntMap.fromList . map mkEntry $ Group.enumerate ulist)) (Map.insert uri desc) where mkEntry (UserId uid) = (uid, Set.singleton uri)
263
false
true
0
12
67
137
66
71
null
null
reuk/rayverb
src/Scene.hs
gpl-2.0
setGain :: Flt -> IOUArray Int Flt -> IO () setGain gain arr = do (mini, maxi) <- getBounds arr worker mini maxi where worker ind maxi | ind > maxi = return () | otherwise = do val <- readArray arr ind writeArray arr ind (val * gain) worker (ind + 1) maxi
385
setGain :: Flt -> IOUArray Int Flt -> IO () setGain gain arr = do (mini, maxi) <- getBounds arr worker mini maxi where worker ind maxi | ind > maxi = return () | otherwise = do val <- readArray arr ind writeArray arr ind (val * gain) worker (ind + 1) maxi
385
setGain gain arr = do (mini, maxi) <- getBounds arr worker mini maxi where worker ind maxi | ind > maxi = return () | otherwise = do val <- readArray arr ind writeArray arr ind (val * gain) worker (ind + 1) maxi
341
false
true
0
12
183
138
63
75
null
null