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
bjornbm/astro
test/Astro/Orbit/InterpolateSpec.hs
bsd-3-clause
spec_linearPolateT = describe "linearPolateT (t0,y0) (t1,y1) t" $ do it "returns y0 when interpolating at t0." (property $ \(t0::E UT1 D, y0::Length D) (t1,y1) -> t0 /= t1 ==> linearPolateT (y0`At`t0) (y1`At`t1) t0 ~== y0) it "returns y1 when interpolating at t1." (property $ \(t0::E UT1 D, y0::Length D) (t1,y1) -> t0 /= t1 ==> linearPolateT (y0`At`t0) (y1`At`t1) t1 ~== y1)
402
spec_linearPolateT = describe "linearPolateT (t0,y0) (t1,y1) t" $ do it "returns y0 when interpolating at t0." (property $ \(t0::E UT1 D, y0::Length D) (t1,y1) -> t0 /= t1 ==> linearPolateT (y0`At`t0) (y1`At`t1) t0 ~== y0) it "returns y1 when interpolating at t1." (property $ \(t0::E UT1 D, y0::Length D) (t1,y1) -> t0 /= t1 ==> linearPolateT (y0`At`t0) (y1`At`t1) t1 ~== y1)
402
spec_linearPolateT = describe "linearPolateT (t0,y0) (t1,y1) t" $ do it "returns y0 when interpolating at t0." (property $ \(t0::E UT1 D, y0::Length D) (t1,y1) -> t0 /= t1 ==> linearPolateT (y0`At`t0) (y1`At`t1) t0 ~== y0) it "returns y1 when interpolating at t1." (property $ \(t0::E UT1 D, y0::Length D) (t1,y1) -> t0 /= t1 ==> linearPolateT (y0`At`t0) (y1`At`t1) t1 ~== y1)
402
false
false
0
16
86
187
100
87
null
null
bigs/7inch
src/Main.hs
mit
-- Config stuff channels = ["#game"]
36
channels = ["#game"]
20
channels = ["#game"]
20
true
false
1
5
5
13
6
7
null
null
icyfork/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkSingleQuotedVariables3 = verifyNot checkSingleQuotedVariables "sed 's/foo$/bar/'"
91
prop_checkSingleQuotedVariables3 = verifyNot checkSingleQuotedVariables "sed 's/foo$/bar/'"
91
prop_checkSingleQuotedVariables3 = verifyNot checkSingleQuotedVariables "sed 's/foo$/bar/'"
91
false
false
0
5
5
11
5
6
null
null
cpettitt/tamien
Tamien/TI/Eval.hs
mit
getStatMaxHeap :: TiStats -> Int getStatMaxHeap (TiStats _ _ x _) = x
69
getStatMaxHeap :: TiStats -> Int getStatMaxHeap (TiStats _ _ x _) = x
69
getStatMaxHeap (TiStats _ _ x _) = x
36
false
true
0
9
12
36
16
20
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
ingratiatingly = id
19
ingratiatingly = id
19
ingratiatingly = id
19
false
false
0
4
2
6
3
3
null
null
pigworker/CS410-14
Ex6/ANSIEscapes.hs
unlicense
initTermSize = (escape "[=3h")
35
initTermSize = (escape "[=3h")
35
initTermSize = (escape "[=3h")
35
false
false
0
6
8
12
6
6
null
null
simonmar/alex
src/Sort.hs
bsd-3-clause
-- `isort' is an insertion sort and is here for historical reasons; msort is -- better in almost every situation. isort:: (a->a->Bool) -> [a] -> [a] isort (<=) = foldr (insrt (<=)) []
184
isort:: (a->a->Bool) -> [a] -> [a] isort (<=) = foldr (insrt (<=)) []
69
isort (<=) = foldr (insrt (<=)) []
34
true
true
0
9
33
65
34
31
null
null
ekmett/hmpfr
src/Data/Number/MPFR/Special.hs
bsd-3-clause
log10_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int) log10_ r p d = withMPFR r p d mpfr_log10
102
log10_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int) log10_ r p d = withMPFR r p d mpfr_log10
102
log10_ r p d = withMPFR r p d mpfr_log10
40
false
true
0
8
25
45
23
22
null
null
gbwey/persistent
persistent-zookeeper/Database/Persist/Zookeeper/Config.hs
mit
withZookeeperPool :: (Monad m, MonadIO m) => ZookeeperConf -> (Connection -> m a) -> m a withZookeeperPool conf connectionReader = do conn <- liftIO $ createPoolConfig conf connectionReader conn
198
withZookeeperPool :: (Monad m, MonadIO m) => ZookeeperConf -> (Connection -> m a) -> m a withZookeeperPool conf connectionReader = do conn <- liftIO $ createPoolConfig conf connectionReader conn
198
withZookeeperPool conf connectionReader = do conn <- liftIO $ createPoolConfig conf connectionReader conn
109
false
true
0
10
32
77
35
42
null
null
kylcarte/harihara
src/Harihara/Lastfm/Requests.hs
bsd-3-clause
getInfo_tag :: Text -> Lastfm GenreTag getInfo_tag tg = do logDebugData "Tag" $ ppShow tg getInfo $ Tag.getInfo <*> FM.tag tg
144
getInfo_tag :: Text -> Lastfm GenreTag getInfo_tag tg = do logDebugData "Tag" $ ppShow tg getInfo $ Tag.getInfo <*> FM.tag tg
144
getInfo_tag tg = do logDebugData "Tag" $ ppShow tg getInfo $ Tag.getInfo <*> FM.tag tg
98
false
true
0
9
39
52
23
29
null
null
j5b/ps-pc
ModelChecker_test.hs
gpl-3.0
test19 = testequality "Failed to show C or not D is true" result target $ printModel model1 where result = checkGivens c_or_nd model1 target = ("", True)
163
test19 = testequality "Failed to show C or not D is true" result target $ printModel model1 where result = checkGivens c_or_nd model1 target = ("", True)
163
test19 = testequality "Failed to show C or not D is true" result target $ printModel model1 where result = checkGivens c_or_nd model1 target = ("", True)
163
false
false
2
6
36
52
22
30
null
null
olsner/ghc
compiler/cmm/Hoopl/Dataflow.hs
bsd-3-clause
analyzeCmm :: Direction -> DataflowLattice f -> TransferFun f -> CmmGraph -> FactBase f -> FactBase f analyzeCmm dir lattice transfer cmmGraph initFact = let entry = g_entry cmmGraph hooplGraph = g_graph cmmGraph blockMap = case hooplGraph of GMany NothingO bm NothingO -> bm entries = if mapNull initFact then [entry] else mapKeys initFact in fixpointAnalysis dir lattice transfer entries blockMap initFact
491
analyzeCmm :: Direction -> DataflowLattice f -> TransferFun f -> CmmGraph -> FactBase f -> FactBase f analyzeCmm dir lattice transfer cmmGraph initFact = let entry = g_entry cmmGraph hooplGraph = g_graph cmmGraph blockMap = case hooplGraph of GMany NothingO bm NothingO -> bm entries = if mapNull initFact then [entry] else mapKeys initFact in fixpointAnalysis dir lattice transfer entries blockMap initFact
491
analyzeCmm dir lattice transfer cmmGraph initFact = let entry = g_entry cmmGraph hooplGraph = g_graph cmmGraph blockMap = case hooplGraph of GMany NothingO bm NothingO -> bm entries = if mapNull initFact then [entry] else mapKeys initFact in fixpointAnalysis dir lattice transfer entries blockMap initFact
365
false
true
0
12
145
137
65
72
null
null
philipcraig/hutton
src/Exercises/Tautology.hs
bsd-3-clause
p4 :: Prop p4 = Imply (And (Var 'A') (Imply (Var 'A') (Var 'B'))) (Var 'B')
75
p4 :: Prop p4 = Imply (And (Var 'A') (Imply (Var 'A') (Var 'B'))) (Var 'B')
75
p4 = Imply (And (Var 'A') (Imply (Var 'A') (Var 'B'))) (Var 'B')
64
false
true
0
11
15
56
28
28
null
null
narrative/achaeabot
src/Bot.hs
mit
whenMissing :: Applicative f => Maybe a -> f () -> f () whenMissing Nothing f = f
81
whenMissing :: Applicative f => Maybe a -> f () -> f () whenMissing Nothing f = f
81
whenMissing Nothing f = f
25
false
true
0
10
17
49
21
28
null
null
NICTA/tickle
src/Data/Tickle/Get.hs
bsd-3-clause
-- | -- -- >>> runGet (pushFront (BC.pack "def") :: Get () ()) (BLC.pack "") -- RunGet () -- -- >>> runGet (pushFront (BC.pack "def") :: Get () ()) (BLC.pack "abc") -- RunGet () pushFront :: B.ByteString -> Get e () pushFront b = Get (\c q -> q (B.append b c) ())
269
pushFront :: B.ByteString -> Get e () pushFront b = Get (\c q -> q (B.append b c) ())
91
pushFront b = Get (\c q -> q (B.append b c) ())
49
true
true
0
11
58
65
35
30
null
null
patperry/hs-linear-algebra
lib/Numeric/LinearAlgebra/Matrix/Base.hs
bsd-3-clause
splitColsAt :: (Storable e) => Int -> Matrix e -> (Matrix e, Matrix e) splitColsAt j a | j < 0 || j > n = error $ printf ("splitColsAt %d <matrix with dim (%d,%d)>:" ++ " invalid index") j m n | otherwise = let a1 = unsafeSlice (0,0) (m,j) a a2 = unsafeSlice (0,j) (m,n-j) a in (a1,a2) where (m,n) = dim a
366
splitColsAt :: (Storable e) => Int -> Matrix e -> (Matrix e, Matrix e) splitColsAt j a | j < 0 || j > n = error $ printf ("splitColsAt %d <matrix with dim (%d,%d)>:" ++ " invalid index") j m n | otherwise = let a1 = unsafeSlice (0,0) (m,j) a a2 = unsafeSlice (0,j) (m,n-j) a in (a1,a2) where (m,n) = dim a
366
splitColsAt j a | j < 0 || j > n = error $ printf ("splitColsAt %d <matrix with dim (%d,%d)>:" ++ " invalid index") j m n | otherwise = let a1 = unsafeSlice (0,0) (m,j) a a2 = unsafeSlice (0,j) (m,n-j) a in (a1,a2) where (m,n) = dim a
295
false
true
1
11
125
175
91
84
null
null
DNoved1/distill
src/Distill/Expr/Representation.hs
mit
parseArg :: Parser (String, Type' String) parseArg = Token.parens tokens $ do x <- identifier tokens symbol tokens ":" t <- parseExpr return (x, t)
163
parseArg :: Parser (String, Type' String) parseArg = Token.parens tokens $ do x <- identifier tokens symbol tokens ":" t <- parseExpr return (x, t)
163
parseArg = Token.parens tokens $ do x <- identifier tokens symbol tokens ":" t <- parseExpr return (x, t)
121
false
true
1
10
40
73
32
41
null
null
Rotsor/wheeled-vehicle
Gloss.hs
bsd-3-clause
polygon :: [Vector DPixel] -> Picture polygon = GL.polygon . map (mapV (realToFrac . (/~ pixel)))
97
polygon :: [Vector DPixel] -> Picture polygon = GL.polygon . map (mapV (realToFrac . (/~ pixel)))
97
polygon = GL.polygon . map (mapV (realToFrac . (/~ pixel)))
59
false
true
0
11
15
47
25
22
null
null
jamshidh/ethereum-vm
src/Blockchain/JCommand.hs
bsd-3-clause
pushVal::Word->[Operation] pushVal (Number x) = [PUSH $ integer2Bytes1 $ toInteger x]
85
pushVal::Word->[Operation] pushVal (Number x) = [PUSH $ integer2Bytes1 $ toInteger x]
85
pushVal (Number x) = [PUSH $ integer2Bytes1 $ toInteger x]
58
false
true
0
9
10
48
22
26
null
null
sampou-org/pfad
Code/Code14.hs
bsd-3-clause
thd :: (a,b,c,d) -> c thd (_,_,z,_) = z
39
thd :: (a,b,c,d) -> c thd (_,_,z,_) = z
39
thd (_,_,z,_) = z
17
false
true
0
6
8
42
25
17
null
null
kmate/HaRe
old/tools/base/lib/Monads/Monadic.hs
bsd-3-clause
whileM :: Monad m => m Bool -> m () -> m () whileM p m = whenM p (m >> whileM p m)
92
whileM :: Monad m => m Bool -> m () -> m () whileM p m = whenM p (m >> whileM p m)
92
whileM p m = whenM p (m >> whileM p m)
41
false
true
0
10
33
65
29
36
null
null
foreverbell/project-euler-solutions
lib/Common/Numbers/Numbers.hs
bsd-3-clause
inverse x p = if x' == 0 then undefined else powMod x' (toInteger (p - 2)) p where x' = x `rem` p -- | x and m should be co-prime. -- | this version is preferred.
175
inverse x p = if x' == 0 then undefined else powMod x' (toInteger (p - 2)) p where x' = x `rem` p -- | x and m should be co-prime. -- | this version is preferred.
175
inverse x p = if x' == 0 then undefined else powMod x' (toInteger (p - 2)) p where x' = x `rem` p -- | x and m should be co-prime. -- | this version is preferred.
175
false
false
1
10
50
63
32
31
null
null
keithodulaigh/Hets
CspCASL/SymMapAna.hs
gpl-2.0
liamsRelatedCommTypes :: Rel.Rel SORT -> CommType -> CommType -> Bool liamsRelatedCommTypes rel ct1 ct2 = case (ct1, ct2) of (CommTypeSort s1, CommTypeSort s2) -> s1 == s2 || s1 `Set.member` Rel.succs rel s2 (CommTypeChan (TypedChanName c1 s1), CommTypeChan (TypedChanName c2 s2)) -> c1 == c2 && s1 == s2 _ -> False
329
liamsRelatedCommTypes :: Rel.Rel SORT -> CommType -> CommType -> Bool liamsRelatedCommTypes rel ct1 ct2 = case (ct1, ct2) of (CommTypeSort s1, CommTypeSort s2) -> s1 == s2 || s1 `Set.member` Rel.succs rel s2 (CommTypeChan (TypedChanName c1 s1), CommTypeChan (TypedChanName c2 s2)) -> c1 == c2 && s1 == s2 _ -> False
329
liamsRelatedCommTypes rel ct1 ct2 = case (ct1, ct2) of (CommTypeSort s1, CommTypeSort s2) -> s1 == s2 || s1 `Set.member` Rel.succs rel s2 (CommTypeChan (TypedChanName c1 s1), CommTypeChan (TypedChanName c2 s2)) -> c1 == c2 && s1 == s2 _ -> False
259
false
true
5
13
65
139
70
69
null
null
athanclark/rose-trees
bench/Data/Tree/KnuthBench.hs
bsd-3-clause
tree2 = evalState (makeWith 20 20 2 >>= newNode) 1
50
tree2 = evalState (makeWith 20 20 2 >>= newNode) 1
50
tree2 = evalState (makeWith 20 20 2 >>= newNode) 1
50
false
false
0
8
9
25
12
13
null
null
khajavi/pandoc
src/Text/Pandoc/Readers/Markdown.hs
gpl-2.0
plain :: GenParser Char ParserState Block plain = many1 inline >>~ spaces >>= return . Plain . normalizeSpaces
110
plain :: GenParser Char ParserState Block plain = many1 inline >>~ spaces >>= return . Plain . normalizeSpaces
110
plain = many1 inline >>~ spaces >>= return . Plain . normalizeSpaces
68
false
true
1
8
17
41
18
23
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxCURSOR_SIZING :: Int wxCURSOR_SIZING = 22
43
wxCURSOR_SIZING :: Int wxCURSOR_SIZING = 22
43
wxCURSOR_SIZING = 22
20
false
true
0
4
5
11
6
5
null
null
alekar/hugs
packages/base/Data/Map.hs
bsd-3-clause
filterLt cmp (Bin sx kx x l r) = case cmp kx of LT -> filterLt cmp l GT -> join kx x l (filterLt cmp r) EQ -> l {-------------------------------------------------------------------- Split --------------------------------------------------------------------} -- | /O(log n)/. The expression (@'split' k map@) is a pair @(map1,map2)@ where -- the keys in @map1@ are smaller than @k@ and the keys in @map2@ larger than @k@. Any key equal to @k@ is found in neither @map1@ nor @map2@.
503
filterLt cmp (Bin sx kx x l r) = case cmp kx of LT -> filterLt cmp l GT -> join kx x l (filterLt cmp r) EQ -> l {-------------------------------------------------------------------- Split --------------------------------------------------------------------} -- | /O(log n)/. The expression (@'split' k map@) is a pair @(map1,map2)@ where -- the keys in @map1@ are smaller than @k@ and the keys in @map2@ larger than @k@. Any key equal to @k@ is found in neither @map1@ nor @map2@.
503
filterLt cmp (Bin sx kx x l r) = case cmp kx of LT -> filterLt cmp l GT -> join kx x l (filterLt cmp r) EQ -> l {-------------------------------------------------------------------- Split --------------------------------------------------------------------} -- | /O(log n)/. The expression (@'split' k map@) is a pair @(map1,map2)@ where -- the keys in @map1@ are smaller than @k@ and the keys in @map2@ larger than @k@. Any key equal to @k@ is found in neither @map1@ nor @map2@.
503
false
false
3
7
98
78
37
41
null
null
dysinger/amazonka
amazonka-emr/gen/Network/AWS/EMR/RemoveTags.hs
mpl-2.0
-- | The Amazon EMR resource identifier from which tags will be removed. This -- value must be a cluster identifier. rtResourceId :: Lens' RemoveTags Text rtResourceId = lens _rtResourceId (\s a -> s { _rtResourceId = a })
222
rtResourceId :: Lens' RemoveTags Text rtResourceId = lens _rtResourceId (\s a -> s { _rtResourceId = a })
105
rtResourceId = lens _rtResourceId (\s a -> s { _rtResourceId = a })
67
true
true
0
9
38
41
23
18
null
null
mcschroeder/ghc
compiler/typecheck/TcGenGenerics.hs
bsd-3-clause
{- Note [degenerate use of FFoldType] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We use foldDataConArgs here only for its ability to treat tuples specially. foldDataConArgs also tracks covariance (though it assumes all higher-order type parameters are covariant) and has hooks for special handling of functions and polytypes, but we do *not* use those. The key issue is that Generic1 deriving currently offers no sophisticated support for functions. For example, we cannot handle data F a = F ((a -> Int) -> Int) even though a is occurring covariantly. In fact, our rule is harsh: a is simply not allowed to occur within the first argument of (->). We treat (->) the same as any other non-tuple tycon. Unfortunately, this means we have to track "the parameter occurs in this type" explicitly, even though foldDataConArgs is also doing this internally. -} -- canDoGenerics1 rep_tc tc_args determines if a Generic1/Rep1 can be derived -- for a type expression (rep_tc tc_arg0 tc_arg1 ... tc_argn). -- -- Checks (a) through (d) from Note [Requirements for deriving Generic and Rep] -- are taken care of by the call to canDoGenerics. -- -- It returns Nothing if deriving is possible. It returns (Just reason) if not. canDoGenerics1 :: DynFlags -> TyCon -> [Type] -> Validity canDoGenerics1 dflags rep_tc tc_args = canDoGenerics dflags rep_tc tc_args `andValid` additionalChecks where additionalChecks -- check (f) from Note [Requirements for deriving Generic and Rep] | null (tyConTyVars rep_tc) = NotValid $ text "Data type" <+> quotes (ppr rep_tc) <+> text "must have some type parameters" | otherwise = mergeErrors $ concatMap check_con data_cons data_cons = tyConDataCons rep_tc check_con con = case check_vanilla con of j@(NotValid {}) -> [j] IsValid -> _ccdg1_errors `map` foldDataConArgs (ft_check con) con bad :: DataCon -> SDoc -> SDoc bad con msg = text "Constructor" <+> quotes (ppr con) <+> msg check_vanilla :: DataCon -> Validity check_vanilla con | isVanillaDataCon con = IsValid | otherwise = NotValid (bad con existential) bmzero = CCDG1 False IsValid bmbad con s = CCDG1 True $ NotValid $ bad con s bmplus (CCDG1 b1 m1) (CCDG1 b2 m2) = CCDG1 (b1 || b2) (m1 `andValid` m2) -- check (g) from Note [degenerate use of FFoldType] ft_check :: DataCon -> FFoldType Check_for_CanDoGenerics1 ft_check con = FT { ft_triv = bmzero , ft_var = caseVar, ft_co_var = caseVar -- (component_0,component_1,...,component_n) , ft_tup = \_ components -> if any _ccdg1_hasParam (init components) then bmbad con wrong_arg else foldr bmplus bmzero components -- (dom -> rng), where the head of ty is not a tuple tycon , ft_fun = \dom rng -> -- cf #8516 if _ccdg1_hasParam dom then bmbad con wrong_arg else bmplus dom rng -- (ty arg), where head of ty is neither (->) nor a tuple constructor and -- the parameter of interest does not occur in ty , ft_ty_app = \_ arg -> arg , ft_bad_app = bmbad con wrong_arg , ft_forall = \_ body -> body -- polytypes are handled elsewhere } where caseVar = CCDG1 True IsValid existential = text "must not have existential arguments" wrong_arg = text "applies a type to an argument involving the last parameter" $$ text "but the applied type is not of kind * -> *" {- ************************************************************************ * * \subsection{Generating the RHS of a generic default method} * * ************************************************************************ -}
3,914
canDoGenerics1 :: DynFlags -> TyCon -> [Type] -> Validity canDoGenerics1 dflags rep_tc tc_args = canDoGenerics dflags rep_tc tc_args `andValid` additionalChecks where additionalChecks -- check (f) from Note [Requirements for deriving Generic and Rep] | null (tyConTyVars rep_tc) = NotValid $ text "Data type" <+> quotes (ppr rep_tc) <+> text "must have some type parameters" | otherwise = mergeErrors $ concatMap check_con data_cons data_cons = tyConDataCons rep_tc check_con con = case check_vanilla con of j@(NotValid {}) -> [j] IsValid -> _ccdg1_errors `map` foldDataConArgs (ft_check con) con bad :: DataCon -> SDoc -> SDoc bad con msg = text "Constructor" <+> quotes (ppr con) <+> msg check_vanilla :: DataCon -> Validity check_vanilla con | isVanillaDataCon con = IsValid | otherwise = NotValid (bad con existential) bmzero = CCDG1 False IsValid bmbad con s = CCDG1 True $ NotValid $ bad con s bmplus (CCDG1 b1 m1) (CCDG1 b2 m2) = CCDG1 (b1 || b2) (m1 `andValid` m2) -- check (g) from Note [degenerate use of FFoldType] ft_check :: DataCon -> FFoldType Check_for_CanDoGenerics1 ft_check con = FT { ft_triv = bmzero , ft_var = caseVar, ft_co_var = caseVar -- (component_0,component_1,...,component_n) , ft_tup = \_ components -> if any _ccdg1_hasParam (init components) then bmbad con wrong_arg else foldr bmplus bmzero components -- (dom -> rng), where the head of ty is not a tuple tycon , ft_fun = \dom rng -> -- cf #8516 if _ccdg1_hasParam dom then bmbad con wrong_arg else bmplus dom rng -- (ty arg), where head of ty is neither (->) nor a tuple constructor and -- the parameter of interest does not occur in ty , ft_ty_app = \_ arg -> arg , ft_bad_app = bmbad con wrong_arg , ft_forall = \_ body -> body -- polytypes are handled elsewhere } where caseVar = CCDG1 True IsValid existential = text "must not have existential arguments" wrong_arg = text "applies a type to an argument involving the last parameter" $$ text "but the applied type is not of kind * -> *" {- ************************************************************************ * * \subsection{Generating the RHS of a generic default method} * * ************************************************************************ -}
2,698
canDoGenerics1 dflags rep_tc tc_args = canDoGenerics dflags rep_tc tc_args `andValid` additionalChecks where additionalChecks -- check (f) from Note [Requirements for deriving Generic and Rep] | null (tyConTyVars rep_tc) = NotValid $ text "Data type" <+> quotes (ppr rep_tc) <+> text "must have some type parameters" | otherwise = mergeErrors $ concatMap check_con data_cons data_cons = tyConDataCons rep_tc check_con con = case check_vanilla con of j@(NotValid {}) -> [j] IsValid -> _ccdg1_errors `map` foldDataConArgs (ft_check con) con bad :: DataCon -> SDoc -> SDoc bad con msg = text "Constructor" <+> quotes (ppr con) <+> msg check_vanilla :: DataCon -> Validity check_vanilla con | isVanillaDataCon con = IsValid | otherwise = NotValid (bad con existential) bmzero = CCDG1 False IsValid bmbad con s = CCDG1 True $ NotValid $ bad con s bmplus (CCDG1 b1 m1) (CCDG1 b2 m2) = CCDG1 (b1 || b2) (m1 `andValid` m2) -- check (g) from Note [degenerate use of FFoldType] ft_check :: DataCon -> FFoldType Check_for_CanDoGenerics1 ft_check con = FT { ft_triv = bmzero , ft_var = caseVar, ft_co_var = caseVar -- (component_0,component_1,...,component_n) , ft_tup = \_ components -> if any _ccdg1_hasParam (init components) then bmbad con wrong_arg else foldr bmplus bmzero components -- (dom -> rng), where the head of ty is not a tuple tycon , ft_fun = \dom rng -> -- cf #8516 if _ccdg1_hasParam dom then bmbad con wrong_arg else bmplus dom rng -- (ty arg), where head of ty is neither (->) nor a tuple constructor and -- the parameter of interest does not occur in ty , ft_ty_app = \_ arg -> arg , ft_bad_app = bmbad con wrong_arg , ft_forall = \_ body -> body -- polytypes are handled elsewhere } where caseVar = CCDG1 True IsValid existential = text "must not have existential arguments" wrong_arg = text "applies a type to an argument involving the last parameter" $$ text "but the applied type is not of kind * -> *" {- ************************************************************************ * * \subsection{Generating the RHS of a generic default method} * * ************************************************************************ -}
2,640
true
true
3
11
1,057
575
296
279
null
null
thiagoarrais/gtk2hs
tools/apiGen/src/Module.hs
lgpl-2.1
makeOldSignals :: Module -> Module makeOldSignals module_ = module_ { module_decls = makeOldSignal (module_decls module_) } where makeOldSignal (decl@Decl { decl_name = newName, decl_body = signal@Signal {} } : decls) = decl : let oldName = "on" ++ signal_name signal in decl { decl_name = oldName, decl_deprecated = True, decl_deprecated_comment = "instead of '" ++ oldName ++ " obj' " ++ "use 'on obj " ++ newName ++ "'", decl_doc = Nothing, decl_body = signal { signal_is_old_style = True, signal_is_after = False } } : let oldName = "after" ++ signal_name signal in decl { decl_name = oldName, decl_deprecated = True, decl_deprecated_comment = "instead of '" ++ oldName ++ " obj' " ++ "use 'after obj " ++ newName ++ "'", decl_doc = Nothing, decl_body = signal { signal_is_old_style = True, signal_is_after = True } } : makeOldSignal decls makeOldSignal (decl:decls) = decl : makeOldSignal decls makeOldSignal [] = []
1,341
makeOldSignals :: Module -> Module makeOldSignals module_ = module_ { module_decls = makeOldSignal (module_decls module_) } where makeOldSignal (decl@Decl { decl_name = newName, decl_body = signal@Signal {} } : decls) = decl : let oldName = "on" ++ signal_name signal in decl { decl_name = oldName, decl_deprecated = True, decl_deprecated_comment = "instead of '" ++ oldName ++ " obj' " ++ "use 'on obj " ++ newName ++ "'", decl_doc = Nothing, decl_body = signal { signal_is_old_style = True, signal_is_after = False } } : let oldName = "after" ++ signal_name signal in decl { decl_name = oldName, decl_deprecated = True, decl_deprecated_comment = "instead of '" ++ oldName ++ " obj' " ++ "use 'after obj " ++ newName ++ "'", decl_doc = Nothing, decl_body = signal { signal_is_old_style = True, signal_is_after = True } } : makeOldSignal decls makeOldSignal (decl:decls) = decl : makeOldSignal decls makeOldSignal [] = []
1,341
makeOldSignals module_ = module_ { module_decls = makeOldSignal (module_decls module_) } where makeOldSignal (decl@Decl { decl_name = newName, decl_body = signal@Signal {} } : decls) = decl : let oldName = "on" ++ signal_name signal in decl { decl_name = oldName, decl_deprecated = True, decl_deprecated_comment = "instead of '" ++ oldName ++ " obj' " ++ "use 'on obj " ++ newName ++ "'", decl_doc = Nothing, decl_body = signal { signal_is_old_style = True, signal_is_after = False } } : let oldName = "after" ++ signal_name signal in decl { decl_name = oldName, decl_deprecated = True, decl_deprecated_comment = "instead of '" ++ oldName ++ " obj' " ++ "use 'after obj " ++ newName ++ "'", decl_doc = Nothing, decl_body = signal { signal_is_old_style = True, signal_is_after = True } } : makeOldSignal decls makeOldSignal (decl:decls) = decl : makeOldSignal decls makeOldSignal [] = []
1,306
false
true
2
19
569
294
162
132
null
null
mstksg/expr-gadt
src/Data/ExprGADT/Parse.hs
bsd-3-clause
exprVar :: (Monad m, TokenParsing m) => BoundVars vs -> m (ExprTW vs) exprVar bvs = do varStr <- liftA2 (:) (lower <|> char '_') (many (alphaNum <|> oneOf "_'")) <?> "Variable name" case lookupBV bvs varStr of Just e -> return e Nothing -> unexpected ("Variable `" ++ varStr ++ "` not in scope.") <?> "Variable in scope: " ++ inScopeString where inScope = bvStrings bvs inScopeString | null inScope = "(none)" | otherwise = '{' : intercalate ", " inScope ++ "}" -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- data ExprIxW :: * -> * where -- EIW :: ETList vs -> Expr vs a -> ExprIxW a -- data ExprW :: * where -- EW :: ETList vs -> EType a -> Expr vs a -> ExprW -- data ExprTW :: [*] -> * where -- ExTW :: EType a -> Expr vs a -> ExprTW vs -- deriving instance Show ExprW -- deriving instance Show (ExprTW vs) -- exprInt :: forall m vs. (MonadPlus m, TokenParsing m) => ETList vs -> m (Expr vs Int) -- exprInt ets = exprPlus 0 <|> exprIntLit <|> exprIntVar 0 -- where -- exprPlus :: Int -> m (Expr vs Int) -- exprPlus p = parensIf (p > 6) $ do -- e1 <- try $ do -- e1 <- exprIntLit <|> exprIntVar 7 -- spaces -- string "+" -- return e1 -- spaces -- e2 <- exprIntLit <|> exprIntVar 6 -- return $ e1 + e2 -- exprIntLit :: m (Expr vs Int) -- exprIntLit = iI . fromInteger <$> integer -- exprIntVar :: Int -> m (Expr vs Int) -- exprIntVar p = do -- ExTW t ev <- exprVar ets p -- case t of -- EInt -> pure ev -- _ -> unexpected "Variable indexes item of wrong type." -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- indexor :: (Monad m, TokenParsing m, CharParsing m) => Int -> m Int -- indexor p = iz <|> parensIf (p > 10) is -- where -- iz = 1 <$ string "IZ" -- is = do -- _ <- string "IS" -- skipSome space -- fmap succ $ iz <|> parens is -- -- iwSucc :: IndexorW -> IndexorW -- -- iwSucc (IxW ix) = IxW (IS ix) -- fetchType :: ETList vs -> Int -> Maybe ETypeW -- fetchType (x :* _) 0 = Just $ ETW x -- fetchType (_ :* xs) n | n > 0 = fetchType xs (n - 1) -- fetchType _ _ = Nothing -- makeVariable :: ETList vs -> Int -> Maybe (ExprTW vs) -- makeVariable ets n = do -- guard $ n > 0 -- x :* xs <- Just ets -- if n == 1 -- then Just $ ExTW x (V IZ) -- else do -- ExTW x' (V ix) <- makeVariable xs (n - 1) -- return $ ExTW x' (V (IS ix))
3,345
exprVar :: (Monad m, TokenParsing m) => BoundVars vs -> m (ExprTW vs) exprVar bvs = do varStr <- liftA2 (:) (lower <|> char '_') (many (alphaNum <|> oneOf "_'")) <?> "Variable name" case lookupBV bvs varStr of Just e -> return e Nothing -> unexpected ("Variable `" ++ varStr ++ "` not in scope.") <?> "Variable in scope: " ++ inScopeString where inScope = bvStrings bvs inScopeString | null inScope = "(none)" | otherwise = '{' : intercalate ", " inScope ++ "}" -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- data ExprIxW :: * -> * where -- EIW :: ETList vs -> Expr vs a -> ExprIxW a -- data ExprW :: * where -- EW :: ETList vs -> EType a -> Expr vs a -> ExprW -- data ExprTW :: [*] -> * where -- ExTW :: EType a -> Expr vs a -> ExprTW vs -- deriving instance Show ExprW -- deriving instance Show (ExprTW vs) -- exprInt :: forall m vs. (MonadPlus m, TokenParsing m) => ETList vs -> m (Expr vs Int) -- exprInt ets = exprPlus 0 <|> exprIntLit <|> exprIntVar 0 -- where -- exprPlus :: Int -> m (Expr vs Int) -- exprPlus p = parensIf (p > 6) $ do -- e1 <- try $ do -- e1 <- exprIntLit <|> exprIntVar 7 -- spaces -- string "+" -- return e1 -- spaces -- e2 <- exprIntLit <|> exprIntVar 6 -- return $ e1 + e2 -- exprIntLit :: m (Expr vs Int) -- exprIntLit = iI . fromInteger <$> integer -- exprIntVar :: Int -> m (Expr vs Int) -- exprIntVar p = do -- ExTW t ev <- exprVar ets p -- case t of -- EInt -> pure ev -- _ -> unexpected "Variable indexes item of wrong type." -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- indexor :: (Monad m, TokenParsing m, CharParsing m) => Int -> m Int -- indexor p = iz <|> parensIf (p > 10) is -- where -- iz = 1 <$ string "IZ" -- is = do -- _ <- string "IS" -- skipSome space -- fmap succ $ iz <|> parens is -- -- iwSucc :: IndexorW -> IndexorW -- -- iwSucc (IxW ix) = IxW (IS ix) -- fetchType :: ETList vs -> Int -> Maybe ETypeW -- fetchType (x :* _) 0 = Just $ ETW x -- fetchType (_ :* xs) n | n > 0 = fetchType xs (n - 1) -- fetchType _ _ = Nothing -- makeVariable :: ETList vs -> Int -> Maybe (ExprTW vs) -- makeVariable ets n = do -- guard $ n > 0 -- x :* xs <- Just ets -- if n == 1 -- then Just $ ExTW x (V IZ) -- else do -- ExTW x' (V ix) <- makeVariable xs (n - 1) -- return $ ExTW x' (V (IS ix))
3,345
exprVar bvs = do varStr <- liftA2 (:) (lower <|> char '_') (many (alphaNum <|> oneOf "_'")) <?> "Variable name" case lookupBV bvs varStr of Just e -> return e Nothing -> unexpected ("Variable `" ++ varStr ++ "` not in scope.") <?> "Variable in scope: " ++ inScopeString where inScope = bvStrings bvs inScopeString | null inScope = "(none)" | otherwise = '{' : intercalate ", " inScope ++ "}" -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- data ExprIxW :: * -> * where -- EIW :: ETList vs -> Expr vs a -> ExprIxW a -- data ExprW :: * where -- EW :: ETList vs -> EType a -> Expr vs a -> ExprW -- data ExprTW :: [*] -> * where -- ExTW :: EType a -> Expr vs a -> ExprTW vs -- deriving instance Show ExprW -- deriving instance Show (ExprTW vs) -- exprInt :: forall m vs. (MonadPlus m, TokenParsing m) => ETList vs -> m (Expr vs Int) -- exprInt ets = exprPlus 0 <|> exprIntLit <|> exprIntVar 0 -- where -- exprPlus :: Int -> m (Expr vs Int) -- exprPlus p = parensIf (p > 6) $ do -- e1 <- try $ do -- e1 <- exprIntLit <|> exprIntVar 7 -- spaces -- string "+" -- return e1 -- spaces -- e2 <- exprIntLit <|> exprIntVar 6 -- return $ e1 + e2 -- exprIntLit :: m (Expr vs Int) -- exprIntLit = iI . fromInteger <$> integer -- exprIntVar :: Int -> m (Expr vs Int) -- exprIntVar p = do -- ExTW t ev <- exprVar ets p -- case t of -- EInt -> pure ev -- _ -> unexpected "Variable indexes item of wrong type." -- exprVar :: (Monad m, TokenParsing m) => ETList vs -> Int -> m (ExprTW vs) -- exprVar ets p = parensIf (p > 10) $ do -- _ <- string "V" -- skipSome space -- ix <- indexor 11 -- case makeVariable ets ix of -- Just e -> return e -- Nothing -> unexpected "Index out of bounds." -- indexor :: (Monad m, TokenParsing m, CharParsing m) => Int -> m Int -- indexor p = iz <|> parensIf (p > 10) is -- where -- iz = 1 <$ string "IZ" -- is = do -- _ <- string "IS" -- skipSome space -- fmap succ $ iz <|> parens is -- -- iwSucc :: IndexorW -> IndexorW -- -- iwSucc (IxW ix) = IxW (IS ix) -- fetchType :: ETList vs -> Int -> Maybe ETypeW -- fetchType (x :* _) 0 = Just $ ETW x -- fetchType (_ :* xs) n | n > 0 = fetchType xs (n - 1) -- fetchType _ _ = Nothing -- makeVariable :: ETList vs -> Int -> Maybe (ExprTW vs) -- makeVariable ets n = do -- guard $ n > 0 -- x :* xs <- Just ets -- if n == 1 -- then Just $ ExTW x (V IZ) -- else do -- ExTW x' (V ix) <- makeVariable xs (n - 1) -- return $ ExTW x' (V (IS ix))
3,275
false
true
0
15
1,025
267
166
101
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Identifies what kind of resource this is. Value: the fixed string -- \"dfareporting#citiesListResponse\". citKind :: Lens' CitiesListResponse Text citKind = lens _citKind (\ s a -> s{_citKind = a})
202
citKind :: Lens' CitiesListResponse Text citKind = lens _citKind (\ s a -> s{_citKind = a})
91
citKind = lens _citKind (\ s a -> s{_citKind = a})
50
true
true
1
9
30
46
23
23
null
null
brendanhay/gogol
gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Projects/Builds/Retry.hs
mpl-2.0
-- | JSONP pbrCallback :: Lens' ProjectsBuildsRetry (Maybe Text) pbrCallback = lens _pbrCallback (\ s a -> s{_pbrCallback = a})
129
pbrCallback :: Lens' ProjectsBuildsRetry (Maybe Text) pbrCallback = lens _pbrCallback (\ s a -> s{_pbrCallback = a})
118
pbrCallback = lens _pbrCallback (\ s a -> s{_pbrCallback = a})
64
true
true
0
9
21
48
25
23
null
null
olsner/ghc
compiler/prelude/PrimOp.hs
bsd-3-clause
mkCompare str ty = Compare (mkVarOccFS str) ty
46
mkCompare str ty = Compare (mkVarOccFS str) ty
46
mkCompare str ty = Compare (mkVarOccFS str) ty
46
false
false
1
6
7
28
10
18
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxCONFIG_TYPE_FLOAT :: Int wxCONFIG_TYPE_FLOAT = 4
50
wxCONFIG_TYPE_FLOAT :: Int wxCONFIG_TYPE_FLOAT = 4
50
wxCONFIG_TYPE_FLOAT = 4
23
false
true
0
4
5
11
6
5
null
null
gallais/typing-with-leftovers
src/linear/Type/Parser.hs
gpl-3.0
pRType7 :: Parser RType pRType7 = Plus <$> pRType8 <*> (betweenSpace (string "+") *> pRType7) <|> pRType8
124
pRType7 :: Parser RType pRType7 = Plus <$> pRType8 <*> (betweenSpace (string "+") *> pRType7) <|> pRType8
124
pRType7 = Plus <$> pRType8 <*> (betweenSpace (string "+") *> pRType7) <|> pRType8
100
false
true
3
10
35
46
23
23
null
null
kylcarte/derivation
src/Data/Derivation/STLC.hs
bsd-3-clause
lam :: (a :< gam |- b) -> (gam |- a :-> b) lam e = only e ==> LAM
65
lam :: (a :< gam |- b) -> (gam |- a :-> b) lam e = only e ==> LAM
65
lam e = only e ==> LAM
22
false
true
0
8
19
47
24
23
null
null
jarmond/locomotive-haskell
src/Loco/Error.hs
gpl-3.0
showError (InvalidLineError n) = "invalid line number: " ++ show n
66
showError (InvalidLineError n) = "invalid line number: " ++ show n
66
showError (InvalidLineError n) = "invalid line number: " ++ show n
66
false
false
0
7
10
22
10
12
null
null
sdiehl/ghc
compiler/types/Type.hs
bsd-3-clause
funResultTy ty = pprPanic "funResultTy" (ppr ty)
70
funResultTy ty = pprPanic "funResultTy" (ppr ty)
70
funResultTy ty = pprPanic "funResultTy" (ppr ty)
70
false
false
0
7
28
20
9
11
null
null
JacquesCarette/literate-scientific-software
code/drasil-example/Drasil/SWHS/Unitals.hs
bsd-2-clause
htCapWMax = mkQuantDef (unitary' "htCapWMax" (nounPhraseSP "maximum specific heat capacity of water") (staged (supMax (eqSymb htCapW)) (subMax (eqSymb htCapW))) UT.heatCapSpec Rational) 4210
197
htCapWMax = mkQuantDef (unitary' "htCapWMax" (nounPhraseSP "maximum specific heat capacity of water") (staged (supMax (eqSymb htCapW)) (subMax (eqSymb htCapW))) UT.heatCapSpec Rational) 4210
197
htCapWMax = mkQuantDef (unitary' "htCapWMax" (nounPhraseSP "maximum specific heat capacity of water") (staged (supMax (eqSymb htCapW)) (subMax (eqSymb htCapW))) UT.heatCapSpec Rational) 4210
197
false
false
0
13
28
65
32
33
null
null
mindriot101/pandoc
src/Text/Pandoc/Options.hs
gpl-2.0
multimarkdownExtensions :: Set Extension multimarkdownExtensions = Set.fromList [ Ext_pipe_tables , Ext_raw_html , Ext_markdown_attribute , Ext_link_attributes , Ext_raw_tex , Ext_tex_math_double_backslash , Ext_intraword_underscores , Ext_mmd_title_block , Ext_footnotes , Ext_definition_lists , Ext_all_symbols_escapable , Ext_implicit_header_references , Ext_auto_identifiers , Ext_mmd_header_identifiers ]
439
multimarkdownExtensions :: Set Extension multimarkdownExtensions = Set.fromList [ Ext_pipe_tables , Ext_raw_html , Ext_markdown_attribute , Ext_link_attributes , Ext_raw_tex , Ext_tex_math_double_backslash , Ext_intraword_underscores , Ext_mmd_title_block , Ext_footnotes , Ext_definition_lists , Ext_all_symbols_escapable , Ext_implicit_header_references , Ext_auto_identifiers , Ext_mmd_header_identifiers ]
439
multimarkdownExtensions = Set.fromList [ Ext_pipe_tables , Ext_raw_html , Ext_markdown_attribute , Ext_link_attributes , Ext_raw_tex , Ext_tex_math_double_backslash , Ext_intraword_underscores , Ext_mmd_title_block , Ext_footnotes , Ext_definition_lists , Ext_all_symbols_escapable , Ext_implicit_header_references , Ext_auto_identifiers , Ext_mmd_header_identifiers ]
398
false
true
0
5
65
61
37
24
null
null
brendanhay/gogol
gogol-servicenetworking/gen/Network/Google/ServiceNetworking/Types/Product.hs
mpl-2.0
-- | Route name. See https:\/\/cloud.google.com\/vpc\/docs\/routes rName :: Lens' Route (Maybe Text) rName = lens _rName (\ s a -> s{_rName = a})
145
rName :: Lens' Route (Maybe Text) rName = lens _rName (\ s a -> s{_rName = a})
78
rName = lens _rName (\ s a -> s{_rName = a})
44
true
true
0
9
22
46
25
21
null
null
fmapfmapfmap/amazonka
amazonka-rds/gen/Network/AWS/RDS/CopyDBSnapshot.hs
mpl-2.0
-- | Creates a value of 'CopyDBSnapshot' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'cdsCopyTags' -- -- * 'cdsTags' -- -- * 'cdsSourceDBSnapshotIdentifier' -- -- * 'cdsTargetDBSnapshotIdentifier' copyDBSnapshot :: Text -- ^ 'cdsSourceDBSnapshotIdentifier' -> Text -- ^ 'cdsTargetDBSnapshotIdentifier' -> CopyDBSnapshot copyDBSnapshot pSourceDBSnapshotIdentifier_ pTargetDBSnapshotIdentifier_ = CopyDBSnapshot' { _cdsCopyTags = Nothing , _cdsTags = Nothing , _cdsSourceDBSnapshotIdentifier = pSourceDBSnapshotIdentifier_ , _cdsTargetDBSnapshotIdentifier = pTargetDBSnapshotIdentifier_ }
711
copyDBSnapshot :: Text -- ^ 'cdsSourceDBSnapshotIdentifier' -> Text -- ^ 'cdsTargetDBSnapshotIdentifier' -> CopyDBSnapshot copyDBSnapshot pSourceDBSnapshotIdentifier_ pTargetDBSnapshotIdentifier_ = CopyDBSnapshot' { _cdsCopyTags = Nothing , _cdsTags = Nothing , _cdsSourceDBSnapshotIdentifier = pSourceDBSnapshotIdentifier_ , _cdsTargetDBSnapshotIdentifier = pTargetDBSnapshotIdentifier_ }
425
copyDBSnapshot pSourceDBSnapshotIdentifier_ pTargetDBSnapshotIdentifier_ = CopyDBSnapshot' { _cdsCopyTags = Nothing , _cdsTags = Nothing , _cdsSourceDBSnapshotIdentifier = pSourceDBSnapshotIdentifier_ , _cdsTargetDBSnapshotIdentifier = pTargetDBSnapshotIdentifier_ }
290
true
true
0
8
116
72
44
28
null
null
rethab/combinatorrent
src/Protocol/Wire.hs
bsd-2-clause
msgSize (AllowedFast _) = 5
31
msgSize (AllowedFast _) = 5
31
msgSize (AllowedFast _) = 5
31
false
false
0
7
8
15
7
8
null
null
jwiegley/ghc-release
utils/haddock/src/Haddock/Parser.hs
gpl-3.0
joinPara :: Doc id -> Doc id -> Doc id joinPara (DocParagraph p) c = docParagraph $ docAppend p c
97
joinPara :: Doc id -> Doc id -> Doc id joinPara (DocParagraph p) c = docParagraph $ docAppend p c
97
joinPara (DocParagraph p) c = docParagraph $ docAppend p c
58
false
true
0
7
19
48
22
26
null
null
cgag/selecth
test/test.hs
mit
main = do hspecTest <- testSpec "hspec" hspecSpec defaultMain $ testGroup "Tests" [ hspecTest ]
100
main = do hspecTest <- testSpec "hspec" hspecSpec defaultMain $ testGroup "Tests" [ hspecTest ]
100
main = do hspecTest <- testSpec "hspec" hspecSpec defaultMain $ testGroup "Tests" [ hspecTest ]
100
false
false
0
9
19
33
15
18
null
null
tibbe/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
labelType (CaseLabel _ _) = CodeLabel
59
labelType (CaseLabel _ _) = CodeLabel
59
labelType (CaseLabel _ _) = CodeLabel
59
false
false
0
6
27
18
8
10
null
null
lostbean/sphermonics
src/Texture/SH/RotationSO4.hs
gpl-3.0
toRealMatrix :: M.Matrix (Complex Double) -> M.Matrix Double toRealMatrix m = let nsqrt = round $ sqrt $ (fromIntegral $ cols m :: Double) l = nsqrt - 1 u = M.diagBlock $ map realPartMatrixHSH [0 .. l] in cmap realPart $ (ctrans u) `multiply` m `multiply` u
265
toRealMatrix :: M.Matrix (Complex Double) -> M.Matrix Double toRealMatrix m = let nsqrt = round $ sqrt $ (fromIntegral $ cols m :: Double) l = nsqrt - 1 u = M.diagBlock $ map realPartMatrixHSH [0 .. l] in cmap realPart $ (ctrans u) `multiply` m `multiply` u
265
toRealMatrix m = let nsqrt = round $ sqrt $ (fromIntegral $ cols m :: Double) l = nsqrt - 1 u = M.diagBlock $ map realPartMatrixHSH [0 .. l] in cmap realPart $ (ctrans u) `multiply` m `multiply` u
204
false
true
0
12
55
122
63
59
null
null
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
-- * Execution log types elogMessage :: String elogMessage = Types.eLogTypeToRaw ELogMessage
93
elogMessage :: String elogMessage = Types.eLogTypeToRaw ELogMessage
67
elogMessage = Types.eLogTypeToRaw ELogMessage
45
true
true
0
6
12
17
9
8
null
null
bbangert/echo
EchoServer.hs
mit
echo :: Handle -> IO () echo h = do hSetBuffering h LineBuffering loop where loop = do line <- hGetLine h hPutStrLn h line loop
165
echo :: Handle -> IO () echo h = do hSetBuffering h LineBuffering loop where loop = do line <- hGetLine h hPutStrLn h line loop
165
echo h = do hSetBuffering h LineBuffering loop where loop = do line <- hGetLine h hPutStrLn h line loop
141
false
true
1
8
63
71
28
43
null
null
j-rock/rayt
src/Ray/Scene.hs
mit
black :: RGBPixel black = rgb 0 0 0
35
black :: RGBPixel black = rgb 0 0 0
35
black = rgb 0 0 0
17
false
true
0
6
8
24
10
14
null
null
lihlcnkr/codejam
backup/src/CodeWars/TinyTreePassCompiler.hs
apache-2.0
getPriorityValue (TChar '[') = 1
32
getPriorityValue (TChar '[') = 1
32
getPriorityValue (TChar '[') = 1
32
false
false
0
7
4
15
7
8
null
null
romanb/amazonka
amazonka-kinesis/gen/Network/AWS/Kinesis/Types.hs
mpl-2.0
-- | The range of possible sequence numbers for the shard. sSequenceNumberRange :: Lens' Shard SequenceNumberRange sSequenceNumberRange = lens _sSequenceNumberRange (\s a -> s { _sSequenceNumberRange = a })
210
sSequenceNumberRange :: Lens' Shard SequenceNumberRange sSequenceNumberRange = lens _sSequenceNumberRange (\s a -> s { _sSequenceNumberRange = a })
151
sSequenceNumberRange = lens _sSequenceNumberRange (\s a -> s { _sSequenceNumberRange = a })
95
true
true
0
9
32
40
22
18
null
null
itsbruce/hackerrank
alg/graph/snakesLadders.hs
unlicense
main = do n <- readLn results <- replicateM n runTest mapM_ putStrLn $ map show results
99
main = do n <- readLn results <- replicateM n runTest mapM_ putStrLn $ map show results
99
main = do n <- readLn results <- replicateM n runTest mapM_ putStrLn $ map show results
99
false
false
1
9
28
44
17
27
null
null
daewon/til
exercism/haskell/series/src/Series.hs
mpl-2.0
slices :: Int -> String -> [[Int]] slices 0 _ = [[]]
52
slices :: Int -> String -> [[Int]] slices 0 _ = [[]]
52
slices 0 _ = [[]]
17
false
true
0
10
11
41
20
21
null
null
facebookincubator/duckling
Duckling/Rules.hs
bsd-3-clause
localeRules LO = LORules.localeRules
36
localeRules LO = LORules.localeRules
36
localeRules LO = LORules.localeRules
36
false
false
0
5
3
11
5
6
null
null
ak1211/tractor
test/MatsuiCoJp/BrokerSpec.hs
agpl-3.0
sinkText conf = simpleTextMsg conf C..| sinkSlack conf
54
sinkText conf = simpleTextMsg conf C..| sinkSlack conf
54
sinkText conf = simpleTextMsg conf C..| sinkSlack conf
54
false
false
0
6
7
21
9
12
null
null
dbp/positionsites
src/State/Data.hs
bsd-3-clause
boolFieldData _ = False
23
boolFieldData _ = False
23
boolFieldData _ = False
23
false
false
0
5
3
9
4
5
null
null
pshendry/project-euler-solutions
0024/solution.hs
mit
solve :: String solve = (sort $ permutations "0123456789") !! 999999
68
solve :: String solve = (sort $ permutations "0123456789") !! 999999
68
solve = (sort $ permutations "0123456789") !! 999999
52
false
true
0
8
10
25
13
12
null
null
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/GetOpenIdConnectProvider.hs
mpl-2.0
-- | The response status code. goicprsResponseStatus :: Lens' GetOpenIdConnectProviderResponse Int goicprsResponseStatus = lens _goicprsResponseStatus (\ s a -> s{_goicprsResponseStatus = a})
191
goicprsResponseStatus :: Lens' GetOpenIdConnectProviderResponse Int goicprsResponseStatus = lens _goicprsResponseStatus (\ s a -> s{_goicprsResponseStatus = a})
160
goicprsResponseStatus = lens _goicprsResponseStatus (\ s a -> s{_goicprsResponseStatus = a})
92
true
true
0
9
21
40
22
18
null
null
brendanhay/gogol
gogol-containeranalysis/gen/Network/Google/Resource/ContainerAnalysis/Projects/Occurrences/GetNotes.hs
mpl-2.0
-- | Creates a value of 'ProjectsOccurrencesGetNotes' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pognXgafv' -- -- * 'pognUploadProtocol' -- -- * 'pognAccessToken' -- -- * 'pognUploadType' -- -- * 'pognName' -- -- * 'pognCallback' projectsOccurrencesGetNotes :: Text -- ^ 'pognName' -> ProjectsOccurrencesGetNotes projectsOccurrencesGetNotes pPognName_ = ProjectsOccurrencesGetNotes' { _pognXgafv = Nothing , _pognUploadProtocol = Nothing , _pognAccessToken = Nothing , _pognUploadType = Nothing , _pognName = pPognName_ , _pognCallback = Nothing }
676
projectsOccurrencesGetNotes :: Text -- ^ 'pognName' -> ProjectsOccurrencesGetNotes projectsOccurrencesGetNotes pPognName_ = ProjectsOccurrencesGetNotes' { _pognXgafv = Nothing , _pognUploadProtocol = Nothing , _pognAccessToken = Nothing , _pognUploadType = Nothing , _pognName = pPognName_ , _pognCallback = Nothing }
355
projectsOccurrencesGetNotes pPognName_ = ProjectsOccurrencesGetNotes' { _pognXgafv = Nothing , _pognUploadProtocol = Nothing , _pognAccessToken = Nothing , _pognUploadType = Nothing , _pognName = pPognName_ , _pognCallback = Nothing }
264
true
true
0
7
128
81
52
29
null
null
logistark/haskellbookexercises
6 - Typeclasses/chapter6.hs
apache-2.0
equalityForAll :: Papu -> Papu -> Bool equalityForAll p p' = p == p'
70
equalityForAll :: Papu -> Papu -> Bool equalityForAll p p' = p == p'
68
equalityForAll p p' = p == p'
29
false
true
0
6
15
28
14
14
null
null
ulricha/dsh
src/Database/DSH/CL/Opt/Auxiliary.hs
bsd-3-clause
firstOnly (JTupElem _ e) = firstOnly e
49
firstOnly (JTupElem _ e) = firstOnly e
49
firstOnly (JTupElem _ e) = firstOnly e
49
false
false
0
6
17
21
9
12
null
null
mcschroeder/ghc
compiler/main/DynFlags.hs
bsd-3-clause
-- | Set the Haskell language standard to use setLanguage :: Language -> DynP () setLanguage l = upd (`lang_set` Just l)
120
setLanguage :: Language -> DynP () setLanguage l = upd (`lang_set` Just l)
74
setLanguage l = upd (`lang_set` Just l)
39
true
true
0
7
21
36
19
17
null
null
ameingast/yawn
src/Yawn/Util/Time.hs
bsd-3-clause
-- ANSI C's asctime() format -- > Sun Nov 6 08:49:37 1994 getAscDate :: IO (String) getAscDate = getClockTime >>= clockTimeToAscDate
136
getAscDate :: IO (String) getAscDate = getClockTime >>= clockTimeToAscDate
77
getAscDate = getClockTime >>= clockTimeToAscDate
51
true
true
0
6
24
23
13
10
null
null
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Aliases/Delete.hs
mpl-2.0
-- | Pretty-print response. cadPp :: Lens' CoursesAliasesDelete Bool cadPp = lens _cadPp (\ s a -> s{_cadPp = a})
113
cadPp :: Lens' CoursesAliasesDelete Bool cadPp = lens _cadPp (\ s a -> s{_cadPp = a})
85
cadPp = lens _cadPp (\ s a -> s{_cadPp = a})
44
true
true
1
9
19
46
22
24
null
null
siddhanathan/ghc
utils/testremove/wouldrm.hs
bsd-3-clause
main :: IO () main = do args <- getArgs ls <- case args of "CLEAN_FILES" : files -> return $ map CleanFile files "CLEAN_REC" : dirs -> return $ map CleanRec dirs _ -> error "Bad args" appendFile "would-be-cleaned" $ unlines $ map show ls
308
main :: IO () main = do args <- getArgs ls <- case args of "CLEAN_FILES" : files -> return $ map CleanFile files "CLEAN_REC" : dirs -> return $ map CleanRec dirs _ -> error "Bad args" appendFile "would-be-cleaned" $ unlines $ map show ls
308
main = do args <- getArgs ls <- case args of "CLEAN_FILES" : files -> return $ map CleanFile files "CLEAN_REC" : dirs -> return $ map CleanRec dirs _ -> error "Bad args" appendFile "would-be-cleaned" $ unlines $ map show ls
294
false
true
1
13
116
104
46
58
null
null
gleber/erlhask
src/Main.hs
apache-2.0
-- | The main entry point. main :: IO () main = do putStrLn "Booting..." tr <- createTransport "localhost" "8981" defaultTCPParameters case tr of Left e -> do putStrLn "Faield to create a transport" print e Right transport -> do putStrLn "Transport created." node <- newLocalNode transport initRemoteTable putStrLn "Node created." putStrLn "Running boot process..." runProcess node bootProc putStrLn "Boot process terminated"
487
main :: IO () main = do putStrLn "Booting..." tr <- createTransport "localhost" "8981" defaultTCPParameters case tr of Left e -> do putStrLn "Faield to create a transport" print e Right transport -> do putStrLn "Transport created." node <- newLocalNode transport initRemoteTable putStrLn "Node created." putStrLn "Running boot process..." runProcess node bootProc putStrLn "Boot process terminated"
460
main = do putStrLn "Booting..." tr <- createTransport "localhost" "8981" defaultTCPParameters case tr of Left e -> do putStrLn "Faield to create a transport" print e Right transport -> do putStrLn "Transport created." node <- newLocalNode transport initRemoteTable putStrLn "Node created." putStrLn "Running boot process..." runProcess node bootProc putStrLn "Boot process terminated"
446
true
true
0
13
123
118
48
70
null
null
cdodev/scintilla
src/Scintilla/Query/Types.hs
bsd-3-clause
t :: forall m ps w t r e a q . ( MonadIO m, MonadMask m, MonadThrow m, Exception e , PP.Default O.QueryRunner (PgR t) (HsR t) , TableR t, TableRW t, ToHsI t w, ParseHsR t r, ParseHsR t q , Allow ['Insert, 'Fetch] ps) => DBWrite e ps m [r] t = do _q <- toWrite theQ insertDB (undefined :: Table t) (undefined :: [w]) where theQ :: (MonadIO m, MonadMask m, Exception e) => DBMonad ps m [q] theQ = queryDb (undefined :: (Query (Database t) () (PgR t)))
484
t :: forall m ps w t r e a q . ( MonadIO m, MonadMask m, MonadThrow m, Exception e , PP.Default O.QueryRunner (PgR t) (HsR t) , TableR t, TableRW t, ToHsI t w, ParseHsR t r, ParseHsR t q , Allow ['Insert, 'Fetch] ps) => DBWrite e ps m [r] t = do _q <- toWrite theQ insertDB (undefined :: Table t) (undefined :: [w]) where theQ :: (MonadIO m, MonadMask m, Exception e) => DBMonad ps m [q] theQ = queryDb (undefined :: (Query (Database t) () (PgR t)))
484
t = do _q <- toWrite theQ insertDB (undefined :: Table t) (undefined :: [w]) where theQ :: (MonadIO m, MonadMask m, Exception e) => DBMonad ps m [q] theQ = queryDb (undefined :: (Query (Database t) () (PgR t)))
224
false
true
0
10
127
260
136
124
null
null
thomie/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
fetchCommand :: CommandUI FetchFlags fetchCommand = CommandUI { commandName = "fetch", commandSynopsis = "Downloads packages for later installation.", commandUsage = usageAlternatives "fetch" [ "[FLAGS] PACKAGES" ], commandDescription = Just $ \_ -> "Note that it currently is not possible to fetch the dependencies for a\n" ++ "package in the current directory.\n", commandNotes = Nothing, commandDefaultFlags = defaultFetchFlags, commandOptions = \ showOrParseArgs -> [ optionVerbosity fetchVerbosity (\v flags -> flags { fetchVerbosity = v }) -- , option "o" ["output"] -- "Put the package(s) somewhere specific rather than the usual cache." -- fetchOutput (\v flags -> flags { fetchOutput = v }) -- (reqArgFlag "PATH") , option [] ["dependencies", "deps"] "Resolve and fetch dependencies (default)" fetchDeps (\v flags -> flags { fetchDeps = v }) trueArg , option [] ["no-dependencies", "no-deps"] "Ignore dependencies" fetchDeps (\v flags -> flags { fetchDeps = v }) falseArg , option [] ["dry-run"] "Do not install anything, only print what would be installed." fetchDryRun (\v flags -> flags { fetchDryRun = v }) trueArg ] ++ optionSolver fetchSolver (\v flags -> flags { fetchSolver = v }) : optionSolverFlags showOrParseArgs fetchMaxBackjumps (\v flags -> flags { fetchMaxBackjumps = v }) fetchReorderGoals (\v flags -> flags { fetchReorderGoals = v }) fetchCountConflicts (\v flags -> flags { fetchCountConflicts = v }) fetchIndependentGoals (\v flags -> flags { fetchIndependentGoals = v }) fetchShadowPkgs (\v flags -> flags { fetchShadowPkgs = v }) fetchStrongFlags (\v flags -> flags { fetchStrongFlags = v }) }
2,158
fetchCommand :: CommandUI FetchFlags fetchCommand = CommandUI { commandName = "fetch", commandSynopsis = "Downloads packages for later installation.", commandUsage = usageAlternatives "fetch" [ "[FLAGS] PACKAGES" ], commandDescription = Just $ \_ -> "Note that it currently is not possible to fetch the dependencies for a\n" ++ "package in the current directory.\n", commandNotes = Nothing, commandDefaultFlags = defaultFetchFlags, commandOptions = \ showOrParseArgs -> [ optionVerbosity fetchVerbosity (\v flags -> flags { fetchVerbosity = v }) -- , option "o" ["output"] -- "Put the package(s) somewhere specific rather than the usual cache." -- fetchOutput (\v flags -> flags { fetchOutput = v }) -- (reqArgFlag "PATH") , option [] ["dependencies", "deps"] "Resolve and fetch dependencies (default)" fetchDeps (\v flags -> flags { fetchDeps = v }) trueArg , option [] ["no-dependencies", "no-deps"] "Ignore dependencies" fetchDeps (\v flags -> flags { fetchDeps = v }) falseArg , option [] ["dry-run"] "Do not install anything, only print what would be installed." fetchDryRun (\v flags -> flags { fetchDryRun = v }) trueArg ] ++ optionSolver fetchSolver (\v flags -> flags { fetchSolver = v }) : optionSolverFlags showOrParseArgs fetchMaxBackjumps (\v flags -> flags { fetchMaxBackjumps = v }) fetchReorderGoals (\v flags -> flags { fetchReorderGoals = v }) fetchCountConflicts (\v flags -> flags { fetchCountConflicts = v }) fetchIndependentGoals (\v flags -> flags { fetchIndependentGoals = v }) fetchShadowPkgs (\v flags -> flags { fetchShadowPkgs = v }) fetchStrongFlags (\v flags -> flags { fetchStrongFlags = v }) }
2,158
fetchCommand = CommandUI { commandName = "fetch", commandSynopsis = "Downloads packages for later installation.", commandUsage = usageAlternatives "fetch" [ "[FLAGS] PACKAGES" ], commandDescription = Just $ \_ -> "Note that it currently is not possible to fetch the dependencies for a\n" ++ "package in the current directory.\n", commandNotes = Nothing, commandDefaultFlags = defaultFetchFlags, commandOptions = \ showOrParseArgs -> [ optionVerbosity fetchVerbosity (\v flags -> flags { fetchVerbosity = v }) -- , option "o" ["output"] -- "Put the package(s) somewhere specific rather than the usual cache." -- fetchOutput (\v flags -> flags { fetchOutput = v }) -- (reqArgFlag "PATH") , option [] ["dependencies", "deps"] "Resolve and fetch dependencies (default)" fetchDeps (\v flags -> flags { fetchDeps = v }) trueArg , option [] ["no-dependencies", "no-deps"] "Ignore dependencies" fetchDeps (\v flags -> flags { fetchDeps = v }) falseArg , option [] ["dry-run"] "Do not install anything, only print what would be installed." fetchDryRun (\v flags -> flags { fetchDryRun = v }) trueArg ] ++ optionSolver fetchSolver (\v flags -> flags { fetchSolver = v }) : optionSolverFlags showOrParseArgs fetchMaxBackjumps (\v flags -> flags { fetchMaxBackjumps = v }) fetchReorderGoals (\v flags -> flags { fetchReorderGoals = v }) fetchCountConflicts (\v flags -> flags { fetchCountConflicts = v }) fetchIndependentGoals (\v flags -> flags { fetchIndependentGoals = v }) fetchShadowPkgs (\v flags -> flags { fetchShadowPkgs = v }) fetchStrongFlags (\v flags -> flags { fetchStrongFlags = v }) }
2,121
false
true
0
15
777
403
235
168
null
null
hamishmack/haskell-gi
lib/Data/GI/CodeGen/Cabal.hs
lgpl-2.1
haskellGIAPIVersion :: Int haskellGIAPIVersion = (head . versionBranch) version
79
haskellGIAPIVersion :: Int haskellGIAPIVersion = (head . versionBranch) version
79
haskellGIAPIVersion = (head . versionBranch) version
52
false
true
0
7
8
21
11
10
null
null
diku-dk/futhark
src/Futhark/IR/Primitive.hs
isc
blankPrimValue (IntType Int16) = IntValue $ Int16Value 0
56
blankPrimValue (IntType Int16) = IntValue $ Int16Value 0
56
blankPrimValue (IntType Int16) = IntValue $ Int16Value 0
56
false
false
0
7
7
22
10
12
null
null
andygill/thermopolis
src/View/Page.hs
bsd-2-clause
sideLink :: (PageIdentity p f, ContentReader f) => p -> f Clause -> f Clause sideLink path content = readClause "sidelink.html" [ ("class",active path) , ("path",rootClause <+> return (textToClause (T.pack (show path)))) -- return $ viewRootClause path <> pathToClause (viewee path)) , ("content",content) ]
403
sideLink :: (PageIdentity p f, ContentReader f) => p -> f Clause -> f Clause sideLink path content = readClause "sidelink.html" [ ("class",active path) , ("path",rootClause <+> return (textToClause (T.pack (show path)))) -- return $ viewRootClause path <> pathToClause (viewee path)) , ("content",content) ]
403
sideLink path content = readClause "sidelink.html" [ ("class",active path) , ("path",rootClause <+> return (textToClause (T.pack (show path)))) -- return $ viewRootClause path <> pathToClause (viewee path)) , ("content",content) ]
326
false
true
0
15
139
114
59
55
null
null
BartAdv/Idris-dev
src/Idris/Output.hs
bsd-3-clause
iPrintTermWithType :: Doc OutputAnnotation -> Doc OutputAnnotation -> Idris () iPrintTermWithType tm ty = iRenderResult (tm <+> colon <+> align ty)
147
iPrintTermWithType :: Doc OutputAnnotation -> Doc OutputAnnotation -> Idris () iPrintTermWithType tm ty = iRenderResult (tm <+> colon <+> align ty)
147
iPrintTermWithType tm ty = iRenderResult (tm <+> colon <+> align ty)
68
false
true
0
9
20
56
25
31
null
null
seereason/ghcjs
src/Compiler/DriverPipeline.hs
mit
runPhase (RealPhase (As with_cpp)) input_fn dflags = do -- LLVM from version 3.0 onwards doesn't support the OS X system -- assembler, so we use clang as the assembler instead. (#5636) let whichAsProg | hscTarget dflags == HscLlvm && platformOS (targetPlatform dflags) == OSDarwin = do -- be careful what options we call clang with -- see #5903 and #7617 for bugs caused by this. llvmVer <- liftIO $ figureLlvmVersion dflags return $ case llvmVer of Just n | n >= 30 -> SysTools.runClang _ -> SysTools.runAs | otherwise = return SysTools.runAs as_prog <- whichAsProg let cmdline_include_paths = includePaths dflags let pic_c_flags = picCCOpts dflags next_phase <- maybeMergeStub output_fn <- phaseOutputFilename next_phase -- we create directories for the object file, because it -- might be a hierarchical module. liftIO $ createDirectoryIfMissing True (takeDirectory output_fn) ccInfo <- liftIO $ getCompilerInfo dflags let runAssembler inputFilename outputFilename = liftIO $ as_prog dflags ([ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ] -- See Note [-fPIC for assembler] ++ map SysTools.Option pic_c_flags -- We only support SparcV9 and better because V8 lacks an atomic CAS -- instruction so we have to make sure that the assembler accepts the -- instruction set. Note that the user can still override this -- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag -- regardless of the ordering. -- -- This is a temporary hack. ++ (if platformArch (targetPlatform dflags) == ArchSPARC then [SysTools.Option "-mcpu=v9"] else []) ++ (if any (ccInfo ==) [Clang, AppleClang, AppleClang51] then [SysTools.Option "-Qunused-arguments"] else []) ++ [ SysTools.Option "-x" , if with_cpp then SysTools.Option "assembler-with-cpp" else SysTools.Option "assembler" , SysTools.Option "-c" , SysTools.FileOption "" inputFilename , SysTools.Option "-o" , SysTools.FileOption "" outputFilename ]) liftIO $ debugTraceMsg dflags 4 (text "Running the assembler") runAssembler input_fn output_fn return (RealPhase next_phase, output_fn) -- This is for calling the assembler on a split assembly file (so a collection -- of assembly files)
3,081
runPhase (RealPhase (As with_cpp)) input_fn dflags = do -- LLVM from version 3.0 onwards doesn't support the OS X system -- assembler, so we use clang as the assembler instead. (#5636) let whichAsProg | hscTarget dflags == HscLlvm && platformOS (targetPlatform dflags) == OSDarwin = do -- be careful what options we call clang with -- see #5903 and #7617 for bugs caused by this. llvmVer <- liftIO $ figureLlvmVersion dflags return $ case llvmVer of Just n | n >= 30 -> SysTools.runClang _ -> SysTools.runAs | otherwise = return SysTools.runAs as_prog <- whichAsProg let cmdline_include_paths = includePaths dflags let pic_c_flags = picCCOpts dflags next_phase <- maybeMergeStub output_fn <- phaseOutputFilename next_phase -- we create directories for the object file, because it -- might be a hierarchical module. liftIO $ createDirectoryIfMissing True (takeDirectory output_fn) ccInfo <- liftIO $ getCompilerInfo dflags let runAssembler inputFilename outputFilename = liftIO $ as_prog dflags ([ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ] -- See Note [-fPIC for assembler] ++ map SysTools.Option pic_c_flags -- We only support SparcV9 and better because V8 lacks an atomic CAS -- instruction so we have to make sure that the assembler accepts the -- instruction set. Note that the user can still override this -- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag -- regardless of the ordering. -- -- This is a temporary hack. ++ (if platformArch (targetPlatform dflags) == ArchSPARC then [SysTools.Option "-mcpu=v9"] else []) ++ (if any (ccInfo ==) [Clang, AppleClang, AppleClang51] then [SysTools.Option "-Qunused-arguments"] else []) ++ [ SysTools.Option "-x" , if with_cpp then SysTools.Option "assembler-with-cpp" else SysTools.Option "assembler" , SysTools.Option "-c" , SysTools.FileOption "" inputFilename , SysTools.Option "-o" , SysTools.FileOption "" outputFilename ]) liftIO $ debugTraceMsg dflags 4 (text "Running the assembler") runAssembler input_fn output_fn return (RealPhase next_phase, output_fn) -- This is for calling the assembler on a split assembly file (so a collection -- of assembly files)
3,081
runPhase (RealPhase (As with_cpp)) input_fn dflags = do -- LLVM from version 3.0 onwards doesn't support the OS X system -- assembler, so we use clang as the assembler instead. (#5636) let whichAsProg | hscTarget dflags == HscLlvm && platformOS (targetPlatform dflags) == OSDarwin = do -- be careful what options we call clang with -- see #5903 and #7617 for bugs caused by this. llvmVer <- liftIO $ figureLlvmVersion dflags return $ case llvmVer of Just n | n >= 30 -> SysTools.runClang _ -> SysTools.runAs | otherwise = return SysTools.runAs as_prog <- whichAsProg let cmdline_include_paths = includePaths dflags let pic_c_flags = picCCOpts dflags next_phase <- maybeMergeStub output_fn <- phaseOutputFilename next_phase -- we create directories for the object file, because it -- might be a hierarchical module. liftIO $ createDirectoryIfMissing True (takeDirectory output_fn) ccInfo <- liftIO $ getCompilerInfo dflags let runAssembler inputFilename outputFilename = liftIO $ as_prog dflags ([ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ] -- See Note [-fPIC for assembler] ++ map SysTools.Option pic_c_flags -- We only support SparcV9 and better because V8 lacks an atomic CAS -- instruction so we have to make sure that the assembler accepts the -- instruction set. Note that the user can still override this -- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag -- regardless of the ordering. -- -- This is a temporary hack. ++ (if platformArch (targetPlatform dflags) == ArchSPARC then [SysTools.Option "-mcpu=v9"] else []) ++ (if any (ccInfo ==) [Clang, AppleClang, AppleClang51] then [SysTools.Option "-Qunused-arguments"] else []) ++ [ SysTools.Option "-x" , if with_cpp then SysTools.Option "assembler-with-cpp" else SysTools.Option "assembler" , SysTools.Option "-c" , SysTools.FileOption "" inputFilename , SysTools.Option "-o" , SysTools.FileOption "" outputFilename ]) liftIO $ debugTraceMsg dflags 4 (text "Running the assembler") runAssembler input_fn output_fn return (RealPhase next_phase, output_fn) -- This is for calling the assembler on a split assembly file (so a collection -- of assembly files)
3,081
false
false
1
22
1,255
486
237
249
null
null
rahulmutt/ghcvm
compiler/Eta/CodeGen/Closure.hs
bsd-3-clause
genStdThunk :: Code -> LambdaFormInfo -> (FieldType, Code -> Code) genStdThunk loadContext (LFThunk _ _ _updatable stdForm _) | SelectorThunk pos <- stdForm = ( selectorThunkType , \loads -> loadContext <> iconst jint (fromIntegral pos) <> loads <> selectorThunkCreate ) | ApThunk n <- stdForm = let ft = obj apUpdClass fields = replicate n closureType apUpdClass = apUpdName n in ( ft , \loads -> new ft <> dup ft <> loads <> invokespecial (mkMethodRef apUpdClass "<init>" fields void) ) | otherwise = panic "genStdThunk: Thunk is not in standard form!"
665
genStdThunk :: Code -> LambdaFormInfo -> (FieldType, Code -> Code) genStdThunk loadContext (LFThunk _ _ _updatable stdForm _) | SelectorThunk pos <- stdForm = ( selectorThunkType , \loads -> loadContext <> iconst jint (fromIntegral pos) <> loads <> selectorThunkCreate ) | ApThunk n <- stdForm = let ft = obj apUpdClass fields = replicate n closureType apUpdClass = apUpdName n in ( ft , \loads -> new ft <> dup ft <> loads <> invokespecial (mkMethodRef apUpdClass "<init>" fields void) ) | otherwise = panic "genStdThunk: Thunk is not in standard form!"
665
genStdThunk loadContext (LFThunk _ _ _updatable stdForm _) | SelectorThunk pos <- stdForm = ( selectorThunkType , \loads -> loadContext <> iconst jint (fromIntegral pos) <> loads <> selectorThunkCreate ) | ApThunk n <- stdForm = let ft = obj apUpdClass fields = replicate n closureType apUpdClass = apUpdName n in ( ft , \loads -> new ft <> dup ft <> loads <> invokespecial (mkMethodRef apUpdClass "<init>" fields void) ) | otherwise = panic "genStdThunk: Thunk is not in standard form!"
598
false
true
1
13
202
199
98
101
null
null
MetaMemoryT/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
-- | Pretty printing options with the most verbosity. verbosePPOption :: PPOption verbosePPOption = PPOption { ppopt_impl = True, ppopt_desugarnats = True, ppopt_pinames = True, ppopt_depth = Just 200 }
289
verbosePPOption :: PPOption verbosePPOption = PPOption { ppopt_impl = True, ppopt_desugarnats = True, ppopt_pinames = True, ppopt_depth = Just 200 }
235
verbosePPOption = PPOption { ppopt_impl = True, ppopt_desugarnats = True, ppopt_pinames = True, ppopt_depth = Just 200 }
207
true
true
0
7
116
41
25
16
null
null
dillonhuff/PlayingCards
src/PlayingCards/Deck.hs
bsd-3-clause
jack = Jack
11
jack = Jack
11
jack = Jack
11
false
false
1
5
2
10
3
7
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/ErrorEvent.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent.message Mozilla ErrorEvent.message documentation> getMessage :: (MonadDOM m, FromJSString result) => ErrorEvent -> m result getMessage self = liftDOM ((self ^. js "message") >>= fromJSValUnchecked)
277
getMessage :: (MonadDOM m, FromJSString result) => ErrorEvent -> m result getMessage self = liftDOM ((self ^. js "message") >>= fromJSValUnchecked)
160
getMessage self = liftDOM ((self ^. js "message") >>= fromJSValUnchecked)
75
true
true
0
10
40
57
29
28
null
null
jsl/dictionary-replacer
DictionaryReplacer.hs
mit
replaceableWord = do char '$' s <- wordToken char '$' return $ ReplaceableWord s
88
replaceableWord = do char '$' s <- wordToken char '$' return $ ReplaceableWord s
88
replaceableWord = do char '$' s <- wordToken char '$' return $ ReplaceableWord s
88
false
false
0
8
21
35
14
21
null
null
peterokagey/haskellOEIS
src/Chess/A279212.hs
apache-2.0
a279212T :: Integer -> Integer -> Integer a279212T = chessMoveCounter visibleCells where visibleCells n k = concatMap (\f -> f n k) [queenN, queenNW, queenW, queenSW]
170
a279212T :: Integer -> Integer -> Integer a279212T = chessMoveCounter visibleCells where visibleCells n k = concatMap (\f -> f n k) [queenN, queenNW, queenW, queenSW]
170
a279212T = chessMoveCounter visibleCells where visibleCells n k = concatMap (\f -> f n k) [queenN, queenNW, queenW, queenSW]
128
false
true
0
8
29
63
34
29
null
null
atsukotakahashi/wi
src/library/Yi/Interact.hs
gpl-2.0
pullWrites :: Eq w => P event w -> ([w], P event w) pullWrites a = case computeState a of Running w c -> first (w:) (pullWrites c) _ -> ([], a)
151
pullWrites :: Eq w => P event w -> ([w], P event w) pullWrites a = case computeState a of Running w c -> first (w:) (pullWrites c) _ -> ([], a)
151
pullWrites a = case computeState a of Running w c -> first (w:) (pullWrites c) _ -> ([], a)
99
false
true
0
10
39
97
47
50
null
null
gspindles/mj-score-eval
src/Game/Mahjong/Score.hs
mit
matchValuePattern :: [Tile] -> [Int] -> Bool matchValuePattern ts is = isSameTileType ts && (sort . fmap tileValue $ ts) == is
149
matchValuePattern :: [Tile] -> [Int] -> Bool matchValuePattern ts is = isSameTileType ts && (sort . fmap tileValue $ ts) == is
149
matchValuePattern ts is = isSameTileType ts && (sort . fmap tileValue $ ts) == is
104
false
true
0
10
44
55
28
27
null
null
mightybyte/reflex-dom-stubs
src/GHCJS/DOM/Navigator.hs
bsd-3-clause
ghcjs_dom_navigator_java_enabled = undefined
44
ghcjs_dom_navigator_java_enabled = undefined
44
ghcjs_dom_navigator_java_enabled = undefined
44
false
false
0
4
2
6
3
3
null
null
isomorphism/gtk-inputdevice
Gtk2HsSetup.hs
lgpl-2.1
c2hsLocal :: Program c2hsLocal = (simpleProgram "gtk2hsC2hs") { programFindVersion = findProgramVersion "--version" $ \str -> -- Invoking "gtk2hsC2hs --version" gives a string like: -- C->Haskell Compiler, version 0.13.4 (gtk2hs branch) "Bin IO", 13 Nov 2004 case words str of (_:_:_:ver:_) -> ver _ -> "" }
359
c2hsLocal :: Program c2hsLocal = (simpleProgram "gtk2hsC2hs") { programFindVersion = findProgramVersion "--version" $ \str -> -- Invoking "gtk2hsC2hs --version" gives a string like: -- C->Haskell Compiler, version 0.13.4 (gtk2hs branch) "Bin IO", 13 Nov 2004 case words str of (_:_:_:ver:_) -> ver _ -> "" }
359
c2hsLocal = (simpleProgram "gtk2hsC2hs") { programFindVersion = findProgramVersion "--version" $ \str -> -- Invoking "gtk2hsC2hs --version" gives a string like: -- C->Haskell Compiler, version 0.13.4 (gtk2hs branch) "Bin IO", 13 Nov 2004 case words str of (_:_:_:ver:_) -> ver _ -> "" }
338
false
true
0
16
97
77
41
36
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2007-Programming_in_Haskell-1st_Edition-Graham_Hutton/ch_08_10.hs
unlicense
e16b = U.t "e16b" (eval "(2*30)/15") 4
48
e16b = U.t "e16b" (eval "(2*30)/15") 4
48
e16b = U.t "e16b" (eval "(2*30)/15") 4
48
false
false
1
6
16
27
10
17
null
null
msakai/ptq
src/Parser.hs
lgpl-2.1
f8 :: F8 c => Parser (P c -> P c -> P c) f8 = token "and" >> return F8
70
f8 :: F8 c => Parser (P c -> P c -> P c) f8 = token "and" >> return F8
70
f8 = token "and" >> return F8
29
false
true
0
11
20
56
24
32
null
null
tonymorris/validation
src/Data/Validation.hs
bsd-3-clause
bindValidationB :: Monad f => ValidationB f err a -> (a -> ValidationB f err b) -> ValidationB f err b ValidationB v `bindValidationB` f = ValidationB (v >>= \w -> case w of Failure e -> return (Failure e) Success a -> runValidationB (f a))
308
bindValidationB :: Monad f => ValidationB f err a -> (a -> ValidationB f err b) -> ValidationB f err b ValidationB v `bindValidationB` f = ValidationB (v >>= \w -> case w of Failure e -> return (Failure e) Success a -> runValidationB (f a))
308
ValidationB v `bindValidationB` f = ValidationB (v >>= \w -> case w of Failure e -> return (Failure e) Success a -> runValidationB (f a))
197
false
true
1
14
113
116
55
61
null
null
rgaiacs/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
simpleSubOrSuperString :: OrgParser String simpleSubOrSuperString = try $ choice [ string "*" , mappend <$> option [] ((:[]) <$> oneOf "+-") <*> many1 alphaNum ]
200
simpleSubOrSuperString :: OrgParser String simpleSubOrSuperString = try $ choice [ string "*" , mappend <$> option [] ((:[]) <$> oneOf "+-") <*> many1 alphaNum ]
200
simpleSubOrSuperString = try $ choice [ string "*" , mappend <$> option [] ((:[]) <$> oneOf "+-") <*> many1 alphaNum ]
157
false
true
0
14
63
64
32
32
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/Command.hs
bsd-3-clause
getCurrentChoice :: OptDescr a -> a -> [String] getCurrentChoice (ChoiceOpt alts) a = [ lf | (_,(_sf,lf:_), _, currentChoice) <- alts, currentChoice a]
155
getCurrentChoice :: OptDescr a -> a -> [String] getCurrentChoice (ChoiceOpt alts) a = [ lf | (_,(_sf,lf:_), _, currentChoice) <- alts, currentChoice a]
155
getCurrentChoice (ChoiceOpt alts) a = [ lf | (_,(_sf,lf:_), _, currentChoice) <- alts, currentChoice a]
107
false
true
0
11
26
82
42
40
null
null
kumasento/accelerate
Data/Array/Accelerate/Interpreter.hs
bsd-3-clause
evalPrim (PrimLtEq ty) = evalLtEq ty
47
evalPrim (PrimLtEq ty) = evalLtEq ty
47
evalPrim (PrimLtEq ty) = evalLtEq ty
47
false
false
0
7
16
18
8
10
null
null
bitemyapp/ballast
src/Ballast/Types.hs
bsd-3-clause
hostUri ShipwireSandbox = "https://api.beta.shipwire.com/api/v3"
67
hostUri ShipwireSandbox = "https://api.beta.shipwire.com/api/v3"
67
hostUri ShipwireSandbox = "https://api.beta.shipwire.com/api/v3"
67
false
false
0
5
6
9
4
5
null
null
markus1189/xmonad-contrib-710
XMonad/Hooks/DebugEvents.hs
bsd-3-clause
dumpProp _ "_XMONAD_DECORATED_BY" = dumpWindow
67
dumpProp _ "_XMONAD_DECORATED_BY" = dumpWindow
67
dumpProp _ "_XMONAD_DECORATED_BY" = dumpWindow
67
false
false
0
5
25
11
5
6
null
null
rimmington/cabal
cabal-install/Distribution/Client/InstallPlan.hs
bsd-3-clause
showPlanProblem (PackageCycle cycleGroup) = "The following packages are involved in a dependency cycle " ++ intercalate ", " (map (display.packageId) cycleGroup)
168
showPlanProblem (PackageCycle cycleGroup) = "The following packages are involved in a dependency cycle " ++ intercalate ", " (map (display.packageId) cycleGroup)
168
showPlanProblem (PackageCycle cycleGroup) = "The following packages are involved in a dependency cycle " ++ intercalate ", " (map (display.packageId) cycleGroup)
168
false
false
2
9
27
38
18
20
null
null
suhailshergill/liboleg
Language/TEval/TInfLetP.hs
bsd-3-clause
teval' env (A e1 e2) = do t1 <- teval' env e1 t2 <- teval' env e2 t1r <- newtv unifyM t1 (t2 :> t1r) id return t1r
136
teval' env (A e1 e2) = do t1 <- teval' env e1 t2 <- teval' env e2 t1r <- newtv unifyM t1 (t2 :> t1r) id return t1r
136
teval' env (A e1 e2) = do t1 <- teval' env e1 t2 <- teval' env e2 t1r <- newtv unifyM t1 (t2 :> t1r) id return t1r
136
false
false
0
9
49
73
32
41
null
null
obihann/donair-safe
app/Main.hs
gpl-3.0
help :: [String] -> IO () help [] = putStrLn "Usage: donair [add|load|remove|help|version]"
91
help :: [String] -> IO () help [] = putStrLn "Usage: donair [add|load|remove|help|version]"
91
help [] = putStrLn "Usage: donair [add|load|remove|help|version]"
65
false
true
0
7
12
31
15
16
null
null
ndmitchell/shake
src/Development/Shake/Command.hs
bsd-3-clause
-- | See 'cmd'. Same as 'cmd' except with a unit result. -- 'cmd' is to 'cmd_' as 'command' is to 'command_'. cmd_ :: (Partial, CmdArguments args, Unit args) => args :-> Action () cmd_ = withFrozenCallStack cmd
210
cmd_ :: (Partial, CmdArguments args, Unit args) => args :-> Action () cmd_ = withFrozenCallStack cmd
100
cmd_ = withFrozenCallStack cmd
30
true
true
0
8
37
44
23
21
null
null
flipstone/orville
orville-postgresql/src/Database/Orville/PostgreSQL/Internal/FieldDefinition.hs
mit
withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b withConversion field mapType = field {fieldType = mapType $ fieldType field}
190
withConversion :: FieldDefinition nullability a -> (SqlType a -> SqlType b) -> FieldDefinition nullability b withConversion field mapType = field {fieldType = mapType $ fieldType field}
190
withConversion field mapType = field {fieldType = mapType $ fieldType field}
76
false
true
0
9
30
62
30
32
null
null
gabrielPeart/VM.hs
src/VM/Parser.hs
mit
caseChar c = char (toLower c) <|> char (toUpper c)
50
caseChar c = char (toLower c) <|> char (toUpper c)
50
caseChar c = char (toLower c) <|> char (toUpper c)
50
false
false
0
8
9
31
14
17
null
null
DanielWaterworth/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
-- | Return a list of pairs of the names of the outermost 'Pi'-bound -- variables in the given term, together with their types. getArgTys :: TT n -> [(n, TT n)] getArgTys (Bind n (Pi t) sc) = (n, t) : getArgTys sc
213
getArgTys :: TT n -> [(n, TT n)] getArgTys (Bind n (Pi t) sc) = (n, t) : getArgTys sc
85
getArgTys (Bind n (Pi t) sc) = (n, t) : getArgTys sc
52
true
true
0
11
43
69
35
34
null
null