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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pbevin/toycss | src/html/GenHtml.hs | gpl-2.0 | subNodes :: NodeName -> [NodeName]
subNodes "body" = flowNodes | 62 | subNodes :: NodeName -> [NodeName]
subNodes "body" = flowNodes | 62 | subNodes "body" = flowNodes | 27 | false | true | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
danidiaz/lens | src/Control/Lens/Plated.hs | bsd-3-clause | -------------------------------------------------------------------------------
-- Children
-------------------------------------------------------------------------------
-- | Extract the immediate descendants of a 'Plated' container.
--
-- @
-- 'children' ≡ 'toListOf' 'plate'
-- @
children :: Plated a => a -> [a]
children = toListOf plate | 343 | children :: Plated a => a -> [a]
children = toListOf plate | 58 | children = toListOf plate | 25 | true | true | 0 | 7 | 36 | 36 | 22 | 14 | null | null |
zlqhem/crest-fcoverage | Fcoverage.hs | mit | int = read :: String -> Int | 27 | int = read :: String -> Int | 27 | int = read :: String -> Int | 27 | false | false | 1 | 5 | 6 | 15 | 7 | 8 | null | null |
tjakway/ghcjvm | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | idRuleVars ::Id -> VarSet -- Does *not* include CoreUnfolding vars
idRuleVars id = fvVarSet $ idRuleFVs id | 107 | idRuleVars ::Id -> VarSet
idRuleVars id = fvVarSet $ idRuleFVs id | 65 | idRuleVars id = fvVarSet $ idRuleFVs id | 39 | true | true | 0 | 6 | 17 | 26 | 13 | 13 | null | null |
llscm0202/BIGDATA2017 | ATIVIDADE1/exerciciosListas/ex8.hs | gpl-3.0 | collatz::Int->Int
collatz x
| x `mod` 2 == 0 = x `div` 2
| otherwise = 3*x+1 | 82 | collatz::Int->Int
collatz x
| x `mod` 2 == 0 = x `div` 2
| otherwise = 3*x+1 | 82 | collatz x
| x `mod` 2 == 0 = x `div` 2
| otherwise = 3*x+1 | 64 | false | true | 1 | 9 | 22 | 56 | 29 | 27 | null | null |
lensky/hs-tensor | lib/Data/Tensor/Slice.hs | mit | slModScheme All cstep = Just (0, cstep) | 39 | slModScheme All cstep = Just (0, cstep) | 39 | slModScheme All cstep = Just (0, cstep) | 39 | false | false | 0 | 6 | 6 | 20 | 10 | 10 | null | null |
silky/DanceView | src/Main.hs | bsd-3-clause | getFrames :: Options -> IO [Frame Person]
getFrames opts = go (sourceDirectory opts) (sourceJson opts)
where
go Nothing Nothing = error "Need to specify a source"
go (Just dir) _ = fromScratch dir
go _ (Just file) = fmap munge (readJson file)
munge :: [Frame Skeleton2D] -> [Frame Person]
munge = map f
where
f fsk = Frame (map fromSkeleton (getField @"people" fsk))
(getField @"frameNumber" fsk)
-- | Load from a bunch of JSON files without additional data
fromScratch dir = do
jsonFiles <- find (depth ==? 0) (extension ==? ".json") dir
frameDatas :: [FrameData PersonData] <- mapM readJson jsonFiles
let fds :: [FrameData Person]
fds = map g frameDatas
g fd = FrameData (zipWith ((. (Person [] . show)) . smash) (getField @"people" fd) [(1 :: Integer)..])
-- | Munge them into frames with frame numbers.
frames' :: [Frame Person]
frames' = zipWith (flip smash . Frame []) [1..] fds
return frames' | 1,196 | getFrames :: Options -> IO [Frame Person]
getFrames opts = go (sourceDirectory opts) (sourceJson opts)
where
go Nothing Nothing = error "Need to specify a source"
go (Just dir) _ = fromScratch dir
go _ (Just file) = fmap munge (readJson file)
munge :: [Frame Skeleton2D] -> [Frame Person]
munge = map f
where
f fsk = Frame (map fromSkeleton (getField @"people" fsk))
(getField @"frameNumber" fsk)
-- | Load from a bunch of JSON files without additional data
fromScratch dir = do
jsonFiles <- find (depth ==? 0) (extension ==? ".json") dir
frameDatas :: [FrameData PersonData] <- mapM readJson jsonFiles
let fds :: [FrameData Person]
fds = map g frameDatas
g fd = FrameData (zipWith ((. (Person [] . show)) . smash) (getField @"people" fd) [(1 :: Integer)..])
-- | Munge them into frames with frame numbers.
frames' :: [Frame Person]
frames' = zipWith (flip smash . Frame []) [1..] fds
return frames' | 1,196 | getFrames opts = go (sourceDirectory opts) (sourceJson opts)
where
go Nothing Nothing = error "Need to specify a source"
go (Just dir) _ = fromScratch dir
go _ (Just file) = fmap munge (readJson file)
munge :: [Frame Skeleton2D] -> [Frame Person]
munge = map f
where
f fsk = Frame (map fromSkeleton (getField @"people" fsk))
(getField @"frameNumber" fsk)
-- | Load from a bunch of JSON files without additional data
fromScratch dir = do
jsonFiles <- find (depth ==? 0) (extension ==? ".json") dir
frameDatas :: [FrameData PersonData] <- mapM readJson jsonFiles
let fds :: [FrameData Person]
fds = map g frameDatas
g fd = FrameData (zipWith ((. (Person [] . show)) . smash) (getField @"people" fd) [(1 :: Integer)..])
-- | Munge them into frames with frame numbers.
frames' :: [Frame Person]
frames' = zipWith (flip smash . Frame []) [1..] fds
return frames' | 1,154 | false | true | 4 | 20 | 449 | 402 | 187 | 215 | null | null |
adamgundry/units-parser | Tests/Parser.hs | bsd-3-clause | leftOnly (Right _) = Nothing | 28 | leftOnly (Right _) = Nothing | 28 | leftOnly (Right _) = Nothing | 28 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
jepst/CloudHaskell | Remote/Encoding.hs | bsd-3-clause | serializeConstr (CharConstr c) = putWord8 4 >> put c | 54 | serializeConstr (CharConstr c) = putWord8 4 >> put c | 54 | serializeConstr (CharConstr c) = putWord8 4 >> put c | 54 | false | false | 0 | 6 | 10 | 26 | 11 | 15 | null | null |
MoixaEnergy/blaze-react | src/Text/Blaze/Event/Keycode.hs | mit | ightArrow = Keycode 39
| 31 | rightArrow = Keycode 39 | 31 | rightArrow = Keycode 39 | 31 | false | false | 1 | 4 | 12 | 12 | 4 | 8 | null | null |
Courseography/courseography | app/ParserTests/ParserTests.hs | gpl-3.0 | noPrereqInputs :: [(String, Req)]
noPrereqInputs = [
("", NONE)
, ("None", NONE)
, ("none", NONE)
, ("No", NONE)
, ("no", NONE)
] | 155 | noPrereqInputs :: [(String, Req)]
noPrereqInputs = [
("", NONE)
, ("None", NONE)
, ("none", NONE)
, ("No", NONE)
, ("no", NONE)
] | 155 | noPrereqInputs = [
("", NONE)
, ("None", NONE)
, ("none", NONE)
, ("No", NONE)
, ("no", NONE)
] | 121 | false | true | 0 | 8 | 47 | 72 | 43 | 29 | null | null |
snoyberg/ghc | compiler/typecheck/FunDeps.hs | bsd-3-clause | improveClsFD :: [TyVar] -> FunDep TyVar -- One functional dependency from the class
-> ClsInst -- An instance template
-> [Type] -> [Maybe Name] -- Arguments of this (C tys) predicate
-> [([TyCoVar], [Pair Type])] -- Empty or singleton
improveClsFD clas_tvs fd
(ClsInst { is_tvs = qtvs, is_tys = tys_inst, is_tcs = rough_tcs_inst })
tys_actual rough_tcs_actual
-- Compare instance {a,b} C sx sp sy sq
-- with wanted [W] C tx tp ty tq
-- for fundep (x,y -> p,q) from class (C x p y q)
-- If (sx,sy) unifies with (tx,ty), take the subst S
-- 'qtvs' are the quantified type variables, the ones which an be instantiated
-- to make the types match. For example, given
-- class C a b | a->b where ...
-- instance C (Maybe x) (Tree x) where ..
--
-- and a wanted constraint of form (C (Maybe t1) t2),
-- then we will call checkClsFD with
--
-- is_qtvs = {x}, is_tys = [Maybe x, Tree x]
-- tys_actual = [Maybe t1, t2]
--
-- We can instantiate x to t1, and then we want to force
-- (Tree x) [t1/x] ~ t2
| instanceCantMatch rough_tcs_inst rough_tcs_actual
= [] -- Filter out ones that can't possibly match,
| otherwise
= ASSERT2( length tys_inst == length tys_actual &&
length tys_inst == length clas_tvs
, ppr tys_inst <+> ppr tys_actual )
case tcMatchTyKis ltys1 ltys2 of
Nothing -> []
Just subst | isJust (tcMatchTyKisX subst rtys1 rtys2)
-- Don't include any equations that already hold.
-- Reason: then we know if any actual improvement has happened,
-- in which case we need to iterate the solver
-- In making this check we must taking account of the fact that any
-- qtvs that aren't already instantiated can be instantiated to anything
-- at all
-- NB: We can't do this 'is-useful-equation' check element-wise
-- because of:
-- class C a b c | a -> b c
-- instance C Int x x
-- [Wanted] C Int alpha Int
-- We would get that x -> alpha (isJust) and x -> Int (isJust)
-- so we would produce no FDs, which is clearly wrong.
-> []
| null fdeqs
-> []
| otherwise
-> [(meta_tvs, fdeqs)]
-- We could avoid this substTy stuff by producing the eqn
-- (qtvs, ls1++rs1, ls2++rs2)
-- which will re-do the ls1/ls2 unification when the equation is
-- executed. What we're doing instead is recording the partial
-- work of the ls1/ls2 unification leaving a smaller unification problem
where
rtys1' = map (substTyUnchecked subst) rtys1
fdeqs = zipAndComputeFDEqs (\_ _ -> False) rtys1' rtys2
-- Don't discard anything!
-- We could discard equal types but it's an overkill to call
-- eqType again, since we know for sure that /at least one/
-- equation in there is useful)
meta_tvs = [ setVarType tv (substTyUnchecked subst (varType tv))
| tv <- qtvs, tv `notElemTCvSubst` subst ]
-- meta_tvs are the quantified type variables
-- that have not been substituted out
--
-- Eg. class C a b | a -> b
-- instance C Int [y]
-- Given constraint C Int z
-- we generate the equation
-- ({y}, [y], z)
--
-- But note (a) we get them from the dfun_id, so they are *in order*
-- because the kind variables may be mentioned in the
-- type variabes' kinds
-- (b) we must apply 'subst' to the kinds, in case we have
-- matched out a kind variable, but not a type variable
-- whose kind mentions that kind variable!
-- Trac #6015, #6068
where
(ltys1, rtys1) = instFD fd clas_tvs tys_inst
(ltys2, rtys2) = instFD fd clas_tvs tys_actual
{-
%************************************************************************
%* *
The Coverage condition for instance declarations
* *
************************************************************************
Note [Coverage condition]
~~~~~~~~~~~~~~~~~~~~~~~~~
Example
class C a b | a -> b
instance theta => C t1 t2
For the coverage condition, we check
(normal) fv(t2) `subset` fv(t1)
(liberal) fv(t2) `subset` oclose(fv(t1), theta)
The liberal version ensures the self-consistency of the instance, but
it does not guarantee termination. Example:
class Mul a b c | a b -> c where
(.*.) :: a -> b -> c
instance Mul Int Int Int where (.*.) = (*)
instance Mul Int Float Float where x .*. y = fromIntegral x * y
instance Mul a b c => Mul a [b] [c] where x .*. v = map (x.*.) v
In the third instance, it's not the case that fv([c]) `subset` fv(a,[b]).
But it is the case that fv([c]) `subset` oclose( theta, fv(a,[b]) )
But it is a mistake to accept the instance because then this defn:
f = \ b x y -> if b then x .*. [y] else y
makes instance inference go into a loop, because it requires the constraint
Mul a [b] b
-} | 6,116 | improveClsFD :: [TyVar] -> FunDep TyVar -- One functional dependency from the class
-> ClsInst -- An instance template
-> [Type] -> [Maybe Name] -- Arguments of this (C tys) predicate
-> [([TyCoVar], [Pair Type])]
improveClsFD clas_tvs fd
(ClsInst { is_tvs = qtvs, is_tys = tys_inst, is_tcs = rough_tcs_inst })
tys_actual rough_tcs_actual
-- Compare instance {a,b} C sx sp sy sq
-- with wanted [W] C tx tp ty tq
-- for fundep (x,y -> p,q) from class (C x p y q)
-- If (sx,sy) unifies with (tx,ty), take the subst S
-- 'qtvs' are the quantified type variables, the ones which an be instantiated
-- to make the types match. For example, given
-- class C a b | a->b where ...
-- instance C (Maybe x) (Tree x) where ..
--
-- and a wanted constraint of form (C (Maybe t1) t2),
-- then we will call checkClsFD with
--
-- is_qtvs = {x}, is_tys = [Maybe x, Tree x]
-- tys_actual = [Maybe t1, t2]
--
-- We can instantiate x to t1, and then we want to force
-- (Tree x) [t1/x] ~ t2
| instanceCantMatch rough_tcs_inst rough_tcs_actual
= [] -- Filter out ones that can't possibly match,
| otherwise
= ASSERT2( length tys_inst == length tys_actual &&
length tys_inst == length clas_tvs
, ppr tys_inst <+> ppr tys_actual )
case tcMatchTyKis ltys1 ltys2 of
Nothing -> []
Just subst | isJust (tcMatchTyKisX subst rtys1 rtys2)
-- Don't include any equations that already hold.
-- Reason: then we know if any actual improvement has happened,
-- in which case we need to iterate the solver
-- In making this check we must taking account of the fact that any
-- qtvs that aren't already instantiated can be instantiated to anything
-- at all
-- NB: We can't do this 'is-useful-equation' check element-wise
-- because of:
-- class C a b c | a -> b c
-- instance C Int x x
-- [Wanted] C Int alpha Int
-- We would get that x -> alpha (isJust) and x -> Int (isJust)
-- so we would produce no FDs, which is clearly wrong.
-> []
| null fdeqs
-> []
| otherwise
-> [(meta_tvs, fdeqs)]
-- We could avoid this substTy stuff by producing the eqn
-- (qtvs, ls1++rs1, ls2++rs2)
-- which will re-do the ls1/ls2 unification when the equation is
-- executed. What we're doing instead is recording the partial
-- work of the ls1/ls2 unification leaving a smaller unification problem
where
rtys1' = map (substTyUnchecked subst) rtys1
fdeqs = zipAndComputeFDEqs (\_ _ -> False) rtys1' rtys2
-- Don't discard anything!
-- We could discard equal types but it's an overkill to call
-- eqType again, since we know for sure that /at least one/
-- equation in there is useful)
meta_tvs = [ setVarType tv (substTyUnchecked subst (varType tv))
| tv <- qtvs, tv `notElemTCvSubst` subst ]
-- meta_tvs are the quantified type variables
-- that have not been substituted out
--
-- Eg. class C a b | a -> b
-- instance C Int [y]
-- Given constraint C Int z
-- we generate the equation
-- ({y}, [y], z)
--
-- But note (a) we get them from the dfun_id, so they are *in order*
-- because the kind variables may be mentioned in the
-- type variabes' kinds
-- (b) we must apply 'subst' to the kinds, in case we have
-- matched out a kind variable, but not a type variable
-- whose kind mentions that kind variable!
-- Trac #6015, #6068
where
(ltys1, rtys1) = instFD fd clas_tvs tys_inst
(ltys2, rtys2) = instFD fd clas_tvs tys_actual
{-
%************************************************************************
%* *
The Coverage condition for instance declarations
* *
************************************************************************
Note [Coverage condition]
~~~~~~~~~~~~~~~~~~~~~~~~~
Example
class C a b | a -> b
instance theta => C t1 t2
For the coverage condition, we check
(normal) fv(t2) `subset` fv(t1)
(liberal) fv(t2) `subset` oclose(fv(t1), theta)
The liberal version ensures the self-consistency of the instance, but
it does not guarantee termination. Example:
class Mul a b c | a b -> c where
(.*.) :: a -> b -> c
instance Mul Int Int Int where (.*.) = (*)
instance Mul Int Float Float where x .*. y = fromIntegral x * y
instance Mul a b c => Mul a [b] [c] where x .*. v = map (x.*.) v
In the third instance, it's not the case that fv([c]) `subset` fv(a,[b]).
But it is the case that fv([c]) `subset` oclose( theta, fv(a,[b]) )
But it is a mistake to accept the instance because then this defn:
f = \ b x y -> if b then x .*. [y] else y
makes instance inference go into a loop, because it requires the constraint
Mul a [b] b
-} | 6,093 | improveClsFD clas_tvs fd
(ClsInst { is_tvs = qtvs, is_tys = tys_inst, is_tcs = rough_tcs_inst })
tys_actual rough_tcs_actual
-- Compare instance {a,b} C sx sp sy sq
-- with wanted [W] C tx tp ty tq
-- for fundep (x,y -> p,q) from class (C x p y q)
-- If (sx,sy) unifies with (tx,ty), take the subst S
-- 'qtvs' are the quantified type variables, the ones which an be instantiated
-- to make the types match. For example, given
-- class C a b | a->b where ...
-- instance C (Maybe x) (Tree x) where ..
--
-- and a wanted constraint of form (C (Maybe t1) t2),
-- then we will call checkClsFD with
--
-- is_qtvs = {x}, is_tys = [Maybe x, Tree x]
-- tys_actual = [Maybe t1, t2]
--
-- We can instantiate x to t1, and then we want to force
-- (Tree x) [t1/x] ~ t2
| instanceCantMatch rough_tcs_inst rough_tcs_actual
= [] -- Filter out ones that can't possibly match,
| otherwise
= ASSERT2( length tys_inst == length tys_actual &&
length tys_inst == length clas_tvs
, ppr tys_inst <+> ppr tys_actual )
case tcMatchTyKis ltys1 ltys2 of
Nothing -> []
Just subst | isJust (tcMatchTyKisX subst rtys1 rtys2)
-- Don't include any equations that already hold.
-- Reason: then we know if any actual improvement has happened,
-- in which case we need to iterate the solver
-- In making this check we must taking account of the fact that any
-- qtvs that aren't already instantiated can be instantiated to anything
-- at all
-- NB: We can't do this 'is-useful-equation' check element-wise
-- because of:
-- class C a b c | a -> b c
-- instance C Int x x
-- [Wanted] C Int alpha Int
-- We would get that x -> alpha (isJust) and x -> Int (isJust)
-- so we would produce no FDs, which is clearly wrong.
-> []
| null fdeqs
-> []
| otherwise
-> [(meta_tvs, fdeqs)]
-- We could avoid this substTy stuff by producing the eqn
-- (qtvs, ls1++rs1, ls2++rs2)
-- which will re-do the ls1/ls2 unification when the equation is
-- executed. What we're doing instead is recording the partial
-- work of the ls1/ls2 unification leaving a smaller unification problem
where
rtys1' = map (substTyUnchecked subst) rtys1
fdeqs = zipAndComputeFDEqs (\_ _ -> False) rtys1' rtys2
-- Don't discard anything!
-- We could discard equal types but it's an overkill to call
-- eqType again, since we know for sure that /at least one/
-- equation in there is useful)
meta_tvs = [ setVarType tv (substTyUnchecked subst (varType tv))
| tv <- qtvs, tv `notElemTCvSubst` subst ]
-- meta_tvs are the quantified type variables
-- that have not been substituted out
--
-- Eg. class C a b | a -> b
-- instance C Int [y]
-- Given constraint C Int z
-- we generate the equation
-- ({y}, [y], z)
--
-- But note (a) we get them from the dfun_id, so they are *in order*
-- because the kind variables may be mentioned in the
-- type variabes' kinds
-- (b) we must apply 'subst' to the kinds, in case we have
-- matched out a kind variable, but not a type variable
-- whose kind mentions that kind variable!
-- Trac #6015, #6068
where
(ltys1, rtys1) = instFD fd clas_tvs tys_inst
(ltys2, rtys2) = instFD fd clas_tvs tys_actual
{-
%************************************************************************
%* *
The Coverage condition for instance declarations
* *
************************************************************************
Note [Coverage condition]
~~~~~~~~~~~~~~~~~~~~~~~~~
Example
class C a b | a -> b
instance theta => C t1 t2
For the coverage condition, we check
(normal) fv(t2) `subset` fv(t1)
(liberal) fv(t2) `subset` oclose(fv(t1), theta)
The liberal version ensures the self-consistency of the instance, but
it does not guarantee termination. Example:
class Mul a b c | a b -> c where
(.*.) :: a -> b -> c
instance Mul Int Int Int where (.*.) = (*)
instance Mul Int Float Float where x .*. y = fromIntegral x * y
instance Mul a b c => Mul a [b] [c] where x .*. v = map (x.*.) v
In the third instance, it's not the case that fv([c]) `subset` fv(a,[b]).
But it is the case that fv([c]) `subset` oclose( theta, fv(a,[b]) )
But it is a mistake to accept the instance because then this defn:
f = \ b x y -> if b then x .*. [y] else y
makes instance inference go into a loop, because it requires the constraint
Mul a [b] b
-} | 5,814 | true | true | 4 | 13 | 2,507 | 421 | 246 | 175 | null | null |
mikeizbicki/typeparams | examples/supercomp-lebesgue.hs | bsd-3-clause | -- | criterion configuration parameters
critConfig = Criterion.defaultConfig
{ Criterion.cfgPerformGC = Criterion.ljust True
, Criterion.cfgSamples = Criterion.ljust 30
-- , cfgSummaryFile = ljust $ "results/summary-"++show veclen++"-"++show numvec++".csv"
-- , cfgReport = ljust "report.html"
} | 327 | critConfig = Criterion.defaultConfig
{ Criterion.cfgPerformGC = Criterion.ljust True
, Criterion.cfgSamples = Criterion.ljust 30
-- , cfgSummaryFile = ljust $ "results/summary-"++show veclen++"-"++show numvec++".csv"
-- , cfgReport = ljust "report.html"
} | 287 | critConfig = Criterion.defaultConfig
{ Criterion.cfgPerformGC = Criterion.ljust True
, Criterion.cfgSamples = Criterion.ljust 30
-- , cfgSummaryFile = ljust $ "results/summary-"++show veclen++"-"++show numvec++".csv"
-- , cfgReport = ljust "report.html"
} | 287 | true | false | 0 | 9 | 65 | 43 | 23 | 20 | null | null |
elben/typing-haskell-in-haskell | StaticPrelude.hs | bsd-3-clause | succMfun
= "succ" :>: (Forall [Star]
([isIn1 cEnum (TGen 0)] :=> (TGen 0 `fn` TGen 0))) | 106 | succMfun
= "succ" :>: (Forall [Star]
([isIn1 cEnum (TGen 0)] :=> (TGen 0 `fn` TGen 0))) | 106 | succMfun
= "succ" :>: (Forall [Star]
([isIn1 cEnum (TGen 0)] :=> (TGen 0 `fn` TGen 0))) | 106 | false | false | 1 | 14 | 34 | 61 | 30 | 31 | null | null |
yousufmsoliman/music | Source (Haskell)/Voice.hs | gpl-3.0 | numBefore = length' . context | 29 | numBefore = length' . context | 29 | numBefore = length' . context | 29 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
pbrisbin/toml-parse | src/Text/Toml/Parser.hs | bsd-3-clause | allSame ((TArray{}):xs) = allArray xs | 37 | allSame ((TArray{}):xs) = allArray xs | 37 | allSame ((TArray{}):xs) = allArray xs | 37 | false | false | 0 | 8 | 4 | 27 | 13 | 14 | null | null |
chengzh2008/hpffp | src/ch24-Parser/parseConfig.hs | bsd-3-clause | main :: IO ()
main = hspec $ do
describe "Assignment Parsing" $
it "can parse a simple assignment" $ do
let m = parseByteString parseAssignments mempty assignmentEx
r' = maybeSuccess m
print m
r' `shouldBe` Just ("woot", "1")
describe "Header Parsing" $
it "can parse a heade r" $ do
let m = parseByteString parseHeader mempty headerEx
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Header Parsing" $
it "can parse a simple header" $ do
let m = parseByteString parseHeader mempty headerEx
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Comment parsing" $
it "can skip a comment beforer a header" $ do
let p = skipComments >> parseHeader
i = "; woot\n[blah]"
m = parseByteString p mempty i
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Section parsing" $
it "Can parse a simple section" $ do
let m = parseByteString parseSection mempty sectionEx
r' = maybeSuccess m
states = M.fromList [("Chris", "Texas")]
expected' = Just (Section (Header "states") states)
print m
r' `shouldBe` expected'
describe "INI parsing" $
it "Can parse ultiple sections" $ do
let m = parseByteString parseIni mempty sectionEx''
r' = maybeSuccess m
sectionValues = M.fromList [ ("alias", "claw")
, ("host", "wikipedia.org")]
whatisitValues = M.fromList [ ("red", "intoothandclaw")]
expected' = Just $ Config $
M.fromList [ (Header "section", sectionValues)
, (Header "whatisit", whatisitValues)]
print m
r' `shouldBe` expected' | 1,842 | main :: IO ()
main = hspec $ do
describe "Assignment Parsing" $
it "can parse a simple assignment" $ do
let m = parseByteString parseAssignments mempty assignmentEx
r' = maybeSuccess m
print m
r' `shouldBe` Just ("woot", "1")
describe "Header Parsing" $
it "can parse a heade r" $ do
let m = parseByteString parseHeader mempty headerEx
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Header Parsing" $
it "can parse a simple header" $ do
let m = parseByteString parseHeader mempty headerEx
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Comment parsing" $
it "can skip a comment beforer a header" $ do
let p = skipComments >> parseHeader
i = "; woot\n[blah]"
m = parseByteString p mempty i
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Section parsing" $
it "Can parse a simple section" $ do
let m = parseByteString parseSection mempty sectionEx
r' = maybeSuccess m
states = M.fromList [("Chris", "Texas")]
expected' = Just (Section (Header "states") states)
print m
r' `shouldBe` expected'
describe "INI parsing" $
it "Can parse ultiple sections" $ do
let m = parseByteString parseIni mempty sectionEx''
r' = maybeSuccess m
sectionValues = M.fromList [ ("alias", "claw")
, ("host", "wikipedia.org")]
whatisitValues = M.fromList [ ("red", "intoothandclaw")]
expected' = Just $ Config $
M.fromList [ (Header "section", sectionValues)
, (Header "whatisit", whatisitValues)]
print m
r' `shouldBe` expected' | 1,842 | main = hspec $ do
describe "Assignment Parsing" $
it "can parse a simple assignment" $ do
let m = parseByteString parseAssignments mempty assignmentEx
r' = maybeSuccess m
print m
r' `shouldBe` Just ("woot", "1")
describe "Header Parsing" $
it "can parse a heade r" $ do
let m = parseByteString parseHeader mempty headerEx
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Header Parsing" $
it "can parse a simple header" $ do
let m = parseByteString parseHeader mempty headerEx
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Comment parsing" $
it "can skip a comment beforer a header" $ do
let p = skipComments >> parseHeader
i = "; woot\n[blah]"
m = parseByteString p mempty i
r' = maybeSuccess m
print m
r' `shouldBe` Just (Header "blah")
describe "Section parsing" $
it "Can parse a simple section" $ do
let m = parseByteString parseSection mempty sectionEx
r' = maybeSuccess m
states = M.fromList [("Chris", "Texas")]
expected' = Just (Section (Header "states") states)
print m
r' `shouldBe` expected'
describe "INI parsing" $
it "Can parse ultiple sections" $ do
let m = parseByteString parseIni mempty sectionEx''
r' = maybeSuccess m
sectionValues = M.fromList [ ("alias", "claw")
, ("host", "wikipedia.org")]
whatisitValues = M.fromList [ ("red", "intoothandclaw")]
expected' = Just $ Config $
M.fromList [ (Header "section", sectionValues)
, (Header "whatisit", whatisitValues)]
print m
r' `shouldBe` expected' | 1,828 | false | true | 0 | 18 | 597 | 536 | 258 | 278 | null | null |
ziman/idris-py | src/IRTS/CodegenPython.hs | bsd-3-clause | cgPrim (LIntFloat _) = cgPFun "float" | 37 | cgPrim (LIntFloat _) = cgPFun "float" | 37 | cgPrim (LIntFloat _) = cgPFun "float" | 37 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
oldmanmike/ghc | compiler/llvmGen/LlvmCodeGen/Base.hs | bsd-3-clause | -- | Allocate a new global unnamed metadata identifier
getMetaUniqueId :: LlvmM Int
getMetaUniqueId = LlvmM $ \env -> return (envFreshMeta env, env { envFreshMeta = envFreshMeta env + 1}) | 187 | getMetaUniqueId :: LlvmM Int
getMetaUniqueId = LlvmM $ \env -> return (envFreshMeta env, env { envFreshMeta = envFreshMeta env + 1}) | 132 | getMetaUniqueId = LlvmM $ \env -> return (envFreshMeta env, env { envFreshMeta = envFreshMeta env + 1}) | 103 | true | true | 0 | 12 | 29 | 51 | 27 | 24 | null | null |
aquatir/remember_java_api | code-sample-haskell/hello_world/func_magic/monads.hs | mit | monadReturn = return "WHAT" :: Maybe String | 43 | monadReturn = return "WHAT" :: Maybe String | 43 | monadReturn = return "WHAT" :: Maybe String | 43 | false | false | 2 | 4 | 6 | 16 | 7 | 9 | null | null |
GaloisInc/halvm-ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprParendLExpr :: OutputableBndr id => LHsExpr id -> SDoc
pprParendLExpr (L _ e) = pprParendExpr e | 98 | pprParendLExpr :: OutputableBndr id => LHsExpr id -> SDoc
pprParendLExpr (L _ e) = pprParendExpr e | 98 | pprParendLExpr (L _ e) = pprParendExpr e | 40 | false | true | 0 | 7 | 15 | 39 | 18 | 21 | null | null |
cordawyn/rdf4h | testsuite/tests/W3C/TurtleTest.hs | bsd-3-clause | suiteFilesDir :: T.Text
suiteFilesDir = "data/w3c/turtle/TurtleTests/" | 70 | suiteFilesDir :: T.Text
suiteFilesDir = "data/w3c/turtle/TurtleTests/" | 70 | suiteFilesDir = "data/w3c/turtle/TurtleTests/" | 46 | false | true | 0 | 5 | 5 | 13 | 7 | 6 | null | null |
DavidAlphaFox/ghc | utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-3-clause | latexStripTrailingWhitespace :: Doc a -> Doc a
latexStripTrailingWhitespace (DocString s)
| null s' = DocEmpty
| otherwise = DocString s
where s' = reverse (dropWhile isSpace (reverse s)) | 195 | latexStripTrailingWhitespace :: Doc a -> Doc a
latexStripTrailingWhitespace (DocString s)
| null s' = DocEmpty
| otherwise = DocString s
where s' = reverse (dropWhile isSpace (reverse s)) | 195 | latexStripTrailingWhitespace (DocString s)
| null s' = DocEmpty
| otherwise = DocString s
where s' = reverse (dropWhile isSpace (reverse s)) | 148 | false | true | 1 | 9 | 35 | 74 | 34 | 40 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/HscMain.hs | bsd-3-clause | -- | Rename and typecheck a module, additionally returning the renamed syntax
hscTypecheckRename :: HscEnv -> ModSummary -> HsParsedModule
-> IO (TcGblEnv, RenamedStuff)
hscTypecheckRename hsc_env mod_summary rdr_module = runHsc hsc_env $ do
tc_result <- tcRnModule' hsc_env mod_summary True rdr_module
-- This 'do' is in the Maybe monad!
let rn_info = do decl <- tcg_rn_decls tc_result
let imports = tcg_rn_imports tc_result
exports = tcg_rn_exports tc_result
doc_hdr = tcg_doc_hdr tc_result
return (decl,imports,exports,doc_hdr)
return (tc_result, rn_info)
-- wrapper around tcRnModule to handle safe haskell extras | 751 | hscTypecheckRename :: HscEnv -> ModSummary -> HsParsedModule
-> IO (TcGblEnv, RenamedStuff)
hscTypecheckRename hsc_env mod_summary rdr_module = runHsc hsc_env $ do
tc_result <- tcRnModule' hsc_env mod_summary True rdr_module
-- This 'do' is in the Maybe monad!
let rn_info = do decl <- tcg_rn_decls tc_result
let imports = tcg_rn_imports tc_result
exports = tcg_rn_exports tc_result
doc_hdr = tcg_doc_hdr tc_result
return (decl,imports,exports,doc_hdr)
return (tc_result, rn_info)
-- wrapper around tcRnModule to handle safe haskell extras | 673 | hscTypecheckRename hsc_env mod_summary rdr_module = runHsc hsc_env $ do
tc_result <- tcRnModule' hsc_env mod_summary True rdr_module
-- This 'do' is in the Maybe monad!
let rn_info = do decl <- tcg_rn_decls tc_result
let imports = tcg_rn_imports tc_result
exports = tcg_rn_exports tc_result
doc_hdr = tcg_doc_hdr tc_result
return (decl,imports,exports,doc_hdr)
return (tc_result, rn_info)
-- wrapper around tcRnModule to handle safe haskell extras | 562 | true | true | 0 | 16 | 215 | 142 | 70 | 72 | null | null |
sebastiaanvisser/generic-binary | src/Data/Binary/Generic.hs | bsd-3-clause | encode :: (Generic a, GBinary (Rep a)) => a -> ByteString
encode = runPut . put | 79 | encode :: (Generic a, GBinary (Rep a)) => a -> ByteString
encode = runPut . put | 79 | encode = runPut . put | 21 | false | true | 1 | 9 | 15 | 48 | 22 | 26 | null | null |
stumped2/school | CS381/hw1/Hw1.hs | apache-2.0 | -- c)
steps :: Int -> Cmd
steps 0 = foldr1 Seq [Pen Up, MoveTo (I 0) (I 0)] | 76 | steps :: Int -> Cmd
steps 0 = foldr1 Seq [Pen Up, MoveTo (I 0) (I 0)] | 70 | steps 0 = foldr1 Seq [Pen Up, MoveTo (I 0) (I 0)] | 50 | true | true | 0 | 9 | 19 | 55 | 26 | 29 | null | null |
PuZZleDucK/Hls | Hpwd.hs | gpl-3.0 | showVersion :: DefaultOptions -> String
showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText)
| otherwise = "" | 154 | showVersion :: DefaultOptions -> String
showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText)
| otherwise = "" | 154 | showVersion opts | (displayVersion opts) = concat (intersperse "\n" versionText)
| otherwise = "" | 114 | false | true | 0 | 9 | 35 | 50 | 23 | 27 | null | null |
enolan/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPDeclFC f g (PNamespace ns fc decls) =
PNamespace ns (f fc) (map (mapPDeclFC f g) decls) | 95 | mapPDeclFC f g (PNamespace ns fc decls) =
PNamespace ns (f fc) (map (mapPDeclFC f g) decls) | 95 | mapPDeclFC f g (PNamespace ns fc decls) =
PNamespace ns (f fc) (map (mapPDeclFC f g) decls) | 95 | false | false | 0 | 9 | 20 | 57 | 25 | 32 | null | null |
brenov/set | interpreter/Types.hs | mit | getValue (Bool value _) = show value | 37 | getValue (Bool value _) = show value | 37 | getValue (Bool value _) = show value | 37 | false | false | 0 | 7 | 7 | 20 | 9 | 11 | null | null |
karamellpelle/MEnv | source/OpenGL/IOS/Values.hs | bsd-2-clause | gl_POINTS :: GLenum
gl_POINTS = 0x0000 | 60 | gl_POINTS :: GLenum
gl_POINTS = 0x0000 | 60 | gl_POINTS = 0x0000 | 40 | false | true | 0 | 4 | 27 | 11 | 6 | 5 | null | null |
kumasento/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen.hs | bsd-3-clause | codegenConst (PairTuple ty1 ty0) (cs,c) = codegenConst ty1 cs ++ codegenConst ty0 c | 83 | codegenConst (PairTuple ty1 ty0) (cs,c) = codegenConst ty1 cs ++ codegenConst ty0 c | 83 | codegenConst (PairTuple ty1 ty0) (cs,c) = codegenConst ty1 cs ++ codegenConst ty0 c | 83 | false | false | 0 | 7 | 12 | 39 | 19 | 20 | null | null |
ygale/yesod | yesod-core/Yesod/Core/Class/Yesod.hs | mit | defaultErrorHandler (InvalidArgs ia) = selectRep $ do
provideRep $ defaultLayout $ do
setTitle "Invalid Arguments"
toWidget [hamlet|
<h1>Invalid Arguments
<ul>
$forall msg <- ia
<li>#{msg}
|]
provideRep $ return $ object ["message" .= ("Invalid Arguments" :: Text), "errors" .= ia] | 373 | defaultErrorHandler (InvalidArgs ia) = selectRep $ do
provideRep $ defaultLayout $ do
setTitle "Invalid Arguments"
toWidget [hamlet|
<h1>Invalid Arguments
<ul>
$forall msg <- ia
<li>#{msg}
|]
provideRep $ return $ object ["message" .= ("Invalid Arguments" :: Text), "errors" .= ia] | 373 | defaultErrorHandler (InvalidArgs ia) = selectRep $ do
provideRep $ defaultLayout $ do
setTitle "Invalid Arguments"
toWidget [hamlet|
<h1>Invalid Arguments
<ul>
$forall msg <- ia
<li>#{msg}
|]
provideRep $ return $ object ["message" .= ("Invalid Arguments" :: Text), "errors" .= ia] | 373 | false | false | 0 | 12 | 131 | 80 | 40 | 40 | null | null |
JoshuaGross/haskell-learning-log | Code/Haskellbook/Either.hs | mit | eitherMaybe'' :: (b -> c) -> Either a b -> Maybe c
eitherMaybe'' f = either' (const Nothing) (Just . f) | 103 | eitherMaybe'' :: (b -> c) -> Either a b -> Maybe c
eitherMaybe'' f = either' (const Nothing) (Just . f) | 103 | eitherMaybe'' f = either' (const Nothing) (Just . f) | 52 | false | true | 0 | 8 | 20 | 59 | 28 | 31 | null | null |
rasata/iyql | src/main/haskell/Yql/Data/PPrint.hs | gpl-3.0 | -- | Queries all the lines and returns the maximum line.
width :: Doc -> Int
width = maximum . (0:) . map length . lines . show | 127 | width :: Doc -> Int
width = maximum . (0:) . map length . lines . show | 70 | width = maximum . (0:) . map length . lines . show | 50 | true | true | 0 | 9 | 27 | 39 | 21 | 18 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | -- * Confd request query fields
confdReqqLink :: String
confdReqqLink = ConstantUtils.confdReqqLink | 100 | confdReqqLink :: String
confdReqqLink = ConstantUtils.confdReqqLink | 67 | confdReqqLink = ConstantUtils.confdReqqLink | 43 | true | true | 0 | 6 | 12 | 21 | 9 | 12 | null | null |
rgaiacs/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | dot 'E' = "Ė" | 13 | dot 'E' = "Ė" | 13 | dot 'E' = "Ė" | 13 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
heyduck/pfds | src/Pfds/Ch03/RedBlack.hs | gpl-3.0 | balance B (T R a x (T R b y c)) z d = T R (T B a x b) y (T B c z d) | 67 | balance B (T R a x (T R b y c)) z d = T R (T B a x b) y (T B c z d) | 67 | balance B (T R a x (T R b y c)) z d = T R (T B a x b) y (T B c z d) | 67 | false | false | 1 | 9 | 26 | 75 | 35 | 40 | null | null |
TomMD/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | pprSimplCount (SimplCount { ticks = tks, details = dts, log1 = l1, log2 = l2 })
= vcat [ptext (sLit "Total ticks: ") <+> int tks,
blankLine,
pprTickCounts dts,
if verboseSimplStats then
vcat [blankLine,
ptext (sLit "Log (most recent first)"),
nest 4 (vcat (map ppr l1) $$ vcat (map ppr l2))]
else Outputable.empty
] | 424 | pprSimplCount (SimplCount { ticks = tks, details = dts, log1 = l1, log2 = l2 })
= vcat [ptext (sLit "Total ticks: ") <+> int tks,
blankLine,
pprTickCounts dts,
if verboseSimplStats then
vcat [blankLine,
ptext (sLit "Log (most recent first)"),
nest 4 (vcat (map ppr l1) $$ vcat (map ppr l2))]
else Outputable.empty
] | 424 | pprSimplCount (SimplCount { ticks = tks, details = dts, log1 = l1, log2 = l2 })
= vcat [ptext (sLit "Total ticks: ") <+> int tks,
blankLine,
pprTickCounts dts,
if verboseSimplStats then
vcat [blankLine,
ptext (sLit "Log (most recent first)"),
nest 4 (vcat (map ppr l1) $$ vcat (map ppr l2))]
else Outputable.empty
] | 424 | false | false | 0 | 14 | 162 | 139 | 73 | 66 | null | null |
urbanslug/ghc | testsuite/tests/th/TH_unresolvedInfix_Lib.hs | bsd-3-clause | -------------- Completely-unresolved patterns
p1 = mkQQ ( p ^+? (p ^*? p) ) | 75 | p1 = mkQQ ( p ^+? (p ^*? p) ) | 29 | p1 = mkQQ ( p ^+? (p ^*? p) ) | 29 | true | false | 1 | 9 | 12 | 27 | 13 | 14 | null | null |
sopvop/snap | src/Snap/Snaplet/Internal/Initializer.hs | bsd-3-clause | addPostInitHookBase :: (Snaplet b -> IO (Either Text (Snaplet b)))
-> Initializer b v ()
addPostInitHookBase = Initializer . lift . tell . Hook | 163 | addPostInitHookBase :: (Snaplet b -> IO (Either Text (Snaplet b)))
-> Initializer b v ()
addPostInitHookBase = Initializer . lift . tell . Hook | 163 | addPostInitHookBase = Initializer . lift . tell . Hook | 54 | false | true | 0 | 12 | 43 | 63 | 31 | 32 | null | null |
rahulmutt/ghcvm | compiler/Eta/Core/TrieMap.hs | bsd-3-clause | xtR Phantom f = RM . alterTM 3 f . unRM | 48 | xtR Phantom f = RM . alterTM 3 f . unRM | 48 | xtR Phantom f = RM . alterTM 3 f . unRM | 48 | false | false | 0 | 7 | 19 | 26 | 11 | 15 | null | null |
dgonyeo/ttyvid | ttyvid.hs | mit | getTitle ((TagBranch _ _ [(TagLeaf (TagText txt))]):tags) = txt ++ (getTitle tags) | 82 | getTitle ((TagBranch _ _ [(TagLeaf (TagText txt))]):tags) = txt ++ (getTitle tags) | 82 | getTitle ((TagBranch _ _ [(TagLeaf (TagText txt))]):tags) = txt ++ (getTitle tags) | 82 | false | false | 0 | 14 | 11 | 51 | 26 | 25 | null | null |
massysett/penny | penny/lib/Penny/Copper/Copperize.hs | bsd-3-clause | cFour :: Four Char ()
cFour = Four ('4', ()) | 44 | cFour :: Four Char ()
cFour = Four ('4', ()) | 44 | cFour = Four ('4', ()) | 22 | false | true | 0 | 7 | 9 | 29 | 15 | 14 | null | null |
DanielSchiavini/ampersand | src/Database/Design/Ampersand/Prototype/Generate.hs | gpl-3.0 | generateMSubInterface :: FSpec -> [Declaration] -> Int -> Maybe SubInterface -> [String]
generateMSubInterface fSpec editableRels depth subIntf =
case subIntf of
Nothing -> [ " // No subinterfaces" ]
Just (InterfaceRef isLink nm)
-> [ " // InterfaceRef"
, " , 'refSubInterface' => " ++ showPhpStr nm
, " , 'refSubInterfaceId' => " ++ showPhpStr (escapeIdentifier nm) -- only for new front-end
, " , 'isLinkTo' => "++ show isLink
]
Just (Box _ cl objects)
-> [ " // Box" ++ (maybe "" (\c -> "<"++c++">") cl)
, " , 'boxSubInterfaces' =>"
, " array"
] ++
indent 12
(blockParenthesize "(" ")" ","
(map (genInterfaceObjects fSpec editableRels Nothing (depth + 1)) objects))
-- utils
-- generatorModule is the Haskell module responsible for generation, makes it easy to track the origin of the php code | 1,036 | generateMSubInterface :: FSpec -> [Declaration] -> Int -> Maybe SubInterface -> [String]
generateMSubInterface fSpec editableRels depth subIntf =
case subIntf of
Nothing -> [ " // No subinterfaces" ]
Just (InterfaceRef isLink nm)
-> [ " // InterfaceRef"
, " , 'refSubInterface' => " ++ showPhpStr nm
, " , 'refSubInterfaceId' => " ++ showPhpStr (escapeIdentifier nm) -- only for new front-end
, " , 'isLinkTo' => "++ show isLink
]
Just (Box _ cl objects)
-> [ " // Box" ++ (maybe "" (\c -> "<"++c++">") cl)
, " , 'boxSubInterfaces' =>"
, " array"
] ++
indent 12
(blockParenthesize "(" ")" ","
(map (genInterfaceObjects fSpec editableRels Nothing (depth + 1)) objects))
-- utils
-- generatorModule is the Haskell module responsible for generation, makes it easy to track the origin of the php code | 1,036 | generateMSubInterface fSpec editableRels depth subIntf =
case subIntf of
Nothing -> [ " // No subinterfaces" ]
Just (InterfaceRef isLink nm)
-> [ " // InterfaceRef"
, " , 'refSubInterface' => " ++ showPhpStr nm
, " , 'refSubInterfaceId' => " ++ showPhpStr (escapeIdentifier nm) -- only for new front-end
, " , 'isLinkTo' => "++ show isLink
]
Just (Box _ cl objects)
-> [ " // Box" ++ (maybe "" (\c -> "<"++c++">") cl)
, " , 'boxSubInterfaces' =>"
, " array"
] ++
indent 12
(blockParenthesize "(" ")" ","
(map (genInterfaceObjects fSpec editableRels Nothing (depth + 1)) objects))
-- utils
-- generatorModule is the Haskell module responsible for generation, makes it easy to track the origin of the php code | 947 | false | true | 0 | 17 | 374 | 223 | 116 | 107 | null | null |
bgamari/gl-plot | Graphics/Rendering/GLPlot.hs | bsd-3-clause | schedulePlotTask :: Plot -> (Window -> IO ()) -> IO ()
schedulePlotTask plot action =
scheduleTask (plot ^. pMainloop) $ withPlotContext plot action | 152 | schedulePlotTask :: Plot -> (Window -> IO ()) -> IO ()
schedulePlotTask plot action =
scheduleTask (plot ^. pMainloop) $ withPlotContext plot action | 152 | schedulePlotTask plot action =
scheduleTask (plot ^. pMainloop) $ withPlotContext plot action | 97 | false | true | 0 | 10 | 26 | 60 | 29 | 31 | null | null |
pparkkin/eta | compiler/ETA/Utils/Binary.hs | bsd-3-clause | newByteArray :: Int# -> IO MBA
newByteArray sz = IO $ \s ->
case newByteArray# sz s of { (# s, arr #) ->
(# s, MBA arr #) } | 127 | newByteArray :: Int# -> IO MBA
newByteArray sz = IO $ \s ->
case newByteArray# sz s of { (# s, arr #) ->
(# s, MBA arr #) } | 127 | newByteArray sz = IO $ \s ->
case newByteArray# sz s of { (# s, arr #) ->
(# s, MBA arr #) } | 96 | false | true | 0 | 11 | 33 | 60 | 31 | 29 | null | null |
anton-dessiatov/stack | src/Stack/Types/Config.hs | bsd-3-clause | cabalVersionL :: HasEnvConfig env => Lens' env Version
cabalVersionL = envConfigL.lens
envConfigCabalVersion
(\x y -> x { envConfigCabalVersion = y }) | 158 | cabalVersionL :: HasEnvConfig env => Lens' env Version
cabalVersionL = envConfigL.lens
envConfigCabalVersion
(\x y -> x { envConfigCabalVersion = y }) | 158 | cabalVersionL = envConfigL.lens
envConfigCabalVersion
(\x y -> x { envConfigCabalVersion = y }) | 103 | false | true | 0 | 8 | 28 | 49 | 25 | 24 | null | null |
tolysz/prepare-ghcjs | spec-lts8/base/Data/List/NonEmpty.hs | bsd-3-clause | -- | The 'isPrefix' function returns @True@ if the first argument is
-- a prefix of the second.
isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool
isPrefixOf [] _ = True | 166 | isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool
isPrefixOf [] _ = True | 70 | isPrefixOf [] _ = True | 22 | true | true | 0 | 10 | 33 | 47 | 22 | 25 | null | null |
ihc/futhark | src/Futhark/Representation/AST/Attributes/Scope.hs | isc | extendedScope :: ExtendedScope lore m a
-> Scope lore
-> m a
extendedScope (ExtendedScope m) = runReaderT m | 135 | extendedScope :: ExtendedScope lore m a
-> Scope lore
-> m a
extendedScope (ExtendedScope m) = runReaderT m | 135 | extendedScope (ExtendedScope m) = runReaderT m | 46 | false | true | 0 | 10 | 45 | 48 | 21 | 27 | null | null |
OttoAllmendinger/haskoin-script | testsuite/Units.hs | unlicense | tests =
[ testGroup "Canonical Signatures"
[ testCase "Canonical Sig 1" testCanonicalSig1
, testCase "Canonical Sig 2" testCanonicalSig2
, testCase "Canonical Sig 3" testCanonicalSig3
, testCase "Canonical Sig 4" testCanonicalSig4
, testCase "Canonical Sig 5" testCanonicalSig5
, testCase "Not Canonical Sig 1" testNotCanonical1
, testCase "Not Canonical Sig 2" testNotCanonical2
, testCase "Not Canonical Sig 3" testNotCanonical3
, testCase "Not Canonical Sig 4" testNotCanonical4
, testCase "Not Canonical Sig 5" testNotCanonical5
, testCase "Not Canonical Sig 6" testNotCanonical6
, testCase "Not Canonical Sig 7" testNotCanonical7
, testCase "Not Canonical Sig 8" testNotCanonical8
, testCase "Not Canonical Sig 9" testNotCanonical9
, testCase "Not Canonical Sig 10" testNotCanonical10
, testCase "Not Canonical Sig 11" testNotCanonical11
, testCase "Not Canonical Sig 12" testNotCanonical12
, testCase "Not Canonical Sig 13" testNotCanonical13
, testCase "Not Canonical Sig 14" testNotCanonical14
, testCase "Not Canonical Sig 15" testNotCanonical15
]
] | 1,236 | tests =
[ testGroup "Canonical Signatures"
[ testCase "Canonical Sig 1" testCanonicalSig1
, testCase "Canonical Sig 2" testCanonicalSig2
, testCase "Canonical Sig 3" testCanonicalSig3
, testCase "Canonical Sig 4" testCanonicalSig4
, testCase "Canonical Sig 5" testCanonicalSig5
, testCase "Not Canonical Sig 1" testNotCanonical1
, testCase "Not Canonical Sig 2" testNotCanonical2
, testCase "Not Canonical Sig 3" testNotCanonical3
, testCase "Not Canonical Sig 4" testNotCanonical4
, testCase "Not Canonical Sig 5" testNotCanonical5
, testCase "Not Canonical Sig 6" testNotCanonical6
, testCase "Not Canonical Sig 7" testNotCanonical7
, testCase "Not Canonical Sig 8" testNotCanonical8
, testCase "Not Canonical Sig 9" testNotCanonical9
, testCase "Not Canonical Sig 10" testNotCanonical10
, testCase "Not Canonical Sig 11" testNotCanonical11
, testCase "Not Canonical Sig 12" testNotCanonical12
, testCase "Not Canonical Sig 13" testNotCanonical13
, testCase "Not Canonical Sig 14" testNotCanonical14
, testCase "Not Canonical Sig 15" testNotCanonical15
]
] | 1,236 | tests =
[ testGroup "Canonical Signatures"
[ testCase "Canonical Sig 1" testCanonicalSig1
, testCase "Canonical Sig 2" testCanonicalSig2
, testCase "Canonical Sig 3" testCanonicalSig3
, testCase "Canonical Sig 4" testCanonicalSig4
, testCase "Canonical Sig 5" testCanonicalSig5
, testCase "Not Canonical Sig 1" testNotCanonical1
, testCase "Not Canonical Sig 2" testNotCanonical2
, testCase "Not Canonical Sig 3" testNotCanonical3
, testCase "Not Canonical Sig 4" testNotCanonical4
, testCase "Not Canonical Sig 5" testNotCanonical5
, testCase "Not Canonical Sig 6" testNotCanonical6
, testCase "Not Canonical Sig 7" testNotCanonical7
, testCase "Not Canonical Sig 8" testNotCanonical8
, testCase "Not Canonical Sig 9" testNotCanonical9
, testCase "Not Canonical Sig 10" testNotCanonical10
, testCase "Not Canonical Sig 11" testNotCanonical11
, testCase "Not Canonical Sig 12" testNotCanonical12
, testCase "Not Canonical Sig 13" testNotCanonical13
, testCase "Not Canonical Sig 14" testNotCanonical14
, testCase "Not Canonical Sig 15" testNotCanonical15
]
] | 1,236 | false | false | 0 | 8 | 320 | 174 | 87 | 87 | null | null |
urbanslug/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (NEWBLOCK _)
= panic "PprMach.pprInstr: NEWBLOCK" | 61 | pprInstr (NEWBLOCK _)
= panic "PprMach.pprInstr: NEWBLOCK" | 61 | pprInstr (NEWBLOCK _)
= panic "PprMach.pprInstr: NEWBLOCK" | 61 | false | false | 0 | 6 | 9 | 19 | 8 | 11 | null | null |
shnarazk/gradcondtools | LectTypes.hs | gpl-3.0 | -- | 'YearProperty'の一貫性検証
checkConsistency :: CYear -> YearProperty -> IO ()
checkConsistency y YearProperty{..} = do
let
duplicated (sort -> l) = nub l /= l
cats = _categoriesOfYear ^. each
dups [] = []
dups (s:x) = if elem s x then s : dups x else dups x
when (duplicated cats) $ error $ show y ++ "のカテゴリ名が重複しています: " ++ intercalate "," cats
let ids = _subjectsOfYear ^.. each . to (flip map [_subjectCategory, _subjectName, _subjectIDNumber] . flip ($))
when (duplicated ids) $
error $ show y ++ "のキーIDが重複しています: " ++ intercalate "," (map (^. each) (dups ids)) | 589 | checkConsistency :: CYear -> YearProperty -> IO ()
checkConsistency y YearProperty{..} = do
let
duplicated (sort -> l) = nub l /= l
cats = _categoriesOfYear ^. each
dups [] = []
dups (s:x) = if elem s x then s : dups x else dups x
when (duplicated cats) $ error $ show y ++ "のカテゴリ名が重複しています: " ++ intercalate "," cats
let ids = _subjectsOfYear ^.. each . to (flip map [_subjectCategory, _subjectName, _subjectIDNumber] . flip ($))
when (duplicated ids) $
error $ show y ++ "のキーIDが重複しています: " ++ intercalate "," (map (^. each) (dups ids)) | 563 | checkConsistency y YearProperty{..} = do
let
duplicated (sort -> l) = nub l /= l
cats = _categoriesOfYear ^. each
dups [] = []
dups (s:x) = if elem s x then s : dups x else dups x
when (duplicated cats) $ error $ show y ++ "のカテゴリ名が重複しています: " ++ intercalate "," cats
let ids = _subjectsOfYear ^.. each . to (flip map [_subjectCategory, _subjectName, _subjectIDNumber] . flip ($))
when (duplicated ids) $
error $ show y ++ "のキーIDが重複しています: " ++ intercalate "," (map (^. each) (dups ids)) | 512 | true | true | 0 | 15 | 127 | 257 | 126 | 131 | null | null |
haslab/SecreC | src/Language/SecreC/Prover/Semantics.hs | gpl-3.0 | ordILit f (IUint32 i1) (IUint32 i2) = f i1 i2 | 47 | ordILit f (IUint32 i1) (IUint32 i2) = f i1 i2 | 47 | ordILit f (IUint32 i1) (IUint32 i2) = f i1 i2 | 47 | false | false | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
Ongy/monky | Monky/Version.hs | lgpl-3.0 | -- |The current version as 4tupel
getVersion :: (Int, Int, Int, Int)
getVersion = $versionTH | 92 | getVersion :: (Int, Int, Int, Int)
getVersion = $versionTH | 58 | getVersion = $versionTH | 23 | true | true | 0 | 5 | 14 | 25 | 15 | 10 | null | null |
continuouspi/cpiwb | profileMC1.hs | gpl-3.0 | f24 = Pos (0,infty) f20 | 23 | f24 = Pos (0,infty) f20 | 23 | f24 = Pos (0,infty) f20 | 23 | false | false | 1 | 6 | 4 | 20 | 9 | 11 | null | null |
christiaanb/Idris-dev | src/Core/Execute.hs | bsd-3-clause | doExec env ctxt p@(P Ref n ty) =
do let val = lookupDef n ctxt
case val of
[Function _ tm] -> doExec env ctxt tm
[TyDecl _ _] -> return (EP Ref n EErased) -- abstract def
[Operator tp arity op] -> return (EP Ref n EErased) -- will be special-cased later
[CaseOp _ _ _ _ [] (STerm tm) _ _] -> -- nullary fun
doExec env ctxt tm
[CaseOp _ _ _ _ ns sc _ _] -> return (EP Ref n EErased)
[] -> execFail $ "Could not find " ++ show n ++ " in definitions."
thing -> trace (take 200 $ "got to " ++ show thing ++ " lookup up " ++ show n) $ undefined | 626 | doExec env ctxt p@(P Ref n ty) =
do let val = lookupDef n ctxt
case val of
[Function _ tm] -> doExec env ctxt tm
[TyDecl _ _] -> return (EP Ref n EErased) -- abstract def
[Operator tp arity op] -> return (EP Ref n EErased) -- will be special-cased later
[CaseOp _ _ _ _ [] (STerm tm) _ _] -> -- nullary fun
doExec env ctxt tm
[CaseOp _ _ _ _ ns sc _ _] -> return (EP Ref n EErased)
[] -> execFail $ "Could not find " ++ show n ++ " in definitions."
thing -> trace (take 200 $ "got to " ++ show thing ++ " lookup up " ++ show n) $ undefined | 626 | doExec env ctxt p@(P Ref n ty) =
do let val = lookupDef n ctxt
case val of
[Function _ tm] -> doExec env ctxt tm
[TyDecl _ _] -> return (EP Ref n EErased) -- abstract def
[Operator tp arity op] -> return (EP Ref n EErased) -- will be special-cased later
[CaseOp _ _ _ _ [] (STerm tm) _ _] -> -- nullary fun
doExec env ctxt tm
[CaseOp _ _ _ _ ns sc _ _] -> return (EP Ref n EErased)
[] -> execFail $ "Could not find " ++ show n ++ " in definitions."
thing -> trace (take 200 $ "got to " ++ show thing ++ " lookup up " ++ show n) $ undefined | 626 | false | false | 1 | 18 | 209 | 280 | 131 | 149 | null | null |
fredokun/piexplorer | src/DistTests.hs | gpl-3.0 | runTests = runTestTT distTests | 30 | runTests = runTestTT distTests | 30 | runTests = runTestTT distTests | 30 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
fjarri/wigner | examples/fpe-sde.hs | bsd-3-clause | dalpha = (dx - D.i * dy) / 2 | 28 | dalpha = (dx - D.i * dy) / 2 | 28 | dalpha = (dx - D.i * dy) / 2 | 28 | false | false | 0 | 9 | 8 | 23 | 12 | 11 | null | null |
kranich/haste-compiler | src/Haste/AST/Constructors.hs | bsd-3-clause | -- | Create a function.
fun :: [Var] -> Stm -> Exp
fun = Fun | 60 | fun :: [Var] -> Stm -> Exp
fun = Fun | 36 | fun = Fun | 9 | true | true | 0 | 8 | 14 | 30 | 14 | 16 | null | null |
Philonous/pontarius-xmpp-e2e | source/Pontarius/E2E.hs | apache-2.0 | e2eDefaultParameters :: E2EParameters
e2eDefaultParameters = E2EParameters { paramDHPrime = e2eDefaultPrime
, paramDHGenerator = 2
, paramDHKeySizeBits = 320
, paramEncrypt = e2eDefaultCtrEncryption
, paramEncryptionBlockSize = 128 -- check bits / bytes
, paramEncryptionKeySize = 128
, paramHash = SHA256.hash
, paramMac = HMAC.hmac SHA256.hash (512 `div` 8)
, paramCheckMac = e2eDefaultCheckMac
} | 731 | e2eDefaultParameters :: E2EParameters
e2eDefaultParameters = E2EParameters { paramDHPrime = e2eDefaultPrime
, paramDHGenerator = 2
, paramDHKeySizeBits = 320
, paramEncrypt = e2eDefaultCtrEncryption
, paramEncryptionBlockSize = 128 -- check bits / bytes
, paramEncryptionKeySize = 128
, paramHash = SHA256.hash
, paramMac = HMAC.hmac SHA256.hash (512 `div` 8)
, paramCheckMac = e2eDefaultCheckMac
} | 731 | e2eDefaultParameters = E2EParameters { paramDHPrime = e2eDefaultPrime
, paramDHGenerator = 2
, paramDHKeySizeBits = 320
, paramEncrypt = e2eDefaultCtrEncryption
, paramEncryptionBlockSize = 128 -- check bits / bytes
, paramEncryptionKeySize = 128
, paramHash = SHA256.hash
, paramMac = HMAC.hmac SHA256.hash (512 `div` 8)
, paramCheckMac = e2eDefaultCheckMac
} | 693 | false | true | 0 | 9 | 384 | 88 | 55 | 33 | null | null |
tjakway/ghcjvm | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | forkAlts :: [FCode a] -> FCode [a]
-- (forkAlts' bs d) takes fcodes 'bs' for the branches of a 'case', and
-- an fcode for the default case 'd', and compiles each in the current
-- environment. The current environment is passed on unmodified, except
-- that the virtual Hp is moved on to the worst virtual Hp for the branches
forkAlts branch_fcodes
= do { info_down <- getInfoDown
; us <- newUniqSupply
; state <- getState
; let compile us branch
= (us2, doFCode branch info_down branch_state)
where
(us1,us2) = splitUniqSupply us
branch_state = (initCgState us1) {
cgs_binds = cgs_binds state
, cgs_hp_usg = cgs_hp_usg state }
(_us, results) = mapAccumL compile us branch_fcodes
(branch_results, branch_out_states) = unzip results
; setState $ foldl stateIncUsage state branch_out_states
-- NB foldl. state is the *left* argument to stateIncUsage
; return branch_results } | 1,110 | forkAlts :: [FCode a] -> FCode [a]
forkAlts branch_fcodes
= do { info_down <- getInfoDown
; us <- newUniqSupply
; state <- getState
; let compile us branch
= (us2, doFCode branch info_down branch_state)
where
(us1,us2) = splitUniqSupply us
branch_state = (initCgState us1) {
cgs_binds = cgs_binds state
, cgs_hp_usg = cgs_hp_usg state }
(_us, results) = mapAccumL compile us branch_fcodes
(branch_results, branch_out_states) = unzip results
; setState $ foldl stateIncUsage state branch_out_states
-- NB foldl. state is the *left* argument to stateIncUsage
; return branch_results } | 817 | forkAlts branch_fcodes
= do { info_down <- getInfoDown
; us <- newUniqSupply
; state <- getState
; let compile us branch
= (us2, doFCode branch info_down branch_state)
where
(us1,us2) = splitUniqSupply us
branch_state = (initCgState us1) {
cgs_binds = cgs_binds state
, cgs_hp_usg = cgs_hp_usg state }
(_us, results) = mapAccumL compile us branch_fcodes
(branch_results, branch_out_states) = unzip results
; setState $ foldl stateIncUsage state branch_out_states
-- NB foldl. state is the *left* argument to stateIncUsage
; return branch_results } | 782 | true | true | 0 | 15 | 377 | 197 | 102 | 95 | null | null |
enolan/whiteout | src/Internal/Peers/Handler.hs | bsd-3-clause | sameIp _ _ =
error "Got non-IPv4 SockAddr in sameIp" | 98 | sameIp _ _ =
error "Got non-IPv4 SockAddr in sameIp" | 98 | sameIp _ _ =
error "Got non-IPv4 SockAddr in sameIp" | 98 | false | false | 0 | 5 | 55 | 14 | 6 | 8 | null | null |
HyperGainZ/neobot | app/bot.hs | bsd-3-clause | ircNetworkThread :: Config.Config -> Config.Network -> Handle -> TChan SignalData -> IO (IrcThreadQuitReason)
ircNetworkThread config network h githubChan = do
let
nick = Config.networkNick network
channels = Config.networkChannels network
watching_channels = filter (watches_some_repo) channels
watches_some_repo = null . Config.channelWatchedGithubRepos
write h "NICK" nick
write h "USER" (nick `mappend` " 0 * :neobot")
mapM_ (\chan -> write h "JOIN" $ Config.channelName chan) channels
eventLoop config network githubChan h | 579 | ircNetworkThread :: Config.Config -> Config.Network -> Handle -> TChan SignalData -> IO (IrcThreadQuitReason)
ircNetworkThread config network h githubChan = do
let
nick = Config.networkNick network
channels = Config.networkChannels network
watching_channels = filter (watches_some_repo) channels
watches_some_repo = null . Config.channelWatchedGithubRepos
write h "NICK" nick
write h "USER" (nick `mappend` " 0 * :neobot")
mapM_ (\chan -> write h "JOIN" $ Config.channelName chan) channels
eventLoop config network githubChan h | 579 | ircNetworkThread config network h githubChan = do
let
nick = Config.networkNick network
channels = Config.networkChannels network
watching_channels = filter (watches_some_repo) channels
watches_some_repo = null . Config.channelWatchedGithubRepos
write h "NICK" nick
write h "USER" (nick `mappend` " 0 * :neobot")
mapM_ (\chan -> write h "JOIN" $ Config.channelName chan) channels
eventLoop config network githubChan h | 469 | false | true | 0 | 13 | 118 | 175 | 82 | 93 | null | null |
Erdwolf/autotool-bonn | src/HTWK/SS04/Informatik.hs | gpl-2.0 | aufgaben = []
++ HTWK.SS04.Informatik.Boolean.generates
++ HTWK.SS04.Informatik.Code.generates
++ HTWK.SS04.Informatik.Crypt.generates | 155 | aufgaben = []
++ HTWK.SS04.Informatik.Boolean.generates
++ HTWK.SS04.Informatik.Code.generates
++ HTWK.SS04.Informatik.Crypt.generates | 155 | aufgaben = []
++ HTWK.SS04.Informatik.Boolean.generates
++ HTWK.SS04.Informatik.Code.generates
++ HTWK.SS04.Informatik.Crypt.generates | 155 | false | false | 0 | 8 | 29 | 35 | 22 | 13 | null | null |
olorin/amazonka | amazonka-rds/gen/Network/AWS/RDS/Types/Product.hs | mpl-2.0 | -- | The description of the option.
ogoDescription :: Lens' OptionGroupOption (Maybe Text)
ogoDescription = lens _ogoDescription (\ s a -> s{_ogoDescription = a}) | 162 | ogoDescription :: Lens' OptionGroupOption (Maybe Text)
ogoDescription = lens _ogoDescription (\ s a -> s{_ogoDescription = a}) | 126 | ogoDescription = lens _ogoDescription (\ s a -> s{_ogoDescription = a}) | 71 | true | true | 0 | 9 | 23 | 46 | 25 | 21 | null | null |
hausdorff/pyli | src/Lexer.hs | mit | -- a toString function for tokens
showTkns :: [Tkn] -> String
showTkns [] = "" | 78 | showTkns :: [Tkn] -> String
showTkns [] = "" | 44 | showTkns [] = "" | 16 | true | true | 0 | 8 | 14 | 30 | 14 | 16 | null | null |
hephaestus-pl/hephaestus | alexandre/feature-modeling/src/FeatureModel/Parsers/SPLOT/NewSPLOT2FeatureModel.hs | mit | modelo2 = SPLOT(FeatureModel (Feature (FName2 (Ident "r"))[BinRelation (Cardinality 1 1) (LSolitaryFeature (FName2 (Ident "r_6_7")))]) []) | 138 | modelo2 = SPLOT(FeatureModel (Feature (FName2 (Ident "r"))[BinRelation (Cardinality 1 1) (LSolitaryFeature (FName2 (Ident "r_6_7")))]) []) | 138 | modelo2 = SPLOT(FeatureModel (Feature (FName2 (Ident "r"))[BinRelation (Cardinality 1 1) (LSolitaryFeature (FName2 (Ident "r_6_7")))]) []) | 138 | false | false | 1 | 16 | 14 | 76 | 36 | 40 | null | null |
gridaphobe/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | collect_bind _ (VarBind { var_id = f }) acc = f : acc | 64 | collect_bind _ (VarBind { var_id = f }) acc = f : acc | 64 | collect_bind _ (VarBind { var_id = f }) acc = f : acc | 64 | false | false | 0 | 9 | 23 | 29 | 15 | 14 | null | null |
tabemann/amphibian | src/Network/IRC/Client/Amphibian/ServerReplies.hs | bsd-3-clause | rpl_ENDOFSTATS :: B.ByteString
rpl_ENDOFSTATS = encodeUtf8 "219" | 64 | rpl_ENDOFSTATS :: B.ByteString
rpl_ENDOFSTATS = encodeUtf8 "219" | 64 | rpl_ENDOFSTATS = encodeUtf8 "219" | 33 | false | true | 0 | 5 | 6 | 16 | 8 | 8 | null | null |
ublubu/shapes | shapes/src/Physics/Scenes/TwoFlyingBoxes.hs | mit | boxB' :: label -> WorldObj label
boxB' = makeWorldObj boxB 0.2 0 $ makeRectangleHull 2 2 | 88 | boxB' :: label -> WorldObj label
boxB' = makeWorldObj boxB 0.2 0 $ makeRectangleHull 2 2 | 88 | boxB' = makeWorldObj boxB 0.2 0 $ makeRectangleHull 2 2 | 55 | false | true | 0 | 7 | 15 | 39 | 17 | 22 | null | null |
nagyf/wyas | src/Evaluator.hs | mit | eval _ (List [Atom "quote", val]) = return val | 46 | eval _ (List [Atom "quote", val]) = return val | 46 | eval _ (List [Atom "quote", val]) = return val | 46 | false | false | 1 | 8 | 8 | 31 | 14 | 17 | null | null |
GaloisInc/elf | src/Data/ElfEdit/Get.hs | bsd-3-clause | ------------------------------------------------------------------------
-- Utilities
-- | Returns null-terminated string at given index in bytestring.
lookupString :: Word32 -> B.ByteString -> B.ByteString
lookupString o b = B.takeWhile (/= 0) $ B.drop (fromIntegral o) b | 273 | lookupString :: Word32 -> B.ByteString -> B.ByteString
lookupString o b = B.takeWhile (/= 0) $ B.drop (fromIntegral o) b | 120 | lookupString o b = B.takeWhile (/= 0) $ B.drop (fromIntegral o) b | 65 | true | true | 0 | 9 | 32 | 62 | 31 | 31 | null | null |
wavewave/hoodle-core | src/Hoodle/GUI/Menu.hs | gpl-3.0 | int2Point PenWork 1 = predefined_fine | 37 | int2Point PenWork 1 = predefined_fine | 37 | int2Point PenWork 1 = predefined_fine | 37 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
rahulmutt/ghcvm | eta/Eta/REPL/UI/Tags.hs | bsd-3-clause | ghciCreateTagsFile :: TagsKind -> FilePath -> GHCi ()
ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
--
-- - extract createTagsFile so it can be used from the command-line
-- (probably need to fix first problem before this is useful).
-- | 444 | ghciCreateTagsFile :: TagsKind -> FilePath -> GHCi ()
ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
--
-- - extract createTagsFile so it can be used from the command-line
-- (probably need to fix first problem before this is useful).
-- | 444 | ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
--
-- - extract createTagsFile so it can be used from the command-line
-- (probably need to fix first problem before this is useful).
-- | 390 | false | true | 0 | 8 | 101 | 45 | 25 | 20 | null | null |
abakst/liquidhaskell | benchmarks/hmatrix-0.15.0.1/examples/multiply.hs | bsd-3-clause | a = s ⋅ v × m × m × v ⋅ s | 25 | a = s ⋅ v × m × m × v ⋅ s | 25 | a = s ⋅ v × m × m × v ⋅ s | 25 | false | false | 1 | 9 | 12 | 30 | 13 | 17 | null | null |
KHs000/haskellToys | src/scripts/fizzbuzz.hs | mit | print' m = print m | 24 | print' m = print m | 24 | print' m = print m | 24 | false | false | 0 | 5 | 10 | 12 | 5 | 7 | null | null |
nevrenato/Hets_Fork | OWL2/Parse.hs | gpl-2.0 | sameOrDifferentIndu :: CharParser st SameOrDifferent
sameOrDifferentIndu = (pkeyword sameIndividualC >> return Same)
<|> (pkeyword differentIndividualsC >> return Different) | 177 | sameOrDifferentIndu :: CharParser st SameOrDifferent
sameOrDifferentIndu = (pkeyword sameIndividualC >> return Same)
<|> (pkeyword differentIndividualsC >> return Different) | 177 | sameOrDifferentIndu = (pkeyword sameIndividualC >> return Same)
<|> (pkeyword differentIndividualsC >> return Different) | 124 | false | true | 3 | 8 | 21 | 50 | 24 | 26 | null | null |
TomMD/crypto-api | Crypto/Classes.hs | bsd-3-clause | hashFunc' :: Hash c d => d -> (B.ByteString -> d)
hashFunc' d = f
where
f = hash'
a = f undefined `asTypeOf` d
| 118 | hashFunc' :: Hash c d => d -> (B.ByteString -> d)
hashFunc' d = f
where
f = hash'
a = f undefined `asTypeOf` d
| 118 | hashFunc' d = f
where
f = hash'
a = f undefined `asTypeOf` d
| 68 | false | true | 2 | 11 | 32 | 72 | 32 | 40 | null | null |
ciderpunx/exercismo | src/SpaceAge.hs | gpl-3.0 | ageOn Jupiter s = ageOn Earth s / 11.862615 | 45 | ageOn Jupiter s = ageOn Earth s / 11.862615 | 45 | ageOn Jupiter s = ageOn Earth s / 11.862615 | 45 | false | false | 1 | 6 | 10 | 25 | 9 | 16 | null | null |
bartoszw/haslo | HasloQC.hs | bsd-3-clause | patientArgs = Args
{ replay = Nothing
, maxSuccess = 300
, maxDiscard = 10000
, maxSize = 300
, chatty = True
} | 138 | patientArgs = Args
{ replay = Nothing
, maxSuccess = 300
, maxDiscard = 10000
, maxSize = 300
, chatty = True
} | 138 | patientArgs = Args
{ replay = Nothing
, maxSuccess = 300
, maxDiscard = 10000
, maxSize = 300
, chatty = True
} | 138 | false | false | 0 | 7 | 50 | 42 | 25 | 17 | null | null |
wizzup/advent_of_code | 2016/2/part1.hs | mit | mkMove :: String -> [Move]
mkMove = map (read . (:[])) | 54 | mkMove :: String -> [Move]
mkMove = map (read . (:[])) | 54 | mkMove = map (read . (:[])) | 27 | false | true | 0 | 9 | 10 | 41 | 20 | 21 | null | null |
llllllllll/false | False/Targets/ASM.hs | gpl-2.0 | funcToASM _ FRead = return
[ Instruction POP [ RegParam RAX ]
, Instruction PUSH [ MemRegParam (Just QWord) RAX ]
] | 184 | funcToASM _ FRead = return
[ Instruction POP [ RegParam RAX ]
, Instruction PUSH [ MemRegParam (Just QWord) RAX ]
] | 184 | funcToASM _ FRead = return
[ Instruction POP [ RegParam RAX ]
, Instruction PUSH [ MemRegParam (Just QWord) RAX ]
] | 184 | false | false | 0 | 11 | 90 | 50 | 24 | 26 | null | null |
mslovy/barrelfish | hake/RuleDefs.hs | mit | mackerel_generic :: Options -> String -> String -> HRule
mackerel_generic opts dev flag =
let
arch = optArch opts
in
Rule [ mackerelProgLoc,
Str ("--" ++ flag),
Str "-c", mackerelDevFileLoc dev,
Str "-o", Out arch (mackerelDevHdrPath dev)
] | 312 | mackerel_generic :: Options -> String -> String -> HRule
mackerel_generic opts dev flag =
let
arch = optArch opts
in
Rule [ mackerelProgLoc,
Str ("--" ++ flag),
Str "-c", mackerelDevFileLoc dev,
Str "-o", Out arch (mackerelDevHdrPath dev)
] | 312 | mackerel_generic opts dev flag =
let
arch = optArch opts
in
Rule [ mackerelProgLoc,
Str ("--" ++ flag),
Str "-c", mackerelDevFileLoc dev,
Str "-o", Out arch (mackerelDevHdrPath dev)
] | 255 | false | true | 0 | 11 | 109 | 95 | 47 | 48 | null | null |
adamschoenemann/simple-frp | test/FRP/ParserSpec.hs | mit | txt_frp_sum_acc =
[text|
\us ns acc ->
let cons(u, delay(us')) = us in
let cons(n, delay(ns')) = ns in
let stable(x) = promote(n + acc) in
cons(x, delay(u, sum_acc us' ns' x))
|] | 200 | txt_frp_sum_acc =
[text|
\us ns acc ->
let cons(u, delay(us')) = us in
let cons(n, delay(ns')) = ns in
let stable(x) = promote(n + acc) in
cons(x, delay(u, sum_acc us' ns' x))
|] | 200 | txt_frp_sum_acc =
[text|
\us ns acc ->
let cons(u, delay(us')) = us in
let cons(n, delay(ns')) = ns in
let stable(x) = promote(n + acc) in
cons(x, delay(u, sum_acc us' ns' x))
|] | 200 | false | false | 1 | 5 | 54 | 14 | 7 | 7 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | getEngineVacuumSpecificImpulseStream :: KRPCHS.SpaceCenter.Engine -> RPCContext (KRPCStream (Float))
getEngineVacuumSpecificImpulseStream thisArg = requestStream $ getEngineVacuumSpecificImpulseStreamReq thisArg | 211 | getEngineVacuumSpecificImpulseStream :: KRPCHS.SpaceCenter.Engine -> RPCContext (KRPCStream (Float))
getEngineVacuumSpecificImpulseStream thisArg = requestStream $ getEngineVacuumSpecificImpulseStreamReq thisArg | 211 | getEngineVacuumSpecificImpulseStream thisArg = requestStream $ getEngineVacuumSpecificImpulseStreamReq thisArg | 110 | false | true | 0 | 9 | 13 | 40 | 20 | 20 | null | null |
BartAdv/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | bcc i (PROJECTINTO r t idx)
= indent i ++ creg r ++ " = GETARG(" ++ creg t ++ ", " ++ show idx ++ ");\n" | 108 | bcc i (PROJECTINTO r t idx)
= indent i ++ creg r ++ " = GETARG(" ++ creg t ++ ", " ++ show idx ++ ");\n" | 108 | bcc i (PROJECTINTO r t idx)
= indent i ++ creg r ++ " = GETARG(" ++ creg t ++ ", " ++ show idx ++ ");\n" | 108 | false | false | 0 | 11 | 30 | 57 | 26 | 31 | null | null |
tidalcycles/tidal-midi | Sound/Tidal/MIDI/Tetra.hs | gpl-3.0 | (unison, unison_p) = pF "unison" (Just 0) | 41 | (unison, unison_p) = pF "unison" (Just 0) | 41 | (unison, unison_p) = pF "unison" (Just 0) | 41 | false | false | 0 | 7 | 6 | 24 | 12 | 12 | null | null |
talanis85/rechord | src/Text/ChordPro.hs | gpl-3.0 | parseChordPro input = runParser cpFile (TonalScale (Pitch C natural) ionianScale) "" input | 90 | parseChordPro input = runParser cpFile (TonalScale (Pitch C natural) ionianScale) "" input | 90 | parseChordPro input = runParser cpFile (TonalScale (Pitch C natural) ionianScale) "" input | 90 | false | false | 0 | 9 | 11 | 34 | 16 | 18 | null | null |
DavidAlphaFox/darcs | src/Darcs/Util/Printer.hs | gpl-2.0 | -- | 'hputDocWith' puts a doc on the given handle using the given printer.
hPutDocWith :: Printers -> RenderMode -> Handle -> Doc -> IO ()
hPutDocWith prs target h d = hPrintPrintables target h (renderWith (prs h) d) | 216 | hPutDocWith :: Printers -> RenderMode -> Handle -> Doc -> IO ()
hPutDocWith prs target h d = hPrintPrintables target h (renderWith (prs h) d) | 141 | hPutDocWith prs target h d = hPrintPrintables target h (renderWith (prs h) d) | 77 | true | true | 0 | 10 | 38 | 63 | 31 | 32 | null | null |
jstolarek/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getOperand e = getOperand_generic e | 35 | getOperand e = getOperand_generic e | 35 | getOperand e = getOperand_generic e | 35 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-from-first-principles-master/02/02.10.05-excercise.hs | mit | divide = z / x + y
where x = 7
y = (negate x)
z = y * 10 | 77 | divide = z / x + y
where x = 7
y = (negate x)
z = y * 10 | 77 | divide = z / x + y
where x = 7
y = (negate x)
z = y * 10 | 77 | false | false | 2 | 8 | 40 | 46 | 22 | 24 | null | null |
DavidAlphaFox/ghc | libraries/transformers/Control/Monad/Trans/Writer/Lazy.hs | bsd-3-clause | censor :: (Monoid w, Monad m) => (w -> w) -> WriterT w m a -> WriterT w m a
censor f m = WriterT $ do
~(a, w) <- runWriterT m
return (a, f w)
-- | Lift a @callCC@ operation to the new monad. | 199 | censor :: (Monoid w, Monad m) => (w -> w) -> WriterT w m a -> WriterT w m a
censor f m = WriterT $ do
~(a, w) <- runWriterT m
return (a, f w)
-- | Lift a @callCC@ operation to the new monad. | 199 | censor f m = WriterT $ do
~(a, w) <- runWriterT m
return (a, f w)
-- | Lift a @callCC@ operation to the new monad. | 123 | false | true | 0 | 10 | 54 | 97 | 48 | 49 | null | null |
oldmanmike/ghc | compiler/stgSyn/CoreToStg.hs | bsd-3-clause | coreToStgExpr
:: CoreExpr
-> LneM (StgExpr, -- Decorated STG expr
FreeVarsInfo, -- Its free vars (NB free, not live)
EscVarsSet) -- Its escapees, a subset of its free vars;
-- also a subset of the domain of the envt
-- because we are only interested in the escapees
-- for vars which might be turned into
-- let-no-escaped ones.
-- The second and third components can be derived in a simple bottom up pass, not
-- dependent on any decisions about which variables will be let-no-escaped or
-- not. The first component, that is, the decorated expression, may then depend
-- on these components, but it in turn is not scrutinised as the basis for any
-- decisions. Hence no black holes.
-- No LitInteger's should be left by the time this is called. CorePrep
-- should have converted them all to a real core representation.
coreToStgExpr (Lit (LitInteger {})) = panic "coreToStgExpr: LitInteger" | 1,083 | coreToStgExpr
:: CoreExpr
-> LneM (StgExpr, -- Decorated STG expr
FreeVarsInfo, -- Its free vars (NB free, not live)
EscVarsSet)
coreToStgExpr (Lit (LitInteger {})) = panic "coreToStgExpr: LitInteger" | 257 | coreToStgExpr (Lit (LitInteger {})) = panic "coreToStgExpr: LitInteger" | 71 | true | true | 1 | 10 | 345 | 63 | 39 | 24 | null | null |
beijaflor-io/haskell-language-dockerfile | dist/build/autogen/Paths_language_dockerfile.hs | gpl-3.0 | catchIO = Exception.catch | 25 | catchIO = Exception.catch | 25 | catchIO = Exception.catch | 25 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
dicomgrid/dicom-haskell-library | src/Data/DICOM/Dictionary.hs | gpl-3.0 | studypriorityid :: String -> Element
studypriorityid = cs $ tag (TagGroup 0x0032) (TagElement 0x000C) | 101 | studypriorityid :: String -> Element
studypriorityid = cs $ tag (TagGroup 0x0032) (TagElement 0x000C) | 101 | studypriorityid = cs $ tag (TagGroup 0x0032) (TagElement 0x000C) | 64 | false | true | 2 | 7 | 13 | 43 | 19 | 24 | null | null |
mydaum/cabal | cabal-testsuite/PackageTests/NewBuild/T4477/cabal.test.hs | bsd-3-clause | main = cabalTest $ do
expectBroken 4477 $ do
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello World" | 120 | main = cabalTest $ do
expectBroken 4477 $ do
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello World" | 120 | main = cabalTest $ do
expectBroken 4477 $ do
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello World" | 120 | false | false | 3 | 13 | 27 | 43 | 17 | 26 | null | null |
christiaanb/clash-tryout | src/CLaSH/Util/CoreHW/Transform.hs | bsd-3-clause | localFreeVars ::
(Functor m, Monad m, State.MonadState s m)
=> (s :-> Map.Map Var Term)
-> [Var]
-> Term
-> TransformSession m [Var]
localFreeVars globalEnv exclude expr = do
bndrs <- fmap (Map.keys) $ (lift . lift) $ Label.gets globalEnv
let interesting var = Var.isLocalVar var && (var `notElem` (bndrs ++ exclude))
let freeVars = VarSet.varSetElems $ termSomeFreeVars interesting expr
return freeVars | 450 | localFreeVars ::
(Functor m, Monad m, State.MonadState s m)
=> (s :-> Map.Map Var Term)
-> [Var]
-> Term
-> TransformSession m [Var]
localFreeVars globalEnv exclude expr = do
bndrs <- fmap (Map.keys) $ (lift . lift) $ Label.gets globalEnv
let interesting var = Var.isLocalVar var && (var `notElem` (bndrs ++ exclude))
let freeVars = VarSet.varSetElems $ termSomeFreeVars interesting expr
return freeVars | 450 | localFreeVars globalEnv exclude expr = do
bndrs <- fmap (Map.keys) $ (lift . lift) $ Label.gets globalEnv
let interesting var = Var.isLocalVar var && (var `notElem` (bndrs ++ exclude))
let freeVars = VarSet.varSetElems $ termSomeFreeVars interesting expr
return freeVars | 307 | false | true | 0 | 15 | 108 | 183 | 89 | 94 | null | null |
walpurgisriot/unitparty | UnitParty/Parser.hs | gpl-3.0 | getUnit :: String -> Maybe Unit
getUnit u = M.lookup u units <|>
(getPrefix u >>= \(v, r) -> fmap v $ getUnit r) | 115 | getUnit :: String -> Maybe Unit
getUnit u = M.lookup u units <|>
(getPrefix u >>= \(v, r) -> fmap v $ getUnit r) | 115 | getUnit u = M.lookup u units <|>
(getPrefix u >>= \(v, r) -> fmap v $ getUnit r) | 83 | false | true | 0 | 10 | 26 | 63 | 31 | 32 | null | null |
RossMeikleham/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | debug TRACE = "#define IDRIS_TRACE\n\n" | 39 | debug TRACE = "#define IDRIS_TRACE\n\n" | 39 | debug TRACE = "#define IDRIS_TRACE\n\n" | 39 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
jlubi333/Camille | camille/hs/TypeChecker.hs | mit | checkType env (StringExpression _) = return () | 46 | checkType env (StringExpression _) = return () | 46 | checkType env (StringExpression _) = return () | 46 | false | false | 0 | 7 | 6 | 22 | 10 | 12 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.