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
roberth/uu-helium
test/typeClassesParse/CorrectEmptyWhere.hs
gpl-3.0
main2 = 2 where
15
main2 = 2 where
15
main2 = 2 where
15
false
false
0
4
3
7
4
3
null
null
Crazycolorz5/Haskell-Code
fizzBuzz_tasks.hs
unlicense
c = a >>= \x-> map ($x) $ map (^) b
35
c = a >>= \x-> map ($x) $ map (^) b
35
c = a >>= \x-> map ($x) $ map (^) b
35
false
false
1
10
10
36
17
19
null
null
Mathnerd314/lamdu
test/InferCombinators.hs
gpl-3.0
listOf :: InferResults t -> InferResults t listOf = (getDef "List" $$)
70
listOf :: InferResults t -> InferResults t listOf = (getDef "List" $$)
70
listOf = (getDef "List" $$)
27
false
true
0
6
11
28
14
14
null
null
meiersi/scyther-proof
src/Scyther/Message.hs
gpl-3.0
normMsg m@(MMVar _) = m
33
normMsg m@(MMVar _) = m
33
normMsg m@(MMVar _) = m
33
false
false
0
8
14
18
9
9
null
null
sdiehl/picologic
src/Picologic/AST.hs
mit
eval vs (Bottom) = False
24
eval vs (Bottom) = False
24
eval vs (Bottom) = False
24
false
false
0
6
4
14
7
7
null
null
Paow/encore
src/parser/Parser/Parser.hs
bsd-3-clause
mode :: EncParser (Type -> Type) mode = (reserved "linear" >> return makeLinear) <|> (reserved "local" >> return makeLocal) <|> (reserved "active" >> return makeActive) <|> (reserved "shared" >> return makeShared) <|> (reserved "sharable" >> return makeSharable) <|> (reserved "unsafe" >> return makeUnsafe) <|> (reserved "read" >> return makeRead) <|> (reserved "subord" >> return makeSubordinate) <?> "mode"
514
mode :: EncParser (Type -> Type) mode = (reserved "linear" >> return makeLinear) <|> (reserved "local" >> return makeLocal) <|> (reserved "active" >> return makeActive) <|> (reserved "shared" >> return makeShared) <|> (reserved "sharable" >> return makeSharable) <|> (reserved "unsafe" >> return makeUnsafe) <|> (reserved "read" >> return makeRead) <|> (reserved "subord" >> return makeSubordinate) <?> "mode"
514
mode = (reserved "linear" >> return makeLinear) <|> (reserved "local" >> return makeLocal) <|> (reserved "active" >> return makeActive) <|> (reserved "shared" >> return makeShared) <|> (reserved "sharable" >> return makeSharable) <|> (reserved "unsafe" >> return makeUnsafe) <|> (reserved "read" >> return makeRead) <|> (reserved "subord" >> return makeSubordinate) <?> "mode"
481
false
true
0
15
161
157
75
82
null
null
sol/wai
wai/Network/Wai.hs
mit
responseToStream (ResponseRaw _ res) = responseToStream res
59
responseToStream (ResponseRaw _ res) = responseToStream res
59
responseToStream (ResponseRaw _ res) = responseToStream res
59
false
false
0
7
6
20
9
11
null
null
PaulGustafson/stringnet
Stringnet.hs
mit
initialPerimeter RightDisk = [Reverse $ IE RightLoop, IE RightLeg, Reverse $ IE RightLeg]
92
initialPerimeter RightDisk = [Reverse $ IE RightLoop, IE RightLeg, Reverse $ IE RightLeg]
92
initialPerimeter RightDisk = [Reverse $ IE RightLoop, IE RightLeg, Reverse $ IE RightLeg]
92
false
false
1
8
15
39
17
22
null
null
ocean0yohsuke/Simply-Typed-Lambda
Start/Lib/Prelude.hs
bsd-3-clause
reverse :: [a] -> [a] reverse xs = foldl (\a x -> x : a) [] xs
62
reverse :: [a] -> [a] reverse xs = foldl (\a x -> x : a) [] xs
62
reverse xs = foldl (\a x -> x : a) [] xs
40
false
true
0
8
16
50
26
24
null
null
mauriciofierrom/cis194-homework
homework05/src/Calc.hs
mit
eval (ExprT.Lit x) = x
53
eval (ExprT.Lit x) = x
53
eval (ExprT.Lit x) = x
53
false
false
0
8
35
17
8
9
null
null
literate-unitb/literate-unitb
src/Document/Tests/GarbageCollector.hs
mit
case7 :: IO String case7 = proof_obligation_stripped path0 "m1/THM/thm0/main goal/assertion/lmm0/step 3" 1
106
case7 :: IO String case7 = proof_obligation_stripped path0 "m1/THM/thm0/main goal/assertion/lmm0/step 3" 1
106
case7 = proof_obligation_stripped path0 "m1/THM/thm0/main goal/assertion/lmm0/step 3" 1
87
false
true
1
5
11
24
10
14
null
null
kaoskorobase/mescaline
resources/hugs/packages/base/Data/Map.hs
gpl-3.0
fromDistinctAscList :: [(k,a)] -> Map k a fromDistinctAscList xs = build const (length xs) xs where -- 1) use continutations so that we use heap space instead of stack space. -- 2) special case for n==5 to build bushier trees. build c 0 xs = c Tip xs build c 5 xs = case xs of ((k1,x1):(k2,x2):(k3,x3):(k4,x4):(k5,x5):xx) -> c (bin k4 x4 (bin k2 x2 (singleton k1 x1) (singleton k3 x3)) (singleton k5 x5)) xx build c n xs = seq nr $ build (buildR nr c) nl xs where nl = n `div` 2 nr = n - nl - 1 buildR n c l ((k,x):ys) = build (buildB l k x c) n ys buildB l k x c r zs = c (bin k x l r) zs {-------------------------------------------------------------------- Utility functions that return sub-ranges of the original tree. Some functions take a comparison function as argument to allow comparisons against infinite values. A function [cmplo k] should be read as [compare lo k]. [trim cmplo cmphi t] A tree that is either empty or where [cmplo k == LT] and [cmphi k == GT] for the key [k] of the root. [filterGt cmp t] A tree where for all keys [k]. [cmp k == LT] [filterLt cmp t] A tree where for all keys [k]. [cmp k == GT] [split k t] Returns two trees [l] and [r] where all keys in [l] are <[k] and all keys in [r] are >[k]. [splitLookup k t] Just like [split] but also returns whether [k] was found in the tree. --------------------------------------------------------------------} {-------------------------------------------------------------------- [trim lo hi t] trims away all subtrees that surely contain no values between the range [lo] to [hi]. The returned tree is either empty or the key of the root is between @lo@ and @hi@. --------------------------------------------------------------------}
2,017
fromDistinctAscList :: [(k,a)] -> Map k a fromDistinctAscList xs = build const (length xs) xs where -- 1) use continutations so that we use heap space instead of stack space. -- 2) special case for n==5 to build bushier trees. build c 0 xs = c Tip xs build c 5 xs = case xs of ((k1,x1):(k2,x2):(k3,x3):(k4,x4):(k5,x5):xx) -> c (bin k4 x4 (bin k2 x2 (singleton k1 x1) (singleton k3 x3)) (singleton k5 x5)) xx build c n xs = seq nr $ build (buildR nr c) nl xs where nl = n `div` 2 nr = n - nl - 1 buildR n c l ((k,x):ys) = build (buildB l k x c) n ys buildB l k x c r zs = c (bin k x l r) zs {-------------------------------------------------------------------- Utility functions that return sub-ranges of the original tree. Some functions take a comparison function as argument to allow comparisons against infinite values. A function [cmplo k] should be read as [compare lo k]. [trim cmplo cmphi t] A tree that is either empty or where [cmplo k == LT] and [cmphi k == GT] for the key [k] of the root. [filterGt cmp t] A tree where for all keys [k]. [cmp k == LT] [filterLt cmp t] A tree where for all keys [k]. [cmp k == GT] [split k t] Returns two trees [l] and [r] where all keys in [l] are <[k] and all keys in [r] are >[k]. [splitLookup k t] Just like [split] but also returns whether [k] was found in the tree. --------------------------------------------------------------------} {-------------------------------------------------------------------- [trim lo hi t] trims away all subtrees that surely contain no values between the range [lo] to [hi]. The returned tree is either empty or the key of the root is between @lo@ and @hi@. --------------------------------------------------------------------}
2,016
fromDistinctAscList xs = build const (length xs) xs where -- 1) use continutations so that we use heap space instead of stack space. -- 2) special case for n==5 to build bushier trees. build c 0 xs = c Tip xs build c 5 xs = case xs of ((k1,x1):(k2,x2):(k3,x3):(k4,x4):(k5,x5):xx) -> c (bin k4 x4 (bin k2 x2 (singleton k1 x1) (singleton k3 x3)) (singleton k5 x5)) xx build c n xs = seq nr $ build (buildR nr c) nl xs where nl = n `div` 2 nr = n - nl - 1 buildR n c l ((k,x):ys) = build (buildB l k x c) n ys buildB l k x c r zs = c (bin k x l r) zs {-------------------------------------------------------------------- Utility functions that return sub-ranges of the original tree. Some functions take a comparison function as argument to allow comparisons against infinite values. A function [cmplo k] should be read as [compare lo k]. [trim cmplo cmphi t] A tree that is either empty or where [cmplo k == LT] and [cmphi k == GT] for the key [k] of the root. [filterGt cmp t] A tree where for all keys [k]. [cmp k == LT] [filterLt cmp t] A tree where for all keys [k]. [cmp k == GT] [split k t] Returns two trees [l] and [r] where all keys in [l] are <[k] and all keys in [r] are >[k]. [splitLookup k t] Just like [split] but also returns whether [k] was found in the tree. --------------------------------------------------------------------} {-------------------------------------------------------------------- [trim lo hi t] trims away all subtrees that surely contain no values between the range [lo] to [hi]. The returned tree is either empty or the key of the root is between @lo@ and @hi@. --------------------------------------------------------------------}
1,974
false
true
0
14
607
338
177
161
null
null
crockeo/lips
src/lib/Language/Lips/Base.hs
mit
get (LString xs:LNumber index:[]) = liftM (LString . return) $ getRaw xs $ floor index
86
get (LString xs:LNumber index:[]) = liftM (LString . return) $ getRaw xs $ floor index
86
get (LString xs:LNumber index:[]) = liftM (LString . return) $ getRaw xs $ floor index
86
false
false
0
9
14
53
24
29
null
null
poxu/pandoc
src/Text/Pandoc/Readers/Docx.hs
gpl-2.0
evalDocxContext :: DocxContext a -> DEnv -> DState -> Either PandocError a evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx
162
evalDocxContext :: DocxContext a -> DEnv -> DState -> Either PandocError a evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx
162
evalDocxContext ctx env st = flip evalState st . flip runReaderT env . runExceptT $ ctx
87
false
true
0
8
27
60
28
32
null
null
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/UpdateRdsDbInstance.hs
mpl-2.0
-- | The database password. urdiDbPassword :: Lens' UpdateRdsDbInstance (Maybe Text) urdiDbPassword = lens _urdiDbPassword (\s a -> s { _urdiDbPassword = a })
158
urdiDbPassword :: Lens' UpdateRdsDbInstance (Maybe Text) urdiDbPassword = lens _urdiDbPassword (\s a -> s { _urdiDbPassword = a })
130
urdiDbPassword = lens _urdiDbPassword (\s a -> s { _urdiDbPassword = a })
73
true
true
0
9
23
46
25
21
null
null
rootzlevel/device-manager
src/Notifications.hs
bsd-3-clause
mkBody :: Device -> Text mkBody d = if devName d == "" then devFile d else devName d <> " (" <> devFile d <> ")"
123
mkBody :: Device -> Text mkBody d = if devName d == "" then devFile d else devName d <> " (" <> devFile d <> ")"
123
mkBody d = if devName d == "" then devFile d else devName d <> " (" <> devFile d <> ")"
98
false
true
0
9
37
60
27
33
null
null
ksaveljev/hake-2
src/Constants.hs
bsd-3-clause
-- [string] to put in center of the screen svcDownload = 16 :: Int
78
svcDownload = 16 :: Int
34
svcDownload = 16 :: Int
34
true
false
0
4
25
10
6
4
null
null
phonohawk/HsOpenSSL
OpenSSL/BIO.hs
cc0-1.0
-- |@'bioWriteBS' bio bs@ writes @bs@ to @bio@. bioWriteBS :: BIO -> B.ByteString -> IO () bioWriteBS bio bs = withBioPtr bio $ \ bioPtr -> unsafeUseAsCStringLen bs $ \ (buf, len) -> _write bioPtr buf (fromIntegral len) >>= interpret where interpret :: CInt -> IO () interpret n | n == fromIntegral (B.length bs) = return () | n == -1 = bioWriteBS bio bs -- full retry | n < -1 = raiseOpenSSLError | otherwise = bioWriteBS bio (B.drop (fromIntegral n) bs) -- partial retry -- |@'bioWriteLBS' bio lbs@ lazily writes entire @lbs@ to @bio@. The -- string doesn't necessarily have to be finite.
700
bioWriteBS :: BIO -> B.ByteString -> IO () bioWriteBS bio bs = withBioPtr bio $ \ bioPtr -> unsafeUseAsCStringLen bs $ \ (buf, len) -> _write bioPtr buf (fromIntegral len) >>= interpret where interpret :: CInt -> IO () interpret n | n == fromIntegral (B.length bs) = return () | n == -1 = bioWriteBS bio bs -- full retry | n < -1 = raiseOpenSSLError | otherwise = bioWriteBS bio (B.drop (fromIntegral n) bs) -- partial retry -- |@'bioWriteLBS' bio lbs@ lazily writes entire @lbs@ to @bio@. The -- string doesn't necessarily have to be finite.
652
bioWriteBS bio bs = withBioPtr bio $ \ bioPtr -> unsafeUseAsCStringLen bs $ \ (buf, len) -> _write bioPtr buf (fromIntegral len) >>= interpret where interpret :: CInt -> IO () interpret n | n == fromIntegral (B.length bs) = return () | n == -1 = bioWriteBS bio bs -- full retry | n < -1 = raiseOpenSSLError | otherwise = bioWriteBS bio (B.drop (fromIntegral n) bs) -- partial retry -- |@'bioWriteLBS' bio lbs@ lazily writes entire @lbs@ to @bio@. The -- string doesn't necessarily have to be finite.
609
true
true
3
12
215
202
98
104
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateRouteTable.hs
mpl-2.0
crtDryRun :: Lens' CreateRouteTable (Maybe Bool) crtDryRun = lens _crtDryRun (\s a -> s { _crtDryRun = a })
107
crtDryRun :: Lens' CreateRouteTable (Maybe Bool) crtDryRun = lens _crtDryRun (\s a -> s { _crtDryRun = a })
107
crtDryRun = lens _crtDryRun (\s a -> s { _crtDryRun = a })
58
false
true
1
9
18
50
24
26
null
null
ahushh/Monaba
monaba/src/Handler/Captcha.hs
mit
checkCaptcha :: Maybe Text -> Handler () -> Handler () checkCaptcha mCaptcha wrongCaptchaRedirect = do mCaptchaValue <- lookupSession "captchaValue" mCaptchaId <- lookupSession "captchaId" AppSettings{..} <- appSettings <$> getYesod case mCaptchaId of Just cId -> do let path = captchaFilePath appStaticDir (unpack cId) ++ captchaExt whenM (liftIO $ doesFileExist path) $ liftIO $ removeFile path when ((T.toLower <$> mCaptchaValue) /= (T.toLower <$> mCaptcha)) wrongCaptchaRedirect _ -> wrongCaptchaRedirect
555
checkCaptcha :: Maybe Text -> Handler () -> Handler () checkCaptcha mCaptcha wrongCaptchaRedirect = do mCaptchaValue <- lookupSession "captchaValue" mCaptchaId <- lookupSession "captchaId" AppSettings{..} <- appSettings <$> getYesod case mCaptchaId of Just cId -> do let path = captchaFilePath appStaticDir (unpack cId) ++ captchaExt whenM (liftIO $ doesFileExist path) $ liftIO $ removeFile path when ((T.toLower <$> mCaptchaValue) /= (T.toLower <$> mCaptcha)) wrongCaptchaRedirect _ -> wrongCaptchaRedirect
555
checkCaptcha mCaptcha wrongCaptchaRedirect = do mCaptchaValue <- lookupSession "captchaValue" mCaptchaId <- lookupSession "captchaId" AppSettings{..} <- appSettings <$> getYesod case mCaptchaId of Just cId -> do let path = captchaFilePath appStaticDir (unpack cId) ++ captchaExt whenM (liftIO $ doesFileExist path) $ liftIO $ removeFile path when ((T.toLower <$> mCaptchaValue) /= (T.toLower <$> mCaptcha)) wrongCaptchaRedirect _ -> wrongCaptchaRedirect
500
false
true
0
18
112
180
83
97
null
null
DanielWaterworth/Idris-dev
src/IRTS/CodegenJava.hs
bsd-3-clause
mkConstant c@(StrType ) = ClassLit (Just $ stringType)
56
mkConstant c@(StrType ) = ClassLit (Just $ stringType)
56
mkConstant c@(StrType ) = ClassLit (Just $ stringType)
56
false
false
0
7
9
25
13
12
null
null
ezrosent/latexnodes
Parser.hs
mit
{-curly :: Parser String-} {-curly = parseDelim '{' '}'-} bt :: String -> Parser a -> Parser a bt b s = string b *> s <* string b
130
bt :: String -> Parser a -> Parser a bt b s = string b *> s <* string b
71
bt b s = string b *> s <* string b
34
true
true
0
7
29
50
23
27
null
null
cpdurham/GlossRayJulia
JuliaAcc.hs
gpl-2.0
is = 50
7
is = 50
7
is = 50
7
false
false
1
5
2
10
3
7
null
null
CindyLinz/Haskell.js
trans/src/Desugar/List.hs
mit
deListQualStmt (GroupUsing l exp) = GroupUsing (id l) (deListExp exp)
69
deListQualStmt (GroupUsing l exp) = GroupUsing (id l) (deListExp exp)
69
deListQualStmt (GroupUsing l exp) = GroupUsing (id l) (deListExp exp)
69
false
false
0
7
9
34
16
18
null
null
jwaldmann/satchmo-solver
src/Satchmo/Parse.hs
gpl-3.0
pline :: A.Parser [Int] pline = A.many1 $ ( A.signed A.decimal <* A.many' (A.satisfy A.isSpace ) )
136
pline :: A.Parser [Int] pline = A.many1 $ ( A.signed A.decimal <* A.many' (A.satisfy A.isSpace ) )
136
pline = A.many1 $ ( A.signed A.decimal <* A.many' (A.satisfy A.isSpace ) )
112
false
true
0
11
54
54
27
27
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/elem_1.hs
mit
foldr f z (Cons x xs) = f x (foldr f z xs)
42
foldr f z (Cons x xs) = f x (foldr f z xs)
42
foldr f z (Cons x xs) = f x (foldr f z xs)
42
false
false
0
7
12
36
17
19
null
null
laurencer/confluence-sync
vendor/haxr/Network/XmlRpc/Pretty.hs
bsd-3-clause
publicid :: PublicID -> MBuilder publicid (PUBLICID p) = "PUBLICID" <+> pubidliteral p
95
publicid :: PublicID -> MBuilder publicid (PUBLICID p) = "PUBLICID" <+> pubidliteral p
95
publicid (PUBLICID p) = "PUBLICID" <+> pubidliteral p
62
false
true
0
7
21
31
15
16
null
null
beni55/pandoc
src/pandoc.hs
gpl-2.0
copyrightMessage :: String copyrightMessage = "\nCopyright (C) 2006-2012 John MacFarlane\n" ++ "Web: http://johnmacfarlane.net/pandoc\n" ++ "This is free software; see the source for copying conditions. There is no\n" ++ "warranty, not even for merchantability or fitness for a particular purpose."
360
copyrightMessage :: String copyrightMessage = "\nCopyright (C) 2006-2012 John MacFarlane\n" ++ "Web: http://johnmacfarlane.net/pandoc\n" ++ "This is free software; see the source for copying conditions. There is no\n" ++ "warranty, not even for merchantability or fitness for a particular purpose."
360
copyrightMessage = "\nCopyright (C) 2006-2012 John MacFarlane\n" ++ "Web: http://johnmacfarlane.net/pandoc\n" ++ "This is free software; see the source for copying conditions. There is no\n" ++ "warranty, not even for merchantability or fitness for a particular purpose."
333
false
true
0
7
100
30
13
17
null
null
DanielWaterworth/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
sParentN :: Name -> String -> SpecialName sParentN n s = ParentN n (T.pack s)
77
sParentN :: Name -> String -> SpecialName sParentN n s = ParentN n (T.pack s)
77
sParentN n s = ParentN n (T.pack s)
35
false
true
0
8
14
37
18
19
null
null
5outh/Haskell-Graphics-Projects
Project4/Algorithms.hs
mit
applyMatrix3d :: (Num a, RealFrac a) => Point3d a -> Matrix a -> Maybe (Point3d a) applyMatrix3d pt m = let converted = m <> (toMatrix3d pt) in case converted of Just m' -> let [[x], [y], [z], _] = mdata m' in Just (x, y, z) _ -> Nothing
262
applyMatrix3d :: (Num a, RealFrac a) => Point3d a -> Matrix a -> Maybe (Point3d a) applyMatrix3d pt m = let converted = m <> (toMatrix3d pt) in case converted of Just m' -> let [[x], [y], [z], _] = mdata m' in Just (x, y, z) _ -> Nothing
262
applyMatrix3d pt m = let converted = m <> (toMatrix3d pt) in case converted of Just m' -> let [[x], [y], [z], _] = mdata m' in Just (x, y, z) _ -> Nothing
179
false
true
0
15
74
147
73
74
null
null
nevrenato/Hets_Fork
CSL/Keywords.hs
gpl-2.0
-- infix operators sym_assignS :: String sym_assignS = ":="
59
sym_assignS :: String sym_assignS = ":="
40
sym_assignS = ":="
18
true
true
0
6
8
19
8
11
null
null
BeautifulDestinations/caret
lib/Caret/BFGS.hs
mit
-- Main BFGS step routine. This is a more or less verbatim -- translation of the description in Section 10.7 of Numerical Recipes -- in C, 2nd ed. -- bfgsStepWith :: BFGSOpts -> Fn -> GradFn -> BFGS -> Either String (Bool, BFGS) bfgsStepWith (BFGSOpts ptol gtol _) f df (BFGS p fp g xi h stpmax) = case lineSearch f p fp g xi stpmax of Left err -> Left err Right (pn, fpn) -> if hasnan gn then Left $ nanMsg pn Nothing (Just gn) else if cvg then Right (True, BFGS pn fpn gn xi h stpmax) else Right (False, BFGS pn fpn gn xin hn stpmax) where gn = df pn ; dp = pn - p ; dg = gn - g ; hdg = h #> dg dpdg = dp `dot` dg ; dghdg = dg `dot` hdg hn = h + ((dpdg + dghdg) / dpdg^2) `scale` (dp `outer` dp) - (1/dpdg) `scale` (h <> (dg `outer` dp) + (dp `outer` dg) <> h) xin = -hn #> gn cvg = maxabsratio dp p < ptol || maxabsratio' (fpn `max` 1) gn p < gtol -- Generate error messages for NaN production in function and gradient -- calculations. --
1,065
bfgsStepWith :: BFGSOpts -> Fn -> GradFn -> BFGS -> Either String (Bool, BFGS) bfgsStepWith (BFGSOpts ptol gtol _) f df (BFGS p fp g xi h stpmax) = case lineSearch f p fp g xi stpmax of Left err -> Left err Right (pn, fpn) -> if hasnan gn then Left $ nanMsg pn Nothing (Just gn) else if cvg then Right (True, BFGS pn fpn gn xi h stpmax) else Right (False, BFGS pn fpn gn xin hn stpmax) where gn = df pn ; dp = pn - p ; dg = gn - g ; hdg = h #> dg dpdg = dp `dot` dg ; dghdg = dg `dot` hdg hn = h + ((dpdg + dghdg) / dpdg^2) `scale` (dp `outer` dp) - (1/dpdg) `scale` (h <> (dg `outer` dp) + (dp `outer` dg) <> h) xin = -hn #> gn cvg = maxabsratio dp p < ptol || maxabsratio' (fpn `max` 1) gn p < gtol -- Generate error messages for NaN production in function and gradient -- calculations. --
914
bfgsStepWith (BFGSOpts ptol gtol _) f df (BFGS p fp g xi h stpmax) = case lineSearch f p fp g xi stpmax of Left err -> Left err Right (pn, fpn) -> if hasnan gn then Left $ nanMsg pn Nothing (Just gn) else if cvg then Right (True, BFGS pn fpn gn xi h stpmax) else Right (False, BFGS pn fpn gn xin hn stpmax) where gn = df pn ; dp = pn - p ; dg = gn - g ; hdg = h #> dg dpdg = dp `dot` dg ; dghdg = dg `dot` hdg hn = h + ((dpdg + dghdg) / dpdg^2) `scale` (dp `outer` dp) - (1/dpdg) `scale` (h <> (dg `outer` dp) + (dp `outer` dg) <> h) xin = -hn #> gn cvg = maxabsratio dp p < ptol || maxabsratio' (fpn `max` 1) gn p < gtol -- Generate error messages for NaN production in function and gradient -- calculations. --
835
true
true
0
18
329
408
225
183
null
null
apyrgio/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
hvVncBindAddress :: String hvVncBindAddress = "vnc_bind_address"
64
hvVncBindAddress :: String hvVncBindAddress = "vnc_bind_address"
64
hvVncBindAddress = "vnc_bind_address"
37
false
true
0
4
5
11
6
5
null
null
NCrashed/servant-auth-token
servant-auth-token-rocksdb/src/Servant/Server/Auth/Token/RocksDB.hs
bsd-3-clause
-- | Helper to lift low-level RocksDB queries to backend monad liftEnv :: Monad m => (RocksDBEnv -> ResourceT m a) -> RocksDBBackendT m a liftEnv f = do e <- getEnv RocksDBBackendT . lift . lift $ f e
204
liftEnv :: Monad m => (RocksDBEnv -> ResourceT m a) -> RocksDBBackendT m a liftEnv f = do e <- getEnv RocksDBBackendT . lift . lift $ f e
141
liftEnv f = do e <- getEnv RocksDBBackendT . lift . lift $ f e
66
true
true
0
9
43
68
32
36
null
null
josercruz01/hsoptions
src/System/Console/HsOptions/ParserCore.hs
apache-2.0
-- | Parses the flags from the input stream of characters to a stream of -- tokens. -- -- Based on the syntax of the @flags input@ this parser should not fail. -- If there is any kind of errors while parsing an exception is thrown. -- -- Arguments: -- -- *@default_operations@: a map from flag name to default operation. -- -- *@input@: the input stream of characters. -- -- Returns: -- -- * A stream of tokens. -- -- Throws: -- -- * An exception if some error with the parser occurs. parseInput :: DefaultOp -> String -> [Token] parseInput defaultOp input = case parseInput' defaultOp input of Left err -> error (show err) Right result -> result
728
parseInput :: DefaultOp -> String -> [Token] parseInput defaultOp input = case parseInput' defaultOp input of Left err -> error (show err) Right result -> result
231
parseInput defaultOp input = case parseInput' defaultOp input of Left err -> error (show err) Right result -> result
186
true
true
0
10
200
87
50
37
null
null
mindriot101/pandoc
src/Text/Pandoc/Writers/Man.hs
gpl-2.0
-- | Escape special characters for Man. escapeString :: String -> String escapeString = escapeStringUsing manEscapes
116
escapeString :: String -> String escapeString = escapeStringUsing manEscapes
76
escapeString = escapeStringUsing manEscapes
43
true
true
0
5
15
19
10
9
null
null
blamario/grampa
deep-transformations/src/Transformation/Shallow/TH.hs
bsd-2-clause
reifyConstructors :: Name -> Q (TypeQ, [Con]) reifyConstructors ty = do (TyConI tyCon) <- reify ty (tyConName, tyVars, _kind, cs) <- case tyCon of DataD _ nm tyVars kind cs _ -> return (nm, tyVars, kind, cs) NewtypeD _ nm tyVars kind c _ -> return (nm, tyVars, kind, [c]) _ -> fail "deriveApply: tyCon may not be a type synonym." #if MIN_VERSION_template_haskell(2,17,0) let (KindedTV tyVar _ (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars instanceType = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars) apply t (PlainTV name _) = appT t (varT name) apply t (KindedTV name _ _) = appT t (varT name) #else let (KindedTV tyVar (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars instanceType = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars) apply t (PlainTV name) = appT t (varT name) apply t (KindedTV name _) = appT t (varT name) #endif putQ (Deriving tyConName tyVar) return (instanceType, cs)
1,048
reifyConstructors :: Name -> Q (TypeQ, [Con]) reifyConstructors ty = do (TyConI tyCon) <- reify ty (tyConName, tyVars, _kind, cs) <- case tyCon of DataD _ nm tyVars kind cs _ -> return (nm, tyVars, kind, cs) NewtypeD _ nm tyVars kind c _ -> return (nm, tyVars, kind, [c]) _ -> fail "deriveApply: tyCon may not be a type synonym." #if MIN_VERSION_template_haskell(2,17,0) let (KindedTV tyVar _ (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars instanceType = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars) apply t (PlainTV name _) = appT t (varT name) apply t (KindedTV name _ _) = appT t (varT name) #else let (KindedTV tyVar (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars instanceType = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars) apply t (PlainTV name) = appT t (varT name) apply t (KindedTV name _) = appT t (varT name) #endif putQ (Deriving tyConName tyVar) return (instanceType, cs)
1,048
reifyConstructors ty = do (TyConI tyCon) <- reify ty (tyConName, tyVars, _kind, cs) <- case tyCon of DataD _ nm tyVars kind cs _ -> return (nm, tyVars, kind, cs) NewtypeD _ nm tyVars kind c _ -> return (nm, tyVars, kind, [c]) _ -> fail "deriveApply: tyCon may not be a type synonym." #if MIN_VERSION_template_haskell(2,17,0) let (KindedTV tyVar _ (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars instanceType = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars) apply t (PlainTV name _) = appT t (varT name) apply t (KindedTV name _ _) = appT t (varT name) #else let (KindedTV tyVar (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars instanceType = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars) apply t (PlainTV name) = appT t (varT name) apply t (KindedTV name _) = appT t (varT name) #endif putQ (Deriving tyConName tyVar) return (instanceType, cs)
1,002
false
true
0
16
273
316
159
157
null
null
dimara/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | Path generating random UUID randomUuidFile :: String randomUuidFile = ConstantUtils.randomUuidFile
103
randomUuidFile :: String randomUuidFile = ConstantUtils.randomUuidFile
70
randomUuidFile = ConstantUtils.randomUuidFile
45
true
true
0
6
11
21
9
12
null
null
rahulmutt/ghcvm
compiler/Eta/Prelude/PrimOp.hs
bsd-3-clause
primOpCodeSize JChar2WordOp = 0
31
primOpCodeSize JChar2WordOp = 0
31
primOpCodeSize JChar2WordOp = 0
31
false
false
0
5
3
9
4
5
null
null
fmthoma/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
cselRCoercionTyConKey = mkPreludeTyConUnique 101
66
cselRCoercionTyConKey = mkPreludeTyConUnique 101
66
cselRCoercionTyConKey = mkPreludeTyConUnique 101
66
false
false
0
5
21
9
4
5
null
null
sixears/fluffy
src/Fluffy/Language/TH/Record.hs
mit
mkRLensT_ :: String -> String -> String -> Q [Dec] mkRLensT_ name = mkRLensT (mkName name) (mkName ('_' : name))
112
mkRLensT_ :: String -> String -> String -> Q [Dec] mkRLensT_ name = mkRLensT (mkName name) (mkName ('_' : name))
112
mkRLensT_ name = mkRLensT (mkName name) (mkName ('_' : name))
61
false
true
0
9
19
56
28
28
null
null
divipp/turing-music
Turing.hs
bsd-3-clause
showTape :: Int -> Tape -> String showTape i (Tape p l r) | n > 0 = replicate n ' ' ++ l' | otherwise = drop (-n) l' where n = i - length l + p l' = map tr $ reverse l ++ r tr x | x == blankSymbol = ' ' tr x = x --------------------
260
showTape :: Int -> Tape -> String showTape i (Tape p l r) | n > 0 = replicate n ' ' ++ l' | otherwise = drop (-n) l' where n = i - length l + p l' = map tr $ reverse l ++ r tr x | x == blankSymbol = ' ' tr x = x --------------------
260
showTape i (Tape p l r) | n > 0 = replicate n ' ' ++ l' | otherwise = drop (-n) l' where n = i - length l + p l' = map tr $ reverse l ++ r tr x | x == blankSymbol = ' ' tr x = x --------------------
226
false
true
4
10
89
138
65
73
null
null
ChristopherKing42/tagsoup
Text/HTML/Download.hs
bsd-3-clause
-- | This function opens a URL on the internet. -- Any @http:\/\/@ prefix is ignored. -- -- > openURL "www.haskell.org/haskellwiki/Haskell" -- -- Known Limitations: -- -- * Only HTTP on port 80 -- -- * Outputs the HTTP Headers as well -- -- * Does not work with all servers -- -- It is hoped that a more reliable version of this function will be -- placed in a new HTTP library at some point! openURL :: String -> IO String openURL url | "http://" `isPrefixOf` url = openURL (drop 7 url)
489
openURL :: String -> IO String openURL url | "http://" `isPrefixOf` url = openURL (drop 7 url)
94
openURL url | "http://" `isPrefixOf` url = openURL (drop 7 url)
63
true
true
0
8
94
63
37
26
null
null
bmillwood/stepeval
testsuite/Test.hs
bsd-3-clause
testMain :: [String] -> IO () testMain args = fmap (const ()) . runMaybeT $ do (verbose, tests) <- (,) <$> parseOpts <*> getTests files liftIO $ runTests verbose tests where (opts, files) = partition ((== "-") . take 1) args parseOpts = case opts of [] -> return False ["-v"] -> return True ["--verbose"] -> return True _ -> liftIO (putStrLn "Failed to parse options") >> mzero
402
testMain :: [String] -> IO () testMain args = fmap (const ()) . runMaybeT $ do (verbose, tests) <- (,) <$> parseOpts <*> getTests files liftIO $ runTests verbose tests where (opts, files) = partition ((== "-") . take 1) args parseOpts = case opts of [] -> return False ["-v"] -> return True ["--verbose"] -> return True _ -> liftIO (putStrLn "Failed to parse options") >> mzero
402
testMain args = fmap (const ()) . runMaybeT $ do (verbose, tests) <- (,) <$> parseOpts <*> getTests files liftIO $ runTests verbose tests where (opts, files) = partition ((== "-") . take 1) args parseOpts = case opts of [] -> return False ["-v"] -> return True ["--verbose"] -> return True _ -> liftIO (putStrLn "Failed to parse options") >> mzero
372
false
true
4
11
92
185
90
95
null
null
solidsnack/shell-escape
Data/ByteString/ShellEscape/Bash.hs
bsd-3-clause
backslashify :: Char -> String backslashify c = (take 2 . drop 1 . show) c
105
backslashify :: Char -> String backslashify c = (take 2 . drop 1 . show) c
105
backslashify c = (take 2 . drop 1 . show) c
58
false
true
0
9
46
38
18
20
null
null
fmthoma/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__")
67
showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__")
67
showList___RDR = varQual_RDR gHC_SHOW (fsLit "showList__")
67
false
false
0
7
14
17
8
9
null
null
glutamate/cmdtheline
src/System/Console/CmdTheLine/Arg.hs
mit
{- $opt An optional argument is specified on the command line by a /name/ possibly followed by a /value/. The name of an option can be /short/ or /long/. * A /short/ name is a dash followed by a single alphanumeric character: @-h@, @-q@, @-I@. * A /long/ name is two dashes followed by alphanumeric characters and dashes: @--help@, @--silent@, @--ignore-case@. More than one name may refer to the same optional argument. For example in a given program the names @-q@, @--quiet@, and @--silent@ may all stand for the same boolean argument indicating the program to be quiet. Long names can be specified by any non-ambiguous prefix. There are three ways to assign values to an optional argument on the command line. * As the next token on the command line: @-o a.out@, @--output a.out@. * Glued to a short name: @-oa.out@. * Glued to a long name after an equal character: @--output=a.out@. Glued forms are necessary if the value itself starts with a dash, as is the case for negative numbers, @--min=-10@. -} -- -- Flags -- -- | Create a command line flag that can appear at most once on the -- command line. Yields @False@ in absence and @True@ in presence. flag :: OptInfo -> Arg Bool flag oi = Arg $ Term [ai] yield where ai = fromOptInfo oi yield _ cl = case optArg cl ai of [] -> return False [( _, _, Nothing )] -> return True [( _, f, Just v )] -> argFail $ E.flagValue f v (( _, f, _ ) : ( _, g, _ ) : _ ) -> argFail $ E.optRepeated f g -- | As 'flag' but may appear an infinity of times. Yields a list of @True@s -- as long as the number of times present.
1,680
flag :: OptInfo -> Arg Bool flag oi = Arg $ Term [ai] yield where ai = fromOptInfo oi yield _ cl = case optArg cl ai of [] -> return False [( _, _, Nothing )] -> return True [( _, f, Just v )] -> argFail $ E.flagValue f v (( _, f, _ ) : ( _, g, _ ) : _ ) -> argFail $ E.optRepeated f g -- | As 'flag' but may appear an infinity of times. Yields a list of @True@s -- as long as the number of times present.
467
flag oi = Arg $ Term [ai] yield where ai = fromOptInfo oi yield _ cl = case optArg cl ai of [] -> return False [( _, _, Nothing )] -> return True [( _, f, Just v )] -> argFail $ E.flagValue f v (( _, f, _ ) : ( _, g, _ ) : _ ) -> argFail $ E.optRepeated f g -- | As 'flag' but may appear an infinity of times. Yields a list of @True@s -- as long as the number of times present.
439
true
true
4
11
418
190
99
91
null
null
esengie/fpl-exploration-tool
src/specLang/SortCheck/Term.hs
bsd-3-clause
checkTerm' meta ctx fa@(FunApp f args) = do st <- get case Map.lookup f (st^.SymbolTable.funSyms) of Nothing -> throwError $ "Undefined funSym " ++ show f Just (FunSym _ needS res) -> do haveS <- mapM (\(ctx', tm) -> do ctx'' <- checkCtxShadowing ctx ctx' srt <- checkTerm' meta ctx'' tm lift $ addToCtx (length ctx') srt) args unless (needS == haveS) $ throwError $ "Arg sorts don't match, need:\n\t" ++ show needS ++ "\nbut have:\n\t" ++ show haveS ++ "\nin: " ++ show fa return res
556
checkTerm' meta ctx fa@(FunApp f args) = do st <- get case Map.lookup f (st^.SymbolTable.funSyms) of Nothing -> throwError $ "Undefined funSym " ++ show f Just (FunSym _ needS res) -> do haveS <- mapM (\(ctx', tm) -> do ctx'' <- checkCtxShadowing ctx ctx' srt <- checkTerm' meta ctx'' tm lift $ addToCtx (length ctx') srt) args unless (needS == haveS) $ throwError $ "Arg sorts don't match, need:\n\t" ++ show needS ++ "\nbut have:\n\t" ++ show haveS ++ "\nin: " ++ show fa return res
556
checkTerm' meta ctx fa@(FunApp f args) = do st <- get case Map.lookup f (st^.SymbolTable.funSyms) of Nothing -> throwError $ "Undefined funSym " ++ show f Just (FunSym _ needS res) -> do haveS <- mapM (\(ctx', tm) -> do ctx'' <- checkCtxShadowing ctx ctx' srt <- checkTerm' meta ctx'' tm lift $ addToCtx (length ctx') srt) args unless (needS == haveS) $ throwError $ "Arg sorts don't match, need:\n\t" ++ show needS ++ "\nbut have:\n\t" ++ show haveS ++ "\nin: " ++ show fa return res
556
false
false
0
21
158
216
101
115
null
null
rzil/honours
LeavittPathAlgebras/Example13.hs
mit
c' = WLPA.AEdge "c" 1
21
c' = WLPA.AEdge "c" 1
21
c' = WLPA.AEdge "c" 1
21
false
false
1
5
4
18
6
12
null
null
junjiemars/another-haskell-tutorial
src/Varfun.hs
bsd-2-clause
r=5.0
5
r=5.0
5
r=5.0
5
false
false
1
5
0
11
3
8
null
null
TOSPIO/yi
src/library/Yi/TextCompletion.hs
gpl-2.0
charClass :: Char -> Maybe Int charClass c = findIndex (generalCategory c `elem`) [ [ UppercaseLetter, LowercaseLetter, TitlecaseLetter , ModifierLetter, OtherLetter , ConnectorPunctuation , NonSpacingMark, SpacingCombiningMark, EnclosingMark , DecimalNumber, LetterNumber, OtherNumber ] , [ MathSymbol, CurrencySymbol, ModifierSymbol, OtherSymbol ] ]
489
charClass :: Char -> Maybe Int charClass c = findIndex (generalCategory c `elem`) [ [ UppercaseLetter, LowercaseLetter, TitlecaseLetter , ModifierLetter, OtherLetter , ConnectorPunctuation , NonSpacingMark, SpacingCombiningMark, EnclosingMark , DecimalNumber, LetterNumber, OtherNumber ] , [ MathSymbol, CurrencySymbol, ModifierSymbol, OtherSymbol ] ]
489
charClass c = findIndex (generalCategory c `elem`) [ [ UppercaseLetter, LowercaseLetter, TitlecaseLetter , ModifierLetter, OtherLetter , ConnectorPunctuation , NonSpacingMark, SpacingCombiningMark, EnclosingMark , DecimalNumber, LetterNumber, OtherNumber ] , [ MathSymbol, CurrencySymbol, ModifierSymbol, OtherSymbol ] ]
458
false
true
0
7
177
89
54
35
null
null
kfiz/IHaskell
ipython-kernel/src/IHaskell/IPython/Message/Parser.hs
mit
parser HistoryRequestMessage = historyRequestParser
51
parser HistoryRequestMessage = historyRequestParser
51
parser HistoryRequestMessage = historyRequestParser
51
false
false
0
5
3
9
4
5
null
null
yav/alsa-haskell
Sound/Alsa/Sequencer.hs
mit
-- | This is the name that should be passed to 'open' in most cases. default_seq_name :: String default_seq_name = "default"
124
default_seq_name :: String default_seq_name = "default"
55
default_seq_name = "default"
28
true
true
0
4
20
12
7
5
null
null
rahulmutt/ghcvm
compiler/Eta/HsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (HsUnboundVar {}) = False
45
hsExprNeedsParens (HsUnboundVar {}) = False
45
hsExprNeedsParens (HsUnboundVar {}) = False
45
false
false
0
7
6
16
8
8
null
null
zouppen/sextoy
src/Web.hs
gpl-3.0
validateSkips :: Integral a => Text -> Maybe a validateSkips t = case decimal t of Right (a,"") -> if a<38 then Just a else Nothing _ -> Nothing
185
validateSkips :: Integral a => Text -> Maybe a validateSkips t = case decimal t of Right (a,"") -> if a<38 then Just a else Nothing _ -> Nothing
185
validateSkips t = case decimal t of Right (a,"") -> if a<38 then Just a else Nothing _ -> Nothing
138
false
true
3
7
69
71
35
36
null
null
michaeldever/haskellfm
DirectoryOperations.hs
gpl-3.0
{-| This function takes a list of directories, and attempts to move them to a location which will be provided by the user. -} moveFolder :: [FilePath] -- ^ The list of directories to be moved. -> IO ( ) moveFolder dirs = operateName dirs S.moveDirectory "Move Folder(s)" "Please enter the destination for the selected folder(s): "
350
moveFolder :: [FilePath] -- ^ The list of directories to be moved. -> IO ( ) moveFolder dirs = operateName dirs S.moveDirectory "Move Folder(s)" "Please enter the destination for the selected folder(s): "
215
moveFolder dirs = operateName dirs S.moveDirectory "Move Folder(s)" "Please enter the destination for the selected folder(s): "
127
true
true
0
7
76
39
20
19
null
null
kawu/named
Data/Named.hs
bsd-2-clause
mapWords' :: (w -> w') -> Ne w t -> Ne w' t mapWords' f ne = ne { children = map (mapWordCh f) (children ne) }
110
mapWords' :: (w -> w') -> Ne w t -> Ne w' t mapWords' f ne = ne { children = map (mapWordCh f) (children ne) }
110
mapWords' f ne = ne { children = map (mapWordCh f) (children ne) }
66
false
true
0
9
26
66
33
33
null
null
adrianherrera/reil-parser
src/Data/REIL/InstructionSet.hs
mit
getInstOp2 (Undef _ op _) = op
30
getInstOp2 (Undef _ op _) = op
30
getInstOp2 (Undef _ op _) = op
30
false
false
0
7
6
19
9
10
null
null
OpenXT/manager
xenmgr/XenMgr/Connect/Xl.hs
gpl-2.0
hibernate :: Uuid -> IO () hibernate uuid = do domid <- getDomainId uuid exitCode <- system ("xl hiberate " ++ domid) bailIfError exitCode "Error entering s4."
184
hibernate :: Uuid -> IO () hibernate uuid = do domid <- getDomainId uuid exitCode <- system ("xl hiberate " ++ domid) bailIfError exitCode "Error entering s4."
184
hibernate uuid = do domid <- getDomainId uuid exitCode <- system ("xl hiberate " ++ domid) bailIfError exitCode "Error entering s4."
157
false
true
0
11
51
63
27
36
null
null
haasn/colour
Data/Colour/Names.hs
mit
limegreen :: (Ord a, Floating a) => Colour a limegreen = sRGB24 50 205 50
73
limegreen :: (Ord a, Floating a) => Colour a limegreen = sRGB24 50 205 50
73
limegreen = sRGB24 50 205 50
28
false
true
0
7
14
44
19
25
null
null
mrkkrp/stack
src/Options/Applicative/Builder/Extra.hs
bsd-3-clause
defaultPathCompleterOpts :: PathCompleterOpts defaultPathCompleterOpts = PathCompleterOpts { pcoAbsolute = True , pcoRelative = True , pcoRootDir = Nothing , pcoFileFilter = const True , pcoDirFilter = const True }
238
defaultPathCompleterOpts :: PathCompleterOpts defaultPathCompleterOpts = PathCompleterOpts { pcoAbsolute = True , pcoRelative = True , pcoRootDir = Nothing , pcoFileFilter = const True , pcoDirFilter = const True }
238
defaultPathCompleterOpts = PathCompleterOpts { pcoAbsolute = True , pcoRelative = True , pcoRootDir = Nothing , pcoFileFilter = const True , pcoDirFilter = const True }
192
false
true
0
7
52
49
29
20
null
null
keithodulaigh/Hets
Comorphisms/HasCASL2IsabelleHOL.hs
gpl-2.0
groupCons :: [ProgEq] -> Id -> [ProgEq] groupCons peqs name = filter hasSameName peqs where hasSameName (ProgEq pat _ _) = hsn pat hsn pat = case pat of QualOp _ (PolyId n _ _) _ _ _ _ -> n == name ApplTerm t1 _ _ -> hsn t1 TypedTerm t _ _ _ -> hsn t TupleTerm _ _ -> True _ -> False {- Input: List of case alternatives with same leading constructor Functionality: Tests whether the constructor has no arguments, if so translates case alternatives -}
542
groupCons :: [ProgEq] -> Id -> [ProgEq] groupCons peqs name = filter hasSameName peqs where hasSameName (ProgEq pat _ _) = hsn pat hsn pat = case pat of QualOp _ (PolyId n _ _) _ _ _ _ -> n == name ApplTerm t1 _ _ -> hsn t1 TypedTerm t _ _ _ -> hsn t TupleTerm _ _ -> True _ -> False {- Input: List of case alternatives with same leading constructor Functionality: Tests whether the constructor has no arguments, if so translates case alternatives -}
542
groupCons peqs name = filter hasSameName peqs where hasSameName (ProgEq pat _ _) = hsn pat hsn pat = case pat of QualOp _ (PolyId n _ _) _ _ _ _ -> n == name ApplTerm t1 _ _ -> hsn t1 TypedTerm t _ _ _ -> hsn t TupleTerm _ _ -> True _ -> False {- Input: List of case alternatives with same leading constructor Functionality: Tests whether the constructor has no arguments, if so translates case alternatives -}
502
false
true
1
11
181
156
75
81
null
null
dysinger/amazonka
amazonka-dynamodb/gen/Network/AWS/DynamoDB/DeleteItem.hs
mpl-2.0
-- | 'DeleteItemResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dirAttributes' @::@ 'HashMap' 'Text' 'AttributeValue' -- -- * 'dirConsumedCapacity' @::@ 'Maybe' 'ConsumedCapacity' -- -- * 'dirItemCollectionMetrics' @::@ 'Maybe' 'ItemCollectionMetrics' -- deleteItemResponse :: DeleteItemResponse deleteItemResponse = DeleteItemResponse { _dirAttributes = mempty , _dirConsumedCapacity = Nothing , _dirItemCollectionMetrics = Nothing }
512
deleteItemResponse :: DeleteItemResponse deleteItemResponse = DeleteItemResponse { _dirAttributes = mempty , _dirConsumedCapacity = Nothing , _dirItemCollectionMetrics = Nothing }
211
deleteItemResponse = DeleteItemResponse { _dirAttributes = mempty , _dirConsumedCapacity = Nothing , _dirItemCollectionMetrics = Nothing }
170
true
true
0
7
86
45
30
15
null
null
Booster2/Booster2
Workflow_Precond/impl_disjoint/Workflows.hs
bsd-3-clause
exParWf3 = Par [exSeqWfChoice11,exSeqWfChoice12]
51
exParWf3 = Par [exSeqWfChoice11,exSeqWfChoice12]
51
exParWf3 = Par [exSeqWfChoice11,exSeqWfChoice12]
51
false
false
0
6
6
15
8
7
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmForeign.hs
bsd-3-clause
stack_SP dflags = closureField dflags (oFFSET_StgStack_sp dflags)
69
stack_SP dflags = closureField dflags (oFFSET_StgStack_sp dflags)
69
stack_SP dflags = closureField dflags (oFFSET_StgStack_sp dflags)
69
false
false
0
7
10
20
9
11
null
null
sdiehl/ghc
compiler/nativeGen/PPC/Instr.hs
bsd-3-clause
ppc_patchJumpInstr :: Instr -> (BlockId -> BlockId) -> Instr ppc_patchJumpInstr insn patchF = case insn of BCC cc id p -> BCC cc (patchF id) p BCCFAR cc id p -> BCCFAR cc (patchF id) p BCTR ids lbl rs -> BCTR (map (fmap patchF) ids) lbl rs _ -> insn -- ----------------------------------------------------------------------------- -- | An instruction to spill a register into a spill slot.
445
ppc_patchJumpInstr :: Instr -> (BlockId -> BlockId) -> Instr ppc_patchJumpInstr insn patchF = case insn of BCC cc id p -> BCC cc (patchF id) p BCCFAR cc id p -> BCCFAR cc (patchF id) p BCTR ids lbl rs -> BCTR (map (fmap patchF) ids) lbl rs _ -> insn -- ----------------------------------------------------------------------------- -- | An instruction to spill a register into a spill slot.
445
ppc_patchJumpInstr insn patchF = case insn of BCC cc id p -> BCC cc (patchF id) p BCCFAR cc id p -> BCCFAR cc (patchF id) p BCTR ids lbl rs -> BCTR (map (fmap patchF) ids) lbl rs _ -> insn -- ----------------------------------------------------------------------------- -- | An instruction to spill a register into a spill slot.
384
false
true
0
12
120
129
63
66
null
null
AlexeyRaga/eta
compiler/ETA/Main/DynFlags.hs
bsd-3-clause
hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags) hasArg fn = HasArg (upd . fn)
103
hasArg :: (String -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags) hasArg fn = HasArg (upd . fn)
103
hasArg fn = HasArg (upd . fn)
29
false
true
0
9
17
53
25
28
null
null
jaapweel/piffle
src/IrPiffle.hs
gpl-2.0
tExp env (Seq p declarations expressions lastExpression) = do thisPosition p (env, declarations) <- tDeclarations env declarations expressions <- tExp env `mapM` expressions lastExpression <- tExp env lastExpression return (I.Seq p (ty lastExpression) declarations expressions lastExpression) {- For an if statement, the condition must be of atomic type, and the types of the branches must match. -}
453
tExp env (Seq p declarations expressions lastExpression) = do thisPosition p (env, declarations) <- tDeclarations env declarations expressions <- tExp env `mapM` expressions lastExpression <- tExp env lastExpression return (I.Seq p (ty lastExpression) declarations expressions lastExpression) {- For an if statement, the condition must be of atomic type, and the types of the branches must match. -}
453
tExp env (Seq p declarations expressions lastExpression) = do thisPosition p (env, declarations) <- tDeclarations env declarations expressions <- tExp env `mapM` expressions lastExpression <- tExp env lastExpression return (I.Seq p (ty lastExpression) declarations expressions lastExpression) {- For an if statement, the condition must be of atomic type, and the types of the branches must match. -}
453
false
false
0
11
110
106
49
57
null
null
HJvT/com
System/Win32/Com/Exception.hs
bsd-3-clause
mK_S_MONIKERALREADYREGISTERED :: HRESULT mK_S_MONIKERALREADYREGISTERED = word32ToInt32 (0x000401E7 ::Word32)
108
mK_S_MONIKERALREADYREGISTERED :: HRESULT mK_S_MONIKERALREADYREGISTERED = word32ToInt32 (0x000401E7 ::Word32)
108
mK_S_MONIKERALREADYREGISTERED = word32ToInt32 (0x000401E7 ::Word32)
67
false
true
0
6
7
26
12
14
null
null
mainland/nikola
src/Data/Vector/UnboxedForeign/Mutable.hs
bsd-3-clause
null = G.null
13
null = G.null
13
null = G.null
13
false
false
0
5
2
8
4
4
null
null
spechub/Hets
CSL/Fold.hs
gpl-2.0
foldCMD :: Record a b -> CMD -> a foldCMD r f = case f of Ass c def -> foldAss r f c $ foldTerm r def Cmd s l -> foldCmd r f s $ map (foldTerm r) l Sequence l -> foldSequence r f $ map (foldCMD r) l Cond l -> foldCond r f $ map cf l where cf (x, y) = (foldTerm r x, map (foldCMD r) y) Repeat c l -> foldRepeat r f (foldTerm r c) $ map (foldCMD r) l
384
foldCMD :: Record a b -> CMD -> a foldCMD r f = case f of Ass c def -> foldAss r f c $ foldTerm r def Cmd s l -> foldCmd r f s $ map (foldTerm r) l Sequence l -> foldSequence r f $ map (foldCMD r) l Cond l -> foldCond r f $ map cf l where cf (x, y) = (foldTerm r x, map (foldCMD r) y) Repeat c l -> foldRepeat r f (foldTerm r c) $ map (foldCMD r) l
384
foldCMD r f = case f of Ass c def -> foldAss r f c $ foldTerm r def Cmd s l -> foldCmd r f s $ map (foldTerm r) l Sequence l -> foldSequence r f $ map (foldCMD r) l Cond l -> foldCond r f $ map cf l where cf (x, y) = (foldTerm r x, map (foldCMD r) y) Repeat c l -> foldRepeat r f (foldTerm r c) $ map (foldCMD r) l
350
false
true
0
13
124
228
106
122
null
null
jvictor0/JoSQL
CodeGen/ResolveDepends.hs
mit
codeResolvedQuery :: NutleyQuery -> HaskellFunction codeResolvedQuery = (uncurry resolveDepends) . codeQuery
108
codeResolvedQuery :: NutleyQuery -> HaskellFunction codeResolvedQuery = (uncurry resolveDepends) . codeQuery
108
codeResolvedQuery = (uncurry resolveDepends) . codeQuery
56
false
true
0
7
10
25
13
12
null
null
IanConnolly/distributed-process-aws
src/Control/Distributed/Process/Backend/AWS.hs
bsd-3-clause
localExpect :: Serializable a => LocalProcess a localExpect = LocalProcess $ do ch <- ask liftIO $ do isE <- readIntChannel ch len <- readIntChannel ch lenAgain <- readIntChannel ch when (len /= lenAgain) $ throwIO (userError "Internal error: protocol violation (perhaps the remote binary is not installed correctly?)") msg <- readSizeChannel ch len if isE /= 0 then error (decode msg) else return (decode msg)
450
localExpect :: Serializable a => LocalProcess a localExpect = LocalProcess $ do ch <- ask liftIO $ do isE <- readIntChannel ch len <- readIntChannel ch lenAgain <- readIntChannel ch when (len /= lenAgain) $ throwIO (userError "Internal error: protocol violation (perhaps the remote binary is not installed correctly?)") msg <- readSizeChannel ch len if isE /= 0 then error (decode msg) else return (decode msg)
450
localExpect = LocalProcess $ do ch <- ask liftIO $ do isE <- readIntChannel ch len <- readIntChannel ch lenAgain <- readIntChannel ch when (len /= lenAgain) $ throwIO (userError "Internal error: protocol violation (perhaps the remote binary is not installed correctly?)") msg <- readSizeChannel ch len if isE /= 0 then error (decode msg) else return (decode msg)
402
false
true
0
14
105
140
63
77
null
null
bramgg/99haskell
Sandbox.hs
mit
trim :: Char -> String -> String trim v = x . x where x = reverse . dropWhile (\x -> x == v)
92
trim :: Char -> String -> String trim v = x . x where x = reverse . dropWhile (\x -> x == v)
92
trim v = x . x where x = reverse . dropWhile (\x -> x == v)
59
false
true
0
11
23
52
27
25
null
null
ddssff/lens
src/Control/Lens/Lens.hs
bsd-3-clause
-- | Replace the target of a 'Lens', but return the old value. -- -- When you do not need the old value, ('Control.Lens.Setter..~') is more flexible. -- -- @ -- ('<<.~') :: 'Lens' s t a b -> b -> s -> (a, t) -- ('<<.~') :: 'Control.Lens.Iso.Iso' s t a b -> b -> s -> (a, t) -- ('<<.~') :: 'Monoid' a => 'Control.Lens.Traversal.Traversal' s t a b -> b -> s -> (a, t) -- @ (<<.~) :: LensLike ((,)a) s t a b -> b -> s -> (a, t) l <<.~ b = l $ \a -> (a, b)
487
(<<.~) :: LensLike ((,)a) s t a b -> b -> s -> (a, t) l <<.~ b = l $ \a -> (a, b)
81
l <<.~ b = l $ \a -> (a, b)
27
true
true
0
11
139
82
48
34
null
null
gelisam/hawk
src/System/Console/Hawk/Interpreter.hs
apache-2.0
wrapErrorsM :: Monad m => m (Either InterpreterError a) -> UncertainT m a wrapErrorsM = lift >=> wrapErrors
107
wrapErrorsM :: Monad m => m (Either InterpreterError a) -> UncertainT m a wrapErrorsM = lift >=> wrapErrors
107
wrapErrorsM = lift >=> wrapErrors
33
false
true
2
10
17
50
22
28
null
null
z0isch/aoc2016
src/Day11.hs
bsd-3-clause
inputStartState = ProbState 3 (Map.fromList [(0,Set.empty), (1,Set.empty), (2,Set.empty), (3,Set.fromList [Gen"T",Gen"Pl",Gen"S",Gen"Pr",Gen"R"])]) (Map.fromList [(0,Set.empty), (1,Set.empty), (2,Set.empty), (3,Set.fromList [Chip"T",Chip"Pl",Chip"S",Chip"Pr",Chip"R"])])
298
inputStartState = ProbState 3 (Map.fromList [(0,Set.empty), (1,Set.empty), (2,Set.empty), (3,Set.fromList [Gen"T",Gen"Pl",Gen"S",Gen"Pr",Gen"R"])]) (Map.fromList [(0,Set.empty), (1,Set.empty), (2,Set.empty), (3,Set.fromList [Chip"T",Chip"Pl",Chip"S",Chip"Pr",Chip"R"])])
298
inputStartState = ProbState 3 (Map.fromList [(0,Set.empty), (1,Set.empty), (2,Set.empty), (3,Set.fromList [Gen"T",Gen"Pl",Gen"S",Gen"Pr",Gen"R"])]) (Map.fromList [(0,Set.empty), (1,Set.empty), (2,Set.empty), (3,Set.fromList [Chip"T",Chip"Pl",Chip"S",Chip"Pr",Chip"R"])])
298
false
false
0
12
43
183
102
81
null
null
buckie/juno
src/Juno/Hoplite/Term.hs
bsd-3-clause
hopliteTerm2ScopedTerm (ELit l) = T.ELit l
42
hopliteTerm2ScopedTerm (ELit l) = T.ELit l
42
hopliteTerm2ScopedTerm (ELit l) = T.ELit l
42
false
false
0
7
5
20
9
11
null
null
green-haskell/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
quoteParens :: Doc -> Doc quoteParens d = text "'(" <> d <> text ")"
68
quoteParens :: Doc -> Doc quoteParens d = text "'(" <> d <> text ")"
68
quoteParens d = text "'(" <> d <> text ")"
42
false
true
0
7
14
32
15
17
null
null
eb-gh-cr/XMonadContrib1
XMonad/Hooks/DebugEvents.hs
bsd-3-clause
dumpProp _ "_NET_WM_WINDOW_OPACITY" = dumpPercent
68
dumpProp _ "_NET_WM_WINDOW_OPACITY" = dumpPercent
68
dumpProp _ "_NET_WM_WINDOW_OPACITY" = dumpPercent
68
false
false
0
5
23
11
5
6
null
null
eugenkiss/loopgotowhile
src/Language/LoopGotoWhile/Goto/Extended.hs
bsd-3-clause
-- | Given a string representation of an extended Goto program parse it and -- return either an error string or the AST. If given a valid strict Goto -- program parse it as well. parse :: String -> Either String Program parse s = case Strict.parse s of Right strictP -> Right $ toExtended strictP Left _ -> mkStdParser parseProgram [] whiteSpace s -- * Parsing -- ======= -- | Carry along a list of labels to check if there aren't any duplicates.
483
parse :: String -> Either String Program parse s = case Strict.parse s of Right strictP -> Right $ toExtended strictP Left _ -> mkStdParser parseProgram [] whiteSpace s -- * Parsing -- ======= -- | Carry along a list of labels to check if there aren't any duplicates.
304
parse s = case Strict.parse s of Right strictP -> Right $ toExtended strictP Left _ -> mkStdParser parseProgram [] whiteSpace s -- * Parsing -- ======= -- | Carry along a list of labels to check if there aren't any duplicates.
263
true
true
0
9
120
74
37
37
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x1F84' = "\x03B1\x0313\x0301\x0345"
51
decomposeChar '\x1F84' = "\x03B1\x0313\x0301\x0345"
51
decomposeChar '\x1F84' = "\x03B1\x0313\x0301\x0345"
51
false
false
0
5
3
9
4
5
null
null
bergmark/transliterate
src/Translit/GHC.hs
bsd-3-clause
split :: Text -> Text -> [Text] split "" s = map T.singleton (T.unpack s)
73
split :: Text -> Text -> [Text] split "" s = map T.singleton (T.unpack s)
73
split "" s = map T.singleton (T.unpack s)
41
false
true
0
9
14
49
22
27
null
null
roberth/uu-helium
test/typeerrors/Examples/ExprListElem.hs
gpl-3.0
f = [ "neushoorn" , 47 ]
24
f = [ "neushoorn" , 47 ]
24
f = [ "neushoorn" , 47 ]
24
false
false
1
5
6
15
7
8
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Vhdl.hs
gpl-2.0
list_types = Set.fromList $ words $ "bit bit_vector character boolean boolean_vector integer integer_vector real real_vector time time_vector delay_length string severity_level positive natural file_open_kind file_open_status signed unsigned unresolved_unsigned unresolved_signed line text side width std_logic std_logic_vector std_ulogic std_ulogic_vector x01 x01z ux01 ux01z qsim_state qsim_state_vector qsim_12state qsim_12state_vector qsim_strength mux_bit mux_vector reg_bit reg_vector wor_bit wor_vector"
510
list_types = Set.fromList $ words $ "bit bit_vector character boolean boolean_vector integer integer_vector real real_vector time time_vector delay_length string severity_level positive natural file_open_kind file_open_status signed unsigned unresolved_unsigned unresolved_signed line text side width std_logic std_logic_vector std_ulogic std_ulogic_vector x01 x01z ux01 ux01z qsim_state qsim_state_vector qsim_12state qsim_12state_vector qsim_strength mux_bit mux_vector reg_bit reg_vector wor_bit wor_vector"
510
list_types = Set.fromList $ words $ "bit bit_vector character boolean boolean_vector integer integer_vector real real_vector time time_vector delay_length string severity_level positive natural file_open_kind file_open_status signed unsigned unresolved_unsigned unresolved_signed line text side width std_logic std_logic_vector std_ulogic std_ulogic_vector x01 x01z ux01 ux01z qsim_state qsim_state_vector qsim_12state qsim_12state_vector qsim_strength mux_bit mux_vector reg_bit reg_vector wor_bit wor_vector"
510
false
false
1
7
50
20
8
12
null
null
robinp/haskell-indexer
haskell-indexer-backend-ghc/src/Language/Haskell/Indexer/Backend/GhcLens.hs
apache-2.0
-- | All values of type 'a' below the root of type 's'. -- -- Warning! Edge case behavior differs from uniplate - if 'a'~'s', uniplate -- would return only the root, while this returns everything except the root. -- Such usecase is not intended for universeBi anyway - use universe or -- children. universeBi :: forall s a. (Data a, Data s) => s -> [a] universeBi = concatMap carefulUniverse . (careful return :: s -> [a])
422
universeBi :: forall s a. (Data a, Data s) => s -> [a] universeBi = concatMap carefulUniverse . (careful return :: s -> [a])
124
universeBi = concatMap carefulUniverse . (careful return :: s -> [a])
69
true
true
0
8
77
68
40
28
null
null
jean-edouard/manager
upgrade-db/Migrations/M_8.hs
gpl-2.0
migration = Migration { sourceVersion = 8 , targetVersion = 9 , actions = act }
95
migration = Migration { sourceVersion = 8 , targetVersion = 9 , actions = act }
95
migration = Migration { sourceVersion = 8 , targetVersion = 9 , actions = act }
95
false
false
1
7
31
33
17
16
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Layout/Combo.hs
bsd-2-clause
combineTwo :: (Read a, Eq a, LayoutClass super (), LayoutClass l1 a, LayoutClass l2 a) => super () -> l1 a -> l2 a -> CombineTwo (super ()) l1 l2 a combineTwo = C2 [] []
183
combineTwo :: (Read a, Eq a, LayoutClass super (), LayoutClass l1 a, LayoutClass l2 a) => super () -> l1 a -> l2 a -> CombineTwo (super ()) l1 l2 a combineTwo = C2 [] []
183
combineTwo = C2 [] []
21
false
true
0
12
49
101
49
52
null
null
Annaraf/ASD
Isi/a.hs
mit
--pembatas --blom intercalate' [] [[]] = []
43
intercalate' [] [[]] = []
25
intercalate' [] [[]] = []
25
true
false
0
7
6
22
12
10
null
null
roberth/uu-helium
src/Helium/ModuleSystem/ImportEnvironment.hs
gpl-3.0
addTypingStrategies :: Core_TypingStrategies -> ImportEnvironment -> ImportEnvironment addTypingStrategies new importenv = importenv {typingStrategies = new ++ typingStrategies importenv}
189
addTypingStrategies :: Core_TypingStrategies -> ImportEnvironment -> ImportEnvironment addTypingStrategies new importenv = importenv {typingStrategies = new ++ typingStrategies importenv}
187
addTypingStrategies new importenv = importenv {typingStrategies = new ++ typingStrategies importenv}
100
false
true
0
8
19
39
20
19
null
null
abuiles/turbinado-blog
tmp/dependencies/haskell-src-exts-0.3.9/Language/Haskell/Exts/ParseUtils.hs
bsd-3-clause
checkContext :: HsType -> P HsContext checkContext (HsTyTuple Boxed ts) = mapM checkAssertion ts
100
checkContext :: HsType -> P HsContext checkContext (HsTyTuple Boxed ts) = mapM checkAssertion ts
100
checkContext (HsTyTuple Boxed ts) = mapM checkAssertion ts
62
false
true
0
7
17
34
16
18
null
null
ryzhyk/cocoon
cocoon/SMT.hs
apache-2.0
expr2SMT (EStruct _ s fs) = SMT.EStruct s $ map expr2SMT fs
62
expr2SMT (EStruct _ s fs) = SMT.EStruct s $ map expr2SMT fs
62
expr2SMT (EStruct _ s fs) = SMT.EStruct s $ map expr2SMT fs
62
false
false
0
7
14
33
15
18
null
null
thalerjonathan/phd
coding/learning/haskell/grahambook/src/Slides/Chapter9.hs
gpl-3.0
nextPlayerIdx 2 = 1
19
nextPlayerIdx 2 = 1
19
nextPlayerIdx 2 = 1
19
false
false
1
5
3
13
4
9
null
null
ariep/TCache
src/Data/Persistent/Collection.hs
bsd-3-clause
-- | Version in the STM monad flushSTM :: (Typeable a, Serialize a) => Persist -> RefQueue a -> STM () flushSTM store tv = delDBRef store tv
140
flushSTM :: (Typeable a, Serialize a) => Persist -> RefQueue a -> STM () flushSTM store tv = delDBRef store tv
110
flushSTM store tv = delDBRef store tv
37
true
true
0
9
27
53
26
27
null
null
akhileshs/stack
src/Stack/Types/Config.hs
bsd-3-clause
packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) packageDatabaseLocal = do root <- installationRootLocal return $ root </> $(mkRelDir "pkgdb") -- | Directory for holding flag cache information
248
packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) packageDatabaseLocal = do root <- installationRootLocal return $ root </> $(mkRelDir "pkgdb") -- | Directory for holding flag cache information
248
packageDatabaseLocal = do root <- installationRootLocal return $ root </> $(mkRelDir "pkgdb") -- | Directory for holding flag cache information
152
false
true
0
10
42
71
35
36
null
null
kcharter/spdy-base
src/Network/SPDY/Internal/Constants.hs
bsd-3-clause
tsRefusedStream :: Word32 tsRefusedStream = 3
45
tsRefusedStream :: Word32 tsRefusedStream = 3
45
tsRefusedStream = 3
19
false
true
0
4
5
11
6
5
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/index_2.hs
mit
primMinusInt (Neg x) (Pos y) = Neg (primPlusNat x y)
52
primMinusInt (Neg x) (Pos y) = Neg (primPlusNat x y)
52
primMinusInt (Neg x) (Pos y) = Neg (primPlusNat x y)
52
false
false
0
7
9
34
16
18
null
null
mrakgr/futhark
src/Futhark/Pass/ExtractKernels/ISRWIM.hs
bsd-3-clause
setOuterDimTo :: SubExp -> Type -> Type setOuterDimTo w t = arrayOfRow (rowType t) w
86
setOuterDimTo :: SubExp -> Type -> Type setOuterDimTo w t = arrayOfRow (rowType t) w
86
setOuterDimTo w t = arrayOfRow (rowType t) w
46
false
true
0
8
16
41
18
23
null
null
TomMD/ghc
compiler/utils/Outputable.hs
bsd-3-clause
qualPackage :: PprStyle -> QueryQualifyPackage qualPackage (PprUser q _) m = queryQualifyPackage q m
101
qualPackage :: PprStyle -> QueryQualifyPackage qualPackage (PprUser q _) m = queryQualifyPackage q m
101
qualPackage (PprUser q _) m = queryQualifyPackage q m
54
false
true
0
7
14
33
16
17
null
null
karamellpelle/grid
source/Game/Run/Helpers/Make.hs
gpl-3.0
saveRunWorld :: RunWorld -> MEnv' () saveRunWorld run = io $ do -- read map LevelPuzzleName -> Peak for run world namespeaks <- readBinary' rLevelPuzzleNamePeakS $ runFile run -- write to tmp file tmp <- fileTmp "runworld.tmp" writeBinary' (wRunWorld namespeaks run) tmp -- copy tmp file to run file, then remove tmp file copyFile tmp $ runFile run removeFile tmp
398
saveRunWorld :: RunWorld -> MEnv' () saveRunWorld run = io $ do -- read map LevelPuzzleName -> Peak for run world namespeaks <- readBinary' rLevelPuzzleNamePeakS $ runFile run -- write to tmp file tmp <- fileTmp "runworld.tmp" writeBinary' (wRunWorld namespeaks run) tmp -- copy tmp file to run file, then remove tmp file copyFile tmp $ runFile run removeFile tmp
398
saveRunWorld run = io $ do -- read map LevelPuzzleName -> Peak for run world namespeaks <- readBinary' rLevelPuzzleNamePeakS $ runFile run -- write to tmp file tmp <- fileTmp "runworld.tmp" writeBinary' (wRunWorld namespeaks run) tmp -- copy tmp file to run file, then remove tmp file copyFile tmp $ runFile run removeFile tmp
361
false
true
0
10
94
92
41
51
null
null