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
ocramz/sparse-linear-algebra
src/Numeric/LinearAlgebra/Class.hs
gpl-3.0
normInftyR :: (Foldable t, Ord a) => t a -> a normInftyR x = maximum x
70
normInftyR :: (Foldable t, Ord a) => t a -> a normInftyR x = maximum x
70
normInftyR x = maximum x
24
false
true
0
7
15
39
19
20
null
null
jtdaugherty/vty-ui-builder
src/Graphics/Vty/Widgets/Builder/Handlers.hs
bsd-3-clause
coreSpecHandlers :: [WidgetElementHandler] coreSpecHandlers = concat [ Box.handlers , Wrap.handlers , Borders.handlers , Fills.handlers , Centered.handlers , Limits.handlers , Fixed.handlers , Pad.handlers , Table.handlers , List.handlers , Text.handlers , Edit.handlers , Button.handlers , ProgressBar.handlers , Dialog.handlers , DirBrowser.handlers , CheckBox.handlers ]
564
coreSpecHandlers :: [WidgetElementHandler] coreSpecHandlers = concat [ Box.handlers , Wrap.handlers , Borders.handlers , Fills.handlers , Centered.handlers , Limits.handlers , Fixed.handlers , Pad.handlers , Table.handlers , List.handlers , Text.handlers , Edit.handlers , Button.handlers , ProgressBar.handlers , Dialog.handlers , DirBrowser.handlers , CheckBox.handlers ]
564
coreSpecHandlers = concat [ Box.handlers , Wrap.handlers , Borders.handlers , Fills.handlers , Centered.handlers , Limits.handlers , Fixed.handlers , Pad.handlers , Table.handlers , List.handlers , Text.handlers , Edit.handlers , Button.handlers , ProgressBar.handlers , Dialog.handlers , DirBrowser.handlers , CheckBox.handlers ]
521
false
true
0
7
231
102
60
42
null
null
markus-git/co-feldspar
src/Feldspar/Array/Vector.hs
bsd-3-clause
-- | Zips togheter two vectors and returns vector of corresponding pairs. zip :: (Vector exp, Pully exp vec1 a, Pully exp vec2 b) => vec1 -> vec2 -> Pull exp (a, b) zip a b = Pull (length a `min` length b) (\i -> (a!i, b!i))
226
zip :: (Vector exp, Pully exp vec1 a, Pully exp vec2 b) => vec1 -> vec2 -> Pull exp (a, b) zip a b = Pull (length a `min` length b) (\i -> (a!i, b!i))
152
zip a b = Pull (length a `min` length b) (\i -> (a!i, b!i))
59
true
true
0
10
48
112
58
54
null
null
qpliu/esolang
ph/hs/compiler/interp.hs
gpl-3.0
handleArgs ("-v":file:_) = runParameters (readFile file) getContents print
74
handleArgs ("-v":file:_) = runParameters (readFile file) getContents print
74
handleArgs ("-v":file:_) = runParameters (readFile file) getContents print
74
false
false
0
8
7
33
16
17
null
null
xie-dongping/modelicaparser
src/Language/Modelica/Parser/Lexer.hs
bsd-3-clause
loop_ = keyword "loop"
34
loop_ = keyword "loop"
34
loop_ = keyword "loop"
34
false
false
0
5
15
9
4
5
null
null
gianlucagiorgolo/glue-xle
Sigma.hs
mit
prod (h : t) = do a <- h as <- prod t return $ a : as
65
prod (h : t) = do a <- h as <- prod t return $ a : as
65
prod (h : t) = do a <- h as <- prod t return $ a : as
65
false
false
0
8
29
45
20
25
null
null
raventid/coursera_learning
haskell/will_kurt/unit6/36_main_module.hs
mit
main :: IO () main = undefined
30
main :: IO () main = undefined
30
main = undefined
16
false
true
0
6
6
16
8
8
null
null
taxell/SHK
src/LexJSH.hs
mit
lexOp _ ('-' : '=' : rest) = '-' : '=' : ' ' : lexOp True rest
62
lexOp _ ('-' : '=' : rest) = '-' : '=' : ' ' : lexOp True rest
62
lexOp _ ('-' : '=' : rest) = '-' : '=' : ' ' : lexOp True rest
62
false
false
1
7
17
41
19
22
null
null
hexenroehrling/hs-scheduler
src/RunParse.hs
gpl-3.0
pLocalNodeStmt :: LocalNode -> ParserConfig LocalNode pLocalNodeStmt nd = lineStmt pNodeStmt' where pNodeStmt' = pThreads nd <|> pNodeScaleTimeout nd <|> pNodeGroup nd <|> return nd <?> "empty line, comment or local node keyword"
319
pLocalNodeStmt :: LocalNode -> ParserConfig LocalNode pLocalNodeStmt nd = lineStmt pNodeStmt' where pNodeStmt' = pThreads nd <|> pNodeScaleTimeout nd <|> pNodeGroup nd <|> return nd <?> "empty line, comment or local node keyword"
319
pLocalNodeStmt nd = lineStmt pNodeStmt' where pNodeStmt' = pThreads nd <|> pNodeScaleTimeout nd <|> pNodeGroup nd <|> return nd <?> "empty line, comment or local node keyword"
265
false
true
0
9
122
60
27
33
null
null
davenport-haskell/ansiblecheck-cli
app/Main.hs
bsd-3-clause
writeOS (OEL OEL6) = ("oraclelinux", "6")
41
writeOS (OEL OEL6) = ("oraclelinux", "6")
41
writeOS (OEL OEL6) = ("oraclelinux", "6")
41
false
false
0
6
5
22
11
11
null
null
slpopejoy/fadno-xml
src/Fadno/MusicXml/MusicXml30.hs
bsd-2-clause
parseLanguage :: String -> P.XParse Language parseLanguage = return . fromString
80
parseLanguage :: String -> P.XParse Language parseLanguage = return . fromString
80
parseLanguage = return . fromString
35
false
true
0
7
10
24
12
12
null
null
beni55/qoropa
src/Qoropa/Buffer/Log.hs
gpl-2.0
scrollDown :: (IORef Log, Lock) -> Int -> Int -> IO () scrollDown (ref, lock) cols cnt = Lock.with lock $ scrollDown' ref cols cnt
130
scrollDown :: (IORef Log, Lock) -> Int -> Int -> IO () scrollDown (ref, lock) cols cnt = Lock.with lock $ scrollDown' ref cols cnt
130
scrollDown (ref, lock) cols cnt = Lock.with lock $ scrollDown' ref cols cnt
75
false
true
0
9
24
66
33
33
null
null
rimmington/cabal
Cabal/Distribution/Simple/GHCJS.hs
bsd-3-clause
-- | Return the 'FilePath' to the global GHC package database. getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath getGlobalPackageDB verbosity ghcjsProg = (reverse . dropWhile isSpace . reverse) `fmap` rawSystemProgramStdout verbosity ghcjsProg ["--print-global-package-db"]
300
getGlobalPackageDB :: Verbosity -> ConfiguredProgram -> IO FilePath getGlobalPackageDB verbosity ghcjsProg = (reverse . dropWhile isSpace . reverse) `fmap` rawSystemProgramStdout verbosity ghcjsProg ["--print-global-package-db"]
237
getGlobalPackageDB verbosity ghcjsProg = (reverse . dropWhile isSpace . reverse) `fmap` rawSystemProgramStdout verbosity ghcjsProg ["--print-global-package-db"]
169
true
true
0
9
42
58
30
28
null
null
kmate/raw-feldspar
src/Feldspar/Data/Validated.hs
bsd-3-clause
-- | Deconstruct an 'Validated' value caseValidated :: Syntax b => Validated a -> b -- ^ Invalid case -> (a -> b) -- ^ Valid case -> b caseValidated v no yes = validated no yes v
203
caseValidated :: Syntax b => Validated a -> b -- ^ Invalid case -> (a -> b) -- ^ Valid case -> b caseValidated v no yes = validated no yes v
165
caseValidated v no yes = validated no yes v
43
true
true
0
11
62
59
29
30
null
null
kmate/raw-feldspar
src/Feldspar/Primitive/Representation.hs
bsd-3-clause
primTypeEq ComplexFloatT ComplexFloatT = Just Dict
52
primTypeEq ComplexFloatT ComplexFloatT = Just Dict
52
primTypeEq ComplexFloatT ComplexFloatT = Just Dict
52
false
false
0
5
7
14
6
8
null
null
collective/ECSpooler
backends/haskell/haskell_libs/TreeLib.hs
gpl-2.0
numTree' :: (Eq a, Show a) => Tree a -> Tree Int numTree' tree = numberTree' tree (tree2table tree)
99
numTree' :: (Eq a, Show a) => Tree a -> Tree Int numTree' tree = numberTree' tree (tree2table tree)
99
numTree' tree = numberTree' tree (tree2table tree)
50
false
true
0
7
18
50
24
26
null
null
telser/numerals
src/Text/Numeral/Exp/Reified.hs
bsd-3-clause
showExp (Mul x y) = "Mul (" ++ showExp x ++ ") (" ++ showExp y ++ ")"
71
showExp (Mul x y) = "Mul (" ++ showExp x ++ ") (" ++ showExp y ++ ")"
71
showExp (Mul x y) = "Mul (" ++ showExp x ++ ") (" ++ showExp y ++ ")"
71
false
false
0
9
19
39
18
21
null
null
abid-mujtaba/haskell-cas
test/QuickTests/Addition.hs
apache-2.0
-- If one wants a look at the generated expressions in any quickCheck simply replace the call with 'verboseCheck'. This is a good debugging strategy. -- We use 'counterexample' to attach a label to each test which will be printed if the test fails. This will let us know at a glance what went wrong. tests = do quickCheck $ counterexample "Adding zero to an expression" prop_Add_0 quickCheck $ counterexample "Adding an expression with itself" prop_Add_equal quickCheck $ counterexample "Add a constant times an expression with another contant times its expressions" prop_Add_equal2 quickCheck $ counterexample "Subtract an expression from itself" prop_Sub_equal quickCheck $ counterexample "Additive Commutation between two expressions" prop_Add_Commute -- Any function that starts with "prop_" is considered a property by QuickCheck -- Define properties that test the additive features of expressions
965
tests = do quickCheck $ counterexample "Adding zero to an expression" prop_Add_0 quickCheck $ counterexample "Adding an expression with itself" prop_Add_equal quickCheck $ counterexample "Add a constant times an expression with another contant times its expressions" prop_Add_equal2 quickCheck $ counterexample "Subtract an expression from itself" prop_Sub_equal quickCheck $ counterexample "Additive Commutation between two expressions" prop_Add_Commute -- Any function that starts with "prop_" is considered a property by QuickCheck -- Define properties that test the additive features of expressions
664
tests = do quickCheck $ counterexample "Adding zero to an expression" prop_Add_0 quickCheck $ counterexample "Adding an expression with itself" prop_Add_equal quickCheck $ counterexample "Add a constant times an expression with another contant times its expressions" prop_Add_equal2 quickCheck $ counterexample "Subtract an expression from itself" prop_Sub_equal quickCheck $ counterexample "Additive Commutation between two expressions" prop_Add_Commute -- Any function that starts with "prop_" is considered a property by QuickCheck -- Define properties that test the additive features of expressions
664
true
false
1
9
195
74
32
42
null
null
keithodulaigh/Hets
RelationalScheme/ParseRS.hs
gpl-2.0
parseEntry :: AParser st (Token, Bool) parseEntry = do iK <- look4Key iid <- rsVarId [] return (iid, iK)
132
parseEntry :: AParser st (Token, Bool) parseEntry = do iK <- look4Key iid <- rsVarId [] return (iid, iK)
132
parseEntry = do iK <- look4Key iid <- rsVarId [] return (iid, iK)
93
false
true
1
10
46
57
26
31
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpCanFail ReadArrayArrayOp_MutableByteArray = True
54
primOpCanFail ReadArrayArrayOp_MutableByteArray = True
54
primOpCanFail ReadArrayArrayOp_MutableByteArray = True
54
false
false
0
4
3
10
4
6
null
null
skill-lang/skill
deps/haskell/ReadFields.hs
bsd-3-clause
g'fieldRestriction 5 getter = g'bytes g'v64
43
g'fieldRestriction 5 getter = g'bytes g'v64
43
g'fieldRestriction 5 getter = g'bytes g'v64
43
false
false
0
5
5
14
6
8
null
null
soupi/chip-8
src/CPU/Emulate.hs
bsd-3-clause
-- | -- Opcode 0x1nnn -- Jump to address 0x0nnn -- changes the program counter to given address jump :: W.Word16 -> Instruction jump address = pure . Lens.set CPU.pc address
175
jump :: W.Word16 -> Instruction jump address = pure . Lens.set CPU.pc address
79
jump address = pure . Lens.set CPU.pc address
47
true
true
0
7
32
37
20
17
null
null
ekmett/containers
Data/IntSet/Base.hs
bsd-3-clause
partition :: (Key -> Bool) -> IntSet -> (IntSet,IntSet) partition predicate0 t0 = toPair $ go predicate0 t0 where go predicate t = case t of Bin p m l r -> let (l1 :*: l2) = go predicate l (r1 :*: r2) = go predicate r in bin p m l1 r1 :*: bin p m l2 r2 Tip kx bm -> let bm1 = foldl'Bits 0 (bitPred kx) 0 bm in tip kx bm1 :*: tip kx (bm `xor` bm1) Nil -> (Nil :*: Nil) where bitPred kx bm bi | predicate (kx + bi) = bm .|. bitmapOfSuffix bi | otherwise = bm {-# INLINE bitPred #-} -- | /O(min(n,W))/. The expression (@'split' x set@) is a pair @(set1,set2)@ -- where @set1@ comprises the elements of @set@ less than @x@ and @set2@ -- comprises the elements of @set@ greater than @x@. -- -- > split 3 (fromList [1..5]) == (fromList [1,2], fromList [4,5])
927
partition :: (Key -> Bool) -> IntSet -> (IntSet,IntSet) partition predicate0 t0 = toPair $ go predicate0 t0 where go predicate t = case t of Bin p m l r -> let (l1 :*: l2) = go predicate l (r1 :*: r2) = go predicate r in bin p m l1 r1 :*: bin p m l2 r2 Tip kx bm -> let bm1 = foldl'Bits 0 (bitPred kx) 0 bm in tip kx bm1 :*: tip kx (bm `xor` bm1) Nil -> (Nil :*: Nil) where bitPred kx bm bi | predicate (kx + bi) = bm .|. bitmapOfSuffix bi | otherwise = bm {-# INLINE bitPred #-} -- | /O(min(n,W))/. The expression (@'split' x set@) is a pair @(set1,set2)@ -- where @set1@ comprises the elements of @set@ less than @x@ and @set2@ -- comprises the elements of @set@ greater than @x@. -- -- > split 3 (fromList [1..5]) == (fromList [1,2], fromList [4,5])
927
partition predicate0 t0 = toPair $ go predicate0 t0 where go predicate t = case t of Bin p m l r -> let (l1 :*: l2) = go predicate l (r1 :*: r2) = go predicate r in bin p m l1 r1 :*: bin p m l2 r2 Tip kx bm -> let bm1 = foldl'Bits 0 (bitPred kx) 0 bm in tip kx bm1 :*: tip kx (bm `xor` bm1) Nil -> (Nil :*: Nil) where bitPred kx bm bi | predicate (kx + bi) = bm .|. bitmapOfSuffix bi | otherwise = bm {-# INLINE bitPred #-} -- | /O(min(n,W))/. The expression (@'split' x set@) is a pair @(set1,set2)@ -- where @set1@ comprises the elements of @set@ less than @x@ and @set2@ -- comprises the elements of @set@ greater than @x@. -- -- > split 3 (fromList [1..5]) == (fromList [1,2], fromList [4,5])
871
false
true
0
14
330
267
132
135
null
null
JoelHoskin/99HaskellProblems
Lists.hs
mit
- Problem 2 myButLast :: [a] -> a myButLast l = (reverse l) !! 1
65
myButLast :: [a] -> a myButLast l = (reverse l) !! 1
52
myButLast l = (reverse l) !! 1
30
true
true
1
7
15
36
18
18
null
null
DavidEGrayson/drvdiff
src/DrvFromAterm.hs
mit
stringFromAterm :: Aterm -> Either BadDerivationAtermError String stringFromAterm (QuotedString string) = pure string
117
stringFromAterm :: Aterm -> Either BadDerivationAtermError String stringFromAterm (QuotedString string) = pure string
117
stringFromAterm (QuotedString string) = pure string
51
false
true
0
7
12
32
15
17
null
null
jtojnar/hulk
src/Hulk/Client.hs
bsd-3-clause
handleTell :: Text -> Text -> Hulk () handleTell name msg = sendMsgTo RPL_NOTICE name msg
89
handleTell :: Text -> Text -> Hulk () handleTell name msg = sendMsgTo RPL_NOTICE name msg
89
handleTell name msg = sendMsgTo RPL_NOTICE name msg
51
false
true
0
9
15
40
18
22
null
null
kaoskorobase/mescaline
tools/looper.hs
gpl-3.0
main_ :: [String] -> IO () main_ [dbDir, pattern] = do db <- DB.open dbDir let us = DB.query (DB.pathMatch pattern) db main_gui db us
145
main_ :: [String] -> IO () main_ [dbDir, pattern] = do db <- DB.open dbDir let us = DB.query (DB.pathMatch pattern) db main_gui db us
145
main_ [dbDir, pattern] = do db <- DB.open dbDir let us = DB.query (DB.pathMatch pattern) db main_gui db us
118
false
true
0
14
36
81
37
44
null
null
sviperll/LambdaInterpreter
src/Lambda/Show.hs
gpl-3.0
showLeft i@(UnmarkedTerm (Lam _ _)) = "(" ++ show i ++ ")"
58
showLeft i@(UnmarkedTerm (Lam _ _)) = "(" ++ show i ++ ")"
58
showLeft i@(UnmarkedTerm (Lam _ _)) = "(" ++ show i ++ ")"
58
false
false
0
10
11
37
18
19
null
null
abhin4v/combinatorrent
src/Protocol/Wire.hs
bsd-2-clause
getExtendedMsg :: Get Message getChoke = byte 0 *> return Choke
72
getExtendedMsg :: Get Message getChoke = byte 0 *> return Choke
72
getChoke = byte 0 *> return Choke
42
false
true
0
6
19
24
11
13
null
null
k0001/reflex
src/Reflex/Dynamic.hs
bsd-3-clause
-- | Merge the 'Dynamic' values using their 'Monoid' instance. mconcatDyn :: forall t m a. (Reflex t, MonadHold t m, Monoid a) => [Dynamic t a] -> m (Dynamic t a) mconcatDyn es = do ddm :: Dynamic t (DMap (Const2 Int a)) <- distributeDMapOverDyn $ DMap.fromList $ map (\(k, v) -> WrapArg (Const2 k) :=> v) $ zip [0 :: Int ..] es mapDyn (mconcat . map (\(Const2 _ :=> v) -> v) . DMap.toList) ddm -- | Create a 'Dynamic' with a 'DMap' of values out of a 'DMap' of -- Dynamic values.
485
mconcatDyn :: forall t m a. (Reflex t, MonadHold t m, Monoid a) => [Dynamic t a] -> m (Dynamic t a) mconcatDyn es = do ddm :: Dynamic t (DMap (Const2 Int a)) <- distributeDMapOverDyn $ DMap.fromList $ map (\(k, v) -> WrapArg (Const2 k) :=> v) $ zip [0 :: Int ..] es mapDyn (mconcat . map (\(Const2 _ :=> v) -> v) . DMap.toList) ddm -- | Create a 'Dynamic' with a 'DMap' of values out of a 'DMap' of -- Dynamic values.
422
mconcatDyn es = do ddm :: Dynamic t (DMap (Const2 Int a)) <- distributeDMapOverDyn $ DMap.fromList $ map (\(k, v) -> WrapArg (Const2 k) :=> v) $ zip [0 :: Int ..] es mapDyn (mconcat . map (\(Const2 _ :=> v) -> v) . DMap.toList) ddm -- | Create a 'Dynamic' with a 'DMap' of values out of a 'DMap' of -- Dynamic values.
322
true
true
0
16
100
198
103
95
null
null
ciderpunx/cv-api
src/Db.hs
gpl-3.0
createEducation :: CvKey -> Education -> SqlPersistM (Key Education) createEducation cvKey e = insert $ Education (Just cvKey) (educationInstitution e) (educationArea e) (educationStudyType e) (educationStartDate e) (educationEndDate e) (educationGpa e) (educationCourses e)
390
createEducation :: CvKey -> Education -> SqlPersistM (Key Education) createEducation cvKey e = insert $ Education (Just cvKey) (educationInstitution e) (educationArea e) (educationStudyType e) (educationStartDate e) (educationEndDate e) (educationGpa e) (educationCourses e)
390
createEducation cvKey e = insert $ Education (Just cvKey) (educationInstitution e) (educationArea e) (educationStudyType e) (educationStartDate e) (educationEndDate e) (educationGpa e) (educationCourses e)
321
false
true
0
9
147
102
50
52
null
null
fractalcat/series
lib/Data/TimeSeries.hs
mit
timeParam :: TimeStamp -> TimeStamp -> SampleInterval -> Double timeParam t1 t2 ti = fromIntegral (ti - t1) / fromIntegral (t2 - t1)
132
timeParam :: TimeStamp -> TimeStamp -> SampleInterval -> Double timeParam t1 t2 ti = fromIntegral (ti - t1) / fromIntegral (t2 - t1)
132
timeParam t1 t2 ti = fromIntegral (ti - t1) / fromIntegral (t2 - t1)
68
false
true
0
8
22
54
27
27
null
null
tilltheis/propositional-logic
src/PropositionalLogic/LogicTest.hs
bsd-3-clause
findDisjInConj' _ x = x
23
findDisjInConj' _ x = x
23
findDisjInConj' _ x = x
23
false
false
0
5
4
11
5
6
null
null
scrive/hpqtypes
src/Database/PostgreSQL/PQTypes/Internal/Utils.hs
bsd-3-clause
safePeekCString :: CString -> IO (Maybe String) safePeekCString cs | cs == nullPtr = return Nothing | otherwise = Just <$> peekCString cs
145
safePeekCString :: CString -> IO (Maybe String) safePeekCString cs | cs == nullPtr = return Nothing | otherwise = Just <$> peekCString cs
145
safePeekCString cs | cs == nullPtr = return Nothing | otherwise = Just <$> peekCString cs
97
false
true
1
8
30
54
25
29
null
null
alanz/htelehash
src/Network/TeleHash/Packet.hs
bsd-3-clause
unLP :: LinePacket -> BC.ByteString unLP (LP x) = x
51
unLP :: LinePacket -> BC.ByteString unLP (LP x) = x
51
unLP (LP x) = x
15
false
true
0
7
9
26
13
13
null
null
yihuang/xml2json
tests/Test.hs
bsd-3-clause
testPList :: (String, L.ByteString, Value) -> Spec testPList (desc, xml, json) = it desc $ let v = runExcT (PList.xmlToJSON xml) in v == json
162
testPList :: (String, L.ByteString, Value) -> Spec testPList (desc, xml, json) = it desc $ let v = runExcT (PList.xmlToJSON xml) in v == json
162
testPList (desc, xml, json) = it desc $ let v = runExcT (PList.xmlToJSON xml) in v == json
111
false
true
0
13
45
71
37
34
null
null
mitchellwrosen/dohaskell
src/Handler/Feed.hs
bsd-3-clause
timeout :: Int timeout = 10
27
timeout :: Int timeout = 10
27
timeout = 10
12
false
true
0
6
5
18
7
11
null
null
FranklinChen/twenty-four-days2015-of-hackage
src/SymbolicDifferentiation/AlphaSyntax.hs
bsd-3-clause
deriv (V v') v = N (if v' == v then 1 else 0)
52
deriv (V v') v = N (if v' == v then 1 else 0)
52
deriv (V v') v = N (if v' == v then 1 else 0)
52
false
false
1
8
20
37
18
19
null
null
ku-fpg/kansas-amber
tests/ExprTests/ExprWord32.hs
bsd-3-clause
prop_gt :: ArduinoConnection -> RemoteRef Bool -> Word32 -> Word32 -> Property prop_gt c r x y = monadicIO $ do let local = x > y remote <- run $ send c $ do writeRemoteRefE r $ (lit x) >* (lit y) v <- readRemoteRefE r return v assert (local == litEvalB remote)
297
prop_gt :: ArduinoConnection -> RemoteRef Bool -> Word32 -> Word32 -> Property prop_gt c r x y = monadicIO $ do let local = x > y remote <- run $ send c $ do writeRemoteRefE r $ (lit x) >* (lit y) v <- readRemoteRefE r return v assert (local == litEvalB remote)
297
prop_gt c r x y = monadicIO $ do let local = x > y remote <- run $ send c $ do writeRemoteRefE r $ (lit x) >* (lit y) v <- readRemoteRefE r return v assert (local == litEvalB remote)
218
false
true
0
15
89
132
60
72
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSYS_HSCROLL_Y :: Int wxSYS_HSCROLL_Y = 27
43
wxSYS_HSCROLL_Y :: Int wxSYS_HSCROLL_Y = 27
43
wxSYS_HSCROLL_Y = 27
20
false
true
0
4
5
11
6
5
null
null
gridaphobe/ghc
utils/genapply/Main.hs
bsd-3-clause
formalParamType arg = argRep arg
32
formalParamType arg = argRep arg
32
formalParamType arg = argRep arg
32
false
false
0
5
4
12
5
7
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'V.zipWith5' v_zipWith5 = V.zipWith5
40
v_zipWith5 = V.zipWith5
23
v_zipWith5 = V.zipWith5
23
true
false
0
5
4
9
5
4
null
null
nshimaza/cisco-spark-api
webex-teams-api/app/Main.hs
mit
beforeMessageOptParser :: Parser MessageId beforeMessageOptParser = MessageId . T.pack <$> strOption ( long "before-message" <> short 'm' <> metavar "MESSAGE_ID" <> help "List messages sent before a message, by ID" )
249
beforeMessageOptParser :: Parser MessageId beforeMessageOptParser = MessageId . T.pack <$> strOption ( long "before-message" <> short 'm' <> metavar "MESSAGE_ID" <> help "List messages sent before a message, by ID" )
249
beforeMessageOptParser = MessageId . T.pack <$> strOption ( long "before-message" <> short 'm' <> metavar "MESSAGE_ID" <> help "List messages sent before a message, by ID" )
206
false
true
1
10
63
61
26
35
null
null
DanielSchuessler/hstri
Tests.hs
gpl-3.0
prop_innerEdgeNeighborhood :: Triangulation -> Property prop_innerEdgeNeighborhood (tr :: Triangulation) = forAllElements (edges tr) (\te -> case innerEdgeNeighborhood te of Nothing -> property (isBoundaryEdge te) Just xs -> length xs .=. ecSize te) where isBoundaryEdge = any (isNothing . lookupGluingOfITriangle tr) . itrianglesContainingEdge -- | Test that each element of krBasis satisfies the matching equations
500
prop_innerEdgeNeighborhood :: Triangulation -> Property prop_innerEdgeNeighborhood (tr :: Triangulation) = forAllElements (edges tr) (\te -> case innerEdgeNeighborhood te of Nothing -> property (isBoundaryEdge te) Just xs -> length xs .=. ecSize te) where isBoundaryEdge = any (isNothing . lookupGluingOfITriangle tr) . itrianglesContainingEdge -- | Test that each element of krBasis satisfies the matching equations
500
prop_innerEdgeNeighborhood (tr :: Triangulation) = forAllElements (edges tr) (\te -> case innerEdgeNeighborhood te of Nothing -> property (isBoundaryEdge te) Just xs -> length xs .=. ecSize te) where isBoundaryEdge = any (isNothing . lookupGluingOfITriangle tr) . itrianglesContainingEdge -- | Test that each element of krBasis satisfies the matching equations
444
false
true
0
12
137
112
54
58
null
null
andyarvanitis/Idris-dev
src/Idris/ParseHelpers.hs
bsd-3-clause
-- | Parses string as a token symbol :: MonadicParsing m => String -> m String symbol = Tok.symbol
98
symbol :: MonadicParsing m => String -> m String symbol = Tok.symbol
68
symbol = Tok.symbol
19
true
true
0
8
18
34
15
19
null
null
AndreasPK/stack
src/Stack/Build/ConstructPlan.hs
bsd-3-clause
toolWarningText :: ToolWarning -> Text toolWarningText (NoToolFound toolName pkgName) = "No packages found in snapshot which provide a " <> T.pack (show toolName) <> " executable, which is a build-tool dependency of " <> T.pack (show (packageNameString pkgName))
278
toolWarningText :: ToolWarning -> Text toolWarningText (NoToolFound toolName pkgName) = "No packages found in snapshot which provide a " <> T.pack (show toolName) <> " executable, which is a build-tool dependency of " <> T.pack (show (packageNameString pkgName))
278
toolWarningText (NoToolFound toolName pkgName) = "No packages found in snapshot which provide a " <> T.pack (show toolName) <> " executable, which is a build-tool dependency of " <> T.pack (show (packageNameString pkgName))
239
false
true
0
10
53
66
32
34
null
null
bitemyapp/uri-bytestring
test/URI/ByteStringTests.hs
bsd-3-clause
------------------------------------------------------------------------------- testParses' :: URIParserOptions -> ByteString -> URI -> TestTree testParses' opts s u = testGroup "testParses'" [ parseTestURI opts s $ Right u , parseTestRelativeRef opts (makeRelativeRefBS s) $ Right (makeRelativeRefTyped u) ]
320
testParses' :: URIParserOptions -> ByteString -> URI -> TestTree testParses' opts s u = testGroup "testParses'" [ parseTestURI opts s $ Right u , parseTestRelativeRef opts (makeRelativeRefBS s) $ Right (makeRelativeRefTyped u) ]
240
testParses' opts s u = testGroup "testParses'" [ parseTestURI opts s $ Right u , parseTestRelativeRef opts (makeRelativeRefBS s) $ Right (makeRelativeRefTyped u) ]
175
true
true
0
9
45
79
38
41
null
null
Heather/Idris-dev
src/Idris/IdrisDoc.hs
bsd-3-clause
extractPTactic (Induction p) = extract p
45
extractPTactic (Induction p) = extract p
45
extractPTactic (Induction p) = extract p
45
false
false
0
6
10
19
8
11
null
null
CharlesRandles/cryptoChallenge
aescbc.hs
gpl-3.0
toByteString :: Cipher -> B.ByteString toByteString c = pack (toString c)
74
toByteString :: Cipher -> B.ByteString toByteString c = pack (toString c)
74
toByteString c = pack (toString c)
35
false
true
0
8
11
34
15
19
null
null
nevrenato/HetsAlloy
PGIP/Query.hs
gpl-2.0
-- | the path is not empty and leading slashes are removed anaUri :: [String] -> [QueryPair] -> [String] -> Either String Query anaUri pathBits query globals = case anaQuery query globals of Left err -> Left err Right (mi, qk) -> let path = intercalate "/" pathBits in case (mi, readMaybe path) of (Just i, Just j) | i /= j -> Left "different dg ids" (_, mj) -> Right $ Query (case catMaybes [mi, mj] of [] -> NewDGQuery path [] i : _ -> DGQuery i $ if isJust mj then Nothing else Just path) qk
555
anaUri :: [String] -> [QueryPair] -> [String] -> Either String Query anaUri pathBits query globals = case anaQuery query globals of Left err -> Left err Right (mi, qk) -> let path = intercalate "/" pathBits in case (mi, readMaybe path) of (Just i, Just j) | i /= j -> Left "different dg ids" (_, mj) -> Right $ Query (case catMaybes [mi, mj] of [] -> NewDGQuery path [] i : _ -> DGQuery i $ if isJust mj then Nothing else Just path) qk
496
anaUri pathBits query globals = case anaQuery query globals of Left err -> Left err Right (mi, qk) -> let path = intercalate "/" pathBits in case (mi, readMaybe path) of (Just i, Just j) | i /= j -> Left "different dg ids" (_, mj) -> Right $ Query (case catMaybes [mi, mj] of [] -> NewDGQuery path [] i : _ -> DGQuery i $ if isJust mj then Nothing else Just path) qk
427
true
true
2
17
159
219
111
108
null
null
keithodulaigh/Hets
Common/AnnoParser.hs
gpl-2.0
parseInternal :: GenParser Char () a -> Pos -> String -> Either ParseError a parseInternal p sp = parse (do setPosition $ fromPos sp spaces res <- p eof return res) (Id.sourceName sp)
205
parseInternal :: GenParser Char () a -> Pos -> String -> Either ParseError a parseInternal p sp = parse (do setPosition $ fromPos sp spaces res <- p eof return res) (Id.sourceName sp)
205
parseInternal p sp = parse (do setPosition $ fromPos sp spaces res <- p eof return res) (Id.sourceName sp)
128
false
true
0
9
54
93
40
53
null
null
qpliu/esolang
blo/hs/TestLLVMCodeGen.hs
gpl-3.0
testSetClear :: Assertion testSetClear = testCodeGen "testSetClear" "type a{a}func TestSetClear(){var a a;set a.a;clear a.a}" (prologue ++ "define void @_TestSetClear() {" ++ " l0:" ++ " %0 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* null,i32 0,i32 1,i8 1" ++ " %1 = ptrtoint i1* %0 to i8" ++ " %2 = alloca i8,i8 %1" ++ " %3 = insertvalue {i8*,i8**} undef,i8* %2,0" ++ " %4 = insertvalue {i8*,i8**} %3,i8** null,1" ++ " call void @llvm.memset.p0i8.i8(i8* %2,i8 0,i8 %1,i32 0,i1 0)" ++ " %5 = extractvalue {i8*,i8**} %4,0" ++ " %6 = bitcast i8* %5 to {i8,[0 x i1]}*" ++ " %7 = select i1 1,i8 0,i8 0" ++ " %8 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* %6,i32 0,i32 1,i8 %7" ++ " store i1 1,i1* %8" ++ " %9 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* %6,i32 0,i32 1,i8 %7" ++ " store i1 0,i1* %9" ++ " ret void" ++ " }")
1,037
testSetClear :: Assertion testSetClear = testCodeGen "testSetClear" "type a{a}func TestSetClear(){var a a;set a.a;clear a.a}" (prologue ++ "define void @_TestSetClear() {" ++ " l0:" ++ " %0 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* null,i32 0,i32 1,i8 1" ++ " %1 = ptrtoint i1* %0 to i8" ++ " %2 = alloca i8,i8 %1" ++ " %3 = insertvalue {i8*,i8**} undef,i8* %2,0" ++ " %4 = insertvalue {i8*,i8**} %3,i8** null,1" ++ " call void @llvm.memset.p0i8.i8(i8* %2,i8 0,i8 %1,i32 0,i1 0)" ++ " %5 = extractvalue {i8*,i8**} %4,0" ++ " %6 = bitcast i8* %5 to {i8,[0 x i1]}*" ++ " %7 = select i1 1,i8 0,i8 0" ++ " %8 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* %6,i32 0,i32 1,i8 %7" ++ " store i1 1,i1* %8" ++ " %9 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* %6,i32 0,i32 1,i8 %7" ++ " store i1 0,i1* %9" ++ " ret void" ++ " }")
1,037
testSetClear = testCodeGen "testSetClear" "type a{a}func TestSetClear(){var a a;set a.a;clear a.a}" (prologue ++ "define void @_TestSetClear() {" ++ " l0:" ++ " %0 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* null,i32 0,i32 1,i8 1" ++ " %1 = ptrtoint i1* %0 to i8" ++ " %2 = alloca i8,i8 %1" ++ " %3 = insertvalue {i8*,i8**} undef,i8* %2,0" ++ " %4 = insertvalue {i8*,i8**} %3,i8** null,1" ++ " call void @llvm.memset.p0i8.i8(i8* %2,i8 0,i8 %1,i32 0,i1 0)" ++ " %5 = extractvalue {i8*,i8**} %4,0" ++ " %6 = bitcast i8* %5 to {i8,[0 x i1]}*" ++ " %7 = select i1 1,i8 0,i8 0" ++ " %8 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* %6,i32 0,i32 1,i8 %7" ++ " store i1 1,i1* %8" ++ " %9 = getelementptr {i8,[0 x i1]},{i8,[0 x i1]}* %6,i32 0,i32 1,i8 %7" ++ " store i1 0,i1* %9" ++ " ret void" ++ " }")
1,011
false
true
0
23
368
89
45
44
null
null
ingemaradahl/bilder
src/Compiler/Simple/ToGLSL.hs
lgpl-3.0
expToGLSL (S.ECall i es) = G.ECall (G.Ident i) (map expToGLSL es)
65
expToGLSL (S.ECall i es) = G.ECall (G.Ident i) (map expToGLSL es)
65
expToGLSL (S.ECall i es) = G.ECall (G.Ident i) (map expToGLSL es)
65
false
false
0
8
10
44
20
24
null
null
da-x/buildsome
src/Buildsome/Print.hs
gpl-2.0
replay :: Show a => Printer -> Target -> StdOutputs ByteString -> Reason -> Verbosity -> a -> IO () -> IO () replay printer target stdOutputs reason verbosity selfTime action = do action `onExceptionWith` \e -> do printStrLn printer header cmd printer target targetStdOutputs printer target stdOutputs printStrLn printer $ cError $ "EXCEPTION: " <> show e when shouldPrint $ do printStrLn printer $ mconcat [ header, " (originally) took ", cTiming (show selfTime <> " seconds") , outputsHeader ] replayCmd (verbosityCommands verbosity) printer target targetStdOutputs printer target stdOutputs where header = "REPLAY for target " <> cTarget (show (targetOutputs target)) <> " (" <> reason <> ")" shouldPrint = case verbosityOutputs verbosity of PrintOutputsAnyway -> True PrintOutputsNonEmpty -> not (StdOutputs.null stdOutputs) PrintOutputsIfStderr -> not (BS8.null (StdOutputs.stdErr stdOutputs)) outputsHeader = case (BS8.null (StdOutputs.stdOut stdOutputs), BS8.null (StdOutputs.stdErr stdOutputs)) of (False, False) -> ", STDOUT/STDERR follow" (False, True) -> ", STDOUT follows" (True, False) -> ", STDERR follows" (True, True) -> "" Color.Scheme{..} = Color.scheme
1,309
replay :: Show a => Printer -> Target -> StdOutputs ByteString -> Reason -> Verbosity -> a -> IO () -> IO () replay printer target stdOutputs reason verbosity selfTime action = do action `onExceptionWith` \e -> do printStrLn printer header cmd printer target targetStdOutputs printer target stdOutputs printStrLn printer $ cError $ "EXCEPTION: " <> show e when shouldPrint $ do printStrLn printer $ mconcat [ header, " (originally) took ", cTiming (show selfTime <> " seconds") , outputsHeader ] replayCmd (verbosityCommands verbosity) printer target targetStdOutputs printer target stdOutputs where header = "REPLAY for target " <> cTarget (show (targetOutputs target)) <> " (" <> reason <> ")" shouldPrint = case verbosityOutputs verbosity of PrintOutputsAnyway -> True PrintOutputsNonEmpty -> not (StdOutputs.null stdOutputs) PrintOutputsIfStderr -> not (BS8.null (StdOutputs.stdErr stdOutputs)) outputsHeader = case (BS8.null (StdOutputs.stdOut stdOutputs), BS8.null (StdOutputs.stdErr stdOutputs)) of (False, False) -> ", STDOUT/STDERR follow" (False, True) -> ", STDOUT follows" (True, False) -> ", STDERR follows" (True, True) -> "" Color.Scheme{..} = Color.scheme
1,309
replay printer target stdOutputs reason verbosity selfTime action = do action `onExceptionWith` \e -> do printStrLn printer header cmd printer target targetStdOutputs printer target stdOutputs printStrLn printer $ cError $ "EXCEPTION: " <> show e when shouldPrint $ do printStrLn printer $ mconcat [ header, " (originally) took ", cTiming (show selfTime <> " seconds") , outputsHeader ] replayCmd (verbosityCommands verbosity) printer target targetStdOutputs printer target stdOutputs where header = "REPLAY for target " <> cTarget (show (targetOutputs target)) <> " (" <> reason <> ")" shouldPrint = case verbosityOutputs verbosity of PrintOutputsAnyway -> True PrintOutputsNonEmpty -> not (StdOutputs.null stdOutputs) PrintOutputsIfStderr -> not (BS8.null (StdOutputs.stdErr stdOutputs)) outputsHeader = case (BS8.null (StdOutputs.stdOut stdOutputs), BS8.null (StdOutputs.stdErr stdOutputs)) of (False, False) -> ", STDOUT/STDERR follow" (False, True) -> ", STDOUT follows" (True, False) -> ", STDERR follows" (True, True) -> "" Color.Scheme{..} = Color.scheme
1,200
false
true
10
16
301
413
201
212
null
null
luzhuomi/xhaskell
Language/XHaskell/Source.hs
bsd-3-clause
typeVars' (TyCon _) = []
25
typeVars' (TyCon _) = []
25
typeVars' (TyCon _) = []
25
false
false
0
6
5
18
8
10
null
null
danr/hipspec
src/HipSpec/Lang/Rich.hs
gpl-3.0
substMany :: Eq a => [(a,Expr a)] -> Expr a -> Expr a substMany xs e0 = foldr (\ (u,e) -> (e // u)) e0 xs
105
substMany :: Eq a => [(a,Expr a)] -> Expr a -> Expr a substMany xs e0 = foldr (\ (u,e) -> (e // u)) e0 xs
105
substMany xs e0 = foldr (\ (u,e) -> (e // u)) e0 xs
51
false
true
0
9
25
77
40
37
null
null
olsner/ghc
compiler/basicTypes/MkId.hs
bsd-3-clause
coerceName = mkWiredInIdName gHC_PRIM (fsLit "coerce") coerceKey coerceId
98
coerceName = mkWiredInIdName gHC_PRIM (fsLit "coerce") coerceKey coerceId
98
coerceName = mkWiredInIdName gHC_PRIM (fsLit "coerce") coerceKey coerceId
98
false
false
0
7
32
21
10
11
null
null
oldmanmike/haskellSDL2Examples
src/lesson15.hs
gpl-2.0
repeatUntilComplete :: (Monad m) => m World -> m () repeatUntilComplete game = game >>= \state -> unless (gameover state) $ repeatUntilComplete game
148
repeatUntilComplete :: (Monad m) => m World -> m () repeatUntilComplete game = game >>= \state -> unless (gameover state) $ repeatUntilComplete game
148
repeatUntilComplete game = game >>= \state -> unless (gameover state) $ repeatUntilComplete game
96
false
true
0
10
22
64
30
34
null
null
plow-technologies/persistent
persistent-postgresql/Database/Persist/Postgresql/JSON.hs
mit
fromPersistValueParseError :: (Show a) => Text -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64" -> a -- ^ Received value -> Text -- ^ Additional error -> Text -- ^ Error message fromPersistValueParseError haskellType received err = T.concat [ "Failed to parse Haskell type `" , haskellType , "`, but received " , T.pack (show received) , " | with error: " , err ]
517
fromPersistValueParseError :: (Show a) => Text -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64" -> a -- ^ Received value -> Text -- ^ Additional error -> Text fromPersistValueParseError haskellType received err = T.concat [ "Failed to parse Haskell type `" , haskellType , "`, but received " , T.pack (show received) , " | with error: " , err ]
498
fromPersistValueParseError haskellType received err = T.concat [ "Failed to parse Haskell type `" , haskellType , "`, but received " , T.pack (show received) , " | with error: " , err ]
213
true
true
0
8
203
77
43
34
null
null
brendanhay/gogol
gogol-container/gen/Network/Google/Resource/Container/Projects/Zones/Clusters/NodePools/Autoscaling.hs
mpl-2.0
-- | OAuth access token. pzcnpaAccessToken :: Lens' ProjectsZonesClustersNodePoolsAutoscaling (Maybe Text) pzcnpaAccessToken = lens _pzcnpaAccessToken (\ s a -> s{_pzcnpaAccessToken = a})
195
pzcnpaAccessToken :: Lens' ProjectsZonesClustersNodePoolsAutoscaling (Maybe Text) pzcnpaAccessToken = lens _pzcnpaAccessToken (\ s a -> s{_pzcnpaAccessToken = a})
170
pzcnpaAccessToken = lens _pzcnpaAccessToken (\ s a -> s{_pzcnpaAccessToken = a})
88
true
true
0
8
29
49
25
24
null
null
Javran/tuppence
src/Kantour/WhoCallsTheFleet/Fetch.hs
mit
splitLines :: LBS.ByteString -> [BS.ByteString] splitLines = filter nonEmptyLine . BSC.split '\n' . LBS.toStrict where nonEmptyLine = oany (not . isSpace . w2c)
166
splitLines :: LBS.ByteString -> [BS.ByteString] splitLines = filter nonEmptyLine . BSC.split '\n' . LBS.toStrict where nonEmptyLine = oany (not . isSpace . w2c)
166
splitLines = filter nonEmptyLine . BSC.split '\n' . LBS.toStrict where nonEmptyLine = oany (not . isSpace . w2c)
118
false
true
0
8
28
62
31
31
null
null
sdiehl/ghc
compiler/prelude/PrimOp.hs
bsd-3-clause
primOpIsCheap :: PrimOp -> Bool -- See Note [PrimOp can_fail and has_side_effects] primOpIsCheap op = primOpOkForSpeculation op
127
primOpIsCheap :: PrimOp -> Bool primOpIsCheap op = primOpOkForSpeculation op
76
primOpIsCheap op = primOpOkForSpeculation op
44
true
true
0
5
16
22
11
11
null
null
dfordivam/functorrent
test/ControlThreadTests.hs
gpl-3.0
doTests :: IO () doTests = putStrLn "Not Implemented"
53
doTests :: IO () doTests = putStrLn "Not Implemented"
53
doTests = putStrLn "Not Implemented"
36
false
true
0
6
8
19
9
10
null
null
banacorn/tredis
src/Database/Edis/Command/String.hs
mit
incrby :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Integer -> Edis xs xs (Either Reply Integer) incrby key n = Edis $ Redis.incrby (encodeKey key) n
171
incrby :: (KnownSymbol s, StringOfIntegerOrNX xs s) => Proxy s -> Integer -> Edis xs xs (Either Reply Integer) incrby key n = Edis $ Redis.incrby (encodeKey key) n
171
incrby key n = Edis $ Redis.incrby (encodeKey key) n
52
false
true
2
11
36
82
38
44
null
null
tphyahoo/haskoin
haskoin-core/Network/Haskoin/Script/Evaluator.hs
unlicense
eval OP_HASH160 = tStack1 $ return . bsToSv . getHash160 . hash160 . getHash256 . hash256 . opToSv
102
eval OP_HASH160 = tStack1 $ return . bsToSv . getHash160 . hash160 . getHash256 . hash256 . opToSv
102
eval OP_HASH160 = tStack1 $ return . bsToSv . getHash160 . hash160 . getHash256 . hash256 . opToSv
102
false
false
3
8
21
43
18
25
null
null
gbataille/pandoc
src/Text/Pandoc/Writers/RST.hs
gpl-2.0
escapeString :: String -> String escapeString = escapeStringUsing (backslashEscapes "`\\|*_")
93
escapeString :: String -> String escapeString = escapeStringUsing (backslashEscapes "`\\|*_")
93
escapeString = escapeStringUsing (backslashEscapes "`\\|*_")
60
false
true
0
7
9
24
12
12
null
null
ghorn/dynobud
dynobud-typevecs/src/Dyno/TypeVecs.hs
lgpl-3.0
tvlast :: Vec n a -> a tvlast x = case V.length v of 0 -> error "tvlast: empty" _ -> V.last v where v = unVec x
121
tvlast :: Vec n a -> a tvlast x = case V.length v of 0 -> error "tvlast: empty" _ -> V.last v where v = unVec x
121
tvlast x = case V.length v of 0 -> error "tvlast: empty" _ -> V.last v where v = unVec x
98
false
true
1
9
37
72
30
42
null
null
ppomes/hsab
hsab.hs
bsd-2-clause
myForkIO :: IO a -> IO (MVar (Either SomeException a)) myForkIO io = do mvar <- newEmptyMVar void $ forkFinally io (putMVar mvar) return mvar
150
myForkIO :: IO a -> IO (MVar (Either SomeException a)) myForkIO io = do mvar <- newEmptyMVar void $ forkFinally io (putMVar mvar) return mvar
150
myForkIO io = do mvar <- newEmptyMVar void $ forkFinally io (putMVar mvar) return mvar
95
false
true
0
11
33
74
32
42
null
null
sukhmel/experiments.haskell
banana-pause.hs
mit
displayHelpMessage :: IO () displayHelpMessage = mapM_ putStrLn $ "Commands are:": " count - send counter event": " pause - pause event network": " actuate - actuate event network": " quit - quit the program": "": []
244
displayHelpMessage :: IO () displayHelpMessage = mapM_ putStrLn $ "Commands are:": " count - send counter event": " pause - pause event network": " actuate - actuate event network": " quit - quit the program": "": []
244
displayHelpMessage = mapM_ putStrLn $ "Commands are:": " count - send counter event": " pause - pause event network": " actuate - actuate event network": " quit - quit the program": "": []
216
false
true
2
11
64
52
24
28
null
null
wolftune/hoogle
src/Input/Item.hs
bsd-3-clause
itemName (IInstance _) = Nothing
32
itemName (IInstance _) = Nothing
32
itemName (IInstance _) = Nothing
32
false
false
0
7
4
15
7
8
null
null
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs/src/Compiler/GhcjsHooks.hs
mit
runGhcjsPhase :: GhcjsSettings -> GhcjsEnv -> PhasePlus -> FilePath -> DynFlags -> CompPipeline (PhasePlus, FilePath) runGhcjsPhase _settings _env (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (xopt Opt_Cpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ Utils.doCpp dflags1 True{-raw-} True input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn)
1,640
runGhcjsPhase :: GhcjsSettings -> GhcjsEnv -> PhasePlus -> FilePath -> DynFlags -> CompPipeline (PhasePlus, FilePath) runGhcjsPhase _settings _env (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (xopt Opt_Cpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ Utils.doCpp dflags1 True{-raw-} True input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn)
1,639
runGhcjsPhase _settings _env (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (xopt Opt_Cpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ Utils.doCpp dflags1 True{-raw-} True input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn)
1,479
false
true
0
14
537
342
164
178
null
null
khibino/haskell-debian-build.rebuild
mains/odebuild.hs
bsd-3-clause
build' :: [BuildMode] -> ODebuildOptions -> [String] -> Build (Source, Maybe Hackage) build' modes opts args = do ((_, dir), src, mayH) <- prepare opts liftTrace $ Command.build dir modes (installDeps opts) args return (src, mayH)
236
build' :: [BuildMode] -> ODebuildOptions -> [String] -> Build (Source, Maybe Hackage) build' modes opts args = do ((_, dir), src, mayH) <- prepare opts liftTrace $ Command.build dir modes (installDeps opts) args return (src, mayH)
236
build' modes opts args = do ((_, dir), src, mayH) <- prepare opts liftTrace $ Command.build dir modes (installDeps opts) args return (src, mayH)
150
false
true
0
11
41
114
57
57
null
null
ian-ross/c2hs-macos-test
c2hs-0.26.1/src/C2HS/C/Trav.hs
mit
extractAlias :: CDecl -> Bool -> Maybe (Ident, Bool) extractAlias decl@(CDecl specs _ _) ind = case [ts | CTypeSpec ts <- specs] of [CTypeDef ide' _] -> -- type spec is aliased ident case declaredDeclr decl of Nothing -> Just (ide', ind) Just (CDeclr _ [] _ _ _) -> Just (ide', ind) -- no type derivations Just (CDeclr _ [CPtrDeclr _ _] _ _ _) -- one pointer indirection | ind -> Just (ide', False) | otherwise -> Nothing _ -> Nothing _ -> Nothing -- | if the given tag is a forward declaration of a structure, follow the -- reference to the full declaration -- -- * the recursive call is not dangerous as there can't be any cycles --
883
extractAlias :: CDecl -> Bool -> Maybe (Ident, Bool) extractAlias decl@(CDecl specs _ _) ind = case [ts | CTypeSpec ts <- specs] of [CTypeDef ide' _] -> -- type spec is aliased ident case declaredDeclr decl of Nothing -> Just (ide', ind) Just (CDeclr _ [] _ _ _) -> Just (ide', ind) -- no type derivations Just (CDeclr _ [CPtrDeclr _ _] _ _ _) -- one pointer indirection | ind -> Just (ide', False) | otherwise -> Nothing _ -> Nothing _ -> Nothing -- | if the given tag is a forward declaration of a structure, follow the -- reference to the full declaration -- -- * the recursive call is not dangerous as there can't be any cycles --
883
extractAlias decl@(CDecl specs _ _) ind = case [ts | CTypeSpec ts <- specs] of [CTypeDef ide' _] -> -- type spec is aliased ident case declaredDeclr decl of Nothing -> Just (ide', ind) Just (CDeclr _ [] _ _ _) -> Just (ide', ind) -- no type derivations Just (CDeclr _ [CPtrDeclr _ _] _ _ _) -- one pointer indirection | ind -> Just (ide', False) | otherwise -> Nothing _ -> Nothing _ -> Nothing -- | if the given tag is a forward declaration of a structure, follow the -- reference to the full declaration -- -- * the recursive call is not dangerous as there can't be any cycles --
830
false
true
0
15
372
209
108
101
null
null
KaneTW/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
runIdeModeCommand :: Handle -- ^^ The handle for communication -> Integer -- ^^ The continuation ID for the client -> IState -- ^^ The original IState -> FilePath -- ^^ The current open file -> [FilePath] -- ^^ The currently loaded modules -> IdeMode.IdeModeCommand -- ^^ The command to process -> Idris () runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) = do c <- colourise i <- getIState case parseCmd i "(input)" cmd of Failure (ErrInfo err _) -> iPrintError $ show (fixColour False err) Success (Right (Prove mode n')) -> idrisCatch (do process fn (Prove mode n') isetPrompt (mkPrompt mods) case idris_outputmode i of IdeMode n h -> -- signal completion of proof to ide runIO . hPutStrLn h $ IdeMode.convSExp "return" (IdeMode.SymbolAtom "ok", "") n _ -> return ()) (\e -> do ist <- getIState isetPrompt (mkPrompt mods) case idris_outputmode i of IdeMode n h -> runIO . hPutStrLn h $ IdeMode.convSExp "abandon-proof" "Abandoned" n _ -> return () iRenderError $ pprintErr ist e) Success (Right cmd) -> idrisCatch (idemodeProcess fn cmd) (\e -> getIState >>= iRenderError . flip pprintErr e) Success (Left err) -> iPrintError err
1,687
runIdeModeCommand :: Handle -- ^^ The handle for communication -> Integer -- ^^ The continuation ID for the client -> IState -- ^^ The original IState -> FilePath -- ^^ The current open file -> [FilePath] -- ^^ The currently loaded modules -> IdeMode.IdeModeCommand -- ^^ The command to process -> Idris () runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) = do c <- colourise i <- getIState case parseCmd i "(input)" cmd of Failure (ErrInfo err _) -> iPrintError $ show (fixColour False err) Success (Right (Prove mode n')) -> idrisCatch (do process fn (Prove mode n') isetPrompt (mkPrompt mods) case idris_outputmode i of IdeMode n h -> -- signal completion of proof to ide runIO . hPutStrLn h $ IdeMode.convSExp "return" (IdeMode.SymbolAtom "ok", "") n _ -> return ()) (\e -> do ist <- getIState isetPrompt (mkPrompt mods) case idris_outputmode i of IdeMode n h -> runIO . hPutStrLn h $ IdeMode.convSExp "abandon-proof" "Abandoned" n _ -> return () iRenderError $ pprintErr ist e) Success (Right cmd) -> idrisCatch (idemodeProcess fn cmd) (\e -> getIState >>= iRenderError . flip pprintErr e) Success (Left err) -> iPrintError err
1,687
runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) = do c <- colourise i <- getIState case parseCmd i "(input)" cmd of Failure (ErrInfo err _) -> iPrintError $ show (fixColour False err) Success (Right (Prove mode n')) -> idrisCatch (do process fn (Prove mode n') isetPrompt (mkPrompt mods) case idris_outputmode i of IdeMode n h -> -- signal completion of proof to ide runIO . hPutStrLn h $ IdeMode.convSExp "return" (IdeMode.SymbolAtom "ok", "") n _ -> return ()) (\e -> do ist <- getIState isetPrompt (mkPrompt mods) case idris_outputmode i of IdeMode n h -> runIO . hPutStrLn h $ IdeMode.convSExp "abandon-proof" "Abandoned" n _ -> return () iRenderError $ pprintErr ist e) Success (Right cmd) -> idrisCatch (idemodeProcess fn cmd) (\e -> getIState >>= iRenderError . flip pprintErr e) Success (Left err) -> iPrintError err
1,266
false
true
0
21
733
413
196
217
null
null
junjihashimoto/persistent
persistent/Database/Persist/Sql/Raw.hs
mit
getStmt :: MonadIO m => Text -> ReaderT SqlBackend m Statement getStmt sql = do conn <- ask liftIO $ getStmtConn conn sql
129
getStmt :: MonadIO m => Text -> ReaderT SqlBackend m Statement getStmt sql = do conn <- ask liftIO $ getStmtConn conn sql
129
getStmt sql = do conn <- ask liftIO $ getStmtConn conn sql
66
false
true
0
8
30
51
23
28
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSYS_WINDOWMIN_X :: Int wxSYS_WINDOWMIN_X = 19
47
wxSYS_WINDOWMIN_X :: Int wxSYS_WINDOWMIN_X = 19
47
wxSYS_WINDOWMIN_X = 19
22
false
true
0
6
5
18
7
11
null
null
ulricha/dsh
src/Database/DSH/FKL/Lang.hs
bsd-3-clause
parenthize :: (Pretty l, Pretty e) => ExprTempl l e -> Doc parenthize e = case e of Const{} -> pretty e Table{} -> pretty e Var{} -> pretty e PApp1 _ (TupElem _) _ _ -> pretty e _ -> parens $ pretty e
316
parenthize :: (Pretty l, Pretty e) => ExprTempl l e -> Doc parenthize e = case e of Const{} -> pretty e Table{} -> pretty e Var{} -> pretty e PApp1 _ (TupElem _) _ _ -> pretty e _ -> parens $ pretty e
316
parenthize e = case e of Const{} -> pretty e Table{} -> pretty e Var{} -> pretty e PApp1 _ (TupElem _) _ _ -> pretty e _ -> parens $ pretty e
257
false
true
6
8
160
118
55
63
null
null
mettekou/ghc
compiler/ghci/ByteCodeGen.hs
bsd-3-clause
isFollowableArg :: ArgRep -> Bool isFollowableArg P = True
58
isFollowableArg :: ArgRep -> Bool isFollowableArg P = True
58
isFollowableArg P = True
24
false
true
0
7
8
24
10
14
null
null
alcidesv/ReH
hs-src/Rede/SpdyProtocol/Streams/State.hs
bsd-3-clause
defaultStreamState :: Int -> (IO () ) -> MVar Int -> IO StreamState defaultStreamState stream_id fin next_push_id = do stage_ioref <- newIORef Closed_StS rw <- newIORef def sw <- newIORef def ma <- newIORef True push_stream_hash_table <- H.new return $ StreamState { stage = stage_ioref ,receiveWin = rw ,sendWin = sw ,sstreamId = stream_id ,mustAck = ma ,finalizer = fin ,pushStreamHashTable = push_stream_hash_table ,nextPushStreamId = next_push_id }
699
defaultStreamState :: Int -> (IO () ) -> MVar Int -> IO StreamState defaultStreamState stream_id fin next_push_id = do stage_ioref <- newIORef Closed_StS rw <- newIORef def sw <- newIORef def ma <- newIORef True push_stream_hash_table <- H.new return $ StreamState { stage = stage_ioref ,receiveWin = rw ,sendWin = sw ,sstreamId = stream_id ,mustAck = ma ,finalizer = fin ,pushStreamHashTable = push_stream_hash_table ,nextPushStreamId = next_push_id }
698
defaultStreamState stream_id fin next_push_id = do stage_ioref <- newIORef Closed_StS rw <- newIORef def sw <- newIORef def ma <- newIORef True push_stream_hash_table <- H.new return $ StreamState { stage = stage_ioref ,receiveWin = rw ,sendWin = sw ,sstreamId = stream_id ,mustAck = ma ,finalizer = fin ,pushStreamHashTable = push_stream_hash_table ,nextPushStreamId = next_push_id }
629
false
true
0
9
313
150
77
73
null
null
alang9/deque
Data/Deque/NonCat/LessTyped.hs
bsd-3-clause
fixup2' (BigR (RX B0 (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go6 s t u v w x
116
fixup2' (BigR (RX B0 (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go6 s t u v w x
116
fixup2' (BigR (RX B0 (B0)) N (TinyL (B3 (P s t) (P u v) (P w x)))) = go6 s t u v w x
116
false
false
0
12
56
84
41
43
null
null
guoguo12/haskell-ptable
ptable.hs
apache-2.0
awei "Pr" = 140.90765
21
awei "Pr" = 140.90765
21
awei "Pr" = 140.90765
21
false
false
0
4
3
10
4
6
null
null
acowley/ghc
compiler/main/HscTypes.hs
bsd-3-clause
emptyMG :: ModuleGraph emptyMG = []
35
emptyMG :: ModuleGraph emptyMG = []
35
emptyMG = []
12
false
true
0
6
5
20
8
12
null
null
duplode/dohaskell
src/Handler/About.hs
bsd-3-clause
getAboutR :: Handler Html getAboutR = do muid <- maybeAuthId defaultLayout $ do setTitle "dohaskell | about" $(widgetFile "about")
154
getAboutR :: Handler Html getAboutR = do muid <- maybeAuthId defaultLayout $ do setTitle "dohaskell | about" $(widgetFile "about")
154
getAboutR = do muid <- maybeAuthId defaultLayout $ do setTitle "dohaskell | about" $(widgetFile "about")
128
false
true
0
13
42
50
20
30
null
null
ndreynolds/hsURL
src/Http/Uri.hs
mit
unreserved = alphaNum <|> safe <|> extra
40
unreserved = alphaNum <|> safe <|> extra
40
unreserved = alphaNum <|> safe <|> extra
40
false
false
0
6
6
14
7
7
null
null
brendanhay/gogol
gogol-dlp/gen/Network/Google/DLP/Types/Product.hs
mpl-2.0
-- | Points to the field that contains the context, for example, an entity -- id. If set, must also set cryptoKey. If set, shift will be consistent -- for the given context. gpdvdscContext :: Lens' GooglePrivacyDlpV2DateShiftConfig (Maybe GooglePrivacyDlpV2FieldId) gpdvdscContext = lens _gpdvdscContext (\ s a -> s{_gpdvdscContext = a})
345
gpdvdscContext :: Lens' GooglePrivacyDlpV2DateShiftConfig (Maybe GooglePrivacyDlpV2FieldId) gpdvdscContext = lens _gpdvdscContext (\ s a -> s{_gpdvdscContext = a})
171
gpdvdscContext = lens _gpdvdscContext (\ s a -> s{_gpdvdscContext = a})
79
true
true
0
9
57
50
27
23
null
null
jonaprieto/athena
src/Athena/Utils/PrettyPrint.hs
mit
indent i d = hang i (spaced i <> d)
39
indent i d = hang i (spaced i <> d)
39
indent i d = hang i (spaced i <> d)
39
false
false
1
8
13
30
12
18
null
null
romanb/amazonka
gen/src/Gen/Output.hs
mpl-2.0
nameCI :: HasName a => a -> CI Text nameCI = CI.mk . view nameOf
64
nameCI :: HasName a => a -> CI Text nameCI = CI.mk . view nameOf
64
nameCI = CI.mk . view nameOf
28
false
true
0
8
14
39
17
22
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/HTMLDocument.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument.linkColor Mozilla HTMLDocument.linkColor documentation> setLinkColor :: (MonadDOM m, ToJSString val) => HTMLDocument -> val -> m () setLinkColor self val = liftDOM (self ^. jss "linkColor" (toJSVal val))
287
setLinkColor :: (MonadDOM m, ToJSString val) => HTMLDocument -> val -> m () setLinkColor self val = liftDOM (self ^. jss "linkColor" (toJSVal val))
162
setLinkColor self val = liftDOM (self ^. jss "linkColor" (toJSVal val))
73
true
true
0
10
45
66
33
33
null
null
rueshyna/gogol
gogol-maps-coordinate/gen/Network/Google/Resource/Coordinate/Jobs/Patch.hs
mpl-2.0
-- | Job address as newline (Unix) separated string jpAddress :: Lens' JobsPatch (Maybe Text) jpAddress = lens _jpAddress (\ s a -> s{_jpAddress = a})
152
jpAddress :: Lens' JobsPatch (Maybe Text) jpAddress = lens _jpAddress (\ s a -> s{_jpAddress = a})
100
jpAddress = lens _jpAddress (\ s a -> s{_jpAddress = a})
58
true
true
1
9
27
52
25
27
null
null
ChrisSwires/One
dist/build/autogen/Paths_One.hs
bsd-2-clause
version :: Version version = Version {versionBranch = [0,0,0], versionTags = []}
80
version :: Version version = Version {versionBranch = [0,0,0], versionTags = []}
80
version = Version {versionBranch = [0,0,0], versionTags = []}
61
false
true
0
8
11
46
24
22
null
null
shlevy/ghc
compiler/codeGen/StgCmmProf.hs
bsd-3-clause
emitCostCentreDecl :: CostCentre -> FCode () emitCostCentreDecl cc = do { dflags <- getDynFlags ; let is_caf | isCafCC cc = mkIntCLit dflags (ord 'c') -- 'c' == is a CAF | otherwise = zero dflags -- NB. bytesFS: we want the UTF-8 bytes here (#5559) ; label <- newByteStringCLit (bytesFS $ costCentreUserNameFS cc) ; modl <- newByteStringCLit (bytesFS $ Module.moduleNameFS $ Module.moduleName $ cc_mod cc) ; loc <- newByteStringCLit $ bytesFS $ mkFastString $ showPpr dflags (costCentreSrcSpan cc) -- XXX going via FastString to get UTF-8 encoding is silly ; let lits = [ zero dflags, -- StgInt ccID, label, -- char *label, modl, -- char *module, loc, -- char *srcloc, zero64, -- StgWord64 mem_alloc zero dflags, -- StgWord time_ticks is_caf, -- StgInt is_caf zero dflags -- struct _CostCentre *link ] ; emitDataLits (mkCCLabel cc) lits }
1,162
emitCostCentreDecl :: CostCentre -> FCode () emitCostCentreDecl cc = do { dflags <- getDynFlags ; let is_caf | isCafCC cc = mkIntCLit dflags (ord 'c') -- 'c' == is a CAF | otherwise = zero dflags -- NB. bytesFS: we want the UTF-8 bytes here (#5559) ; label <- newByteStringCLit (bytesFS $ costCentreUserNameFS cc) ; modl <- newByteStringCLit (bytesFS $ Module.moduleNameFS $ Module.moduleName $ cc_mod cc) ; loc <- newByteStringCLit $ bytesFS $ mkFastString $ showPpr dflags (costCentreSrcSpan cc) -- XXX going via FastString to get UTF-8 encoding is silly ; let lits = [ zero dflags, -- StgInt ccID, label, -- char *label, modl, -- char *module, loc, -- char *srcloc, zero64, -- StgWord64 mem_alloc zero dflags, -- StgWord time_ticks is_caf, -- StgInt is_caf zero dflags -- struct _CostCentre *link ] ; emitDataLits (mkCCLabel cc) lits }
1,162
emitCostCentreDecl cc = do { dflags <- getDynFlags ; let is_caf | isCafCC cc = mkIntCLit dflags (ord 'c') -- 'c' == is a CAF | otherwise = zero dflags -- NB. bytesFS: we want the UTF-8 bytes here (#5559) ; label <- newByteStringCLit (bytesFS $ costCentreUserNameFS cc) ; modl <- newByteStringCLit (bytesFS $ Module.moduleNameFS $ Module.moduleName $ cc_mod cc) ; loc <- newByteStringCLit $ bytesFS $ mkFastString $ showPpr dflags (costCentreSrcSpan cc) -- XXX going via FastString to get UTF-8 encoding is silly ; let lits = [ zero dflags, -- StgInt ccID, label, -- char *label, modl, -- char *module, loc, -- char *srcloc, zero64, -- StgWord64 mem_alloc zero dflags, -- StgWord time_ticks is_caf, -- StgInt is_caf zero dflags -- struct _CostCentre *link ] ; emitDataLits (mkCCLabel cc) lits }
1,117
false
true
0
13
461
228
117
111
null
null
arnizamani/occam
Haskell.hs
mit
matchPatExp (HsPParen p) e = matchPatExp p e
54
matchPatExp (HsPParen p) e = matchPatExp p e
54
matchPatExp (HsPParen p) e = matchPatExp p e
54
false
false
0
6
17
23
10
13
null
null
nablaa/hquarto
src/Piece.hs
gpl-2.0
readColor 'C' = Just Black
26
readColor 'C' = Just Black
26
readColor 'C' = Just Black
26
false
false
0
5
4
13
5
8
null
null
thomaseding/cgs
src/Main.hs
bsd-3-clause
main :: IO () main = Cgs.main
29
main :: IO () main = Cgs.main
29
main = Cgs.main
15
false
true
0
6
6
18
9
9
null
null
mariefarrell/Hets
CommonLogic/Sublogic.hs
gpl-2.0
-- | determines sublogic for texts, given predicates of the super-text sl_text :: Set.Set NAME -> CommonLogicSL -> TEXT -> CommonLogicSL sl_text prds cs t = case t of Text ps _ -> sl_phrases prds cs ps Named_text _ nt _ -> sl_text prds cs nt -- | determines sublogic for phrases, given predicates of the super-text
335
sl_text :: Set.Set NAME -> CommonLogicSL -> TEXT -> CommonLogicSL sl_text prds cs t = case t of Text ps _ -> sl_phrases prds cs ps Named_text _ nt _ -> sl_text prds cs nt -- | determines sublogic for phrases, given predicates of the super-text
264
sl_text prds cs t = case t of Text ps _ -> sl_phrases prds cs ps Named_text _ nt _ -> sl_text prds cs nt -- | determines sublogic for phrases, given predicates of the super-text
198
true
true
0
8
77
79
38
41
null
null
geraldus/lambdacms
lambdacms-core/LambdaCms/Core/Handler/ActionLog.hs
mit
-- | REST/JSON endpoint for fetching the recent logs. getActionLogAdminIndexR :: CoreHandler TypedContent getActionLogAdminIndexR = getActionLogAdminJson Nothing
161
getActionLogAdminIndexR :: CoreHandler TypedContent getActionLogAdminIndexR = getActionLogAdminJson Nothing
107
getActionLogAdminIndexR = getActionLogAdminJson Nothing
55
true
true
1
5
16
21
9
12
null
null
jtwool/haskell-sandbox
SimpleJSON.hs
gpl-3.0
isNull v = v == JNull
32
isNull v = v == JNull
32
isNull v = v == JNull
32
false
false
0
5
16
13
6
7
null
null
michaeljklein/HCy2C
Cycles/IO.hs
mit
runAllInDir :: String -> IO () runAllInDir dir = do files <- getDirectoryContents dir let exec_files = filter execFile files let run file = readProcess ("./" ++ file) [] [] >>= putStrLn mapM_ run exec_files where execFile name | null name = True | last name == '.' = False | otherwise = execFile $ init name
367
runAllInDir :: String -> IO () runAllInDir dir = do files <- getDirectoryContents dir let exec_files = filter execFile files let run file = readProcess ("./" ++ file) [] [] >>= putStrLn mapM_ run exec_files where execFile name | null name = True | last name == '.' = False | otherwise = execFile $ init name
367
runAllInDir dir = do files <- getDirectoryContents dir let exec_files = filter execFile files let run file = readProcess ("./" ++ file) [] [] >>= putStrLn mapM_ run exec_files where execFile name | null name = True | last name == '.' = False | otherwise = execFile $ init name
336
false
true
0
13
116
140
62
78
null
null
music-suite/music-score
src/Music/Score/Internal/Quantize.hs
bsd-3-clause
konstNumDotsAllowed :: [Int] konstNumDotsAllowed = [1..2]
57
konstNumDotsAllowed :: [Int] konstNumDotsAllowed = [1..2]
57
konstNumDotsAllowed = [1..2]
28
false
true
0
5
5
19
11
8
null
null
thoughtpolice/binary-serialise-cbor
Data/Binary/Serialise/CBOR/Read.hs
bsd-3-clause
go_fast_end (ConsumeNegWord k) !bs = case tryConsumeNegWord (unsafeHead bs) bs of DecodeFailure -> SlowFail bs "expected negative int" DecodedToken sz (W# w#) -> go_fast_end (k w#) (BS.unsafeDrop sz bs)
228
go_fast_end (ConsumeNegWord k) !bs = case tryConsumeNegWord (unsafeHead bs) bs of DecodeFailure -> SlowFail bs "expected negative int" DecodedToken sz (W# w#) -> go_fast_end (k w#) (BS.unsafeDrop sz bs)
228
go_fast_end (ConsumeNegWord k) !bs = case tryConsumeNegWord (unsafeHead bs) bs of DecodeFailure -> SlowFail bs "expected negative int" DecodedToken sz (W# w#) -> go_fast_end (k w#) (BS.unsafeDrop sz bs)
228
false
false
0
11
54
85
39
46
null
null