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
ivanperez-keera/Yampa
yampa-test/src/FRP/Yampa/LTLPast.hs
bsd-3-clause
-- | True if both inputs are True. andSF :: SF (Bool, Bool) Bool andSF = arr (uncurry (&&))
91
andSF :: SF (Bool, Bool) Bool andSF = arr (uncurry (&&))
56
andSF = arr (uncurry (&&))
26
true
true
0
7
18
40
20
20
null
null
LambdaHack/LambdaHack
engine-src/Game/LambdaHack/Client/UI/Animation.hs
bsd-3-clause
-- | Attack that is blocked. blockMiss :: (Point, Point) -> Animation blockMiss poss = Animation $ map (mzipPairs poss) [ (blank , cSym BrCyan '&') , (blank , cSym BrCyan '&') , (blank , blank) , (cSym BrBlue '{', blank) , (cSym BrBlue '{', cSym BrCyan '&') , (cSym BrBlue '{...
483
blockMiss :: (Point, Point) -> Animation blockMiss poss = Animation $ map (mzipPairs poss) [ (blank , cSym BrCyan '&') , (blank , cSym BrCyan '&') , (blank , blank) , (cSym BrBlue '{', blank) , (cSym BrBlue '{', cSym BrCyan '&') , (cSym BrBlue '{', blank) , (cSym BrBlue '...
454
blockMiss poss = Animation $ map (mzipPairs poss) [ (blank , cSym BrCyan '&') , (blank , cSym BrCyan '&') , (blank , blank) , (cSym BrBlue '{', blank) , (cSym BrBlue '{', cSym BrCyan '&') , (cSym BrBlue '{', blank) , (cSym BrBlue '{', blank) , (cSym BrBlue '}', blank) ...
413
true
true
0
8
146
195
109
86
null
null
nomicflux/threals
src/Threal/Tests.hs
gpl-2.0
testAssociativity x y z = ((x + y) + z) =|= (x + (y + z))
57
testAssociativity x y z = ((x + y) + z) =|= (x + (y + z))
57
testAssociativity x y z = ((x + y) + z) =|= (x + (y + z))
57
false
false
0
9
15
46
24
22
null
null
bsl/ebeats
src/Data/Time/Ebeats.hs
bsd-2-clause
-- Can you spot the difference in coding styles?: getEbeatsTime :: IO EbeatsTime getEbeatsTime = do ebs <- getEbeats now <- getCurrentTime let day = toModifiedJulianDay $ utctDay now return $ EbeatsTime day ebs
267
getEbeatsTime :: IO EbeatsTime getEbeatsTime = do ebs <- getEbeats now <- getCurrentTime let day = toModifiedJulianDay $ utctDay now return $ EbeatsTime day ebs
217
getEbeatsTime = do ebs <- getEbeats now <- getCurrentTime let day = toModifiedJulianDay $ utctDay now return $ EbeatsTime day ebs
186
true
true
0
11
90
57
26
31
null
null
apyrgio/snf-ganeti
src/Ganeti/Common.hs
bsd-2-clause
-- | Yes\/no choices completion. optComplYesNo :: OptCompletion optComplYesNo = OptComplChoices ["yes", "no"]
109
optComplYesNo :: OptCompletion optComplYesNo = OptComplChoices ["yes", "no"]
76
optComplYesNo = OptComplChoices ["yes", "no"]
45
true
true
0
6
12
21
12
9
null
null
amutake/psg-scheme
src/Primitives.hs
bsd-3-clause
applyPrim StringNumber = primStringNumber
41
applyPrim StringNumber = primStringNumber
41
applyPrim StringNumber = primStringNumber
41
false
false
0
5
3
9
4
5
null
null
aelve/guide
back/src/Guide/ServerStuff.hs
bsd-3-clause
undoEdit (EditSetItemSummary itemId old new) = do now <- markdownBlockSource . itemSummary <$> dbQuery (GetItem itemId) if now /= new then return (Left "description has been changed further") else Right () <$ dbUpdate (SetItemSummary itemId old)
257
undoEdit (EditSetItemSummary itemId old new) = do now <- markdownBlockSource . itemSummary <$> dbQuery (GetItem itemId) if now /= new then return (Left "description has been changed further") else Right () <$ dbUpdate (SetItemSummary itemId old)
257
undoEdit (EditSetItemSummary itemId old new) = do now <- markdownBlockSource . itemSummary <$> dbQuery (GetItem itemId) if now /= new then return (Left "description has been changed further") else Right () <$ dbUpdate (SetItemSummary itemId old)
257
false
false
0
11
47
87
41
46
null
null
romanb/amazonka
amazonka-iam/gen/Network/AWS/IAM/DetachUserPolicy.hs
mpl-2.0
dup1PolicyArn :: Lens' DetachUserPolicy Text dup1PolicyArn = lens _dup1PolicyArn (\s a -> s { _dup1PolicyArn = a })
115
dup1PolicyArn :: Lens' DetachUserPolicy Text dup1PolicyArn = lens _dup1PolicyArn (\s a -> s { _dup1PolicyArn = a })
115
dup1PolicyArn = lens _dup1PolicyArn (\s a -> s { _dup1PolicyArn = a })
70
false
true
0
9
17
39
21
18
null
null
abakst/liquidhaskell
src/Language/Haskell/Liquid/Bare/RTEnv.hs
bsd-3-clause
buildAliasGraph :: (t -> [Symbol]) -> [RTAlias Symbol t] -> Graph Symbol buildAliasGraph buildEdges = map (buildAliasNode buildEdges)
135
buildAliasGraph :: (t -> [Symbol]) -> [RTAlias Symbol t] -> Graph Symbol buildAliasGraph buildEdges = map (buildAliasNode buildEdges)
135
buildAliasGraph buildEdges = map (buildAliasNode buildEdges)
62
false
true
0
9
19
57
27
30
null
null
beni55/fay
src/Fay/Compiler/InitialPass.hs
bsd-3-clause
-- | Preprocess a module given its filepath and content. preprocessFileWithSource :: FilePath -> String -> Compile () preprocessFileWithSource filepath contents = do (_,st,_) <- compileWith filepath preprocessAST preprocessFileWithSource desugar contents -- This is the state we want to keep modify $ \s -> s { sta...
995
preprocessFileWithSource :: FilePath -> String -> Compile () preprocessFileWithSource filepath contents = do (_,st,_) <- compileWith filepath preprocessAST preprocessFileWithSource desugar contents -- This is the state we want to keep modify $ \s -> s { stateRecords = stateRecords st , ...
938
preprocessFileWithSource filepath contents = do (_,st,_) <- compileWith filepath preprocessAST preprocessFileWithSource desugar contents -- This is the state we want to keep modify $ \s -> s { stateRecords = stateRecords st , stateRecordTypes = stateRecordTypes st , s...
877
true
true
0
12
369
145
78
67
null
null
markus1189/lambda-feed
src/LambdaFeed/Types.hs
gpl-3.0
getItems OnlyRead c = view (readFeeds . at c . non Seq.empty)
61
getItems OnlyRead c = view (readFeeds . at c . non Seq.empty)
61
getItems OnlyRead c = view (readFeeds . at c . non Seq.empty)
61
false
false
0
9
11
33
15
18
null
null
music-suite/music-score
src/Music/Time/Meta.hs
bsd-3-clause
wrapMeta :: forall a. AttributeClass a => a -> Meta wrapMeta a = Meta $ Map.singleton key $ wrapAttr a where key = show $ typeOf (undefined :: a) -- | Type class for things which have meta-data.
202
wrapMeta :: forall a. AttributeClass a => a -> Meta wrapMeta a = Meta $ Map.singleton key $ wrapAttr a where key = show $ typeOf (undefined :: a) -- | Type class for things which have meta-data.
202
wrapMeta a = Meta $ Map.singleton key $ wrapAttr a where key = show $ typeOf (undefined :: a) -- | Type class for things which have meta-data.
150
false
true
3
9
45
77
35
42
null
null
kim/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/Types.hs
mpl-2.0
-- | An indication of which type of values this option has and whether it is -- allowable to select one or more than one of the possible values: -- -- 'Scalar' : Values for this option are a single selection from the possible -- values, or a unformatted string or numeric value governed by the -- MIN/MAX/Regex constrain...
977
codValueType :: Lens' ConfigurationOptionDescription (Maybe ConfigurationOptionValueType) codValueType = lens _codValueType (\s a -> s { _codValueType = a })
157
codValueType = lens _codValueType (\s a -> s { _codValueType = a })
67
true
true
0
9
166
60
39
21
null
null
seppeljordan/simplechat
Chat/Client.hs
gpl-3.0
-- |Returns a command if there is any in the buffer. getMsg :: ChatClient -> (ChatClient, Maybe Command) getMsg cl | hasMsg cl = ( cl { clBuffer = (tail.clBuffer) cl } , Just ((head.clBuffer) cl) ) | otherwise = (cl, Nothing)
283
getMsg :: ChatClient -> (ChatClient, Maybe Command) getMsg cl | hasMsg cl = ( cl { clBuffer = (tail.clBuffer) cl } , Just ((head.clBuffer) cl) ) | otherwise = (cl, Nothing)
230
getMsg cl | hasMsg cl = ( cl { clBuffer = (tail.clBuffer) cl } , Just ((head.clBuffer) cl) ) | otherwise = (cl, Nothing)
178
true
true
0
11
99
96
48
48
null
null
mainland/nikola
src/Data/Array/Nikola/Util/Pretty.hs
bsd-3-clause
infixr_ :: Int -> Fixity infixr_ = Fixity InfixR
48
infixr_ :: Int -> Fixity infixr_ = Fixity InfixR
48
infixr_ = Fixity InfixR
23
false
true
0
7
8
25
10
15
null
null
rdnetto/H2V
H2V/GenerateDFD.hs
gpl-2.0
declName (HsTypeSig _ [n] _) = return $ fromHsName n
52
declName (HsTypeSig _ [n] _) = return $ fromHsName n
52
declName (HsTypeSig _ [n] _) = return $ fromHsName n
52
false
false
0
8
9
29
14
15
null
null
tjakway/ghcjvm
compiler/llvmGen/LlvmCodeGen/Data.hs
bsd-3-clause
-- | Generate Llvm code for a static literal. -- -- Will either generate the code or leave it unresolved if it is a 'CLabel' -- which isn't yet known. genStaticLit :: CmmLit -> LlvmM LlvmStatic genStaticLit (CmmInt i w) = return $ LMStaticLit (LMIntLit i (LMInt $ widthInBits w))
283
genStaticLit :: CmmLit -> LlvmM LlvmStatic genStaticLit (CmmInt i w) = return $ LMStaticLit (LMIntLit i (LMInt $ widthInBits w))
132
genStaticLit (CmmInt i w) = return $ LMStaticLit (LMIntLit i (LMInt $ widthInBits w))
89
true
true
0
11
53
58
30
28
null
null
ihc/futhark
src/Futhark/Representation/AST/Attributes/Aliases.hs
isc
expAliases :: (Aliased lore) => Exp lore -> [Names] expAliases (If _ tb fb attr) = drop (length all_aliases - length ts) all_aliases where ts = ifReturns attr all_aliases = ifAliases (bodyAliases tb, consumedInBody tb) (bodyAliases fb, consumedInBody fb)
310
expAliases :: (Aliased lore) => Exp lore -> [Names] expAliases (If _ tb fb attr) = drop (length all_aliases - length ts) all_aliases where ts = ifReturns attr all_aliases = ifAliases (bodyAliases tb, consumedInBody tb) (bodyAliases fb, consumedInBody fb)
310
expAliases (If _ tb fb attr) = drop (length all_aliases - length ts) all_aliases where ts = ifReturns attr all_aliases = ifAliases (bodyAliases tb, consumedInBody tb) (bodyAliases fb, consumedInBody fb)
258
false
true
1
8
94
108
53
55
null
null
tel/index-basic
src/Control/IMonad/Cont.hs
bsd-3-clause
resetT :: (IMonad m, IMonadTrans t) => ContT a m a i -> t m a i resetT = liftI . evalContT
90
resetT :: (IMonad m, IMonadTrans t) => ContT a m a i -> t m a i resetT = liftI . evalContT
90
resetT = liftI . evalContT
26
false
true
1
8
21
57
26
31
null
null
mrkkrp/stack
src/Options/Applicative/Builder/Extra.hs
bsd-3-clause
-- | 'argument', specialized to 'Text'. textArgument :: Mod ArgumentFields Text -> Parser Text textArgument = argument (T.pack <$> readerAsk)
141
textArgument :: Mod ArgumentFields Text -> Parser Text textArgument = argument (T.pack <$> readerAsk)
101
textArgument = argument (T.pack <$> readerAsk)
46
true
true
0
8
19
36
18
18
null
null
bixuanzju/Simple-Regex
src/NFA.hs
gpl-3.0
findRules :: Char -> NFA -> [Rule] findRules c nfa = filter (ruleApplies c nfa) $ rules nfa
91
findRules :: Char -> NFA -> [Rule] findRules c nfa = filter (ruleApplies c nfa) $ rules nfa
91
findRules c nfa = filter (ruleApplies c nfa) $ rules nfa
56
false
true
0
9
17
50
23
27
null
null
eijian/raytracer
src/Ray/Geometry.hs
bsd-3-clause
-- Mesh getNormal _ (Mesh ps _ _) = Nothing
43
getNormal _ (Mesh ps _ _) = Nothing
35
getNormal _ (Mesh ps _ _) = Nothing
35
true
false
0
7
9
22
11
11
null
null
nkaretnikov/ghc
compiler/utils/Outputable.hs
bsd-3-clause
speakNth 5 = ptext (sLit "fifth")
33
speakNth 5 = ptext (sLit "fifth")
33
speakNth 5 = ptext (sLit "fifth")
33
false
false
0
7
5
18
8
10
null
null
phaul/chess
Test/Puzzle/RunEPD.hs
bsd-3-clause
runTotalScore :: [ String ] -- ^ file names -> (String -> Int) -- ^ minimal required score to continue -> EvaluationConfig -> IO Int runTotalScore fns minimums ec = do mbEres <- runFiles fns minimums False ec let eres = maybe 0 (sum . map stsScore . concatMap snd) mbEres return eres ---------...
509
runTotalScore :: [ String ] -- ^ file names -> (String -> Int) -- ^ minimal required score to continue -> EvaluationConfig -> IO Int runTotalScore fns minimums ec = do mbEres <- runFiles fns minimums False ec let eres = maybe 0 (sum . map stsScore . concatMap snd) mbEres return eres ---------...
509
runTotalScore fns minimums ec = do mbEres <- runFiles fns minimums False ec let eres = maybe 0 (sum . map stsScore . concatMap snd) mbEres return eres ------------------------------------------------------------------------------ -- | Runs everything from the given files. Normally returns Just, but if the -- ...
359
false
true
0
15
101
108
52
56
null
null
klpn/highlighting-kate
Text/Highlighting/Kate/Styles.hs
gpl-2.0
-- | Style with no colors. monochrome :: Style monochrome = Style{ backgroundColor = Nothing , defaultColor = Nothing , lineNumberColor = Nothing , lineNumberBackgroundColor = Nothing , tokenStyles = [ (KeywordTok, defStyle{ tokenBold = True }) , (DataTypeTok, defStyle{ tokenUnderline = True }) ...
848
monochrome :: Style monochrome = Style{ backgroundColor = Nothing , defaultColor = Nothing , lineNumberColor = Nothing , lineNumberBackgroundColor = Nothing , tokenStyles = [ (KeywordTok, defStyle{ tokenBold = True }) , (DataTypeTok, defStyle{ tokenUnderline = True }) , (CommentTok, defStyle{ to...
821
monochrome = Style{ backgroundColor = Nothing , defaultColor = Nothing , lineNumberColor = Nothing , lineNumberBackgroundColor = Nothing , tokenStyles = [ (KeywordTok, defStyle{ tokenBold = True }) , (DataTypeTok, defStyle{ tokenUnderline = True }) , (CommentTok, defStyle{ tokenItalic = True }) ...
801
true
true
0
10
181
248
160
88
null
null
brownsys/nettle-openflow
src/Nettle/OpenFlow/MessagesBinary.hs
bsd-3-clause
putFlowMod :: FlowModRecordInternal -> Put putFlowMod (FlowModRecordInternal {..}) = do putMatch match' putWord16be $ flowModTypeBimap ! command' putWord16be $ maybeTimeOutToCode idleTimeOut' putWord16be $ maybeTimeOutToCode hardTimeOut' putWord16be priority' putWord32be $ maybe (-1) id bufferID' putWord...
491
putFlowMod :: FlowModRecordInternal -> Put putFlowMod (FlowModRecordInternal {..}) = do putMatch match' putWord16be $ flowModTypeBimap ! command' putWord16be $ maybeTimeOutToCode idleTimeOut' putWord16be $ maybeTimeOutToCode hardTimeOut' putWord16be priority' putWord32be $ maybe (-1) id bufferID' putWord...
491
putFlowMod (FlowModRecordInternal {..}) = do putMatch match' putWord16be $ flowModTypeBimap ! command' putWord16be $ maybeTimeOutToCode idleTimeOut' putWord16be $ maybeTimeOutToCode hardTimeOut' putWord16be priority' putWord32be $ maybe (-1) id bufferID' putWord16be $ maybe ofppNone fakePort2Code outPort...
448
false
true
0
10
75
141
63
78
null
null
phunehehe/deepseq-bounded
tests/FooG.hs
bsd-3-clause
- E/A = 2 . B6 TA --data TA = A1 Bool Int -- | A4 (Float,TB,Int) -- | A2 Int -- | A3 TB Bool -- | A5 (Int,Float) --data TB = B1 Bool TA -- | B2 TA TB -- | B3 Bool TA Int -- | B4 Bool Int TA -- | B5 Bool Int Float -- | B6 TA -- | B7 TB -- ...
408
expTB_21 = B7 (B7 (B5 __ 5 2.3))
32
expTB_21 = B7 (B7 (B5 __ 5 2.3))
32
true
false
5
8
176
65
35
30
null
null
mindreader/iron-tracker
Weight/PlateOrder.hs
bsd-3-clause
shrugs = [P45,P25,P10]
24
shrugs = [P45,P25,P10]
24
shrugs = [P45,P25,P10]
24
false
false
1
5
4
18
9
9
null
null
getyourguide/fbthrift
thrift/lib/hs/Thrift/Protocol/SimpleJSON.hs
apache-2.0
buildJSONValue (TDouble d) = doubleDec d
40
buildJSONValue (TDouble d) = doubleDec d
40
buildJSONValue (TDouble d) = doubleDec d
40
false
false
0
6
5
19
8
11
null
null
d0kt0r0/estuary
client/src/Estuary/Help/MiniTidal.hs
gpl-3.0
exampleText "choose" = "sound \"drum ~ drum drum\" # n (choose [0,2,3])"
72
exampleText "choose" = "sound \"drum ~ drum drum\" # n (choose [0,2,3])"
72
exampleText "choose" = "sound \"drum ~ drum drum\" # n (choose [0,2,3])"
72
false
false
0
5
11
9
4
5
null
null
da-x/lamdu
Lamdu/Sugar/Convert/Binder/Params.hs
gpl-3.0
isArgOfCallTo _ _ = False
25
isArgOfCallTo _ _ = False
25
isArgOfCallTo _ _ = False
25
false
false
1
5
4
12
5
7
null
null
vdweegen/UvA-Software_Testing
Lab1/Cas/Exercises.hs
gpl-3.0
result7 = do print("Check Visa (VALID CARD) 4024007187018576") print(isVisa 4024007187018576) print("Check Visa (INVALID CARD) 4034007187018576") print(isVisa 4034007187018576) print("Check AMEX (VALID CARD) 379603918985031") print(isAmericanExpress 379603918985031) print("Check AMEX (INVALID CARD) 379403...
596
result7 = do print("Check Visa (VALID CARD) 4024007187018576") print(isVisa 4024007187018576) print("Check Visa (INVALID CARD) 4034007187018576") print(isVisa 4034007187018576) print("Check AMEX (VALID CARD) 379603918985031") print(isAmericanExpress 379603918985031) print("Check AMEX (INVALID CARD) 379403...
596
result7 = do print("Check Visa (VALID CARD) 4024007187018576") print(isVisa 4024007187018576) print("Check Visa (INVALID CARD) 4034007187018576") print(isVisa 4034007187018576) print("Check AMEX (VALID CARD) 379603918985031") print(isAmericanExpress 379603918985031) print("Check AMEX (INVALID CARD) 379403...
596
false
false
1
10
78
137
58
79
null
null
am-/biri-lang
src/Biri/Language/AbstractSyntax.hs
mit
retype :: TypedExpr -> Type -> TypedExpr retype (TypedExpr e _) = TypedExpr e . Just
84
retype :: TypedExpr -> Type -> TypedExpr retype (TypedExpr e _) = TypedExpr e . Just
84
retype (TypedExpr e _) = TypedExpr e . Just
43
false
true
0
6
15
41
19
22
null
null
esengie/fpl-exploration-tool
src/langGenerator/GeneratorTemplates/LangTemplate.hs
bsd-3-clause
fromScope6 x = fromScope $ fromScope5 x
39
fromScope6 x = fromScope $ fromScope5 x
39
fromScope6 x = fromScope $ fromScope5 x
39
false
false
0
6
6
16
7
9
null
null
bheklilr/omniscient
test/Spec.hs
bsd-3-clause
host :: SockAddr host = SockAddrInet 1234 $ tupleToHostAddress (192, 168, 1, 100)
81
host :: SockAddr host = SockAddrInet 1234 $ tupleToHostAddress (192, 168, 1, 100)
81
host = SockAddrInet 1234 $ tupleToHostAddress (192, 168, 1, 100)
64
false
true
0
7
12
33
18
15
null
null
theNerd247/ariaRacer
src/Aria/Acid.hs
bsd-3-clause
removeRacer :: RacerId -> Update RepoDBState () removeRacer rid = get >>= (put . (racerDB %~ IxSet.deleteIx rid))
113
removeRacer :: RacerId -> Update RepoDBState () removeRacer rid = get >>= (put . (racerDB %~ IxSet.deleteIx rid))
113
removeRacer rid = get >>= (put . (racerDB %~ IxSet.deleteIx rid))
65
false
true
2
11
17
55
26
29
null
null
samscott89/tamarin-prover
lib/theory/src/Theory/Model/Fact.hs
gpl-3.0
-- | If all the fact terms are simple and different msg variables (i.e., not fresh or public), returns the list of all these variables. Otherwise returns Nothing. [This could be relaxed to work for all variables (including fresh and public) if Facts were typed, so that an argument would always have to be fresh or publi...
1,092
isTrivialFact :: LNFact -> Maybe [LVar] isTrivialFact (Fact _ ts) = case ts of [] -> Just [] x:xs -> Prelude.foldl combine (getMsgVar x) (map getMsgVar xs) where combine :: Maybe [LVar] -> Maybe [LVar] -> Maybe [LVar] combine Nothing _ = Nothing combine (Just _ ) Nothing ...
757
isTrivialFact (Fact _ ts) = case ts of [] -> Just [] x:xs -> Prelude.foldl combine (getMsgVar x) (map getMsgVar xs) where combine :: Maybe [LVar] -> Maybe [LVar] -> Maybe [LVar] combine Nothing _ = Nothing combine (Just _ ) Nothing = Nothing combine (Just l1) (Just ...
717
true
true
6
12
223
234
120
114
null
null
maoe/fop
12-Fun-with-Phantom-Types/Type.hs
bsd-3-clause
-- | Generic compresssion compress :: Type t -> t -> [Bit] compress RInt i = compressInt i
107
compress :: Type t -> t -> [Bit] compress RInt i = compressInt i
81
compress RInt i = compressInt i
48
true
true
0
7
34
34
17
17
null
null
TomMD/llvm-pretty
src/Text/LLVM.hs
bsd-3-clause
ptrtoint :: IsValue a => Typed a -> Type -> BB (Typed Value) ptrtoint = convop (Conv PtrToInt)
95
ptrtoint :: IsValue a => Typed a -> Type -> BB (Typed Value) ptrtoint = convop (Conv PtrToInt)
95
ptrtoint = convop (Conv PtrToInt)
34
false
true
0
10
18
47
22
25
null
null
jtojnar/haste-compiler
libraries/ghc-7.10/base/GHC/Natural.hs
bsd-3-clause
-- | 'Natural' subtraction. May @'throw' 'Underflow'@. minusNatural :: Natural -> Natural -> Natural minusNatural x (NatS# 0##) = x
139
minusNatural :: Natural -> Natural -> Natural minusNatural x (NatS# 0##) = x
84
minusNatural x (NatS# 0##) = x
38
true
true
0
10
27
37
17
20
null
null
adamrk/scheme2luac
src/Assembler.hs
bsd-3-clause
maxReg (IABC OpLoadNil a b c) = max a b
39
maxReg (IABC OpLoadNil a b c) = max a b
39
maxReg (IABC OpLoadNil a b c) = max a b
39
false
false
0
7
9
26
12
14
null
null
batebobo/fp1718
class/09.exam-practice.hs
mit
largestInterval :: (Int -> Int) -> (Int -> Int) -> Int -> Int -> (Int, Int) largestInterval f g a b = maximumLengthInterv $ makeIntervals $ matchingVals f g a b
214
largestInterval :: (Int -> Int) -> (Int -> Int) -> Int -> Int -> (Int, Int) largestInterval f g a b = maximumLengthInterv $ makeIntervals $ matchingVals f g a b
214
largestInterval f g a b = maximumLengthInterv $ makeIntervals $ matchingVals f g a b
138
false
true
0
9
84
77
39
38
null
null
input-output-hk/pos-haskell-prototype
chain/src/Pos/Chain/Block/Slog/LastBlkSlots.hs
mit
create :: Int -> LastBlkSlots create k = LastBlkSlots k (OldestFirst []) mempty
79
create :: Int -> LastBlkSlots create k = LastBlkSlots k (OldestFirst []) mempty
79
create k = LastBlkSlots k (OldestFirst []) mempty
49
false
true
0
8
12
33
16
17
null
null
thielema/gitit
gitit.hs
gpl-2.0
putErr :: ExitCode -> String -> IO a putErr c s = B.hPutStrLn stderr (fromString s) >> exitWith c
97
putErr :: ExitCode -> String -> IO a putErr c s = B.hPutStrLn stderr (fromString s) >> exitWith c
97
putErr c s = B.hPutStrLn stderr (fromString s) >> exitWith c
60
false
true
0
8
18
47
22
25
null
null
k3ut0i/xmonad-conf
volume.hs
mit
amixerExe :: ProcessConfig () () () amixerExe = proc "amixer" ["sget", deviceInfo]
82
amixerExe :: ProcessConfig () () () amixerExe = proc "amixer" ["sget", deviceInfo]
82
amixerExe = proc "amixer" ["sget", deviceInfo]
46
false
true
1
6
11
39
18
21
null
null
sharkspeed/dororis
languages/haskell/LYHGG/9-input-and-output/5-bytestrings.hs
bsd-2-clause
copyFile :: FilePath -> FilePath -> IO() copyFile source dest = do contents <- B.readFile source -- 读取 B.writeFile dest contents -- 写入
143
copyFile :: FilePath -> FilePath -> IO() copyFile source dest = do contents <- B.readFile source -- 读取 B.writeFile dest contents -- 写入
143
copyFile source dest = do contents <- B.readFile source -- 读取 B.writeFile dest contents -- 写入
102
false
true
0
9
31
53
25
28
null
null
siddhanathan/yi
yi-core/src/Yi/Buffer/HighLevel.hs
gpl-2.0
-- | Move cursor to origin topB :: BufferM () topB = moveTo 0
61
topB :: BufferM () topB = moveTo 0
34
topB = moveTo 0
15
true
true
0
6
13
20
10
10
null
null
AmpersandTarski/ampersand
src/Ampersand/FSpec/ToFSpec/NormalForms.hs
gpl-3.0
mix :: [[Unifier]] -> [Unifier] mix (ls:lss) = [ Set.union e str | e<-ls, str<-mix lss ]
88
mix :: [[Unifier]] -> [Unifier] mix (ls:lss) = [ Set.union e str | e<-ls, str<-mix lss ]
88
mix (ls:lss) = [ Set.union e str | e<-ls, str<-mix lss ]
56
false
true
0
8
16
67
34
33
null
null
tonymorris/validation
src/Data/Validation.hs
bsd-3-clause
AccSuccess a1 `appsAccValidation` AccFailure _ = AccSuccess a1
65
AccSuccess a1 `appsAccValidation` AccFailure _ = AccSuccess a1
65
AccSuccess a1 `appsAccValidation` AccFailure _ = AccSuccess a1
65
false
false
0
6
10
23
10
13
null
null
spechub/Hets
Logic/LGToJson.hs
gpl-2.0
lGToJson :: LogicGraph -> IO Json lGToJson lg = do let cs = Map.elems $ comorphisms lg groupC = Map.toList . Map.fromListWith (++) ssubs = groupC $ map (\ (Comorphism cid) -> (G_sublogics (sourceLogic cid) $ sourceSublogic cid, [language_name cid])) cs tsubs = groupC $ map...
933
lGToJson :: LogicGraph -> IO Json lGToJson lg = do let cs = Map.elems $ comorphisms lg groupC = Map.toList . Map.fromListWith (++) ssubs = groupC $ map (\ (Comorphism cid) -> (G_sublogics (sourceLogic cid) $ sourceSublogic cid, [language_name cid])) cs tsubs = groupC $ map...
933
lGToJson lg = do let cs = Map.elems $ comorphisms lg groupC = Map.toList . Map.fromListWith (++) ssubs = groupC $ map (\ (Comorphism cid) -> (G_sublogics (sourceLogic cid) $ sourceSublogic cid, [language_name cid])) cs tsubs = groupC $ map (\ (Comorphism cid) -> (G_sublogi...
899
false
true
1
20
260
370
194
176
null
null
rootzlevel/device-manager
lib/DBus/DBusAbstraction.hs
bsd-3-clause
fromVariant' :: (IsVariant a) => Variant -> a fromVariant' v = fromMaybe (error ("Variant " ++ show v ++ " failed")) $ fromVariant v
132
fromVariant' :: (IsVariant a) => Variant -> a fromVariant' v = fromMaybe (error ("Variant " ++ show v ++ " failed")) $ fromVariant v
132
fromVariant' v = fromMaybe (error ("Variant " ++ show v ++ " failed")) $ fromVariant v
86
false
true
0
12
23
57
28
29
null
null
imalsogreg/flycap
tests/multCameras.hs
bsd-3-clause
drawTex :: (GLfloat, GLfloat, GLfloat, GLfloat) -> TextureObject -> IO () drawTex (xl, xh, yl, yh) tex = do textureBinding Texture2D $= Just tex renderPrimitive Quads $ do -- render/draw the image texCoord (TexCoord2 0 (0::GLfloat)) vertex (Vertex3 (xl) (yh) (0::GLfloat)) texCoord (TexCoord2 1 (0::GLflo...
535
drawTex :: (GLfloat, GLfloat, GLfloat, GLfloat) -> TextureObject -> IO () drawTex (xl, xh, yl, yh) tex = do textureBinding Texture2D $= Just tex renderPrimitive Quads $ do -- render/draw the image texCoord (TexCoord2 0 (0::GLfloat)) vertex (Vertex3 (xl) (yh) (0::GLfloat)) texCoord (TexCoord2 1 (0::GLflo...
535
drawTex (xl, xh, yl, yh) tex = do textureBinding Texture2D $= Just tex renderPrimitive Quads $ do -- render/draw the image texCoord (TexCoord2 0 (0::GLfloat)) vertex (Vertex3 (xl) (yh) (0::GLfloat)) texCoord (TexCoord2 1 (0::GLfloat)) vertex (Vertex3 (xh) (yh) (0::GLfloat)) texCoord (TexCoord2 1...
461
false
true
0
13
102
269
140
129
null
null
jcristovao/data-easy
src/Data/Easy.hs
bsd-3-clause
-- -- | Is the pair tuple \'invalid\', i.e., are both (monoid) elements -- 'mempty'? isTripleEmpty :: (Eq a, Monoid a, Eq b, Monoid b, Eq c, Monoid c) => (a, b, c) -> Bool isTripleEmpty (x,y,z) = isEmpty x && isEmpty y && isEmpty z
239
isTripleEmpty :: (Eq a, Monoid a, Eq b, Monoid b, Eq c, Monoid c) => (a, b, c) -> Bool isTripleEmpty (x,y,z) = isEmpty x && isEmpty y && isEmpty z
154
isTripleEmpty (x,y,z) = isEmpty x && isEmpty y && isEmpty z
61
true
true
0
9
53
100
52
48
null
null
jseaton/ttasm
Instructions.hs
gpl-3.0
_cmapTable version nSub tables = do ushort version ushort nSub tables
81
_cmapTable version nSub tables = do ushort version ushort nSub tables
81
_cmapTable version nSub tables = do ushort version ushort nSub tables
81
false
false
0
7
22
28
11
17
null
null
capn-freako/lambda-ccc
src/LambdaCCC/Unused/SReify.hs
bsd-3-clause
standardTyT ty = nonStandardFail ty
35
standardTyT ty = nonStandardFail ty
35
standardTyT ty = nonStandardFail ty
35
false
false
1
5
4
16
5
11
null
null
rahulmutt/ghcvm
compiler/Eta/BasicTypes/Unique.hs
bsd-3-clause
hasKey :: Uniquable a => a -> Unique -> Bool x `hasKey` k = getUnique x == k
88
hasKey :: Uniquable a => a -> Unique -> Bool x `hasKey` k = getUnique x == k
88
x `hasKey` k = getUnique x == k
34
false
true
0
7
29
45
21
24
null
null
AlexeyRaga/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpInfo SetByteArrayOp = mkGenPrimOp (fsLit "setByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, intPrimTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy)
192
primOpInfo SetByteArrayOp = mkGenPrimOp (fsLit "setByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, intPrimTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy)
192
primOpInfo SetByteArrayOp = mkGenPrimOp (fsLit "setByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, intPrimTy, intPrimTy, mkStatePrimTy deltaTy] (mkStatePrimTy deltaTy)
192
false
false
0
7
16
55
28
27
null
null
flowbox-public/cufft
Setup.hs
bsd-3-clause
validateLocation :: Verbosity -> FilePath -> IO Bool validateLocation verbosity path = do -- TODO: Ideally this should check also for cudart.lib and whether cudart exports relevant symbols. -- This should be achievable with some `nm` trickery let testedPath = path </> "include" </> "cuda.h" exists <- doesFileEx...
649
validateLocation :: Verbosity -> FilePath -> IO Bool validateLocation verbosity path = do -- TODO: Ideally this should check also for cudart.lib and whether cudart exports relevant symbols. -- This should be achievable with some `nm` trickery let testedPath = path </> "include" </> "cuda.h" exists <- doesFileEx...
649
validateLocation verbosity path = do -- TODO: Ideally this should check also for cudart.lib and whether cudart exports relevant symbols. -- This should be achievable with some `nm` trickery let testedPath = path </> "include" </> "cuda.h" exists <- doesFileExist testedPath info verbosity $ if exists ...
596
false
true
0
11
125
95
46
49
null
null
wyleyr/org-citeproc
org-citeproc.hs
bsd-3-clause
chooseRenderer :: OutputFormat -> Pandoc -> String chooseRenderer fmt = case fmt of Ascii -> renderPandocPlain Html -> renderPandocHTML OpenDocument -> renderPandocODT Org -> renderPandocOrg NativeBefore -> renderPandocNativeBefore NativeAfter -> renderPandocNative -- rendering functions: -- plain ...
325
chooseRenderer :: OutputFormat -> Pandoc -> String chooseRenderer fmt = case fmt of Ascii -> renderPandocPlain Html -> renderPandocHTML OpenDocument -> renderPandocODT Org -> renderPandocOrg NativeBefore -> renderPandocNativeBefore NativeAfter -> renderPandocNative -- rendering functions: -- plain ...
325
chooseRenderer fmt = case fmt of Ascii -> renderPandocPlain Html -> renderPandocHTML OpenDocument -> renderPandocODT Org -> renderPandocOrg NativeBefore -> renderPandocNativeBefore NativeAfter -> renderPandocNative -- rendering functions: -- plain text:
274
false
true
0
8
57
70
34
36
null
null
kim/amazonka
amazonka-cloudwatch/gen/Network/AWS/CloudWatch/Types.hs
mpl-2.0
-- | The minimum value of the sample set. ssMinimum :: Lens' StatisticSet Double ssMinimum = lens _ssMinimum (\s a -> s { _ssMinimum = a })
139
ssMinimum :: Lens' StatisticSet Double ssMinimum = lens _ssMinimum (\s a -> s { _ssMinimum = a })
97
ssMinimum = lens _ssMinimum (\s a -> s { _ssMinimum = a })
58
true
true
1
9
26
46
22
24
null
null
sgillespie/ghc
compiler/rename/RnBinds.hs
bsd-3-clause
-- Wrapper for local binds -- -- The *client* of this function is responsible for checking for unused binders; -- it doesn't (and can't: we don't have the thing inside the binds) happen here -- -- The client is also responsible for bringing the fixities into scope rnLocalValBindsRHS :: NameSet -- names bound by the LH...
513
rnLocalValBindsRHS :: NameSet -- names bound by the LHSes -> HsValBindsLR Name RdrName -> RnM (HsValBinds Name, DefUses) rnLocalValBindsRHS bound_names binds = rnValBindsRHS (LocalBindCtxt bound_names) binds
248
rnLocalValBindsRHS bound_names binds = rnValBindsRHS (LocalBindCtxt bound_names) binds
88
true
true
0
9
113
59
32
27
null
null
kadena-io/pact
src-ghc/Pact/Server/History/Persistence.hs
bsd-3-clause
eitherToError s (Left e) = error $ "SQLite Error in History exec: " ++ s ++ "\nWith Error: "++ show e
101
eitherToError s (Left e) = error $ "SQLite Error in History exec: " ++ s ++ "\nWith Error: "++ show e
101
eitherToError s (Left e) = error $ "SQLite Error in History exec: " ++ s ++ "\nWith Error: "++ show e
101
false
false
0
8
20
36
17
19
null
null
dancor/melang
src/Main/wiktde-noun-forms.hs
mit
main :: IO () main = do d <- readDewiktLazy storyWdsSet <- readStoryWds let nounForms = readNouns d nounWds = [ (killDer nFPart, nF) | nF <- nounForms , nFPart <- nF ] storyNouns = nub . sort . map snd $ filter ((`Set.member` storyW...
410
main :: IO () main = do d <- readDewiktLazy storyWdsSet <- readStoryWds let nounForms = readNouns d nounWds = [ (killDer nFPart, nF) | nF <- nounForms , nFPart <- nF ] storyNouns = nub . sort . map snd $ filter ((`Set.member` storyW...
410
main = do d <- readDewiktLazy storyWdsSet <- readStoryWds let nounForms = readNouns d nounWds = [ (killDer nFPart, nF) | nF <- nounForms , nFPart <- nF ] storyNouns = nub . sort . map snd $ filter ((`Set.member` storyWdsSet) . fst) ...
396
false
true
0
14
148
143
72
71
null
null
bravit/Idris-dev
src/Idris/Primitives.hs
bsd-3-clause
iCmp :: IntTy -> String -> Bool -> ([Const] -> Maybe Const) -> (IntTy -> PrimFn) -> Totality -> Prim iCmp ity op self impl irop totality = Prim (sUN $ "prim__" ++ op ++ intTyName ity) (ty (replicate 2 . AType . ATInt $ ity) (AType (ATInt (if self then ity else ITNative)))) 2 impl (2, irop ity) totality
320
iCmp :: IntTy -> String -> Bool -> ([Const] -> Maybe Const) -> (IntTy -> PrimFn) -> Totality -> Prim iCmp ity op self impl irop totality = Prim (sUN $ "prim__" ++ op ++ intTyName ity) (ty (replicate 2 . AType . ATInt $ ity) (AType (ATInt (if self then ity else ITNative)))) 2 impl (2, irop ity) totality
320
iCmp ity op self impl irop totality = Prim (sUN $ "prim__" ++ op ++ intTyName ity) (ty (replicate 2 . AType . ATInt $ ity) (AType (ATInt (if self then ity else ITNative)))) 2 impl (2, irop ity) totality
218
false
true
0
13
76
157
81
76
null
null
abau/co4
src/CO4/Util.hs
gpl-3.0
-- |Gets all top-level bindings of a program programToplevelBindings :: Program -> [Binding] programToplevelBindings (Program main decls) = main : (mapMaybe fromDecl decls) where fromDecl (DBind b) = Just b fromDecl _ = Nothing -- |Gets the name of the main binding
285
programToplevelBindings :: Program -> [Binding] programToplevelBindings (Program main decls) = main : (mapMaybe fromDecl decls) where fromDecl (DBind b) = Just b fromDecl _ = Nothing -- |Gets the name of the main binding
240
programToplevelBindings (Program main decls) = main : (mapMaybe fromDecl decls) where fromDecl (DBind b) = Just b fromDecl _ = Nothing -- |Gets the name of the main binding
192
true
true
0
7
61
71
36
35
null
null
jhance/objection
Language/Objection/Parser/Token.hs
gpl-3.0
tokensP :: (Stream s m Char, Monad m) => ParsecT s u m [(SourcePos, Token)] tokensP = many $ spaces *> tokenP <* spaces
119
tokensP :: (Stream s m Char, Monad m) => ParsecT s u m [(SourcePos, Token)] tokensP = many $ spaces *> tokenP <* spaces
119
tokensP = many $ spaces *> tokenP <* spaces
43
false
true
0
8
23
60
32
28
null
null
urbanslug/ghc
compiler/types/InstEnv.hs
bsd-3-clause
mkLocalInstance :: DFunId -> OverlapFlag -> [TyVar] -> Class -> [Type] -> ClsInst -- Used for local instances, where we can safely pull on the DFunId mkLocalInstance dfun oflag tvs cls tys = ClsInst { is_flag = oflag, is_dfun = dfun , is_tvs = tvs , is_cls = cls...
1,689
mkLocalInstance :: DFunId -> OverlapFlag -> [TyVar] -> Class -> [Type] -> ClsInst mkLocalInstance dfun oflag tvs cls tys = ClsInst { is_flag = oflag, is_dfun = dfun , is_tvs = tvs , is_cls = cls, is_cls_nm = cls_name , is_tys = tys, is_tcs = roughMat...
1,621
mkLocalInstance dfun oflag tvs cls tys = ClsInst { is_flag = oflag, is_dfun = dfun , is_tvs = tvs , is_cls = cls, is_cls_nm = cls_name , is_tys = tys, is_tcs = roughMatchTcs tys , is_orphan = orph } where cls_name = className cls dfun_name = idName...
1,507
true
true
0
10
560
444
233
211
null
null
vladimir-ipatov/ganeti
src/Ganeti/OpParams.hs
gpl-2.0
pDryRun :: Field pDryRun = withDoc "Run checks only, don't execute" . optionalField $ booleanField "dry_run"
112
pDryRun :: Field pDryRun = withDoc "Run checks only, don't execute" . optionalField $ booleanField "dry_run"
112
pDryRun = withDoc "Run checks only, don't execute" . optionalField $ booleanField "dry_run"
95
false
true
0
7
19
25
12
13
null
null
cocreature/leksah
src/IDE/Debug.hs
gpl-2.0
debugSetBreakOnException :: Bool -> IDEAction debugSetBreakOnException = debugSet breakOnExceptionFlag
102
debugSetBreakOnException :: Bool -> IDEAction debugSetBreakOnException = debugSet breakOnExceptionFlag
102
debugSetBreakOnException = debugSet breakOnExceptionFlag
56
false
true
0
5
8
18
9
9
null
null
ywata/tokyo-haskell
src/ListSample.hs
bsd-3-clause
-- filter filter_even = filter (\x -> mod x 2 == 0)
53
filter_even = filter (\x -> mod x 2 == 0)
43
filter_even = filter (\x -> mod x 2 == 0)
43
true
false
1
9
13
30
14
16
null
null
tjakway/ghcjvm
compiler/stranal/DmdAnal.hs
bsd-3-clause
coercionDmdEnv :: Coercion -> DmdEnv coercionDmdEnv co = mapVarEnv (const topDmd) (coVarsOfCo co)
97
coercionDmdEnv :: Coercion -> DmdEnv coercionDmdEnv co = mapVarEnv (const topDmd) (coVarsOfCo co)
97
coercionDmdEnv co = mapVarEnv (const topDmd) (coVarsOfCo co)
60
false
true
0
7
12
35
17
18
null
null
li-zhirui/EoplLangs
test/ImplicitRefs/ParserSuite.hs
bsd-3-clause
tests :: Test tests = TestList [ TestLabel "Test const expression" testConstExpr , TestLabel "Test binary-operator expression" testBinOpExpr , TestLabel "Test unary-operator expression" testUnaryOpExpr , TestLabel "Test condition expression" testCondExpr , TestLabel "Test var expression" testVarExpr , TestL...
518
tests :: Test tests = TestList [ TestLabel "Test const expression" testConstExpr , TestLabel "Test binary-operator expression" testBinOpExpr , TestLabel "Test unary-operator expression" testUnaryOpExpr , TestLabel "Test condition expression" testCondExpr , TestLabel "Test var expression" testVarExpr , TestL...
518
tests = TestList [ TestLabel "Test const expression" testConstExpr , TestLabel "Test binary-operator expression" testBinOpExpr , TestLabel "Test unary-operator expression" testUnaryOpExpr , TestLabel "Test condition expression" testCondExpr , TestLabel "Test var expression" testVarExpr , TestLabel "Test let...
504
false
true
0
6
80
86
43
43
null
null
unknownloner/calccomp
FORTH/Stdlib.hs
mit
-- Routine rtn x = Just Rtn {code = x, inline = False, depends = []}
68
rtn x = Just Rtn {code = x, inline = False, depends = []}
57
rtn x = Just Rtn {code = x, inline = False, depends = []}
57
true
false
1
8
15
38
20
18
null
null
arnizamani/OccamStar
ArithmeticAgentOld.hs
gpl-2.0
5 + 8 = 13
10
5 + 8 = 13
10
5 + 8 = 13
10
false
false
2
5
4
13
5
8
null
null
UCSD-PL/RefScript
src/Language/Rsc/Typecheck/Types.hs
bsd-3-clause
tUndef = tPrim TUndefined
26
tUndef = tPrim TUndefined
26
tUndef = tPrim TUndefined
26
false
false
0
5
4
9
4
5
null
null
mudphone/HaskellBook
src/Semigroups.hs
mit
accumulateBothGen :: (Arbitrary a, Arbitrary b) => Gen (AccumulateBoth a b) accumulateBothGen = do a <- arbitrary b <- arbitrary elements [(AccumulateBoth (Failure a)), (AccumulateBoth (Success b))]
204
accumulateBothGen :: (Arbitrary a, Arbitrary b) => Gen (AccumulateBoth a b) accumulateBothGen = do a <- arbitrary b <- arbitrary elements [(AccumulateBoth (Failure a)), (AccumulateBoth (Success b))]
204
accumulateBothGen = do a <- arbitrary b <- arbitrary elements [(AccumulateBoth (Failure a)), (AccumulateBoth (Success b))]
128
false
true
0
12
32
87
43
44
null
null
ehamberg/tapl-haskell-untyped
src/Untyped.hs
bsd-3-clause
showTerms (t:ts) ctx = showInCtx t ctx ++ "\n" ++ showTerms ts ctx
66
showTerms (t:ts) ctx = showInCtx t ctx ++ "\n" ++ showTerms ts ctx
66
showTerms (t:ts) ctx = showInCtx t ctx ++ "\n" ++ showTerms ts ctx
66
false
false
0
7
12
37
17
20
null
null
shlevy/ghc
compiler/basicTypes/Name.hs
bsd-3-clause
isBuiltInSyntax _ = False
67
isBuiltInSyntax _ = False
67
isBuiltInSyntax _ = False
67
false
false
0
5
45
9
4
5
null
null
hguenther/gtl
lib/Misc/ProgramOptions.hs
bsd-3-clause
splitOptions :: String -> [String] splitOptions = map (prependIfNecessary '-') . (split (" -")) where prependIfNecessary :: Eq a => a -> [a] -> [a] prependIfNecessary s l@(x:xs) = if s == x then l else s:l -- | Split list into tokens where the first list matches
273
splitOptions :: String -> [String] splitOptions = map (prependIfNecessary '-') . (split (" -")) where prependIfNecessary :: Eq a => a -> [a] -> [a] prependIfNecessary s l@(x:xs) = if s == x then l else s:l -- | Split list into tokens where the first list matches
273
splitOptions = map (prependIfNecessary '-') . (split (" -")) where prependIfNecessary :: Eq a => a -> [a] -> [a] prependIfNecessary s l@(x:xs) = if s == x then l else s:l -- | Split list into tokens where the first list matches
238
false
true
0
8
58
106
57
49
null
null
ddssff/lens
src/Control/Lens/TH.hs
bsd-3-clause
makeWrappedForDec :: Dec -> Q (Maybe [Dec]) makeWrappedForDec decl = case makeDataDecl decl of Just dataDecl | [con] <- constructors dataDecl , [field] <- toListOf (conFields._2) con -> do wrapped <- makeWrappedInstance dataDecl con field rewrapped <- makeRewrappedInstance dataDecl ...
385
makeWrappedForDec :: Dec -> Q (Maybe [Dec]) makeWrappedForDec decl = case makeDataDecl decl of Just dataDecl | [con] <- constructors dataDecl , [field] <- toListOf (conFields._2) con -> do wrapped <- makeWrappedInstance dataDecl con field rewrapped <- makeRewrappedInstance dataDecl ...
385
makeWrappedForDec decl = case makeDataDecl decl of Just dataDecl | [con] <- constructors dataDecl , [field] <- toListOf (conFields._2) con -> do wrapped <- makeWrappedInstance dataDecl con field rewrapped <- makeRewrappedInstance dataDecl return (Just [rewrapped, wrapped]) ...
341
false
true
0
14
94
134
63
71
null
null
nicklawls/haskellbook
src/Data/Ini.hs
bsd-3-clause
maybeSuccess _ = Nothing
24
maybeSuccess _ = Nothing
24
maybeSuccess _ = Nothing
24
false
false
0
4
3
10
4
6
null
null
bitemyapp/7startups
Startups/CardList.hs
bsd-3-clause
getResourceCard c@(CompanyProfile Microsoft B) s@Stage1 = CompanyCard c s "MM" [AddVictory CompanyVictory 3 HappensOnce]
122
getResourceCard c@(CompanyProfile Microsoft B) s@Stage1 = CompanyCard c s "MM" [AddVictory CompanyVictory 3 HappensOnce]
122
getResourceCard c@(CompanyProfile Microsoft B) s@Stage1 = CompanyCard c s "MM" [AddVictory CompanyVictory 3 HappensOnce]
122
false
false
0
8
15
44
22
22
null
null
alanz/Alex
src/NFA.hs
bsd-3-clause
rexp2nfa b e (Star re) = do s <- newState epsilonEdge b s rexp2nfa s s re epsilonEdge s e
97
rexp2nfa b e (Star re) = do s <- newState epsilonEdge b s rexp2nfa s s re epsilonEdge s e
97
rexp2nfa b e (Star re) = do s <- newState epsilonEdge b s rexp2nfa s s re epsilonEdge s e
97
false
false
0
7
27
52
22
30
null
null
afcowie/vaultaire
src/TelemetryProgram.hs
bsd-3-clause
helpfulParser :: ParserInfo String helpfulParser = info (helper <*> optionsParser) fullDesc
91
helpfulParser :: ParserInfo String helpfulParser = info (helper <*> optionsParser) fullDesc
91
helpfulParser = info (helper <*> optionsParser) fullDesc
56
false
true
0
7
10
26
13
13
null
null
mightymoose/liquidhaskell
tests/todo/maybe0000.hs
bsd-3-clause
{-@ measure fromJustS :: MaybeS a -> a fromJustS (JustS x) = x @-} gloop :: MaybeS Bool gloop = poop True
113
gloop :: MaybeS Bool gloop = poop True
38
gloop = poop True
17
true
true
0
5
29
18
9
9
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
{- - Returnstrueif the given action group is enabled.<param name="group"> - A number between 0 and 9 inclusive, - or between 0 and 250 inclusive when the <a href="http://forum.kerbalspaceprogram.com/index.php?/topic/67235-12oct3116-action-groups-extended-250-action-groups-in-flight-editing-now-kosremotetech">Extende...
655
controlGetActionGroup :: KRPCHS.SpaceCenter.Control -> Data.Word.Word32 -> RPCContext (Bool) controlGetActionGroup thisArg groupArg = do let r = makeRequest "SpaceCenter" "Control_GetActionGroup" [makeArgument 0 thisArg, makeArgument 1 groupArg] res <- sendRequest r processResponse res
298
controlGetActionGroup thisArg groupArg = do let r = makeRequest "SpaceCenter" "Control_GetActionGroup" [makeArgument 0 thisArg, makeArgument 1 groupArg] res <- sendRequest r processResponse res
205
true
true
0
13
80
90
42
48
null
null
anchor/servant-purescript
src/Servant/PureScript.hs
bsd-3-clause
-- | Type for XHR xhrType :: String xhrType = unlines [ "foreign import data XHR :: *" , "foreign import data XHREff :: !" ]
136
xhrType :: String xhrType = unlines [ "foreign import data XHR :: *" , "foreign import data XHREff :: !" ]
118
xhrType = unlines [ "foreign import data XHR :: *" , "foreign import data XHREff :: !" ]
100
true
true
0
6
37
27
13
14
null
null
cullina/Extractor
src/Bit.hs
bsd-3-clause
incrementInt' (b:bs) = let (lowBits, carry) = incrementInt' bs in (xor b carry : lowBits, (&&) b carry)
112
incrementInt' (b:bs) = let (lowBits, carry) = incrementInt' bs in (xor b carry : lowBits, (&&) b carry)
112
incrementInt' (b:bs) = let (lowBits, carry) = incrementInt' bs in (xor b carry : lowBits, (&&) b carry)
112
false
false
0
9
26
59
30
29
null
null
alexliew/learn_you_a_haskell
code/knightmoves.hs
unlicense
inMany :: Int -> KnightPos -> [KnightPos] --inMany x start = return start >>= foldr (<=<) return (replicate x moveKnight) --GhcModLint suggests: inMany x = foldr (<=<) return (replicate x moveKnight)
199
inMany :: Int -> KnightPos -> [KnightPos] inMany x = foldr (<=<) return (replicate x moveKnight)
96
inMany x = foldr (<=<) return (replicate x moveKnight)
54
true
true
0
7
30
44
24
20
null
null
tonymorris/story-board
src/Graphics/Storyboard/Prose.hs
bsd-3-clause
parts p xs = case span (not . p) xs of (before,[_]) -> before : [[]] (before,(_:ys)) -> before : parts p ys (before,[]) -> [before]
183
parts p xs = case span (not . p) xs of (before,[_]) -> before : [[]] (before,(_:ys)) -> before : parts p ys (before,[]) -> [before]
183
parts p xs = case span (not . p) xs of (before,[_]) -> before : [[]] (before,(_:ys)) -> before : parts p ys (before,[]) -> [before]
183
false
false
0
10
77
96
52
44
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Tabular.hs
bsd-3-clause
-- | A short-hand notion for @ el\' \"table\" ... @ tableN' ∷ forall t m a. DomBuilder t m ⇒ m a → m (Element EventResult (DomBuilderSpace m) t, a) tableN' = el' "table"
169
tableN' ∷ forall t m a. DomBuilder t m ⇒ m a → m (Element EventResult (DomBuilderSpace m) t, a) tableN' = el' "table"
117
tableN' = el' "table"
21
true
true
0
13
34
66
32
34
null
null
yamadapc/haskell-projectroot
test/System/Directory/ProjectRootSpec.hs
mit
spec :: Spec spec = describe "getProjectRoot :: FilePath -> IO (Maybe FilePath)" $ it "doesn't seg fault" $ do mroot <- getProjectRoot "/" mroot `shouldBe` Nothing
199
spec :: Spec spec = describe "getProjectRoot :: FilePath -> IO (Maybe FilePath)" $ it "doesn't seg fault" $ do mroot <- getProjectRoot "/" mroot `shouldBe` Nothing
199
spec = describe "getProjectRoot :: FilePath -> IO (Maybe FilePath)" $ it "doesn't seg fault" $ do mroot <- getProjectRoot "/" mroot `shouldBe` Nothing
186
false
true
0
9
62
44
21
23
null
null
vikraman/ghc
compiler/prelude/THNames.hs
bsd-3-clause
classDName = libFun (fsLit "classD") classDIdKey
69
classDName = libFun (fsLit "classD") classDIdKey
69
classDName = libFun (fsLit "classD") classDIdKey
69
false
false
0
7
26
17
8
9
null
null
bj4rtmar/sdl2
src/SDL/Video/Renderer.hs
bsd-3-clause
freeSurface :: MonadIO m => Surface -> m () freeSurface (Surface s _) = Raw.freeSurface s
89
freeSurface :: MonadIO m => Surface -> m () freeSurface (Surface s _) = Raw.freeSurface s
89
freeSurface (Surface s _) = Raw.freeSurface s
45
false
true
0
10
15
47
21
26
null
null
lukexi/ghc-7.8-arm64
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
getRegister' _ _ (CmmLoad mem pk) | isFloatType pk = do Amode addr mem_code <- getAmode mem use_sse2 <- sse2Enabled loadFloatAmode use_sse2 (typeWidth pk) addr mem_code
184
getRegister' _ _ (CmmLoad mem pk) | isFloatType pk = do Amode addr mem_code <- getAmode mem use_sse2 <- sse2Enabled loadFloatAmode use_sse2 (typeWidth pk) addr mem_code
184
getRegister' _ _ (CmmLoad mem pk) | isFloatType pk = do Amode addr mem_code <- getAmode mem use_sse2 <- sse2Enabled loadFloatAmode use_sse2 (typeWidth pk) addr mem_code
184
false
false
0
10
41
70
30
40
null
null
brendanhay/gogol
gogol-dns/gen/Network/Google/DNS/Types/Product.hs
mpl-2.0
-- | Status of the operation (output only). A status of \"done\" means that -- the request to update the authoritative servers has been sent but the -- servers might not be updated yet. cStatus :: Lens' Change (Maybe ChangeStatus) cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
281
cStatus :: Lens' Change (Maybe ChangeStatus) cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
95
cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
50
true
true
1
9
50
51
27
24
null
null
tekul/cryptonite
tests/BlockCipher.hs
bsd-3-clause
defaultKATs = KATs [] [] [] [] [] []
36
defaultKATs = KATs [] [] [] [] [] []
36
defaultKATs = KATs [] [] [] [] [] []
36
false
false
0
6
8
31
15
16
null
null
plow-technologies/ircbrowse
src/Ircbrowse/Types/Import.hs
bsd-3-clause
showChanInt Scalaz = 14
23
showChanInt Scalaz = 14
23
showChanInt Scalaz = 14
23
false
false
1
5
3
13
4
9
null
null
lifengsun/haskell-exercise
scheme/05/operatorparser.hs
gpl-3.0
symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=?>@^_~#"
58
symbol :: Parser Char symbol = oneOf "!$%&|*+-/:<=?>@^_~#"
58
symbol = oneOf "!$%&|*+-/:<=?>@^_~#"
36
false
true
0
5
7
17
8
9
null
null
jasonzoladz/parconc-examples
parinfer/Substitution.hs
bsd-3-clause
extendSub :: Sub -> TVarId -> MonoType -> Sub extendSub s x t = s `thenSub` unitSub x (applySub s t)
137
extendSub :: Sub -> TVarId -> MonoType -> Sub extendSub s x t = s `thenSub` unitSub x (applySub s t)
137
extendSub s x t = s `thenSub` unitSub x (applySub s t)
70
false
true
0
8
57
49
25
24
null
null