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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
urbanslug/ghc
|
testsuite/tests/perf/compiler/T783.hs
|
bsd-3-clause
|
foo x | x == 279 = 279
| 22
|
foo x | x == 279 = 279
| 22
|
foo x | x == 279 = 279
| 22
| false
| false
| 0
| 8
| 7
| 23
| 9
| 14
| null | null |
olsner/ghc
|
compiler/typecheck/FamInst.hs
|
bsd-3-clause
|
tcLookupDataFamInst_maybe :: FamInstEnvs -> TyCon -> [TcType]
-> Maybe (TyCon, [TcType], Coercion)
-- ^ Converts a data family type (eg F [a]) to its representation type (eg FList a)
-- and returns a coercion between the two: co :: F [a] ~R FList a.
tcLookupDataFamInst_maybe fam_inst_envs tc tc_args
| isDataFamilyTyCon tc
, match : _ <- lookupFamInstEnv fam_inst_envs tc tc_args
, FamInstMatch { fim_instance = rep_fam@(FamInst { fi_axiom = ax
, fi_cvs = cvs })
, fim_tys = rep_args
, fim_cos = rep_cos } <- match
, let rep_tc = dataFamInstRepTyCon rep_fam
co = mkUnbranchedAxInstCo Representational ax rep_args
(mkCoVarCos cvs)
= ASSERT( null rep_cos ) -- See Note [Constrained family instances] in FamInstEnv
Just (rep_tc, rep_args, co)
| otherwise
= Nothing
| 954
|
tcLookupDataFamInst_maybe :: FamInstEnvs -> TyCon -> [TcType]
-> Maybe (TyCon, [TcType], Coercion)
tcLookupDataFamInst_maybe fam_inst_envs tc tc_args
| isDataFamilyTyCon tc
, match : _ <- lookupFamInstEnv fam_inst_envs tc tc_args
, FamInstMatch { fim_instance = rep_fam@(FamInst { fi_axiom = ax
, fi_cvs = cvs })
, fim_tys = rep_args
, fim_cos = rep_cos } <- match
, let rep_tc = dataFamInstRepTyCon rep_fam
co = mkUnbranchedAxInstCo Representational ax rep_args
(mkCoVarCos cvs)
= ASSERT( null rep_cos ) -- See Note [Constrained family instances] in FamInstEnv
Just (rep_tc, rep_args, co)
| otherwise
= Nothing
| 803
|
tcLookupDataFamInst_maybe fam_inst_envs tc tc_args
| isDataFamilyTyCon tc
, match : _ <- lookupFamInstEnv fam_inst_envs tc tc_args
, FamInstMatch { fim_instance = rep_fam@(FamInst { fi_axiom = ax
, fi_cvs = cvs })
, fim_tys = rep_args
, fim_cos = rep_cos } <- match
, let rep_tc = dataFamInstRepTyCon rep_fam
co = mkUnbranchedAxInstCo Representational ax rep_args
(mkCoVarCos cvs)
= ASSERT( null rep_cos ) -- See Note [Constrained family instances] in FamInstEnv
Just (rep_tc, rep_args, co)
| otherwise
= Nothing
| 678
| true
| true
| 0
| 16
| 312
| 196
| 104
| 92
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
action_299 (31#) = happyGoto action_18
| 38
|
action_299 (31#) = happyGoto action_18
| 38
|
action_299 (31#) = happyGoto action_18
| 38
| false
| false
| 0
| 6
| 4
| 15
| 7
| 8
| null | null |
rwbarton/rw
|
Crawl/Messages.hs
|
bsd-3-clause
|
rawMessagesOf :: R.Event t A.Value -> R.Event t Message
rawMessagesOf input =
R.spill $
filterBy (\msg -> do
guard $ msg ^? key "msg" == Just "msgs"
let old_msgs = fromMaybe 0 $ msg ^? key "old_msgs"._Integer
parse message = Message
(message ^?! key "channel"._Integer.integral.enum)
(message ^?! key "text"._String)
(message ^?! key "turn"._Integer.integral)
return $ drop (fromInteger old_msgs) $ map parse $
(msg ^.. key "messages"._Array.traverse))
input
| 650
|
rawMessagesOf :: R.Event t A.Value -> R.Event t Message
rawMessagesOf input =
R.spill $
filterBy (\msg -> do
guard $ msg ^? key "msg" == Just "msgs"
let old_msgs = fromMaybe 0 $ msg ^? key "old_msgs"._Integer
parse message = Message
(message ^?! key "channel"._Integer.integral.enum)
(message ^?! key "text"._String)
(message ^?! key "turn"._Integer.integral)
return $ drop (fromInteger old_msgs) $ map parse $
(msg ^.. key "messages"._Array.traverse))
input
| 650
|
rawMessagesOf input =
R.spill $
filterBy (\msg -> do
guard $ msg ^? key "msg" == Just "msgs"
let old_msgs = fromMaybe 0 $ msg ^? key "old_msgs"._Integer
parse message = Message
(message ^?! key "channel"._Integer.integral.enum)
(message ^?! key "text"._String)
(message ^?! key "turn"._Integer.integral)
return $ drop (fromInteger old_msgs) $ map parse $
(msg ^.. key "messages"._Array.traverse))
input
| 594
| false
| true
| 0
| 20
| 258
| 198
| 93
| 105
| null | null |
snowleopard/hadrian
|
src/Way.hs
|
mit
|
osuf, ssuf, hisuf, hcsuf, obootsuf, hibootsuf :: Way -> String
osuf = (++ "o" ) . wayPrefix
| 101
|
osuf, ssuf, hisuf, hcsuf, obootsuf, hibootsuf :: Way -> String
osuf = (++ "o" ) . wayPrefix
| 101
|
osuf = (++ "o" ) . wayPrefix
| 38
| false
| true
| 11
| 7
| 26
| 58
| 23
| 35
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F15.hs
|
bsd-3-clause
|
ptr_glIsVertexAttribEnabledAPPLE :: FunPtr (GLuint -> GLenum -> IO GLboolean)
ptr_glIsVertexAttribEnabledAPPLE = unsafePerformIO $ getCommand "glIsVertexAttribEnabledAPPLE"
| 172
|
ptr_glIsVertexAttribEnabledAPPLE :: FunPtr (GLuint -> GLenum -> IO GLboolean)
ptr_glIsVertexAttribEnabledAPPLE = unsafePerformIO $ getCommand "glIsVertexAttribEnabledAPPLE"
| 172
|
ptr_glIsVertexAttribEnabledAPPLE = unsafePerformIO $ getCommand "glIsVertexAttribEnabledAPPLE"
| 94
| false
| true
| 1
| 9
| 14
| 38
| 17
| 21
| null | null |
hakoja/SHA3
|
Data/Digest/GroestlMutable.hs
|
bsd-3-clause
|
-- !!! Inlining this function leads to 4 times the run-time.
-- See also: rnd512QM
--{-# INLINE permQM #-}
permQM :: BlockLength -> HashState s -> ST s (HashState s)
permQM 512 x = V.foldM' rnd512QM x (V.enumFromN 0 10)
| 222
|
permQM :: BlockLength -> HashState s -> ST s (HashState s)
permQM 512 x = V.foldM' rnd512QM x (V.enumFromN 0 10)
| 114
|
permQM 512 x = V.foldM' rnd512QM x (V.enumFromN 0 10)
| 55
| true
| true
| 0
| 10
| 42
| 64
| 31
| 33
| null | null |
Alllex/stm-data-collection
|
benchmarks/BenchData.hs
|
bsd-3-clause
|
parseBenchProc :: BenchProc -> Parser BenchProc
parseBenchProc defaultProc = BenchProc
<$> option auto (value (getInitSize defaultProc)
<> long "initsize"
<> help "Initial size"
)
<*> option auto (value (getInsRate defaultProc)
<> long "insrate"
<> help "Percentage of insertions during one run"
)
<*> option auto (value (getCountOfRuns defaultProc)
<> long "runs"
<> help "Number of runs for each implementation"
)
<*> option auto (value (getPrepTimeLimit defaultProc)
<> long "prep"
<> help "Time limit for preparation"
)
<*> switch (long "file"
<> help "Whether to output to file")
| 868
|
parseBenchProc :: BenchProc -> Parser BenchProc
parseBenchProc defaultProc = BenchProc
<$> option auto (value (getInitSize defaultProc)
<> long "initsize"
<> help "Initial size"
)
<*> option auto (value (getInsRate defaultProc)
<> long "insrate"
<> help "Percentage of insertions during one run"
)
<*> option auto (value (getCountOfRuns defaultProc)
<> long "runs"
<> help "Number of runs for each implementation"
)
<*> option auto (value (getPrepTimeLimit defaultProc)
<> long "prep"
<> help "Time limit for preparation"
)
<*> switch (long "file"
<> help "Whether to output to file")
| 868
|
parseBenchProc defaultProc = BenchProc
<$> option auto (value (getInitSize defaultProc)
<> long "initsize"
<> help "Initial size"
)
<*> option auto (value (getInsRate defaultProc)
<> long "insrate"
<> help "Percentage of insertions during one run"
)
<*> option auto (value (getCountOfRuns defaultProc)
<> long "runs"
<> help "Number of runs for each implementation"
)
<*> option auto (value (getPrepTimeLimit defaultProc)
<> long "prep"
<> help "Time limit for preparation"
)
<*> switch (long "file"
<> help "Whether to output to file")
| 820
| false
| true
| 14
| 10
| 370
| 203
| 92
| 111
| null | null |
patrickherrmann/advent
|
src/Day03.hs
|
bsd-3-clause
|
housesVisitedWithRoboSanta :: String -> Int
housesVisitedWithRoboSanta s = go s [(0, 0), (0, 0)]
where
go [] vs = length $ nub vs
go (sc:rc:cs) vs@(sv:rv:_) = go cs (move sv sc:move rv rc:vs)
| 201
|
housesVisitedWithRoboSanta :: String -> Int
housesVisitedWithRoboSanta s = go s [(0, 0), (0, 0)]
where
go [] vs = length $ nub vs
go (sc:rc:cs) vs@(sv:rv:_) = go cs (move sv sc:move rv rc:vs)
| 201
|
housesVisitedWithRoboSanta s = go s [(0, 0), (0, 0)]
where
go [] vs = length $ nub vs
go (sc:rc:cs) vs@(sv:rv:_) = go cs (move sv sc:move rv rc:vs)
| 157
| false
| true
| 2
| 9
| 43
| 130
| 64
| 66
| null | null |
haskellbr/follow-haskellers
|
src/Main.hs
|
mit
|
handleEvent :: MonadResource m => TWInfo -> Manager -> StreamingAPI -> m ()
handleEvent twInfo mgr status = case status of
SStatus s -> do
liftIO $ putStrLn ("[tweet] " ++ show (statusText s))
let username = Text.unpack (userScreenName (statusUser s))
-- TODO should read the authenticated user's name
when (username /= "haskellbr2") $ do
liftIO $ putStrLn ("[follow] Following " ++ username)
void (call twInfo mgr (friendshipsCreate (ScreenNameParam username)))
_ -> return ()
| 541
|
handleEvent :: MonadResource m => TWInfo -> Manager -> StreamingAPI -> m ()
handleEvent twInfo mgr status = case status of
SStatus s -> do
liftIO $ putStrLn ("[tweet] " ++ show (statusText s))
let username = Text.unpack (userScreenName (statusUser s))
-- TODO should read the authenticated user's name
when (username /= "haskellbr2") $ do
liftIO $ putStrLn ("[follow] Following " ++ username)
void (call twInfo mgr (friendshipsCreate (ScreenNameParam username)))
_ -> return ()
| 541
|
handleEvent twInfo mgr status = case status of
SStatus s -> do
liftIO $ putStrLn ("[tweet] " ++ show (statusText s))
let username = Text.unpack (userScreenName (statusUser s))
-- TODO should read the authenticated user's name
when (username /= "haskellbr2") $ do
liftIO $ putStrLn ("[follow] Following " ++ username)
void (call twInfo mgr (friendshipsCreate (ScreenNameParam username)))
_ -> return ()
| 465
| false
| true
| 0
| 20
| 137
| 182
| 85
| 97
| null | null |
seL4/capDL-tool
|
CapDL/PrintC.hs
|
bsd-2-clause
|
showObjectFields :: Map ObjID Int -> ObjID -> KernelObject Word -> IRQMap -> CDT -> ObjMap Word -> String
showObjectFields _ _ Endpoint _ _ _ = ".type = CDL_Endpoint,"
| 167
|
showObjectFields :: Map ObjID Int -> ObjID -> KernelObject Word -> IRQMap -> CDT -> ObjMap Word -> String
showObjectFields _ _ Endpoint _ _ _ = ".type = CDL_Endpoint,"
| 167
|
showObjectFields _ _ Endpoint _ _ _ = ".type = CDL_Endpoint,"
| 61
| false
| true
| 0
| 11
| 29
| 59
| 28
| 31
| null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/topic/existentials/2017-03-arnaud-bailly-understanding-existentials/test/ESpec.hs
|
unlicense
|
spec :: Spec
spec =
t01
| 26
|
spec :: Spec
spec =
t01
| 26
|
spec =
t01
| 13
| false
| true
| 0
| 4
| 8
| 11
| 6
| 5
| null | null |
brendanhay/gogol
|
gogol-androidmanagement/gen/Network/Google/Resource/AndroidManagement/Enterprises/Devices/Get.hs
|
mpl-2.0
|
-- | OAuth access token.
edgAccessToken :: Lens' EnterprisesDevicesGet (Maybe Text)
edgAccessToken
= lens _edgAccessToken
(\ s a -> s{_edgAccessToken = a})
| 163
|
edgAccessToken :: Lens' EnterprisesDevicesGet (Maybe Text)
edgAccessToken
= lens _edgAccessToken
(\ s a -> s{_edgAccessToken = a})
| 138
|
edgAccessToken
= lens _edgAccessToken
(\ s a -> s{_edgAccessToken = a})
| 79
| true
| true
| 0
| 8
| 29
| 49
| 25
| 24
| null | null |
sdiehl/ghc
|
hadrian/src/Hadrian/Haskell/Cabal.hs
|
bsd-3-clause
|
cabalArchString other = other
| 35
|
cabalArchString other = other
| 35
|
cabalArchString other = other
| 35
| false
| false
| 0
| 5
| 9
| 9
| 4
| 5
| null | null |
Shimuuar/data-folds
|
ListT.hs
|
bsd-3-clause
|
unfoldrR :: (s -> Maybe (a,s)) -> s -> ListR a
unfoldrR f s0 = ListR $ \cons nil ->
let loop s = case f s of
Just (a,s') -> cons a (loop s')
Nothing -> nil
in loop s0
| 208
|
unfoldrR :: (s -> Maybe (a,s)) -> s -> ListR a
unfoldrR f s0 = ListR $ \cons nil ->
let loop s = case f s of
Just (a,s') -> cons a (loop s')
Nothing -> nil
in loop s0
| 208
|
unfoldrR f s0 = ListR $ \cons nil ->
let loop s = case f s of
Just (a,s') -> cons a (loop s')
Nothing -> nil
in loop s0
| 161
| false
| true
| 0
| 16
| 82
| 110
| 54
| 56
| null | null |
opqdonut/riot
|
Riot/UI.hs
|
gpl-2.0
|
cset_attr (a, p) = do
Curses.wAttrSet Curses.stdScr (a, p)
| 62
|
cset_attr (a, p) = do
Curses.wAttrSet Curses.stdScr (a, p)
| 62
|
cset_attr (a, p) = do
Curses.wAttrSet Curses.stdScr (a, p)
| 62
| false
| false
| 0
| 8
| 12
| 33
| 17
| 16
| null | null |
yuttie/simple-ga
|
test-ga-tree.hs
|
bsd-3-clause
|
countTerms (Mul e1 e2) = countTerms e1 + countTerms e2
| 54
|
countTerms (Mul e1 e2) = countTerms e1 + countTerms e2
| 54
|
countTerms (Mul e1 e2) = countTerms e1 + countTerms e2
| 54
| false
| false
| 0
| 7
| 9
| 27
| 12
| 15
| null | null |
wochinge/CacheSimulator
|
src/Clock/Car2.hs
|
bsd-3-clause
|
readFromCache :: File -> Car -> (Bool, Car)
readFromCache file cache
| inT1 = (True, cache { t1 = t1' })
| inT2 = (True, cache { t2 = t2' })
| otherwise = (False, file `to` cache)
where (inT1, t1') = file `Clock.inCache` t1 cache
(inT2, t2') = file `Clock.inCache` t2 cache
| 301
|
readFromCache :: File -> Car -> (Bool, Car)
readFromCache file cache
| inT1 = (True, cache { t1 = t1' })
| inT2 = (True, cache { t2 = t2' })
| otherwise = (False, file `to` cache)
where (inT1, t1') = file `Clock.inCache` t1 cache
(inT2, t2') = file `Clock.inCache` t2 cache
| 301
|
readFromCache file cache
| inT1 = (True, cache { t1 = t1' })
| inT2 = (True, cache { t2 = t2' })
| otherwise = (False, file `to` cache)
where (inT1, t1') = file `Clock.inCache` t1 cache
(inT2, t2') = file `Clock.inCache` t2 cache
| 257
| false
| true
| 0
| 8
| 80
| 142
| 79
| 63
| null | null |
taylor1791/cis-194-spring
|
test/Test/Week11.hs
|
mit
|
isValid :: String -> Bool
isValid = isJust . runParser parseSExpr
| 65
|
isValid :: String -> Bool
isValid = isJust . runParser parseSExpr
| 65
|
isValid = isJust . runParser parseSExpr
| 39
| false
| true
| 1
| 7
| 10
| 29
| 12
| 17
| null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
899 = 898
| 9
|
899 = 898
| 9
|
899 = 898
| 9
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
moonKimura/vector-0.10.9.1
|
Data/Vector/Generic.hs
|
bsd-3-clause
|
unsafeBackpermute v is = seq v
$ seq n
$ unstream
$ Stream.unbox
$ Stream.map index
$ stream is
where
n = length v
{-# INLINE index #-}
-- NOTE: we do it this way to avoid triggering LiberateCase on n in
-- polymorphic code
index i = UNSAFE_CHECK(checkIndex) "unsafeBackpermute" i n
$ basicUnsafeIndexM v i
-- Safe destructive updates
-- ------------------------
-- | Apply a destructive operation to a vector. The operation will be
-- performed in place if it is safe to do so and will modify a copy of the
-- vector otherwise.
--
-- @
-- modify (\\v -> 'M.write' v 0 \'x\') ('replicate' 3 \'a\') = \<\'x\',\'a\',\'a\'\>
-- @
| 778
|
unsafeBackpermute v is = seq v
$ seq n
$ unstream
$ Stream.unbox
$ Stream.map index
$ stream is
where
n = length v
{-# INLINE index #-}
-- NOTE: we do it this way to avoid triggering LiberateCase on n in
-- polymorphic code
index i = UNSAFE_CHECK(checkIndex) "unsafeBackpermute" i n
$ basicUnsafeIndexM v i
-- Safe destructive updates
-- ------------------------
-- | Apply a destructive operation to a vector. The operation will be
-- performed in place if it is safe to do so and will modify a copy of the
-- vector otherwise.
--
-- @
-- modify (\\v -> 'M.write' v 0 \'x\') ('replicate' 3 \'a\') = \<\'x\',\'a\',\'a\'\>
-- @
| 778
|
unsafeBackpermute v is = seq v
$ seq n
$ unstream
$ Stream.unbox
$ Stream.map index
$ stream is
where
n = length v
{-# INLINE index #-}
-- NOTE: we do it this way to avoid triggering LiberateCase on n in
-- polymorphic code
index i = UNSAFE_CHECK(checkIndex) "unsafeBackpermute" i n
$ basicUnsafeIndexM v i
-- Safe destructive updates
-- ------------------------
-- | Apply a destructive operation to a vector. The operation will be
-- performed in place if it is safe to do so and will modify a copy of the
-- vector otherwise.
--
-- @
-- modify (\\v -> 'M.write' v 0 \'x\') ('replicate' 3 \'a\') = \<\'x\',\'a\',\'a\'\>
-- @
| 778
| false
| false
| 0
| 10
| 265
| 99
| 52
| 47
| null | null |
jfdm/hUML
|
src/ClassDiagram/Transform/Dot.hs
|
bsd-3-clause
|
-- | Do the transformation.
classDiagram2Dot :: ClassDiagram -> Doc
classDiagram2Dot cd = heed <$$> cs <$$> rs <$$> foot
where
heed = text "digraph G{"
foot = text "}"
cs = indent 4 $ prettyClasses (classes cd)
rs = indent 4 $ prettyRelations (relations cd)
-- ----------------------------------------------------------------- [ Classes ]
| 367
|
classDiagram2Dot :: ClassDiagram -> Doc
classDiagram2Dot cd = heed <$$> cs <$$> rs <$$> foot
where
heed = text "digraph G{"
foot = text "}"
cs = indent 4 $ prettyClasses (classes cd)
rs = indent 4 $ prettyRelations (relations cd)
-- ----------------------------------------------------------------- [ Classes ]
| 339
|
classDiagram2Dot cd = heed <$$> cs <$$> rs <$$> foot
where
heed = text "digraph G{"
foot = text "}"
cs = indent 4 $ prettyClasses (classes cd)
rs = indent 4 $ prettyRelations (relations cd)
-- ----------------------------------------------------------------- [ Classes ]
| 299
| true
| true
| 3
| 9
| 79
| 93
| 46
| 47
| null | null |
bitemyapp/located-base
|
src/Data/List/Located.hs
|
bsd-3-clause
|
foldl1' :: (?callStack :: CallStack) => (a -> a -> a) -> [a] -> a
foldl1' f (x:xs) = foldl' f x xs
| 98
|
foldl1' :: (?callStack :: CallStack) => (a -> a -> a) -> [a] -> a
foldl1' f (x:xs) = foldl' f x xs
| 98
|
foldl1' f (x:xs) = foldl' f x xs
| 32
| false
| true
| 0
| 9
| 22
| 61
| 33
| 28
| null | null |
shayan-najd/Haskell-Desugar-Generic
|
Language/Haskell/Exts/Desugar/Generic/Type.hs
|
bsd-3-clause
|
desugarTyTuple (TyTuple b ts) = return $
foldl TyApp (TyCon $ Special $ TupleCon b $ length ts) ts
| 100
|
desugarTyTuple (TyTuple b ts) = return $
foldl TyApp (TyCon $ Special $ TupleCon b $ length ts) ts
| 100
|
desugarTyTuple (TyTuple b ts) = return $
foldl TyApp (TyCon $ Special $ TupleCon b $ length ts) ts
| 100
| false
| false
| 0
| 10
| 20
| 49
| 23
| 26
| null | null |
Wolfchase/Sniffer
|
dist/build/autogen/Paths_sniffer.hs
|
gpl-3.0
|
sysconfdir = "/home/rodolfo/.cabal/etc"
| 39
|
sysconfdir = "/home/rodolfo/.cabal/etc"
| 39
|
sysconfdir = "/home/rodolfo/.cabal/etc"
| 39
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
chengzh2008/hpffp
|
src/ch14-Testing/addition/Addition.hs
|
bsd-3-clause
|
genOrdering :: Gen Ordering
genOrdering = elements [LT, EQ, GT]
| 63
|
genOrdering :: Gen Ordering
genOrdering = elements [LT, EQ, GT]
| 63
|
genOrdering = elements [LT, EQ, GT]
| 35
| false
| true
| 0
| 6
| 9
| 26
| 14
| 12
| null | null |
shangaslammi/prose-doc
|
src/Text/ProseDoc/Tree.hs
|
mit
|
pruneEmptyBranches :: Tree l n -> Tree l n
pruneEmptyBranches t = go t where
go t = case t of
Empty -> Empty
Branch bs -> case filter notEmpty . map go $ bs of
[] -> Empty
bs' -> Branch bs'
Label l t -> case go t of
Empty -> Empty
t' -> Label l t'
n -> n
notEmpty Empty = False
notEmpty _ = True
{-%
A tree can be split into parts based a label test. The split off parts will
contain the same labels when walking the tree spine as the part they were cut
off from.
-}
| 581
|
pruneEmptyBranches :: Tree l n -> Tree l n
pruneEmptyBranches t = go t where
go t = case t of
Empty -> Empty
Branch bs -> case filter notEmpty . map go $ bs of
[] -> Empty
bs' -> Branch bs'
Label l t -> case go t of
Empty -> Empty
t' -> Label l t'
n -> n
notEmpty Empty = False
notEmpty _ = True
{-%
A tree can be split into parts based a label test. The split off parts will
contain the same labels when walking the tree spine as the part they were cut
off from.
-}
| 581
|
pruneEmptyBranches t = go t where
go t = case t of
Empty -> Empty
Branch bs -> case filter notEmpty . map go $ bs of
[] -> Empty
bs' -> Branch bs'
Label l t -> case go t of
Empty -> Empty
t' -> Label l t'
n -> n
notEmpty Empty = False
notEmpty _ = True
{-%
A tree can be split into parts based a label test. The split off parts will
contain the same labels when walking the tree spine as the part they were cut
off from.
-}
| 538
| false
| true
| 0
| 13
| 219
| 158
| 73
| 85
| null | null |
Lupino/dispatch-article
|
src/Article/DataSource.hs
|
bsd-3-clause
|
fetchReq :: ArticleReq a -> TablePrefix -> Connection -> IO a
fetchReq (CreateArticle t s co f c) = createArticle t s co f c
| 131
|
fetchReq :: ArticleReq a -> TablePrefix -> Connection -> IO a
fetchReq (CreateArticle t s co f c) = createArticle t s co f c
| 131
|
fetchReq (CreateArticle t s co f c) = createArticle t s co f c
| 69
| false
| true
| 0
| 8
| 31
| 57
| 27
| 30
| null | null |
kuribas/hmetafont
|
Typography/HMetafont.hs
|
bsd-3-clause
|
y2l = var "y2l"
| 15
|
y2l = var "y2l"
| 15
|
y2l = var "y2l"
| 15
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
TomMD/ghc
|
compiler/hsSyn/HsExpr.hs
|
bsd-3-clause
|
pprCmdArg :: OutputableBndr id => HsCmdTop id -> SDoc
pprCmdArg (HsCmdTop cmd@(L _ (HsCmdArrForm _ Nothing [])) _ _ _)
= ppr_lcmd cmd
| 135
|
pprCmdArg :: OutputableBndr id => HsCmdTop id -> SDoc
pprCmdArg (HsCmdTop cmd@(L _ (HsCmdArrForm _ Nothing [])) _ _ _)
= ppr_lcmd cmd
| 135
|
pprCmdArg (HsCmdTop cmd@(L _ (HsCmdArrForm _ Nothing [])) _ _ _)
= ppr_lcmd cmd
| 81
| false
| true
| 2
| 11
| 24
| 72
| 33
| 39
| null | null |
AlexanderPankiv/ghc
|
compiler/basicTypes/OccName.hs
|
bsd-3-clause
|
-- Data constructor workers are made by setting the name space
-- of the data constructor OccName (which should be a DataName)
-- to VarName
mkDataConWorkerOcc datacon_occ = setOccNameSpace varName datacon_occ
| 209
|
mkDataConWorkerOcc datacon_occ = setOccNameSpace varName datacon_occ
| 68
|
mkDataConWorkerOcc datacon_occ = setOccNameSpace varName datacon_occ
| 68
| true
| false
| 0
| 5
| 30
| 17
| 9
| 8
| null | null |
jthornber/language-c-ejt
|
src/Language/C/Analysis/TypeCheck.hs
|
bsd-3-clause
|
derefType t =
-- XXX: is it good to use canonicalType here?
case canonicalType t of
PtrType t' _ _ -> return t'
ArrayType t' _ _ _ -> return t'
_ -> fail $ "dereferencing non-pointer: " ++ pType t
| 212
|
derefType t =
-- XXX: is it good to use canonicalType here?
case canonicalType t of
PtrType t' _ _ -> return t'
ArrayType t' _ _ _ -> return t'
_ -> fail $ "dereferencing non-pointer: " ++ pType t
| 212
|
derefType t =
-- XXX: is it good to use canonicalType here?
case canonicalType t of
PtrType t' _ _ -> return t'
ArrayType t' _ _ _ -> return t'
_ -> fail $ "dereferencing non-pointer: " ++ pType t
| 212
| false
| false
| 0
| 9
| 56
| 68
| 31
| 37
| null | null |
google-research/dex-lang
|
src/lib/RenderHtml.hs
|
bsd-3-clause
|
syntaxSpan :: String -> StrClass -> Html
syntaxSpan s NormalStr = toHtml s
| 74
|
syntaxSpan :: String -> StrClass -> Html
syntaxSpan s NormalStr = toHtml s
| 74
|
syntaxSpan s NormalStr = toHtml s
| 33
| false
| true
| 0
| 6
| 12
| 27
| 13
| 14
| null | null |
edsko/cabal
|
Cabal/src/Distribution/Simple/GHC/Internal.hs
|
bsd-3-clause
|
mkGhcOptPackages :: ComponentLocalBuildInfo
-> [(UnitId, PackageId, ModuleRenaming)]
mkGhcOptPackages clbi =
map (\(i,p) -> (i,p,lookupRenaming p (componentPackageRenaming clbi)))
(componentPackageDeps clbi)
| 232
|
mkGhcOptPackages :: ComponentLocalBuildInfo
-> [(UnitId, PackageId, ModuleRenaming)]
mkGhcOptPackages clbi =
map (\(i,p) -> (i,p,lookupRenaming p (componentPackageRenaming clbi)))
(componentPackageDeps clbi)
| 232
|
mkGhcOptPackages clbi =
map (\(i,p) -> (i,p,lookupRenaming p (componentPackageRenaming clbi)))
(componentPackageDeps clbi)
| 130
| false
| true
| 0
| 11
| 43
| 75
| 42
| 33
| null | null |
ghcjs/ghcjs
|
src/Gen2/Shim.hs
|
mit
|
versionRangeToBuildDep (Interval lo hi) = T.intercalate " && " $ catMaybes
[((">= " <>) . showVersion) <$> lo,
(("< " <>) . showVersion) <$> hi]
| 250
|
versionRangeToBuildDep (Interval lo hi) = T.intercalate " && " $ catMaybes
[((">= " <>) . showVersion) <$> lo,
(("< " <>) . showVersion) <$> hi]
| 250
|
versionRangeToBuildDep (Interval lo hi) = T.intercalate " && " $ catMaybes
[((">= " <>) . showVersion) <$> lo,
(("< " <>) . showVersion) <$> hi]
| 250
| false
| false
| 0
| 11
| 130
| 65
| 35
| 30
| null | null |
ezyang/ghc
|
testsuite/tests/typecheck/should_fail/T13292.hs
|
bsd-3-clause
|
-- main :: IO ()
main = someFunc
| 32
|
main = someFunc
| 15
|
main = someFunc
| 15
| true
| false
| 0
| 4
| 7
| 7
| 4
| 3
| null | null |
agrafix/HSmarty
|
src/Text/HSmarty/Render/Engine.hs
|
bsd-3-clause
|
applyPrintDirective env expr "urlencode" =
txtPdHelper env expr (T.pack . urlEncode . T.unpack)
| 99
|
applyPrintDirective env expr "urlencode" =
txtPdHelper env expr (T.pack . urlEncode . T.unpack)
| 99
|
applyPrintDirective env expr "urlencode" =
txtPdHelper env expr (T.pack . urlEncode . T.unpack)
| 99
| false
| false
| 0
| 9
| 16
| 35
| 17
| 18
| null | null |
adituv/qbscript
|
src/Compiler/QbScript/Parser.hs
|
bsd-3-clause
|
qbValue QbTFloat = QbFloat <$> float
| 36
|
qbValue QbTFloat = QbFloat <$> float
| 36
|
qbValue QbTFloat = QbFloat <$> float
| 36
| false
| false
| 0
| 5
| 5
| 13
| 6
| 7
| null | null |
triplepointfive/Youtan
|
src/Youtan/Compile/Codegen.hs
|
bsd-3-clause
|
-- Control Flow
br :: Name -> Codegen (Named Terminator)
br val = terminator $ Do $ Br val []
| 93
|
br :: Name -> Codegen (Named Terminator)
br val = terminator $ Do $ Br val []
| 77
|
br val = terminator $ Do $ Br val []
| 36
| true
| true
| 0
| 8
| 19
| 43
| 21
| 22
| null | null |
genos/online_problems
|
advent_of_code_2021/day10/Main.hs
|
mit
|
cToPair ']' = (Close, Bracket)
| 30
|
cToPair ']' = (Close, Bracket)
| 30
|
cToPair ']' = (Close, Bracket)
| 30
| false
| false
| 0
| 5
| 4
| 15
| 8
| 7
| null | null |
bananu7/Turnip
|
src/Turnip/Parser.hs
|
mit
|
funcBody :: Parser Block
funcBody = do
b <- block
reserved "end"
return $ (Block b)
{-
I've decided to desugar local statements to something much easier to eval. Thus:
local x = 5
becomes
local x
x = 5
Which thanks to closure local scoping will be properly assigned.
This however requires localStmt to emit more than one statement
-}
| 356
|
funcBody :: Parser Block
funcBody = do
b <- block
reserved "end"
return $ (Block b)
{-
I've decided to desugar local statements to something much easier to eval. Thus:
local x = 5
becomes
local x
x = 5
Which thanks to closure local scoping will be properly assigned.
This however requires localStmt to emit more than one statement
-}
| 356
|
funcBody = do
b <- block
reserved "end"
return $ (Block b)
{-
I've decided to desugar local statements to something much easier to eval. Thus:
local x = 5
becomes
local x
x = 5
Which thanks to closure local scoping will be properly assigned.
This however requires localStmt to emit more than one statement
-}
| 331
| false
| true
| 0
| 9
| 83
| 41
| 19
| 22
| null | null |
dmbarbour/Sirea
|
sirea-filesystem/src/Sirea/Filesystem/LocalMirror.hs
|
bsd-3-clause
|
ventsHandler lm es =
onNextStep (lm_psched lm) $
mapM_ (eventHandler lm) es
| 90
|
eventsHandler lm es =
onNextStep (lm_psched lm) $
mapM_ (eventHandler lm) es
| 90
|
eventsHandler lm es =
onNextStep (lm_psched lm) $
mapM_ (eventHandler lm) es
| 90
| false
| false
| 0
| 8
| 26
| 35
| 16
| 19
| null | null |
jlamothe/passman
|
test/Spec/NewPWDatabase.hs
|
lgpl-3.0
|
tests :: Test
tests = TestLabel "newPWDatabase" $
length newPWDatabase ~?= 0
| 78
|
tests :: Test
tests = TestLabel "newPWDatabase" $
length newPWDatabase ~?= 0
| 78
|
tests = TestLabel "newPWDatabase" $
length newPWDatabase ~?= 0
| 64
| false
| true
| 0
| 7
| 13
| 25
| 12
| 13
| null | null |
snoyberg/hackage-server
|
Distribution/Server/Packages/Unpack.hs
|
bsd-3-clause
|
explainTarError (PortabilityError (Tar.NonPortableFormat Tar.UstarFormat)) =
error "explainTarError: impossible UstarFormat"
| 128
|
explainTarError (PortabilityError (Tar.NonPortableFormat Tar.UstarFormat)) =
error "explainTarError: impossible UstarFormat"
| 128
|
explainTarError (PortabilityError (Tar.NonPortableFormat Tar.UstarFormat)) =
error "explainTarError: impossible UstarFormat"
| 128
| false
| false
| 0
| 10
| 12
| 28
| 13
| 15
| null | null |
bch29/streaming-png
|
src/Codec/Picture/Png/Streaming/Info.hs
|
lgpl-3.0
|
-- | From a bit depth and colour type, return the number of bits in each pixel,
-- checking also that the bit depth provided is allowed for the given colour
-- type.
getBitsPerPixel :: BitDepth -> ColourType -> Maybe Word8
getBitsPerPixel bitDepth colourType
-- greyscale
| colourType == 0 && bitDepth `elem` [1, 2, 4, 8, 16] = Just bitDepth
-- indexed colour
| colourType == 3 && bitDepth `elem` [1, 2, 4, 8] = Just bitDepth
-- truecolour
| colourType == 2 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 3)
-- greyscale with alpha
| colourType == 4 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 2)
-- truecolour with alpha
| colourType == 6 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 4)
-- unknown
| otherwise = Nothing
| 789
|
getBitsPerPixel :: BitDepth -> ColourType -> Maybe Word8
getBitsPerPixel bitDepth colourType
-- greyscale
| colourType == 0 && bitDepth `elem` [1, 2, 4, 8, 16] = Just bitDepth
-- indexed colour
| colourType == 3 && bitDepth `elem` [1, 2, 4, 8] = Just bitDepth
-- truecolour
| colourType == 2 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 3)
-- greyscale with alpha
| colourType == 4 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 2)
-- truecolour with alpha
| colourType == 6 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 4)
-- unknown
| otherwise = Nothing
| 623
|
getBitsPerPixel bitDepth colourType
-- greyscale
| colourType == 0 && bitDepth `elem` [1, 2, 4, 8, 16] = Just bitDepth
-- indexed colour
| colourType == 3 && bitDepth `elem` [1, 2, 4, 8] = Just bitDepth
-- truecolour
| colourType == 2 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 3)
-- greyscale with alpha
| colourType == 4 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 2)
-- truecolour with alpha
| colourType == 6 && bitDepth == 8 || bitDepth == 16 = Just (bitDepth * 4)
-- unknown
| otherwise = Nothing
| 566
| true
| true
| 1
| 12
| 187
| 245
| 129
| 116
| null | null |
brendanhay/gogol
|
gogol-play-moviespartner/gen/Network/Google/Resource/PlayMoviesPartner/Accounts/Avails/Get.hs
|
mpl-2.0
|
-- | OAuth bearer token.
aagBearerToken :: Lens' AccountsAvailsGet (Maybe Text)
aagBearerToken
= lens _aagBearerToken
(\ s a -> s{_aagBearerToken = a})
| 159
|
aagBearerToken :: Lens' AccountsAvailsGet (Maybe Text)
aagBearerToken
= lens _aagBearerToken
(\ s a -> s{_aagBearerToken = a})
| 134
|
aagBearerToken
= lens _aagBearerToken
(\ s a -> s{_aagBearerToken = a})
| 79
| true
| true
| 1
| 9
| 29
| 52
| 25
| 27
| null | null |
talanis85/mudblood
|
src/Mudblood/Contrib/MG/Guilds/Zauberer.hs
|
gpl-3.0
|
zaubererStateE :: Lens' MGZaubererState Bool
zaubererStateE = lens _zaubererStateE $ \s v -> s { _zaubererStateE = v }
| 136
|
zaubererStateE :: Lens' MGZaubererState Bool
zaubererStateE = lens _zaubererStateE $ \s v -> s { _zaubererStateE = v }
| 136
|
zaubererStateE = lens _zaubererStateE $ \s v -> s { _zaubererStateE = v }
| 85
| false
| true
| 0
| 8
| 36
| 38
| 20
| 18
| null | null |
etcinit/hakyll-serve
|
src/Network/Wai/Serve/Middleware.hs
|
bsd-3-clause
|
-- | Gzip compression middleware.
gzipMiddleware :: Middleware
gzipMiddleware = gzip $ def {gzipFiles = GzipCompress}
| 117
|
gzipMiddleware :: Middleware
gzipMiddleware = gzip $ def {gzipFiles = GzipCompress}
| 83
|
gzipMiddleware = gzip $ def {gzipFiles = GzipCompress}
| 54
| true
| true
| 0
| 7
| 15
| 24
| 14
| 10
| null | null |
olsner/ghc
|
compiler/basicTypes/Module.hs
|
bsd-3-clause
|
parseModSubst :: ReadP [(ModuleName, Module)]
parseModSubst = Parse.between (Parse.char '[') (Parse.char ']')
. flip Parse.sepBy (Parse.char ',')
$ do k <- parseModuleName
_ <- Parse.char '='
v <- parseModuleId
return (k, v)
-- -----------------------------------------------------------------------------
-- $wired_in_packages
-- Certain packages are known to the compiler, in that we know about certain
-- entities that reside in these packages, and the compiler needs to
-- declare static Modules and Names that refer to these packages. Hence
-- the wired-in packages can't include version numbers, since we don't want
-- to bake the version numbers of these packages into GHC.
--
-- So here's the plan. Wired-in packages are still versioned as
-- normal in the packages database, and you can still have multiple
-- versions of them installed. However, for each invocation of GHC,
-- only a single instance of each wired-in package will be recognised
-- (the desired one is selected via @-package@\/@-hide-package@), and GHC
-- will use the unversioned 'UnitId' below when referring to it,
-- including in .hi files and object file symbols. Unselected
-- versions of wired-in packages will be ignored, as will any other
-- package that depends directly or indirectly on it (much as if you
-- had used @-ignore-package@).
-- Make sure you change 'Packages.findWiredInPackages' if you add an entry here
| 1,455
|
parseModSubst :: ReadP [(ModuleName, Module)]
parseModSubst = Parse.between (Parse.char '[') (Parse.char ']')
. flip Parse.sepBy (Parse.char ',')
$ do k <- parseModuleName
_ <- Parse.char '='
v <- parseModuleId
return (k, v)
-- -----------------------------------------------------------------------------
-- $wired_in_packages
-- Certain packages are known to the compiler, in that we know about certain
-- entities that reside in these packages, and the compiler needs to
-- declare static Modules and Names that refer to these packages. Hence
-- the wired-in packages can't include version numbers, since we don't want
-- to bake the version numbers of these packages into GHC.
--
-- So here's the plan. Wired-in packages are still versioned as
-- normal in the packages database, and you can still have multiple
-- versions of them installed. However, for each invocation of GHC,
-- only a single instance of each wired-in package will be recognised
-- (the desired one is selected via @-package@\/@-hide-package@), and GHC
-- will use the unversioned 'UnitId' below when referring to it,
-- including in .hi files and object file symbols. Unselected
-- versions of wired-in packages will be ignored, as will any other
-- package that depends directly or indirectly on it (much as if you
-- had used @-ignore-package@).
-- Make sure you change 'Packages.findWiredInPackages' if you add an entry here
| 1,455
|
parseModSubst = Parse.between (Parse.char '[') (Parse.char ']')
. flip Parse.sepBy (Parse.char ',')
$ do k <- parseModuleName
_ <- Parse.char '='
v <- parseModuleId
return (k, v)
-- -----------------------------------------------------------------------------
-- $wired_in_packages
-- Certain packages are known to the compiler, in that we know about certain
-- entities that reside in these packages, and the compiler needs to
-- declare static Modules and Names that refer to these packages. Hence
-- the wired-in packages can't include version numbers, since we don't want
-- to bake the version numbers of these packages into GHC.
--
-- So here's the plan. Wired-in packages are still versioned as
-- normal in the packages database, and you can still have multiple
-- versions of them installed. However, for each invocation of GHC,
-- only a single instance of each wired-in package will be recognised
-- (the desired one is selected via @-package@\/@-hide-package@), and GHC
-- will use the unversioned 'UnitId' below when referring to it,
-- including in .hi files and object file symbols. Unselected
-- versions of wired-in packages will be ignored, as will any other
-- package that depends directly or indirectly on it (much as if you
-- had used @-ignore-package@).
-- Make sure you change 'Packages.findWiredInPackages' if you add an entry here
| 1,409
| false
| true
| 3
| 10
| 267
| 129
| 71
| 58
| null | null |
beni55/haste-compiler
|
libraries/ghc-7.10/base/Data/Data.hs
|
bsd-3-clause
|
proxyDataType :: DataType
proxyDataType = mkDataType "Data.Proxy.Proxy" [proxyConstr]
| 85
|
proxyDataType :: DataType
proxyDataType = mkDataType "Data.Proxy.Proxy" [proxyConstr]
| 85
|
proxyDataType = mkDataType "Data.Proxy.Proxy" [proxyConstr]
| 59
| false
| true
| 0
| 6
| 7
| 19
| 10
| 9
| null | null |
borisjoffe/haskell
|
scrap.hs
|
mit
|
-- Ex3
myMean :: [Double] -> Double
myMean xs = sum xs / fromIntegral (length xs)
| 81
|
myMean :: [Double] -> Double
myMean xs = sum xs / fromIntegral (length xs)
| 74
|
myMean xs = sum xs / fromIntegral (length xs)
| 45
| true
| true
| 0
| 8
| 15
| 38
| 19
| 19
| null | null |
Proclivis/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_LEX_VBSCRIPT :: Int
wxSTC_LEX_VBSCRIPT = 28
| 49
|
wxSTC_LEX_VBSCRIPT :: Int
wxSTC_LEX_VBSCRIPT = 28
| 49
|
wxSTC_LEX_VBSCRIPT = 28
| 23
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
ml9951/ThreadScope
|
GUI/Timeline/Motion.hs
|
bsd-3-clause
|
centreOnCursor :: TimelineState -> Timestamp -> IO ()
centreOnCursor state cursor =
scroll (\_ page l _u -> max l (fromIntegral cursor - page/2)) state
| 154
|
centreOnCursor :: TimelineState -> Timestamp -> IO ()
centreOnCursor state cursor =
scroll (\_ page l _u -> max l (fromIntegral cursor - page/2)) state
| 153
|
centreOnCursor state cursor =
scroll (\_ page l _u -> max l (fromIntegral cursor - page/2)) state
| 99
| false
| true
| 0
| 12
| 27
| 68
| 33
| 35
| null | null |
scott-fleischman/greek-grammar
|
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
|
mit
|
decomposeChar '\xF990' = "\x6200"
| 33
|
decomposeChar '\xF990' = "\x6200"
| 33
|
decomposeChar '\xF990' = "\x6200"
| 33
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
jmitchell/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
ptacimp n s t = PTacImplicit 2 [] n s t
| 39
|
ptacimp n s t = PTacImplicit 2 [] n s t
| 39
|
ptacimp n s t = PTacImplicit 2 [] n s t
| 39
| false
| false
| 0
| 6
| 10
| 27
| 12
| 15
| null | null |
QuickChick/Luck
|
luck/src/Outer/Types.hs
|
mit
|
-- | @tcAppify C [v1 .. vn] [t1 .. tn] := t1 -> .. -> tn -> C v1 .. vn@
tcAppify :: c -> [v] -> [TcType c v] -> TcType c v
tcAppify cid vars ts = mkFun ts $ TcCon cid (length vars) (map TcVar vars)
| 197
|
tcAppify :: c -> [v] -> [TcType c v] -> TcType c v
tcAppify cid vars ts = mkFun ts $ TcCon cid (length vars) (map TcVar vars)
| 125
|
tcAppify cid vars ts = mkFun ts $ TcCon cid (length vars) (map TcVar vars)
| 74
| true
| true
| 0
| 9
| 48
| 75
| 37
| 38
| null | null |
m-alvarez/jhc
|
lib/haskell-extras/Foreign/Marshal/Pool.hs
|
mit
|
withPool :: (Pool -> IO b) -> IO b
withPool = bracket newPool freePool
| 70
|
withPool :: (Pool -> IO b) -> IO b
withPool = bracket newPool freePool
| 70
|
withPool = bracket newPool freePool
| 35
| false
| true
| 0
| 9
| 13
| 38
| 17
| 21
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/Prelude/PrimOp.hs
|
bsd-3-clause
|
tagOf_PrimOp UnsafeThawSmallArrayOp = _ILIT(163)
| 48
|
tagOf_PrimOp UnsafeThawSmallArrayOp = _ILIT(163)
| 48
|
tagOf_PrimOp UnsafeThawSmallArrayOp = _ILIT(163)
| 48
| false
| false
| 0
| 6
| 3
| 15
| 7
| 8
| null | null |
phischu/fragnix
|
tests/packages/scotty/Text.PrettyPrint.HughesPJ.hs
|
bsd-3-clause
|
-- ---------------------------------------------------------------------------
-- Horizontal composition @<>@
-- We intentionally avoid Data.Monoid.(<>) here due to interactions of
-- Data.Monoid.(<>) and (<+>). See
-- http://www.haskell.org/pipermail/libraries/2011-November/017066.html
-- | Beside.
-- '<>' is associative, with identity 'empty'.
(<>) :: Doc -> Doc -> Doc
(<>) = liftBinary (Ann.<>)
| 403
|
(<>) :: Doc -> Doc -> Doc
(<>) = liftBinary (Ann.<>)
| 52
|
(<>) = liftBinary (Ann.<>)
| 26
| true
| true
| 0
| 6
| 46
| 37
| 25
| 12
| null | null |
spinda/liquidhaskell
|
src/Language/Haskell/Liquid/Constraint/Types.hs
|
bsd-3-clause
|
deleteREnv x (REnv env) = REnv (M.delete x env)
| 49
|
deleteREnv x (REnv env) = REnv (M.delete x env)
| 49
|
deleteREnv x (REnv env) = REnv (M.delete x env)
| 49
| false
| false
| 0
| 8
| 10
| 30
| 14
| 16
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
happyReduction_136 _
= HappyAbsSyn42
(Eq
)
| 77
|
happyReduction_136 _
= HappyAbsSyn42
(Eq
)
| 77
|
happyReduction_136 _
= HappyAbsSyn42
(Eq
)
| 77
| false
| false
| 0
| 6
| 40
| 15
| 7
| 8
| null | null |
pparkkin/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpHasSideEffects ReadArrayArrayOp_ArrayArray = True
| 55
|
primOpHasSideEffects ReadArrayArrayOp_ArrayArray = True
| 55
|
primOpHasSideEffects ReadArrayArrayOp_ArrayArray = True
| 55
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
beni55/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
-- add with carry: overflow == 0 iff no overflow
genPrim _ _ IntAddCOp [r,overf] [x,y] =
PrimInline [j| var rt = `x`+`y`; `r` = rt|0; `overf` = (`r`!=rt)?1:0; |]
| 171
|
genPrim _ _ IntAddCOp [r,overf] [x,y] =
PrimInline [j| var rt = `x`+`y`; `r` = rt|0; `overf` = (`r`!=rt)?1:0; |]
| 122
|
genPrim _ _ IntAddCOp [r,overf] [x,y] =
PrimInline [j| var rt = `x`+`y`; `r` = rt|0; `overf` = (`r`!=rt)?1:0; |]
| 122
| true
| false
| 0
| 6
| 39
| 37
| 22
| 15
| null | null |
iambernie/tryhaskell
|
somefunctions.hs
|
mit
|
lengte :: [a] -> Int
lengte [] = 0
| 34
|
lengte :: [a] -> Int
lengte [] = 0
| 34
|
lengte [] = 0
| 13
| false
| true
| 0
| 6
| 8
| 23
| 12
| 11
| null | null |
davidfontenot/haskell-stuff
|
BasicArrays.hs
|
gpl-2.0
|
diagOfId4 = (liftM getDiag) (matMult (idMatrix 4) (idMatrix 4))
| 63
|
diagOfId4 = (liftM getDiag) (matMult (idMatrix 4) (idMatrix 4))
| 63
|
diagOfId4 = (liftM getDiag) (matMult (idMatrix 4) (idMatrix 4))
| 63
| false
| false
| 0
| 9
| 8
| 35
| 17
| 18
| null | null |
NightElfik/L-systems-in-Haskell
|
src/LSystem.hs
|
unlicense
|
----------------------------------------------------------------------------------------------------
iterateLSystem :: Int -> LSystem -> [SymbolDouble] -> [SymbolDouble]
iterateLSystem 0 _ axiom = axiom
| 202
|
iterateLSystem :: Int -> LSystem -> [SymbolDouble] -> [SymbolDouble]
iterateLSystem 0 _ axiom = axiom
| 101
|
iterateLSystem 0 _ axiom = axiom
| 32
| true
| true
| 0
| 10
| 15
| 43
| 21
| 22
| null | null |
ardumont/haskell-lab
|
test/AnagramTests.hs
|
gpl-2.0
|
testCombinations2 :: Test.HUnit.Test
testCombinations2 = [[],[('a',1)],[('a',2)],[('b',1)],[('b',2)],[('a',1),('b',1)],[('a',1),('b',2)],[('a',2),('b',1)],[('a',2),('b',2)]]
~=?
combinations [('a', 2), ('b', 2)]
| 251
|
testCombinations2 :: Test.HUnit.Test
testCombinations2 = [[],[('a',1)],[('a',2)],[('b',1)],[('b',2)],[('a',1),('b',1)],[('a',1),('b',2)],[('a',2),('b',1)],[('a',2),('b',2)]]
~=?
combinations [('a', 2), ('b', 2)]
| 251
|
testCombinations2 = [[],[('a',1)],[('a',2)],[('b',1)],[('b',2)],[('a',1),('b',1)],[('a',1),('b',2)],[('a',2),('b',1)],[('a',2),('b',2)]]
~=?
combinations [('a', 2), ('b', 2)]
| 214
| false
| true
| 0
| 8
| 51
| 176
| 114
| 62
| null | null |
bgamari/ghc-vis
|
experiments/name.hs
|
bsd-3-clause
|
bindSuspensions :: GhcMonad m => Term -> m Term
bindSuspensions t = do
hsc_env <- getSession
inScope <- GHC.getBindings
let ictxt = hsc_IC hsc_env
prefix = "_t"
alreadyUsedNames = map (occNameString . nameOccName . getName) inScope
availNames = map ((prefix++) . show) [(1::Int)..] \\ alreadyUsedNames
availNames_var <- liftIO $ newIORef availNames
(t', stuff) <- liftIO $ foldTerm (nameSuspensionsAndGetInfos availNames_var) t
let (names, tys, hvals) = unzip3 stuff
let ids = [ mkVanillaGlobal name ty
| (name,ty) <- zip names tys]
new_ic = extendInteractiveContext ictxt (map AnId ids)
liftIO $ extendLinkEnv (zip names hvals)
modifySession $ \_ -> hsc_env {hsc_IC = new_ic }
return t'
where
-- Processing suspensions. Give names and recopilate info
nameSuspensionsAndGetInfos :: IORef [String] ->
TermFold (IO (Term, [(Name,Type,HValue)]))
nameSuspensionsAndGetInfos freeNames = TermFold
{
fSuspension = doSuspension freeNames
, fTerm = \ty dc v tt -> do
tt' <- sequence tt
let (terms,names) = unzip tt'
return (Term ty dc v terms, concat names)
, fPrim = \ty n ->return (Prim ty n,[])
, fNewtypeWrap =
\ty dc t -> do
(term, names) <- t
return (NewtypeWrap ty dc term, names)
, fRefWrap = \ty t -> do
(term, names) <- t
return (RefWrap ty term, names)
}
doSuspension freeNames ct ty hval _name = do
name <- atomicModifyIORef freeNames (\x->(tail x, head x))
n <- newGrimName name
return (Suspension ct ty hval (Just n), [(n,ty,hval)])
-- From ghc/compiler/ghci/Debugger.hs
-- Create new uniques and give them sequentially numbered names
| 2,229
|
bindSuspensions :: GhcMonad m => Term -> m Term
bindSuspensions t = do
hsc_env <- getSession
inScope <- GHC.getBindings
let ictxt = hsc_IC hsc_env
prefix = "_t"
alreadyUsedNames = map (occNameString . nameOccName . getName) inScope
availNames = map ((prefix++) . show) [(1::Int)..] \\ alreadyUsedNames
availNames_var <- liftIO $ newIORef availNames
(t', stuff) <- liftIO $ foldTerm (nameSuspensionsAndGetInfos availNames_var) t
let (names, tys, hvals) = unzip3 stuff
let ids = [ mkVanillaGlobal name ty
| (name,ty) <- zip names tys]
new_ic = extendInteractiveContext ictxt (map AnId ids)
liftIO $ extendLinkEnv (zip names hvals)
modifySession $ \_ -> hsc_env {hsc_IC = new_ic }
return t'
where
-- Processing suspensions. Give names and recopilate info
nameSuspensionsAndGetInfos :: IORef [String] ->
TermFold (IO (Term, [(Name,Type,HValue)]))
nameSuspensionsAndGetInfos freeNames = TermFold
{
fSuspension = doSuspension freeNames
, fTerm = \ty dc v tt -> do
tt' <- sequence tt
let (terms,names) = unzip tt'
return (Term ty dc v terms, concat names)
, fPrim = \ty n ->return (Prim ty n,[])
, fNewtypeWrap =
\ty dc t -> do
(term, names) <- t
return (NewtypeWrap ty dc term, names)
, fRefWrap = \ty t -> do
(term, names) <- t
return (RefWrap ty term, names)
}
doSuspension freeNames ct ty hval _name = do
name <- atomicModifyIORef freeNames (\x->(tail x, head x))
n <- newGrimName name
return (Suspension ct ty hval (Just n), [(n,ty,hval)])
-- From ghc/compiler/ghci/Debugger.hs
-- Create new uniques and give them sequentially numbered names
| 2,229
|
bindSuspensions t = do
hsc_env <- getSession
inScope <- GHC.getBindings
let ictxt = hsc_IC hsc_env
prefix = "_t"
alreadyUsedNames = map (occNameString . nameOccName . getName) inScope
availNames = map ((prefix++) . show) [(1::Int)..] \\ alreadyUsedNames
availNames_var <- liftIO $ newIORef availNames
(t', stuff) <- liftIO $ foldTerm (nameSuspensionsAndGetInfos availNames_var) t
let (names, tys, hvals) = unzip3 stuff
let ids = [ mkVanillaGlobal name ty
| (name,ty) <- zip names tys]
new_ic = extendInteractiveContext ictxt (map AnId ids)
liftIO $ extendLinkEnv (zip names hvals)
modifySession $ \_ -> hsc_env {hsc_IC = new_ic }
return t'
where
-- Processing suspensions. Give names and recopilate info
nameSuspensionsAndGetInfos :: IORef [String] ->
TermFold (IO (Term, [(Name,Type,HValue)]))
nameSuspensionsAndGetInfos freeNames = TermFold
{
fSuspension = doSuspension freeNames
, fTerm = \ty dc v tt -> do
tt' <- sequence tt
let (terms,names) = unzip tt'
return (Term ty dc v terms, concat names)
, fPrim = \ty n ->return (Prim ty n,[])
, fNewtypeWrap =
\ty dc t -> do
(term, names) <- t
return (NewtypeWrap ty dc term, names)
, fRefWrap = \ty t -> do
(term, names) <- t
return (RefWrap ty term, names)
}
doSuspension freeNames ct ty hval _name = do
name <- atomicModifyIORef freeNames (\x->(tail x, head x))
n <- newGrimName name
return (Suspension ct ty hval (Just n), [(n,ty,hval)])
-- From ghc/compiler/ghci/Debugger.hs
-- Create new uniques and give them sequentially numbered names
| 2,181
| false
| true
| 0
| 15
| 931
| 630
| 323
| 307
| null | null |
threetreeslight/learning-haskell
|
practice/old/20150823.hs
|
mit
|
sampleTree :: Tree
sampleTree = [('a', ('b', 'c')), ('b', ('d', 'e')), ('e', ('f', 'g'))]
| 89
|
sampleTree :: Tree
sampleTree = [('a', ('b', 'c')), ('b', ('d', 'e')), ('e', ('f', 'g'))]
| 89
|
sampleTree = [('a', ('b', 'c')), ('b', ('d', 'e')), ('e', ('f', 'g'))]
| 70
| false
| true
| 0
| 7
| 13
| 56
| 36
| 20
| null | null |
forsyde/forsyde-atom
|
src/ForSyDe/Atom/Skel.hs
|
bsd-3-clause
|
farm72 p v1 v2 v3 v4 v5 v6 v7 = (p =.= v1 =*= v2 =*= v3 =*= v4 =*= v5 =*= v6 =*= v7 |<)
| 90
|
farm72 p v1 v2 v3 v4 v5 v6 v7 = (p =.= v1 =*= v2 =*= v3 =*= v4 =*= v5 =*= v6 =*= v7 |<)
| 90
|
farm72 p v1 v2 v3 v4 v5 v6 v7 = (p =.= v1 =*= v2 =*= v3 =*= v4 =*= v5 =*= v6 =*= v7 |<)
| 90
| false
| false
| 0
| 12
| 28
| 55
| 28
| 27
| null | null |
MgaMPKAy/language-sh
|
Language/Sh/Arithmetic.hs
|
bsd-3-clause
|
expr1 :: AP Term
expr1 = buildExpressionParser table1 term
| 61
|
expr1 :: AP Term
expr1 = buildExpressionParser table1 term
| 61
|
expr1 = buildExpressionParser table1 term
| 44
| false
| true
| 0
| 5
| 11
| 19
| 9
| 10
| null | null |
UoYCS-plasma/LazySmallCheck2012
|
suite/performance/Benchmarks/Countdown.hs
|
bsd-3-clause
|
valid Div x y = x `mod` y == 0
| 38
|
valid Div x y = x `mod` y == 0
| 38
|
valid Div x y = x `mod` y == 0
| 38
| false
| false
| 0
| 6
| 17
| 23
| 12
| 11
| null | null |
lambda-llama/sized
|
tests/Data/Sized/ByteString/Tests.hs
|
mit
|
testStorable :: (Arbitrary a, Storable a, Eq a) => a -> Property
testStorable storable = monadicIO $ do
peeked <- run $ do
allocaBytes size $ \ptr -> do
poke ptr storable
peek ptr
assert $ storable == peeked
where
size = sizeOf storable
| 282
|
testStorable :: (Arbitrary a, Storable a, Eq a) => a -> Property
testStorable storable = monadicIO $ do
peeked <- run $ do
allocaBytes size $ \ptr -> do
poke ptr storable
peek ptr
assert $ storable == peeked
where
size = sizeOf storable
| 282
|
testStorable storable = monadicIO $ do
peeked <- run $ do
allocaBytes size $ \ptr -> do
poke ptr storable
peek ptr
assert $ storable == peeked
where
size = sizeOf storable
| 217
| false
| true
| 0
| 16
| 89
| 105
| 49
| 56
| null | null |
cchens/courseography
|
hs/WebParsing/HtmlTable.hs
|
gpl-3.0
|
-- | Finds the first rowspan and/or colspan, and returns a 4-element list where
-- * first element is the row it is found in, if any
-- * second element is the column it is found in, if any
-- * third element is the rowspan, if any
-- * fourth element is the colspan , if any
extractSpans :: [[[Tag T.Text]]] -> [Pos]
extractSpans cells =
map (getSpan cells) (findSpans cells)
| 379
|
extractSpans :: [[[Tag T.Text]]] -> [Pos]
extractSpans cells =
map (getSpan cells) (findSpans cells)
| 103
|
extractSpans cells =
map (getSpan cells) (findSpans cells)
| 61
| true
| true
| 0
| 10
| 75
| 57
| 32
| 25
| null | null |
vikraman/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
-- | Hide a 'FlagSpec' from being displayed in @--show-options@.
--
-- This is for example useful for flags that are obsolete, but should not
-- (yet) be deprecated for compatibility reasons.
hideFlag :: (Deprecation, FlagSpec a) -> (Deprecation, FlagSpec a)
hideFlag (dep, fs) = (dep, fs { flagSpecGhcMode = HiddenFlag })
| 322
|
hideFlag :: (Deprecation, FlagSpec a) -> (Deprecation, FlagSpec a)
hideFlag (dep, fs) = (dep, fs { flagSpecGhcMode = HiddenFlag })
| 130
|
hideFlag (dep, fs) = (dep, fs { flagSpecGhcMode = HiddenFlag })
| 63
| true
| true
| 1
| 8
| 51
| 64
| 36
| 28
| null | null |
MaiaVictor/ReflexScreenWidget
|
src/Reflex/Dom/Widget/Screen.hs
|
mit
|
screenWidget :: forall t m . MonadWidget t m => Behavior t ByteImageRgba -> m (El t)
screenWidget = screenWidgetAttr M.empty
| 124
|
screenWidget :: forall t m . MonadWidget t m => Behavior t ByteImageRgba -> m (El t)
screenWidget = screenWidgetAttr M.empty
| 124
|
screenWidget = screenWidgetAttr M.empty
| 39
| false
| true
| 0
| 11
| 20
| 54
| 25
| 29
| null | null |
polux/snippets
|
HRM.hs
|
apache-2.0
|
subAt :: Address -> HRM ()
subAt address = writeInstruction (SubAt address)
| 75
|
subAt :: Address -> HRM ()
subAt address = writeInstruction (SubAt address)
| 75
|
subAt address = writeInstruction (SubAt address)
| 48
| false
| true
| 0
| 7
| 11
| 32
| 15
| 17
| null | null |
damoxc/ganeti
|
src/Ganeti/Query/Filter.hs
|
gpl-2.0
|
evaluateFilter c mb a (TrueFilter getter) =
wrapGetter c mb a getter trueFilter
| 82
|
evaluateFilter c mb a (TrueFilter getter) =
wrapGetter c mb a getter trueFilter
| 82
|
evaluateFilter c mb a (TrueFilter getter) =
wrapGetter c mb a getter trueFilter
| 82
| false
| false
| 0
| 7
| 15
| 32
| 15
| 17
| null | null |
sampou-org/pfad
|
Code/Code28_WarmingUp.hs
|
bsd-3-clause
|
consList :: [a] -> [[a]] -> [[a]]
consList xs xss = if null xs then xss else xs:xss
| 88
|
consList :: [a] -> [[a]] -> [[a]]
consList xs xss = if null xs then xss else xs:xss
| 88
|
consList xs xss = if null xs then xss else xs:xss
| 51
| false
| true
| 0
| 8
| 22
| 54
| 30
| 24
| null | null |
yxm4109/pandoc
|
src/Text/Pandoc/Writers/RST.hs
|
gpl-2.0
|
inlineToRST (Strikeout lst) = do
contents <- inlineListToRST lst
return $ text "[STRIKEOUT:" <> contents <> char ']'
| 121
|
inlineToRST (Strikeout lst) = do
contents <- inlineListToRST lst
return $ text "[STRIKEOUT:" <> contents <> char ']'
| 121
|
inlineToRST (Strikeout lst) = do
contents <- inlineListToRST lst
return $ text "[STRIKEOUT:" <> contents <> char ']'
| 121
| false
| false
| 0
| 10
| 22
| 47
| 20
| 27
| null | null |
input-output-hk/pos-haskell-prototype
|
chain/src/Pos/Chain/Update/Constants.hs
|
mit
|
-- | Software Versions
genesisSoftwareVersions :: [SoftwareVersion]
genesisSoftwareVersions = map f genesisAppNames
where
f (_, appName) = SoftwareVersion {svAppName = appName, svNumber = 0}
| 196
|
genesisSoftwareVersions :: [SoftwareVersion]
genesisSoftwareVersions = map f genesisAppNames
where
f (_, appName) = SoftwareVersion {svAppName = appName, svNumber = 0}
| 173
|
genesisSoftwareVersions = map f genesisAppNames
where
f (_, appName) = SoftwareVersion {svAppName = appName, svNumber = 0}
| 128
| true
| true
| 0
| 6
| 29
| 50
| 29
| 21
| null | null |
bergmark/clay
|
src/Clay/Elements.hs
|
bsd-3-clause
|
meter = "meter"
| 15
|
meter = "meter"
| 15
|
meter = "meter"
| 15
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
sopvop/cabal
|
Cabal/Distribution/Version.hs
|
bsd-3-clause
|
-- | The version range @-any@. That is, a version range containing all
-- versions.
--
-- > withinRange v anyVersion = True
--
anyVersion :: VersionRange
anyVersion = AnyVersion
| 177
|
anyVersion :: VersionRange
anyVersion = AnyVersion
| 50
|
anyVersion = AnyVersion
| 23
| true
| true
| 0
| 6
| 29
| 23
| 12
| 11
| null | null |
kazu-yamamoto/http2
|
bench-priority/Heap.hs
|
bsd-3-clause
|
deficitStepsW :: Word
deficitStepsW = fromIntegral deficitSteps
| 63
|
deficitStepsW :: Word
deficitStepsW = fromIntegral deficitSteps
| 63
|
deficitStepsW = fromIntegral deficitSteps
| 41
| false
| true
| 0
| 6
| 6
| 20
| 8
| 12
| null | null |
divipp/ActiveHs
|
Html.hs
|
bsd-3-clause
|
mkBott :: (String, String) -> Html
mkBott (i, e) = toHtml (" " ++ i ++ ": ") +++ showLines e
| 93
|
mkBott :: (String, String) -> Html
mkBott (i, e) = toHtml (" " ++ i ++ ": ") +++ showLines e
| 93
|
mkBott (i, e) = toHtml (" " ++ i ++ ": ") +++ showLines e
| 58
| false
| true
| 0
| 9
| 21
| 51
| 27
| 24
| null | null |
conal/shady-graphics
|
src/Shady/Examples.hs
|
agpl-3.0
|
a19e = (uscale2 . (1.1 +) . cos . (+ pi/3) . (/ 2)) <*> a19d
| 60
|
a19e = (uscale2 . (1.1 +) . cos . (+ pi/3) . (/ 2)) <*> a19d
| 60
|
a19e = (uscale2 . (1.1 +) . cos . (+ pi/3) . (/ 2)) <*> a19d
| 60
| false
| false
| 1
| 11
| 15
| 49
| 26
| 23
| null | null |
alexvong1995/pandoc
|
src/Text/Pandoc/Readers/Org.hs
|
gpl-2.0
|
dropCommentTrees blks@(b:bs) =
maybe blks (flip dropUntilHeaderAboveLevel bs) $ commentHeaderLevel b
| 102
|
dropCommentTrees blks@(b:bs) =
maybe blks (flip dropUntilHeaderAboveLevel bs) $ commentHeaderLevel b
| 102
|
dropCommentTrees blks@(b:bs) =
maybe blks (flip dropUntilHeaderAboveLevel bs) $ commentHeaderLevel b
| 102
| false
| false
| 0
| 8
| 12
| 39
| 19
| 20
| null | null |
phaazon/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
|
bsd-3-clause
|
gl_INTERPOLATE :: GLenum
gl_INTERPOLATE = 0x8575
| 48
|
gl_INTERPOLATE :: GLenum
gl_INTERPOLATE = 0x8575
| 48
|
gl_INTERPOLATE = 0x8575
| 23
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
machine-intelligence/Botworld
|
Botworld/Display.hs
|
bsd-3-clause
|
itemDetail InspectShield = ["[°]"]
| 34
|
itemDetail InspectShield = ["[°]"]
| 34
|
itemDetail InspectShield = ["[°]"]
| 34
| false
| false
| 0
| 5
| 3
| 12
| 6
| 6
| null | null |
ndmitchell/cmdargs
|
System/Console/CmdArgs/GetOpt.hs
|
bsd-3-clause
|
onvert :: String -> [OptDescr a] -> Mode ([a],[String])
convert help flags = mode "program" ([],[]) help args (map f flags)
where
args = flagArg (\x (a,b) -> Right (a,b++[x])) "ARG"
f (Option short long x help) = case x of
NoArg x -> flagNone names (\(a,b) -> (a++[x],b)) help
ReqArg op x -> flagReq names (\x (a,b) -> Right (a++[op x],b)) x help
OptArg op x -> flagOpt "" names (\x (a,b) -> Right (a++[op $ if null x then Nothing else Just x],b)) x help
where names = map return short ++ long
| 563
|
convert :: String -> [OptDescr a] -> Mode ([a],[String])
convert help flags = mode "program" ([],[]) help args (map f flags)
where
args = flagArg (\x (a,b) -> Right (a,b++[x])) "ARG"
f (Option short long x help) = case x of
NoArg x -> flagNone names (\(a,b) -> (a++[x],b)) help
ReqArg op x -> flagReq names (\x (a,b) -> Right (a++[op x],b)) x help
OptArg op x -> flagOpt "" names (\x (a,b) -> Right (a++[op $ if null x then Nothing else Just x],b)) x help
where names = map return short ++ long
| 563
|
convert help flags = mode "program" ([],[]) help args (map f flags)
where
args = flagArg (\x (a,b) -> Right (a,b++[x])) "ARG"
f (Option short long x help) = case x of
NoArg x -> flagNone names (\(a,b) -> (a++[x],b)) help
ReqArg op x -> flagReq names (\x (a,b) -> Right (a++[op x],b)) x help
OptArg op x -> flagOpt "" names (\x (a,b) -> Right (a++[op $ if null x then Nothing else Just x],b)) x help
where names = map return short ++ long
| 506
| false
| true
| 0
| 19
| 164
| 328
| 175
| 153
| null | null |
brodyberg/LearnHaskell
|
CaesarCypher.hsproj/StateMonad.hs
|
mit
|
peek :: ST Char -> Char
peek (S x) =
answer
where (answer,_) = x 3
--peek :: ST String -> String
--peek (S [])
-- Given an S (...)
-- And a State (Int)
-- Return a tuple of that Int and a State
-- I think all this does is APPLY the
-- function inside of S (aka st) to the
-- value x
| 294
|
peek :: ST Char -> Char
peek (S x) =
answer
where (answer,_) = x 3
--peek :: ST String -> String
--peek (S [])
-- Given an S (...)
-- And a State (Int)
-- Return a tuple of that Int and a State
-- I think all this does is APPLY the
-- function inside of S (aka st) to the
-- value x
| 294
|
peek (S x) =
answer
where (answer,_) = x 3
--peek :: ST String -> String
--peek (S [])
-- Given an S (...)
-- And a State (Int)
-- Return a tuple of that Int and a State
-- I think all this does is APPLY the
-- function inside of S (aka st) to the
-- value x
| 270
| false
| true
| 0
| 6
| 77
| 56
| 31
| 25
| null | null |
rolph-recto/liquid-fixpoint
|
src/Language/Fixpoint/Smt/Theories.hs
|
bsd-3-clause
|
smt2Sort :: Sort -> Maybe T.Text
smt2Sort (FApp (FTC c) _)
| fTyconSymbol c == "Set_Set" = Just $ format "{}" (Only set)
| 122
|
smt2Sort :: Sort -> Maybe T.Text
smt2Sort (FApp (FTC c) _)
| fTyconSymbol c == "Set_Set" = Just $ format "{}" (Only set)
| 122
|
smt2Sort (FApp (FTC c) _)
| fTyconSymbol c == "Set_Set" = Just $ format "{}" (Only set)
| 89
| false
| true
| 0
| 9
| 24
| 65
| 30
| 35
| null | null |
4e6/sandbox
|
haskell/HackerRank/DataStructures/Divisibility.hs
|
mit
|
slice :: Integral a => Int -> a -> a -> a -> a
slice s x b e = let b' = fromIntegral s - b + 1
e' = fromIntegral s - e
in quot (mod x (10^b')) (10^e')
| 186
|
slice :: Integral a => Int -> a -> a -> a -> a
slice s x b e = let b' = fromIntegral s - b + 1
e' = fromIntegral s - e
in quot (mod x (10^b')) (10^e')
| 186
|
slice s x b e = let b' = fromIntegral s - b + 1
e' = fromIntegral s - e
in quot (mod x (10^b')) (10^e')
| 139
| false
| true
| 0
| 11
| 76
| 104
| 51
| 53
| null | null |
poxu/pandoc
|
src/Text/Pandoc/Readers/Docx.hs
|
gpl-2.0
|
isMetaPar _ = False
| 19
|
isMetaPar _ = False
| 19
|
isMetaPar _ = False
| 19
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
andorp/category-test-laws
|
src/Control/Category/Hask/Universal.hs
|
bsd-3-clause
|
-- There exist only one morphism from the initial object to any other object
-- NOTE: The uniqueness of this function can not be tested via the quickcheck
uniqueInitial :: Initial -> a
uniqueInitial = \case
| 206
|
uniqueInitial :: Initial -> a
uniqueInitial = \case
| 51
|
uniqueInitial = \case
| 21
| true
| true
| 0
| 5
| 35
| 18
| 11
| 7
| null | null |
meteficha/skein
|
tests/runtests.hs
|
bsd-3-clause
|
main :: IO ()
main = do
skein_golden_kat_txt <- getDataFileName ("tests" </> "skein_golden_kat.txt")
kats <- parseKats <$> readFile skein_golden_kat_txt
putStrLn $ "Parsed " ++ show (length kats) ++ " known answer tests"
hspec $ do
describe "Skein golden known answer tests" $ do
skeinKats kats (undefined :: Skein_512_512)
skeinKats kats (undefined :: Skein_1024_1024)
skeinKats kats (undefined :: Skein_256_256)
skeinKats kats (undefined :: Skein_256_128)
skeinKats kats (undefined :: Skein_256_160)
skeinKats kats (undefined :: Skein_256_224)
skeinKats kats (undefined :: Skein_512_128)
skeinKats kats (undefined :: Skein_512_160)
skeinKats kats (undefined :: Skein_512_224)
skeinKats kats (undefined :: Skein_512_256)
skeinKats kats (undefined :: Skein_512_384)
skeinKats kats (undefined :: Skein_1024_384)
skeinKats kats (undefined :: Skein_1024_512)
| 1,015
|
main :: IO ()
main = do
skein_golden_kat_txt <- getDataFileName ("tests" </> "skein_golden_kat.txt")
kats <- parseKats <$> readFile skein_golden_kat_txt
putStrLn $ "Parsed " ++ show (length kats) ++ " known answer tests"
hspec $ do
describe "Skein golden known answer tests" $ do
skeinKats kats (undefined :: Skein_512_512)
skeinKats kats (undefined :: Skein_1024_1024)
skeinKats kats (undefined :: Skein_256_256)
skeinKats kats (undefined :: Skein_256_128)
skeinKats kats (undefined :: Skein_256_160)
skeinKats kats (undefined :: Skein_256_224)
skeinKats kats (undefined :: Skein_512_128)
skeinKats kats (undefined :: Skein_512_160)
skeinKats kats (undefined :: Skein_512_224)
skeinKats kats (undefined :: Skein_512_256)
skeinKats kats (undefined :: Skein_512_384)
skeinKats kats (undefined :: Skein_1024_384)
skeinKats kats (undefined :: Skein_1024_512)
| 1,015
|
main = do
skein_golden_kat_txt <- getDataFileName ("tests" </> "skein_golden_kat.txt")
kats <- parseKats <$> readFile skein_golden_kat_txt
putStrLn $ "Parsed " ++ show (length kats) ++ " known answer tests"
hspec $ do
describe "Skein golden known answer tests" $ do
skeinKats kats (undefined :: Skein_512_512)
skeinKats kats (undefined :: Skein_1024_1024)
skeinKats kats (undefined :: Skein_256_256)
skeinKats kats (undefined :: Skein_256_128)
skeinKats kats (undefined :: Skein_256_160)
skeinKats kats (undefined :: Skein_256_224)
skeinKats kats (undefined :: Skein_512_128)
skeinKats kats (undefined :: Skein_512_160)
skeinKats kats (undefined :: Skein_512_224)
skeinKats kats (undefined :: Skein_512_256)
skeinKats kats (undefined :: Skein_512_384)
skeinKats kats (undefined :: Skein_1024_384)
skeinKats kats (undefined :: Skein_1024_512)
| 1,001
| false
| true
| 0
| 15
| 267
| 276
| 132
| 144
| null | null |
cglazner/ibd_particle
|
src/ParseMorg.hs
|
bsd-3-clause
|
regularLine :: Parser (String, String)
regularLine = let snip xs = (unwords $ init $ words xs, last $ words xs)
in snip <$> (optional (myRes "set") *> lineBody)
| 178
|
regularLine :: Parser (String, String)
regularLine = let snip xs = (unwords $ init $ words xs, last $ words xs)
in snip <$> (optional (myRes "set") *> lineBody)
| 178
|
regularLine = let snip xs = (unwords $ init $ words xs, last $ words xs)
in snip <$> (optional (myRes "set") *> lineBody)
| 139
| false
| true
| 0
| 13
| 46
| 84
| 40
| 44
| null | null |
etu-fkti5301-bgu/alt-exam_automated_theorem_proving
|
src/FormulaSyn.hs
|
bsd-3-clause
|
(≤) :: Term -> Term -> Formula
s ≤ t = Atom $ R "≤" [s, t]
| 58
|
(≤) :: Term -> Term -> Formula
s ≤ t = Atom $ R "≤" [s, t]
| 58
|
s ≤ t = Atom $ R "≤" [s, t]
| 27
| false
| true
| 2
| 9
| 16
| 48
| 23
| 25
| null | null |
adnelson/nix-binary-cache
|
src/Nix/Derivation/Parser.hs
|
mit
|
-- | Parse a derivation file given its store prefix.
parseDerivFromPrefix :: StorePrefix -> IO Derivation
parseDerivFromPrefix (StorePrefix prefix) = do
parseDerivFromPath' =<< findSpByPrefix prefix
| 200
|
parseDerivFromPrefix :: StorePrefix -> IO Derivation
parseDerivFromPrefix (StorePrefix prefix) = do
parseDerivFromPath' =<< findSpByPrefix prefix
| 147
|
parseDerivFromPrefix (StorePrefix prefix) = do
parseDerivFromPath' =<< findSpByPrefix prefix
| 94
| true
| true
| 0
| 8
| 26
| 42
| 19
| 23
| null | null |
spacekitteh/smcghc
|
compiler/utils/Binary.hs
|
bsd-3-clause
|
isEOFBin :: BinHandle -> IO Bool
isEOFBin (BinMem _ ix_r sz_r _) = do
ix <- readFastMutInt ix_r
sz <- readFastMutInt sz_r
return (ix >= sz)
| 145
|
isEOFBin :: BinHandle -> IO Bool
isEOFBin (BinMem _ ix_r sz_r _) = do
ix <- readFastMutInt ix_r
sz <- readFastMutInt sz_r
return (ix >= sz)
| 145
|
isEOFBin (BinMem _ ix_r sz_r _) = do
ix <- readFastMutInt ix_r
sz <- readFastMutInt sz_r
return (ix >= sz)
| 112
| false
| true
| 0
| 10
| 31
| 71
| 31
| 40
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.