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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol
|
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/OperatingSystems/List.hs
|
mpl-2.0
|
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
oslUploadType :: Lens' OperatingSystemsList (Maybe Text)
oslUploadType
= lens _oslUploadType
(\ s a -> s{_oslUploadType = a})
| 204
|
oslUploadType :: Lens' OperatingSystemsList (Maybe Text)
oslUploadType
= lens _oslUploadType
(\ s a -> s{_oslUploadType = a})
| 133
|
oslUploadType
= lens _oslUploadType
(\ s a -> s{_oslUploadType = a})
| 76
| true
| true
| 0
| 9
| 34
| 48
| 25
| 23
| null | null |
cirquit/hjc
|
src/Risc386Clone/TokenIntel.hs
|
mit
|
token_pos (Colon p) = p
| 23
|
token_pos (Colon p) = p
| 23
|
token_pos (Colon p) = p
| 23
| false
| false
| 0
| 7
| 4
| 15
| 7
| 8
| null | null |
kylcarte/threepenny-extra
|
src/Graphics/UI/Threepenny/Attributes/Extra.hs
|
bsd-3-clause
|
mapMAttr :: (a -> a') -> (a' -> a) -> MAttr x a -> MAttr x a'
mapMAttr f = mapReadWriteAttr (fmap f)
| 100
|
mapMAttr :: (a -> a') -> (a' -> a) -> MAttr x a -> MAttr x a'
mapMAttr f = mapReadWriteAttr (fmap f)
| 100
|
mapMAttr f = mapReadWriteAttr (fmap f)
| 38
| false
| true
| 0
| 8
| 22
| 59
| 29
| 30
| null | null |
vTurbine/ghc
|
compiler/main/HscTypes.hs
|
bsd-3-clause
|
shadowed_by :: [Id] -> TyThing -> Bool
shadowed_by ids = shadowed
where
shadowed id = getOccName id `elemOccSet` new_occs
new_occs = mkOccSet (map getOccName ids)
| 172
|
shadowed_by :: [Id] -> TyThing -> Bool
shadowed_by ids = shadowed
where
shadowed id = getOccName id `elemOccSet` new_occs
new_occs = mkOccSet (map getOccName ids)
| 172
|
shadowed_by ids = shadowed
where
shadowed id = getOccName id `elemOccSet` new_occs
new_occs = mkOccSet (map getOccName ids)
| 133
| false
| true
| 0
| 7
| 34
| 61
| 31
| 30
| null | null |
BartAdv/hoogle
|
src/Input/Item.hs
|
bsd-3-clause
|
hseToItem x | [x] <- declNames x = Just $ IName x
| 49
|
hseToItem x | [x] <- declNames x = Just $ IName x
| 49
|
hseToItem x | [x] <- declNames x = Just $ IName x
| 49
| false
| false
| 0
| 9
| 11
| 32
| 14
| 18
| null | null |
frantisekfarka/ghc-dsi
|
testsuite/tests/safeHaskell/safeLanguage/SafeLang13_A.hs
|
bsd-3-clause
|
p :: P
p = P 3
| 14
|
p :: P
p = P 3
| 14
|
p = P 3
| 7
| false
| true
| 0
| 6
| 6
| 21
| 8
| 13
| null | null |
Macha/Mbot
|
IRC/Parsers.hs
|
mit
|
getHostMask :: RawIRCMessage -> Username
getHostMask = takeWhile(/= ' ') . tail . dropWhile (/= '!')
| 100
|
getHostMask :: RawIRCMessage -> Username
getHostMask = takeWhile(/= ' ') . tail . dropWhile (/= '!')
| 100
|
getHostMask = takeWhile(/= ' ') . tail . dropWhile (/= '!')
| 59
| false
| true
| 0
| 8
| 15
| 37
| 20
| 17
| null | null |
portnov/yaledger
|
YaLedger/Kernel.hs
|
bsd-3-clause
|
accountByID i (Leaf _ acc)
| getID acc == i = Just acc
| otherwise = Nothing
| 85
|
accountByID i (Leaf _ acc)
| getID acc == i = Just acc
| otherwise = Nothing
| 85
|
accountByID i (Leaf _ acc)
| getID acc == i = Just acc
| otherwise = Nothing
| 85
| false
| false
| 0
| 9
| 25
| 49
| 20
| 29
| null | null |
tolysz/yesod
|
yesod-core/Yesod/Core/Handler.hs
|
mit
|
notAuthenticated :: MonadHandler m => m a
notAuthenticated = hcError NotAuthenticated
| 85
|
notAuthenticated :: MonadHandler m => m a
notAuthenticated = hcError NotAuthenticated
| 85
|
notAuthenticated = hcError NotAuthenticated
| 43
| false
| true
| 0
| 6
| 10
| 24
| 11
| 13
| null | null |
Ptival/ProofIDE
|
Examples.hs
|
mit
|
tIll2 :: Term ()
tIll2 = lam ["A", "B", "C", "f", "b", "a"] $
var "a" $$ var "b"
| 87
|
tIll2 :: Term ()
tIll2 = lam ["A", "B", "C", "f", "b", "a"] $
var "a" $$ var "b"
| 87
|
tIll2 = lam ["A", "B", "C", "f", "b", "a"] $
var "a" $$ var "b"
| 70
| false
| true
| 2
| 7
| 25
| 50
| 27
| 23
| null | null |
Ming-Tang/FP15
|
src/FP15/Compiler/Reduction/BExpr.hs
|
mit
|
fromTreeFl (Pre (getLocResolvedId -> o) x) = (App o . (:[])) <$> fromTreeFl x
| 77
|
fromTreeFl (Pre (getLocResolvedId -> o) x) = (App o . (:[])) <$> fromTreeFl x
| 77
|
fromTreeFl (Pre (getLocResolvedId -> o) x) = (App o . (:[])) <$> fromTreeFl x
| 77
| false
| false
| 0
| 9
| 13
| 47
| 24
| 23
| null | null |
rueshyna/gogol
|
gogol-games/gen/Network/Google/Games/Types/Product.hs
|
mpl-2.0
|
-- | Token corresponding to the next page of results.
plrNextPageToken :: Lens' PlayerListResponse (Maybe Text)
plrNextPageToken
= lens _plrNextPageToken
(\ s a -> s{_plrNextPageToken = a})
| 197
|
plrNextPageToken :: Lens' PlayerListResponse (Maybe Text)
plrNextPageToken
= lens _plrNextPageToken
(\ s a -> s{_plrNextPageToken = a})
| 143
|
plrNextPageToken
= lens _plrNextPageToken
(\ s a -> s{_plrNextPageToken = a})
| 85
| true
| true
| 0
| 9
| 34
| 48
| 25
| 23
| null | null |
onponomarev/ganeti
|
src/Ganeti/THH/Field.hs
|
bsd-2-clause
|
-- | Tag field description.
tagsFields :: [Field]
tagsFields = [ defaultField [| emptyTagSet |] $
simpleField "tags" [t| TagSet |] ]
| 147
|
tagsFields :: [Field]
tagsFields = [ defaultField [| emptyTagSet |] $
simpleField "tags" [t| TagSet |] ]
| 119
|
tagsFields = [ defaultField [| emptyTagSet |] $
simpleField "tags" [t| TagSet |] ]
| 97
| true
| true
| 0
| 7
| 36
| 37
| 23
| 14
| null | null |
DougBurke/swish
|
src/Swish/RDF/Vocabulary/RDF.hs
|
lgpl-2.1
|
-- | @rdf:predicate@ from <http://www.w3.org/TR/rdf-schema/#ch_predicate>.
rdfPredicate :: ScopedName
rdfPredicate = toRDF "subject"
| 132
|
rdfPredicate :: ScopedName
rdfPredicate = toRDF "subject"
| 57
|
rdfPredicate = toRDF "subject"
| 30
| true
| true
| 0
| 6
| 11
| 22
| 9
| 13
| null | null |
sdiehl/unirewrite
|
test/Test.hs
|
mit
|
ptest4 :: Assertion
ptest4 = pattern (l, r) x @?= Just out
where
l = Int 1
r = Int 2
x = Int 1
out = Int 2
| 130
|
ptest4 :: Assertion
ptest4 = pattern (l, r) x @?= Just out
where
l = Int 1
r = Int 2
x = Int 1
out = Int 2
| 130
|
ptest4 = pattern (l, r) x @?= Just out
where
l = Int 1
r = Int 2
x = Int 1
out = Int 2
| 110
| false
| true
| 0
| 7
| 52
| 64
| 32
| 32
| null | null |
jml/hazard
|
lib/Hazard/Games.hs
|
apache-2.0
|
requestGame :: Int -> Seconds -> GameCreationRequest 'Unchecked
requestGame = GameCreationRequest
| 97
|
requestGame :: Int -> Seconds -> GameCreationRequest 'Unchecked
requestGame = GameCreationRequest
| 97
|
requestGame = GameCreationRequest
| 33
| false
| true
| 0
| 8
| 10
| 24
| 12
| 12
| null | null |
graninas/Haskell-Algorithms
|
Tests/DoNotationTest.hs
|
gpl-3.0
|
-- WTF?!! How does it work?!!!
box = mkActor $ do
warmable
frozenable
| 77
|
box = mkActor $ do
warmable
frozenable
| 46
|
box = mkActor $ do
warmable
frozenable
| 46
| true
| false
| 1
| 8
| 20
| 21
| 8
| 13
| null | null |
Axure/elm-compiler
|
src/Parse/Helpers.hs
|
bsd-3-clause
|
located :: IParser a -> IParser (R.Position, a, R.Position)
located parser =
do start <- getMyPosition
value <- parser
end <- getMyPosition
return (start, value, end)
| 187
|
located :: IParser a -> IParser (R.Position, a, R.Position)
located parser =
do start <- getMyPosition
value <- parser
end <- getMyPosition
return (start, value, end)
| 187
|
located parser =
do start <- getMyPosition
value <- parser
end <- getMyPosition
return (start, value, end)
| 127
| false
| true
| 0
| 8
| 46
| 73
| 36
| 37
| null | null |
ctford/Idris-Elba-dev
|
src/Idris/ParseHelpers.hs
|
bsd-3-clause
|
isDocCommentMarker _ = False
| 31
|
isDocCommentMarker _ = False
| 31
|
isDocCommentMarker _ = False
| 31
| false
| false
| 0
| 5
| 6
| 9
| 4
| 5
| null | null |
text-utf8/text
|
tests/Tests/Properties.hs
|
bsd-2-clause
|
t_toLower_length t = T.length (T.toLower t) >= T.length t
| 57
|
t_toLower_length t = T.length (T.toLower t) >= T.length t
| 57
|
t_toLower_length t = T.length (T.toLower t) >= T.length t
| 57
| false
| false
| 0
| 9
| 8
| 31
| 14
| 17
| null | null |
rimmington/pipes-cliff
|
lib/Pipes/Cliff/Core.hs
|
bsd-3-clause
|
pipeOutput
:: (MonadSafe mo, MonadCatch (Base mo))
=> NonPipe
-- ^ Standard input
-> NonPipe
-- ^ Standard error
-> CreateProcess
-> IO (Producer ByteString mo ExitCode, ProcessHandle)
-- ^ A 'Producer' for standard output
pipeOutput inp err cp = mask_ $ do
pnl <- newProcessHandle (Just inp) Nothing (Just err) cp
let pdcr = runOutputHandle Output pnl
return (pdcr, pnl)
-- | Create a 'Producer' for standard error.
| 444
|
pipeOutput
:: (MonadSafe mo, MonadCatch (Base mo))
=> NonPipe
-- ^ Standard input
-> NonPipe
-- ^ Standard error
-> CreateProcess
-> IO (Producer ByteString mo ExitCode, ProcessHandle)
pipeOutput inp err cp = mask_ $ do
pnl <- newProcessHandle (Just inp) Nothing (Just err) cp
let pdcr = runOutputHandle Output pnl
return (pdcr, pnl)
-- | Create a 'Producer' for standard error.
| 404
|
pipeOutput inp err cp = mask_ $ do
pnl <- newProcessHandle (Just inp) Nothing (Just err) cp
let pdcr = runOutputHandle Output pnl
return (pdcr, pnl)
-- | Create a 'Producer' for standard error.
| 201
| true
| true
| 0
| 12
| 96
| 134
| 66
| 68
| null | null |
pparkkin/eta
|
compiler/ETA/SimplCore/FloatIn.hs
|
bsd-3-clause
|
fiExpr dflags to_drop (_,AnnLet (AnnRec bindings) body)
= fiExpr dflags new_to_drop body
where
(ids, rhss) = unzip bindings
rhss_fvs = map freeVarsOf rhss
body_fvs = freeVarsOf body
-- See Note [extra_fvs (1,2)]
rule_fvs = mapUnionVarSet idRuleAndUnfoldingVars ids
extra_fvs = rule_fvs `unionVarSet`
unionVarSets [ fvs | (fvs, rhs) <- rhss
, noFloatIntoExpr rhs ]
(shared_binds:extra_binds:body_binds:rhss_binds)
= sepBindsByDropPoint dflags False (extra_fvs:body_fvs:rhss_fvs) to_drop
new_to_drop = body_binds ++ -- the bindings used only in the body
[FB (mkVarSet ids) rhs_fvs'
(FloatLet (Rec (fi_bind rhss_binds bindings)))] ++
-- The new binding itself
extra_binds ++ -- Note [extra_fvs (1,2)]
shared_binds -- Used in more than one place
rhs_fvs' = unionVarSets rhss_fvs `unionVarSet`
unionVarSets (map floatedBindsFVs rhss_binds) `unionVarSet`
rule_fvs -- Don't forget the rule variables!
-- Push rhs_binds into the right hand side of the binding
fi_bind :: [FloatInBinds] -- one per "drop pt" conjured w/ fvs_of_rhss
-> [(Id, CoreExprWithFVs)]
-> [(Id, CoreExpr)]
fi_bind to_drops pairs
= [ (binder, fiExpr dflags to_drop rhs)
| ((binder, rhs), to_drop) <- zipEqual "fi_bind" pairs to_drops ]
{-
For @Case@, the possible ``drop points'' for the \tr{to_drop}
bindings are: (a)~inside the scrutinee, (b)~inside one of the
alternatives/default [default FVs always {\em first}!].
Floating case expressions inward was added to fix Trac #5658: strict bindings
not floated in. In particular, this change allows array indexing operations,
which have a single DEFAULT alternative without any binders, to be floated
inward. SIMD primops for unpacking SIMD vectors into an unboxed tuple of unboxed
scalars also need to be floated inward, but unpacks have a single non-DEFAULT
alternative that binds the elements of the tuple. We now therefore also support
floating in cases with a single alternative that may bind values.
-}
| 2,258
|
fiExpr dflags to_drop (_,AnnLet (AnnRec bindings) body)
= fiExpr dflags new_to_drop body
where
(ids, rhss) = unzip bindings
rhss_fvs = map freeVarsOf rhss
body_fvs = freeVarsOf body
-- See Note [extra_fvs (1,2)]
rule_fvs = mapUnionVarSet idRuleAndUnfoldingVars ids
extra_fvs = rule_fvs `unionVarSet`
unionVarSets [ fvs | (fvs, rhs) <- rhss
, noFloatIntoExpr rhs ]
(shared_binds:extra_binds:body_binds:rhss_binds)
= sepBindsByDropPoint dflags False (extra_fvs:body_fvs:rhss_fvs) to_drop
new_to_drop = body_binds ++ -- the bindings used only in the body
[FB (mkVarSet ids) rhs_fvs'
(FloatLet (Rec (fi_bind rhss_binds bindings)))] ++
-- The new binding itself
extra_binds ++ -- Note [extra_fvs (1,2)]
shared_binds -- Used in more than one place
rhs_fvs' = unionVarSets rhss_fvs `unionVarSet`
unionVarSets (map floatedBindsFVs rhss_binds) `unionVarSet`
rule_fvs -- Don't forget the rule variables!
-- Push rhs_binds into the right hand side of the binding
fi_bind :: [FloatInBinds] -- one per "drop pt" conjured w/ fvs_of_rhss
-> [(Id, CoreExprWithFVs)]
-> [(Id, CoreExpr)]
fi_bind to_drops pairs
= [ (binder, fiExpr dflags to_drop rhs)
| ((binder, rhs), to_drop) <- zipEqual "fi_bind" pairs to_drops ]
{-
For @Case@, the possible ``drop points'' for the \tr{to_drop}
bindings are: (a)~inside the scrutinee, (b)~inside one of the
alternatives/default [default FVs always {\em first}!].
Floating case expressions inward was added to fix Trac #5658: strict bindings
not floated in. In particular, this change allows array indexing operations,
which have a single DEFAULT alternative without any binders, to be floated
inward. SIMD primops for unpacking SIMD vectors into an unboxed tuple of unboxed
scalars also need to be floated inward, but unpacks have a single non-DEFAULT
alternative that binds the elements of the tuple. We now therefore also support
floating in cases with a single alternative that may bind values.
-}
| 2,258
|
fiExpr dflags to_drop (_,AnnLet (AnnRec bindings) body)
= fiExpr dflags new_to_drop body
where
(ids, rhss) = unzip bindings
rhss_fvs = map freeVarsOf rhss
body_fvs = freeVarsOf body
-- See Note [extra_fvs (1,2)]
rule_fvs = mapUnionVarSet idRuleAndUnfoldingVars ids
extra_fvs = rule_fvs `unionVarSet`
unionVarSets [ fvs | (fvs, rhs) <- rhss
, noFloatIntoExpr rhs ]
(shared_binds:extra_binds:body_binds:rhss_binds)
= sepBindsByDropPoint dflags False (extra_fvs:body_fvs:rhss_fvs) to_drop
new_to_drop = body_binds ++ -- the bindings used only in the body
[FB (mkVarSet ids) rhs_fvs'
(FloatLet (Rec (fi_bind rhss_binds bindings)))] ++
-- The new binding itself
extra_binds ++ -- Note [extra_fvs (1,2)]
shared_binds -- Used in more than one place
rhs_fvs' = unionVarSets rhss_fvs `unionVarSet`
unionVarSets (map floatedBindsFVs rhss_binds) `unionVarSet`
rule_fvs -- Don't forget the rule variables!
-- Push rhs_binds into the right hand side of the binding
fi_bind :: [FloatInBinds] -- one per "drop pt" conjured w/ fvs_of_rhss
-> [(Id, CoreExprWithFVs)]
-> [(Id, CoreExpr)]
fi_bind to_drops pairs
= [ (binder, fiExpr dflags to_drop rhs)
| ((binder, rhs), to_drop) <- zipEqual "fi_bind" pairs to_drops ]
{-
For @Case@, the possible ``drop points'' for the \tr{to_drop}
bindings are: (a)~inside the scrutinee, (b)~inside one of the
alternatives/default [default FVs always {\em first}!].
Floating case expressions inward was added to fix Trac #5658: strict bindings
not floated in. In particular, this change allows array indexing operations,
which have a single DEFAULT alternative without any binders, to be floated
inward. SIMD primops for unpacking SIMD vectors into an unboxed tuple of unboxed
scalars also need to be floated inward, but unpacks have a single non-DEFAULT
alternative that binds the elements of the tuple. We now therefore also support
floating in cases with a single alternative that may bind values.
-}
| 2,258
| false
| false
| 8
| 18
| 615
| 346
| 186
| 160
| null | null |
baig/review-md
|
critic.hs
|
bsd-3-clause
|
acceptChange (Comment _ _ author str) = Text $ "{>>" ++ (if (not . null $ author) then "@" ++ author ++ " " else "") ++ str ++ "<<}"
| 132
|
acceptChange (Comment _ _ author str) = Text $ "{>>" ++ (if (not . null $ author) then "@" ++ author ++ " " else "") ++ str ++ "<<}"
| 132
|
acceptChange (Comment _ _ author str) = Text $ "{>>" ++ (if (not . null $ author) then "@" ++ author ++ " " else "") ++ str ++ "<<}"
| 132
| false
| false
| 0
| 12
| 29
| 67
| 35
| 32
| null | null |
hyPiRion/swearjure
|
src/Swearjure/Reader.hs
|
gpl-3.0
|
convertAst :: PVal -> EvalState Val
convertAst = go
where go :: PVal -> EvalState Val
go = liftM Fix . goF . unFix
goF :: PValF PVal -> EvalState (SwjValF Val)
goF (PSym s) = return $ uncurry ESym $ splitSym s
goF (PString s) = return $ EStr s
goF (PKw s) = return $ uncurry EKw $ splitSym s
goF (PQualKw s) = return $ EKw (Just "user") s
-- -^ if we could move nses, this would've forced this fn to be of
-- EvalState
goF (PChar c) = return $ EChar c
-- TODO: Go over to compdata. Excellent fit here actually, as this
-- traversal is over a desugared ast.
goF (PFnLit _) = throwError $ IllegalState $ "Internal error: Function "
++ "literals should've been eradicated by now"
goF (PList xs) = EList <$> mapM go xs
goF (PVec xs) = EVec <$> mapM go xs
-- randomization of sets and hash maps
goF (PSet xs) = do vals <- mapM go xs
ESet <$> shuffle vals
-- want this to be Data.Set, but forces eq + ord on Mu/Attr
goF (PHM pairs) = do vals <- mapM (\(x, y) -> (,) <$> go x <*> go y) pairs
EHM <$> shuffle vals
goF (PSyntaxQuote x) = syntaxUnquote x >>= goF
| 1,287
|
convertAst :: PVal -> EvalState Val
convertAst = go
where go :: PVal -> EvalState Val
go = liftM Fix . goF . unFix
goF :: PValF PVal -> EvalState (SwjValF Val)
goF (PSym s) = return $ uncurry ESym $ splitSym s
goF (PString s) = return $ EStr s
goF (PKw s) = return $ uncurry EKw $ splitSym s
goF (PQualKw s) = return $ EKw (Just "user") s
-- -^ if we could move nses, this would've forced this fn to be of
-- EvalState
goF (PChar c) = return $ EChar c
-- TODO: Go over to compdata. Excellent fit here actually, as this
-- traversal is over a desugared ast.
goF (PFnLit _) = throwError $ IllegalState $ "Internal error: Function "
++ "literals should've been eradicated by now"
goF (PList xs) = EList <$> mapM go xs
goF (PVec xs) = EVec <$> mapM go xs
-- randomization of sets and hash maps
goF (PSet xs) = do vals <- mapM go xs
ESet <$> shuffle vals
-- want this to be Data.Set, but forces eq + ord on Mu/Attr
goF (PHM pairs) = do vals <- mapM (\(x, y) -> (,) <$> go x <*> go y) pairs
EHM <$> shuffle vals
goF (PSyntaxQuote x) = syntaxUnquote x >>= goF
| 1,287
|
convertAst = go
where go :: PVal -> EvalState Val
go = liftM Fix . goF . unFix
goF :: PValF PVal -> EvalState (SwjValF Val)
goF (PSym s) = return $ uncurry ESym $ splitSym s
goF (PString s) = return $ EStr s
goF (PKw s) = return $ uncurry EKw $ splitSym s
goF (PQualKw s) = return $ EKw (Just "user") s
-- -^ if we could move nses, this would've forced this fn to be of
-- EvalState
goF (PChar c) = return $ EChar c
-- TODO: Go over to compdata. Excellent fit here actually, as this
-- traversal is over a desugared ast.
goF (PFnLit _) = throwError $ IllegalState $ "Internal error: Function "
++ "literals should've been eradicated by now"
goF (PList xs) = EList <$> mapM go xs
goF (PVec xs) = EVec <$> mapM go xs
-- randomization of sets and hash maps
goF (PSet xs) = do vals <- mapM go xs
ESet <$> shuffle vals
-- want this to be Data.Set, but forces eq + ord on Mu/Attr
goF (PHM pairs) = do vals <- mapM (\(x, y) -> (,) <$> go x <*> go y) pairs
EHM <$> shuffle vals
goF (PSyntaxQuote x) = syntaxUnquote x >>= goF
| 1,251
| false
| true
| 47
| 9
| 452
| 382
| 195
| 187
| null | null |
kylcarte/threepenny-extra
|
src/Reactive/Threepenny/Extra.hs
|
bsd-3-clause
|
lookupE :: Ord k => B (Map k a) -> Event (Maybe k) -> Event (Maybe a)
lookupE b e = go <$> e <!> b
where
go k m = k >>= M.lookup <&> m
| 138
|
lookupE :: Ord k => B (Map k a) -> Event (Maybe k) -> Event (Maybe a)
lookupE b e = go <$> e <!> b
where
go k m = k >>= M.lookup <&> m
| 138
|
lookupE b e = go <$> e <!> b
where
go k m = k >>= M.lookup <&> m
| 68
| false
| true
| 0
| 10
| 39
| 91
| 43
| 48
| null | null |
eijian/mkcpu
|
src/Logic/ComplexLogic.hs
|
bsd-3-clause
|
{- |
4ch multiplexer
IN : [A,B,C0,C1,C2,C3]
OUT: [Y]
>>> lc_multiplexer4ch [sLO, sLO, sHI, sLO, sLO, sLO] == [sHI]
True
>>> lc_multiplexer4ch [sLO, sLO, sLO, sLO, sLO, sLO] == [sLO]
True
>>> let d0 = toBits "001000"
>>> lc_multiplexer4ch d0 == lc_multiplexer4ch'' d0
True
>>> let d1 = toBits "000000"
>>> lc_multiplexer4ch d1 == lc_multiplexer4ch'' d1
True
-}
lc_multiplexer4ch :: LogicCircuit
lc_multiplexer4ch (a:b:c0:c1:c2:c3:_) = [y0 |> y1 |> y2 |> y3]
where
a' = (!>) a
b' = (!>) b
y0 = c0 &> a' &> b'
y1 = c1 &> a &> b'
y2 = c2 &> a' &> b
y3 = c3 &> a &> b
| 598
|
lc_multiplexer4ch :: LogicCircuit
lc_multiplexer4ch (a:b:c0:c1:c2:c3:_) = [y0 |> y1 |> y2 |> y3]
where
a' = (!>) a
b' = (!>) b
y0 = c0 &> a' &> b'
y1 = c1 &> a &> b'
y2 = c2 &> a' &> b
y3 = c3 &> a &> b
| 230
|
lc_multiplexer4ch (a:b:c0:c1:c2:c3:_) = [y0 |> y1 |> y2 |> y3]
where
a' = (!>) a
b' = (!>) b
y0 = c0 &> a' &> b'
y1 = c1 &> a &> b'
y2 = c2 &> a' &> b
y3 = c3 &> a &> b
| 196
| true
| true
| 5
| 13
| 143
| 139
| 71
| 68
| null | null |
jyp/lp-diagrams
|
Graphics/Diagrams/Path.hs
|
agpl-3.0
|
isCycle :: Segment t -> Bool
isCycle Cycle = True
| 49
|
isCycle :: Segment t -> Bool
isCycle Cycle = True
| 49
|
isCycle Cycle = True
| 20
| false
| true
| 0
| 6
| 9
| 21
| 10
| 11
| null | null |
yliu120/K3
|
src/Language/K3/Interpreter/Evaluation.hs
|
apache-2.0
|
-- | Logical operators
binary OAnd = logic (&&)
| 47
|
binary OAnd = logic (&&)
| 24
|
binary OAnd = logic (&&)
| 24
| true
| false
| 0
| 5
| 8
| 15
| 8
| 7
| null | null |
meteogrid/dropdirwatch
|
src/System/DirWatch/Archiver.hs
|
bsd-3-clause
|
fromAwsLevel :: Aws.LogLevel -> Logger.Priority
fromAwsLevel Aws.Debug = Logger.DEBUG
| 87
|
fromAwsLevel :: Aws.LogLevel -> Logger.Priority
fromAwsLevel Aws.Debug = Logger.DEBUG
| 87
|
fromAwsLevel Aws.Debug = Logger.DEBUG
| 39
| false
| true
| 0
| 6
| 10
| 26
| 13
| 13
| null | null |
lzlarryli/advent_of_code_2016
|
day8/part1.hs
|
mit
|
rect b a screen = screen // [((i, j), '#') | i <- [0 .. a - 1], j <- [0 .. b - 1]]
| 82
|
rect b a screen = screen // [((i, j), '#') | i <- [0 .. a - 1], j <- [0 .. b - 1]]
| 82
|
rect b a screen = screen // [((i, j), '#') | i <- [0 .. a - 1], j <- [0 .. b - 1]]
| 82
| false
| false
| 0
| 10
| 24
| 68
| 38
| 30
| null | null |
tjakway/ghcjvm
|
compiler/prelude/TysWiredIn.hs
|
bsd-3-clause
|
listTyCon_RDR = nameRdrName listTyConName
| 43
|
listTyCon_RDR = nameRdrName listTyConName
| 43
|
listTyCon_RDR = nameRdrName listTyConName
| 43
| false
| false
| 1
| 5
| 5
| 12
| 4
| 8
| null | null |
abbradar/aeson
|
Data/Aeson/TH.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- ToJSON
--------------------------------------------------------------------------------
{-
TODO: Don't constrain phantom type variables.
data Foo a = Foo Int
instance (ToJSON a) ⇒ ToJSON Foo where ...
The above (ToJSON a) constraint is not necessary and perhaps undesirable.
-}
-- | Generates a 'ToJSON' instance declaration for the given data type.
deriveToJSON :: Options
-- ^ Encoding options.
-> Name
-- ^ Name of the type for which to generate a 'ToJSON' instance
-- declaration.
-> Q [Dec]
deriveToJSON opts name =
withType name $ \tvbs cons -> fmap (:[]) $ fromCons tvbs cons
where
fromCons :: [TyVarBndr] -> [Con] -> Q Dec
fromCons tvbs cons =
instanceD (applyCon ''ToJSON typeNames)
(classType `appT` instanceType)
[ funD 'toJSON
[ clause []
(normalB $ consToValue opts cons)
[]
]
, funD 'toEncoding
[ clause []
(normalB $ consToEncoding opts cons)
[]
]
]
where
classType = conT ''ToJSON
typeNames = map tvbName tvbs
instanceType = foldl' appT (conT name) $ map varT typeNames
-- | Generates a lambda expression which encodes the given data type as a
-- 'Value'.
| 1,585
|
deriveToJSON :: Options
-- ^ Encoding options.
-> Name
-- ^ Name of the type for which to generate a 'ToJSON' instance
-- declaration.
-> Q [Dec]
deriveToJSON opts name =
withType name $ \tvbs cons -> fmap (:[]) $ fromCons tvbs cons
where
fromCons :: [TyVarBndr] -> [Con] -> Q Dec
fromCons tvbs cons =
instanceD (applyCon ''ToJSON typeNames)
(classType `appT` instanceType)
[ funD 'toJSON
[ clause []
(normalB $ consToValue opts cons)
[]
]
, funD 'toEncoding
[ clause []
(normalB $ consToEncoding opts cons)
[]
]
]
where
classType = conT ''ToJSON
typeNames = map tvbName tvbs
instanceType = foldl' appT (conT name) $ map varT typeNames
-- | Generates a lambda expression which encodes the given data type as a
-- 'Value'.
| 1,147
|
deriveToJSON opts name =
withType name $ \tvbs cons -> fmap (:[]) $ fromCons tvbs cons
where
fromCons :: [TyVarBndr] -> [Con] -> Q Dec
fromCons tvbs cons =
instanceD (applyCon ''ToJSON typeNames)
(classType `appT` instanceType)
[ funD 'toJSON
[ clause []
(normalB $ consToValue opts cons)
[]
]
, funD 'toEncoding
[ clause []
(normalB $ consToEncoding opts cons)
[]
]
]
where
classType = conT ''ToJSON
typeNames = map tvbName tvbs
instanceType = foldl' appT (conT name) $ map varT typeNames
-- | Generates a lambda expression which encodes the given data type as a
-- 'Value'.
| 936
| true
| true
| 4
| 11
| 604
| 268
| 134
| 134
| null | null |
kmilner/tamarin-prover
|
lib/theory/src/Theory/Tools/Wellformedness.hs
|
gpl-3.0
|
-- | Wrap strings at word boundaries.
wrappedText :: Document d => String -> d
wrappedText = fsep . map text . words
| 116
|
wrappedText :: Document d => String -> d
wrappedText = fsep . map text . words
| 78
|
wrappedText = fsep . map text . words
| 37
| true
| true
| 0
| 7
| 22
| 34
| 17
| 17
| null | null |
daewon/til
|
exercism/haskell/raindrops/src/Raindrops.hs
|
mpl-2.0
|
isDiviedBy :: Int -> Int -> Bool
isDiviedBy n m = n `mod` m == 0
| 64
|
isDiviedBy :: Int -> Int -> Bool
isDiviedBy n m = n `mod` m == 0
| 64
|
isDiviedBy n m = n `mod` m == 0
| 31
| false
| true
| 0
| 6
| 15
| 34
| 18
| 16
| null | null |
davidzhulijun/TAM
|
RegisterMachine/Models/CMA3.hs
|
bsd-3-clause
|
trans (JM a1) = jjump (A a1)
| 39
|
trans (JM a1) = jjump (A a1)
| 39
|
trans (JM a1) = jjump (A a1)
| 39
| false
| false
| 0
| 7
| 17
| 24
| 11
| 13
| null | null |
keithodulaigh/Hets
|
CASL/CompositionTable/ToXml.hs
|
gpl-2.0
|
conTable2Elems :: Conversetable -> [Element]
conTable2Elems ct = case ct of
Conversetable a ->
[unode "conversetable" $ concatMap (\ (Contabentry b cs)
-> map (\ c -> conEntry2Elem $ Contabentry b [c]) cs) a]
_ -> []
| 231
|
conTable2Elems :: Conversetable -> [Element]
conTable2Elems ct = case ct of
Conversetable a ->
[unode "conversetable" $ concatMap (\ (Contabentry b cs)
-> map (\ c -> conEntry2Elem $ Contabentry b [c]) cs) a]
_ -> []
| 231
|
conTable2Elems ct = case ct of
Conversetable a ->
[unode "conversetable" $ concatMap (\ (Contabentry b cs)
-> map (\ c -> conEntry2Elem $ Contabentry b [c]) cs) a]
_ -> []
| 186
| false
| true
| 3
| 15
| 51
| 96
| 50
| 46
| null | null |
fabianbergmark/ECMA-262
|
src/Language/JavaScript/JSON.hs
|
bsd-2-clause
|
jsonStringCharacter =
do { notFollowedBy $ satisfy $ \c -> c == '"' || c == '\\' || c <= '\x001F'; sourceCharacter } <|>
do { char '\\'; jsonEscapeSequence }
| 161
|
jsonStringCharacter =
do { notFollowedBy $ satisfy $ \c -> c == '"' || c == '\\' || c <= '\x001F'; sourceCharacter } <|>
do { char '\\'; jsonEscapeSequence }
| 161
|
jsonStringCharacter =
do { notFollowedBy $ satisfy $ \c -> c == '"' || c == '\\' || c <= '\x001F'; sourceCharacter } <|>
do { char '\\'; jsonEscapeSequence }
| 161
| false
| false
| 0
| 14
| 33
| 64
| 33
| 31
| null | null |
badp/ganeti
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
sshsSshHostKey :: String
sshsSshHostKey = "ssh_host_key"
| 56
|
sshsSshHostKey :: String
sshsSshHostKey = "ssh_host_key"
| 56
|
sshsSshHostKey = "ssh_host_key"
| 31
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Trafo/Algebra.hs
|
bsd-3-clause
|
evalQuotRem :: IntegralType a -> (a,a) :-> (a,a)
evalQuotRem ty exp env
| IntegralDict <- integralDict ty
, Tuple (NilTup `SnocTup` x `SnocTup` y) <- exp -- TLM: untup2, but inlined to expose the Elt dictionary
, Just a <- propagate env x
, Just b <- propagate env y
= Stats.substitution "constant fold"
$ Just $ let (u,v) = quotRem a b
in tup2 (Const (fromElt u), Const (fromElt v))
| 439
|
evalQuotRem :: IntegralType a -> (a,a) :-> (a,a)
evalQuotRem ty exp env
| IntegralDict <- integralDict ty
, Tuple (NilTup `SnocTup` x `SnocTup` y) <- exp -- TLM: untup2, but inlined to expose the Elt dictionary
, Just a <- propagate env x
, Just b <- propagate env y
= Stats.substitution "constant fold"
$ Just $ let (u,v) = quotRem a b
in tup2 (Const (fromElt u), Const (fromElt v))
| 439
|
evalQuotRem ty exp env
| IntegralDict <- integralDict ty
, Tuple (NilTup `SnocTup` x `SnocTup` y) <- exp -- TLM: untup2, but inlined to expose the Elt dictionary
, Just a <- propagate env x
, Just b <- propagate env y
= Stats.substitution "constant fold"
$ Just $ let (u,v) = quotRem a b
in tup2 (Const (fromElt u), Const (fromElt v))
| 390
| false
| true
| 2
| 12
| 126
| 177
| 87
| 90
| null | null |
apyrgio/ganeti
|
src/Ganeti/HTools/Program/Hspace.hs
|
bsd-2-clause
|
printResults :: Bool -> Node.List -> Node.List -> Int -> Int
-> [(FailMode, Int)] -> IO ()
printResults True _ fin_nl num_instances allocs sreason = do
let fin_stats = Cluster.totalResources fin_nl
fin_instances = num_instances + allocs
exitWhen (num_instances + allocs /= Cluster.csNinst fin_stats) $
printf "internal inconsistency, allocated (%d)\
\ != counted (%d)\n" (num_instances + allocs)
(Cluster.csNinst fin_stats)
main_reason <- exitIfEmpty "Internal error, no failure reasons?!" sreason
printKeysHTS $ printStats PFinal fin_stats
printKeysHTS [ ("ALLOC_USAGE", printf "%.8f"
((fromIntegral num_instances::Double) /
fromIntegral fin_instances))
, ("ALLOC_INSTANCES", printf "%d" allocs)
, ("ALLOC_FAIL_REASON", map toUpper . show . fst $ main_reason)
]
printKeysHTS $ map (\(x, y) -> (printf "ALLOC_%s_CNT" (show x),
printf "%d" y)) sreason
| 1,073
|
printResults :: Bool -> Node.List -> Node.List -> Int -> Int
-> [(FailMode, Int)] -> IO ()
printResults True _ fin_nl num_instances allocs sreason = do
let fin_stats = Cluster.totalResources fin_nl
fin_instances = num_instances + allocs
exitWhen (num_instances + allocs /= Cluster.csNinst fin_stats) $
printf "internal inconsistency, allocated (%d)\
\ != counted (%d)\n" (num_instances + allocs)
(Cluster.csNinst fin_stats)
main_reason <- exitIfEmpty "Internal error, no failure reasons?!" sreason
printKeysHTS $ printStats PFinal fin_stats
printKeysHTS [ ("ALLOC_USAGE", printf "%.8f"
((fromIntegral num_instances::Double) /
fromIntegral fin_instances))
, ("ALLOC_INSTANCES", printf "%d" allocs)
, ("ALLOC_FAIL_REASON", map toUpper . show . fst $ main_reason)
]
printKeysHTS $ map (\(x, y) -> (printf "ALLOC_%s_CNT" (show x),
printf "%d" y)) sreason
| 1,073
|
printResults True _ fin_nl num_instances allocs sreason = do
let fin_stats = Cluster.totalResources fin_nl
fin_instances = num_instances + allocs
exitWhen (num_instances + allocs /= Cluster.csNinst fin_stats) $
printf "internal inconsistency, allocated (%d)\
\ != counted (%d)\n" (num_instances + allocs)
(Cluster.csNinst fin_stats)
main_reason <- exitIfEmpty "Internal error, no failure reasons?!" sreason
printKeysHTS $ printStats PFinal fin_stats
printKeysHTS [ ("ALLOC_USAGE", printf "%.8f"
((fromIntegral num_instances::Double) /
fromIntegral fin_instances))
, ("ALLOC_INSTANCES", printf "%d" allocs)
, ("ALLOC_FAIL_REASON", map toUpper . show . fst $ main_reason)
]
printKeysHTS $ map (\(x, y) -> (printf "ALLOC_%s_CNT" (show x),
printf "%d" y)) sreason
| 969
| false
| true
| 0
| 15
| 334
| 291
| 145
| 146
| null | null |
jstolarek/ghc
|
compiler/main/DriverPipeline.hs
|
bsd-3-clause
|
link' :: DynFlags -- dynamic flags
-> Bool -- attempt linking in batch mode?
-> HomePackageTable -- what to link
-> IO SuccessFlag
link' dflags batch_attempt_linking hpt
| batch_attempt_linking
= do
let
staticLink = case ghcLink dflags of
LinkStaticLib -> True
_ -> platformBinariesAreStaticLibs (targetPlatform dflags)
-- Don't attempt to link hsigs; they don't actually produce objects.
-- This is in contrast to hs-boot files, which will /eventually/
-- get objects.
home_mod_infos =
filter ((==Nothing).mi_sig_of.hm_iface) (eltsUFM hpt)
-- the packages we depend on
pkg_deps = concatMap (map fst . dep_pkgs . mi_deps . hm_iface) home_mod_infos
-- the linkables to link
linkables = map (expectJust "link".hm_linkable) home_mod_infos
debugTraceMsg dflags 3 (text "link: linkables are ..." $$ vcat (map ppr linkables))
-- check for the -no-link flag
if isNoLink (ghcLink dflags)
then do debugTraceMsg dflags 3 (text "link(batch): linking omitted (-c flag given).")
return Succeeded
else do
let getOfiles (LM _ _ us) = map nameOfObject (filter isObject us)
obj_files = concatMap getOfiles linkables
exe_file = exeFileName staticLink dflags
linking_needed <- linkingNeeded dflags staticLink linkables pkg_deps
if not (gopt Opt_ForceRecomp dflags) && not linking_needed
then do debugTraceMsg dflags 2 (text exe_file <+> ptext (sLit "is up to date, linking not required."))
return Succeeded
else do
compilationProgressMsg dflags ("Linking " ++ exe_file ++ " ...")
-- Don't showPass in Batch mode; doLink will do that for us.
let link = case ghcLink dflags of
LinkBinary -> linkBinary
LinkStaticLib -> linkStaticLibCheck
LinkDynLib -> linkDynLibCheck
other -> panicBadLink other
link dflags obj_files pkg_deps
debugTraceMsg dflags 3 (text "link: done")
-- linkBinary only returns if it succeeds
return Succeeded
| otherwise
= do debugTraceMsg dflags 3 (text "link(batch): upsweep (partially) failed OR" $$
text " Main.main not exported; not linking.")
return Succeeded
| 2,562
|
link' :: DynFlags -- dynamic flags
-> Bool -- attempt linking in batch mode?
-> HomePackageTable -- what to link
-> IO SuccessFlag
link' dflags batch_attempt_linking hpt
| batch_attempt_linking
= do
let
staticLink = case ghcLink dflags of
LinkStaticLib -> True
_ -> platformBinariesAreStaticLibs (targetPlatform dflags)
-- Don't attempt to link hsigs; they don't actually produce objects.
-- This is in contrast to hs-boot files, which will /eventually/
-- get objects.
home_mod_infos =
filter ((==Nothing).mi_sig_of.hm_iface) (eltsUFM hpt)
-- the packages we depend on
pkg_deps = concatMap (map fst . dep_pkgs . mi_deps . hm_iface) home_mod_infos
-- the linkables to link
linkables = map (expectJust "link".hm_linkable) home_mod_infos
debugTraceMsg dflags 3 (text "link: linkables are ..." $$ vcat (map ppr linkables))
-- check for the -no-link flag
if isNoLink (ghcLink dflags)
then do debugTraceMsg dflags 3 (text "link(batch): linking omitted (-c flag given).")
return Succeeded
else do
let getOfiles (LM _ _ us) = map nameOfObject (filter isObject us)
obj_files = concatMap getOfiles linkables
exe_file = exeFileName staticLink dflags
linking_needed <- linkingNeeded dflags staticLink linkables pkg_deps
if not (gopt Opt_ForceRecomp dflags) && not linking_needed
then do debugTraceMsg dflags 2 (text exe_file <+> ptext (sLit "is up to date, linking not required."))
return Succeeded
else do
compilationProgressMsg dflags ("Linking " ++ exe_file ++ " ...")
-- Don't showPass in Batch mode; doLink will do that for us.
let link = case ghcLink dflags of
LinkBinary -> linkBinary
LinkStaticLib -> linkStaticLibCheck
LinkDynLib -> linkDynLibCheck
other -> panicBadLink other
link dflags obj_files pkg_deps
debugTraceMsg dflags 3 (text "link: done")
-- linkBinary only returns if it succeeds
return Succeeded
| otherwise
= do debugTraceMsg dflags 3 (text "link(batch): upsweep (partially) failed OR" $$
text " Main.main not exported; not linking.")
return Succeeded
| 2,561
|
link' dflags batch_attempt_linking hpt
| batch_attempt_linking
= do
let
staticLink = case ghcLink dflags of
LinkStaticLib -> True
_ -> platformBinariesAreStaticLibs (targetPlatform dflags)
-- Don't attempt to link hsigs; they don't actually produce objects.
-- This is in contrast to hs-boot files, which will /eventually/
-- get objects.
home_mod_infos =
filter ((==Nothing).mi_sig_of.hm_iface) (eltsUFM hpt)
-- the packages we depend on
pkg_deps = concatMap (map fst . dep_pkgs . mi_deps . hm_iface) home_mod_infos
-- the linkables to link
linkables = map (expectJust "link".hm_linkable) home_mod_infos
debugTraceMsg dflags 3 (text "link: linkables are ..." $$ vcat (map ppr linkables))
-- check for the -no-link flag
if isNoLink (ghcLink dflags)
then do debugTraceMsg dflags 3 (text "link(batch): linking omitted (-c flag given).")
return Succeeded
else do
let getOfiles (LM _ _ us) = map nameOfObject (filter isObject us)
obj_files = concatMap getOfiles linkables
exe_file = exeFileName staticLink dflags
linking_needed <- linkingNeeded dflags staticLink linkables pkg_deps
if not (gopt Opt_ForceRecomp dflags) && not linking_needed
then do debugTraceMsg dflags 2 (text exe_file <+> ptext (sLit "is up to date, linking not required."))
return Succeeded
else do
compilationProgressMsg dflags ("Linking " ++ exe_file ++ " ...")
-- Don't showPass in Batch mode; doLink will do that for us.
let link = case ghcLink dflags of
LinkBinary -> linkBinary
LinkStaticLib -> linkStaticLibCheck
LinkDynLib -> linkDynLibCheck
other -> panicBadLink other
link dflags obj_files pkg_deps
debugTraceMsg dflags 3 (text "link: done")
-- linkBinary only returns if it succeeds
return Succeeded
| otherwise
= do debugTraceMsg dflags 3 (text "link(batch): upsweep (partially) failed OR" $$
text " Main.main not exported; not linking.")
return Succeeded
| 2,371
| false
| true
| 0
| 22
| 883
| 509
| 239
| 270
| null | null |
tkonolige/inline-julia
|
src/Language/Julia/Inline/Marshal.hs
|
bsd-3-clause
|
-- * Converting Haskell values into Julia values
hsInt :: Int -> IO JLVal
hsInt i = case finiteBitSize i of
64 -> hsInt64 $ fromIntegral i
32 -> hsInt32 $ fromIntegral i
| 194
|
hsInt :: Int -> IO JLVal
hsInt i = case finiteBitSize i of
64 -> hsInt64 $ fromIntegral i
32 -> hsInt32 $ fromIntegral i
| 144
|
hsInt i = case finiteBitSize i of
64 -> hsInt64 $ fromIntegral i
32 -> hsInt32 $ fromIntegral i
| 119
| true
| true
| 0
| 9
| 57
| 58
| 27
| 31
| null | null |
pparkkin/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpHasSideEffects PutMVarOp = True
| 37
|
primOpHasSideEffects PutMVarOp = True
| 37
|
primOpHasSideEffects PutMVarOp = True
| 37
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
jtdaugherty/vty
|
tools/BuildWidthTable.hs
|
bsd-3-clause
|
updateConfigFromArg (OutputPath p) c =
c { configOutputPath = Just p }
| 74
|
updateConfigFromArg (OutputPath p) c =
c { configOutputPath = Just p }
| 74
|
updateConfigFromArg (OutputPath p) c =
c { configOutputPath = Just p }
| 74
| false
| false
| 1
| 8
| 15
| 36
| 15
| 21
| null | null |
KommuSoft/vty-ui
|
test/src/Tests/Edit.hs
|
bsd-3-clause
|
doClippingTest :: Property
doClippingTest =
property $ forAll textGen $ \t ->
forAll (choose (Phys 0, textWidth t + Phys 10)) $ \leftCrop ->
forAll (choose (Phys 0, textWidth t + Phys 10)) $ \resWidth ->
let rect = ClipRect { clipLeft = leftCrop
, clipWidth = resWidth
, clipTop = 0
, clipHeight = 1
}
[(_, ls, rs)] = clip2d rect [t]
[res] = doClipping [t] rect
in strWidth res == 0
|| and [ not ls || (ls && head res == indicatorChar)
, not rs || (rs && last res == indicatorChar)
]
| 758
|
doClippingTest :: Property
doClippingTest =
property $ forAll textGen $ \t ->
forAll (choose (Phys 0, textWidth t + Phys 10)) $ \leftCrop ->
forAll (choose (Phys 0, textWidth t + Phys 10)) $ \resWidth ->
let rect = ClipRect { clipLeft = leftCrop
, clipWidth = resWidth
, clipTop = 0
, clipHeight = 1
}
[(_, ls, rs)] = clip2d rect [t]
[res] = doClipping [t] rect
in strWidth res == 0
|| and [ not ls || (ls && head res == indicatorChar)
, not rs || (rs && last res == indicatorChar)
]
| 758
|
doClippingTest =
property $ forAll textGen $ \t ->
forAll (choose (Phys 0, textWidth t + Phys 10)) $ \leftCrop ->
forAll (choose (Phys 0, textWidth t + Phys 10)) $ \resWidth ->
let rect = ClipRect { clipLeft = leftCrop
, clipWidth = resWidth
, clipTop = 0
, clipHeight = 1
}
[(_, ls, rs)] = clip2d rect [t]
[res] = doClipping [t] rect
in strWidth res == 0
|| and [ not ls || (ls && head res == indicatorChar)
, not rs || (rs && last res == indicatorChar)
]
| 731
| false
| true
| 2
| 20
| 371
| 244
| 126
| 118
| null | null |
GaloisInc/saw-script
|
heapster-saw/src/Verifier/SAW/Heapster/archival/TypeTranslation.hs
|
bsd-3-clause
|
testTypeTranslation :: Integer -> TopLevel ()
testTypeTranslation i =
do sc <- getSharedContext
let (p, t) = (tests !! fromInteger i)
expected <- io $ completeOpenTerm sc $ t
obtained <- io $ completeOpenTerm sc $ typeTranslate empty p
if expected == obtained
then io $ putStrLn "Success!"
else io $ putStrLn $ "Error in testPermTranslation for test case " ++ show i
| 402
|
testTypeTranslation :: Integer -> TopLevel ()
testTypeTranslation i =
do sc <- getSharedContext
let (p, t) = (tests !! fromInteger i)
expected <- io $ completeOpenTerm sc $ t
obtained <- io $ completeOpenTerm sc $ typeTranslate empty p
if expected == obtained
then io $ putStrLn "Success!"
else io $ putStrLn $ "Error in testPermTranslation for test case " ++ show i
| 402
|
testTypeTranslation i =
do sc <- getSharedContext
let (p, t) = (tests !! fromInteger i)
expected <- io $ completeOpenTerm sc $ t
obtained <- io $ completeOpenTerm sc $ typeTranslate empty p
if expected == obtained
then io $ putStrLn "Success!"
else io $ putStrLn $ "Error in testPermTranslation for test case " ++ show i
| 356
| false
| true
| 0
| 13
| 98
| 139
| 64
| 75
| null | null |
ShrykeWindgrace/ChGKCards
|
cli/src/Cli.hs
|
gpl-3.0
|
possibleConfigs :: [CardConfig]
possibleConfigs =
pure CardConfig <*>
[1..6] <*>
[36, 45] <*>
[Just 3, Nothing] <*>
[True, False] <*>
[True] <*>
[True]
| 179
|
possibleConfigs :: [CardConfig]
possibleConfigs =
pure CardConfig <*>
[1..6] <*>
[36, 45] <*>
[Just 3, Nothing] <*>
[True, False] <*>
[True] <*>
[True]
| 179
|
possibleConfigs =
pure CardConfig <*>
[1..6] <*>
[36, 45] <*>
[Just 3, Nothing] <*>
[True, False] <*>
[True] <*>
[True]
| 147
| false
| true
| 0
| 11
| 50
| 73
| 41
| 32
| null | null |
brownplt/ovid
|
src/Ovid/Abstraction.hs
|
bsd-2-clause
|
stringPatCat SAny SAny = SAny
| 29
|
stringPatCat SAny SAny = SAny
| 29
|
stringPatCat SAny SAny = SAny
| 29
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
neobrain/neobot
|
app/bot.hs
|
bsd-3-clause
|
handleIRCChannelMessage context (IRCMessage _ "!about") = sendMessage context "I'm indeed really awesome! Learn more about me in #neobot."
| 140
|
handleIRCChannelMessage context (IRCMessage _ "!about") = sendMessage context "I'm indeed really awesome! Learn more about me in #neobot."
| 140
|
handleIRCChannelMessage context (IRCMessage _ "!about") = sendMessage context "I'm indeed really awesome! Learn more about me in #neobot."
| 140
| false
| false
| 0
| 7
| 19
| 25
| 11
| 14
| null | null |
sdiehl/ghc
|
testsuite/tests/th/TH_unresolvedInfix.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- Patterns --
--------------------------------------------------------------------------------
patterns = [
-------------- Completely-unresolved patterns
case N :+ (N :* N) of
[p1|unused|] -> True,
case N :+ (N :* N) of
[p2|unused|] -> True,
case (N :+ N) :+ N of
[p3|unused|] -> True,
case (N :+ N) :+ N of
[p4|unused|] -> True,
-------------- Completely-resolved patterns
case N :+ (N :* N) of
[p5|unused|] -> True,
case (N :+ N) :* N of
[p6|unused|] -> True,
case N :+ (N :+ N) of
[p7|unused|] -> True,
case (N :+ N) :+ N of
[p8|unused|] -> True,
-------------- Mixed resolved/unresolved
case ((N :+ N) :* N) :+ N of
[p9|unused|] -> True,
case N :+ (N :* (N :+ N)) of
[p10|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p11|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p12|unused|] -> True,
-------------- Parens
case (N :+ (N :* N)) :+ (N :* N) of
[p13|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p14|unused|] -> True,
case (N :+ (N :* N)) :+ N of
[p15|unused|] -> True
]
| 1,222
|
patterns = [
-------------- Completely-unresolved patterns
case N :+ (N :* N) of
[p1|unused|] -> True,
case N :+ (N :* N) of
[p2|unused|] -> True,
case (N :+ N) :+ N of
[p3|unused|] -> True,
case (N :+ N) :+ N of
[p4|unused|] -> True,
-------------- Completely-resolved patterns
case N :+ (N :* N) of
[p5|unused|] -> True,
case (N :+ N) :* N of
[p6|unused|] -> True,
case N :+ (N :+ N) of
[p7|unused|] -> True,
case (N :+ N) :+ N of
[p8|unused|] -> True,
-------------- Mixed resolved/unresolved
case ((N :+ N) :* N) :+ N of
[p9|unused|] -> True,
case N :+ (N :* (N :+ N)) of
[p10|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p11|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p12|unused|] -> True,
-------------- Parens
case (N :+ (N :* N)) :+ (N :* N) of
[p13|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p14|unused|] -> True,
case (N :+ (N :* N)) :+ N of
[p15|unused|] -> True
]
| 979
|
patterns = [
-------------- Completely-unresolved patterns
case N :+ (N :* N) of
[p1|unused|] -> True,
case N :+ (N :* N) of
[p2|unused|] -> True,
case (N :+ N) :+ N of
[p3|unused|] -> True,
case (N :+ N) :+ N of
[p4|unused|] -> True,
-------------- Completely-resolved patterns
case N :+ (N :* N) of
[p5|unused|] -> True,
case (N :+ N) :* N of
[p6|unused|] -> True,
case N :+ (N :+ N) of
[p7|unused|] -> True,
case (N :+ N) :+ N of
[p8|unused|] -> True,
-------------- Mixed resolved/unresolved
case ((N :+ N) :* N) :+ N of
[p9|unused|] -> True,
case N :+ (N :* (N :+ N)) of
[p10|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p11|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p12|unused|] -> True,
-------------- Parens
case (N :+ (N :* N)) :+ (N :* N) of
[p13|unused|] -> True,
case (N :+ N) :* (N :+ N) of
[p14|unused|] -> True,
case (N :+ (N :* N)) :+ N of
[p15|unused|] -> True
]
| 979
| true
| false
| 1
| 12
| 342
| 493
| 297
| 196
| null | null |
spechub/Hets
|
OWL2/AS.hs
|
gpl-2.0
|
-- | sets the correct prefix for the predefined datatypes
setDatatypePrefix :: IRI -> IRI
setDatatypePrefix i = case isDatatypeKeyAux i of
(p, l) : _ -> i {prefixName = p, iFragment = l}
_ -> error $ showIRICompact i ++ " is not a predefined datatype"
-- | checks if the IRI is part of the built-in ones and puts the correct prefix
| 336
|
setDatatypePrefix :: IRI -> IRI
setDatatypePrefix i = case isDatatypeKeyAux i of
(p, l) : _ -> i {prefixName = p, iFragment = l}
_ -> error $ showIRICompact i ++ " is not a predefined datatype"
-- | checks if the IRI is part of the built-in ones and puts the correct prefix
| 278
|
setDatatypePrefix i = case isDatatypeKeyAux i of
(p, l) : _ -> i {prefixName = p, iFragment = l}
_ -> error $ showIRICompact i ++ " is not a predefined datatype"
-- | checks if the IRI is part of the built-in ones and puts the correct prefix
| 246
| true
| true
| 4
| 7
| 68
| 71
| 38
| 33
| null | null |
romanb/amazonka
|
amazonka-swf/gen/Network/AWS/SWF/Types.hs
|
mpl-2.0
|
-- | Provides details of the 'RecordMarker' decision. It is not set for other
-- decision types.
dRecordMarkerDecisionAttributes :: Lens' Decision (Maybe RecordMarkerDecisionAttributes)
dRecordMarkerDecisionAttributes =
lens _dRecordMarkerDecisionAttributes
(\s a -> s { _dRecordMarkerDecisionAttributes = a })
| 322
|
dRecordMarkerDecisionAttributes :: Lens' Decision (Maybe RecordMarkerDecisionAttributes)
dRecordMarkerDecisionAttributes =
lens _dRecordMarkerDecisionAttributes
(\s a -> s { _dRecordMarkerDecisionAttributes = a })
| 225
|
dRecordMarkerDecisionAttributes =
lens _dRecordMarkerDecisionAttributes
(\s a -> s { _dRecordMarkerDecisionAttributes = a })
| 136
| true
| true
| 0
| 9
| 47
| 47
| 26
| 21
| null | null |
bgamari/shaking-up-ghc
|
src/Settings/Default.hs
|
bsd-3-clause
|
-- | Default build ways for the RTS.
defaultRtsWays :: Ways
defaultRtsWays = do
ways <- getLibraryWays
mconcat
[ pure [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? pure [threadedProfiling]
{- , (dynamic `elem` ways) ?
pure [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic
, loggingDynamic, threadedLoggingDynamic ] -}
]
-- Please update doc/flavours.md when changing the default build flavour.
-- | Default build flavour. Other build flavours are defined in modules
-- @Settings.Flavours.*@. Users can add new build flavours in "UserSettings".
| 666
|
defaultRtsWays :: Ways
defaultRtsWays = do
ways <- getLibraryWays
mconcat
[ pure [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? pure [threadedProfiling]
{- , (dynamic `elem` ways) ?
pure [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic
, loggingDynamic, threadedLoggingDynamic ] -}
]
-- Please update doc/flavours.md when changing the default build flavour.
-- | Default build flavour. Other build flavours are defined in modules
-- @Settings.Flavours.*@. Users can add new build flavours in "UserSettings".
| 629
|
defaultRtsWays = do
ways <- getLibraryWays
mconcat
[ pure [ logging, debug, threaded, threadedDebug, threadedLogging ]
, (profiling `elem` ways) ? pure [threadedProfiling]
{- , (dynamic `elem` ways) ?
pure [ dynamic, debugDynamic, threadedDynamic, threadedDebugDynamic
, loggingDynamic, threadedLoggingDynamic ] -}
]
-- Please update doc/flavours.md when changing the default build flavour.
-- | Default build flavour. Other build flavours are defined in modules
-- @Settings.Flavours.*@. Users can add new build flavours in "UserSettings".
| 606
| true
| true
| 0
| 12
| 149
| 79
| 43
| 36
| null | null |
esengie/fpl-exploration-tool
|
src/langGenerator/Lang.hs
|
bsd-3-clause
|
infer ctx TnDef = report "TnDef"
| 32
|
infer ctx TnDef = report "TnDef"
| 32
|
infer ctx TnDef = report "TnDef"
| 32
| false
| false
| 0
| 5
| 5
| 14
| 6
| 8
| null | null |
Chiel92/ants
|
AntSkull.hs
|
gpl-2.0
|
turn2 :: Entry -> Turn -> Cont -> M ()
turn2 _this t k = do
_t2 <- alloc
turn _this t _t2
turn _t2 t k
| 115
|
turn2 :: Entry -> Turn -> Cont -> M ()
turn2 _this t k = do
_t2 <- alloc
turn _this t _t2
turn _t2 t k
| 115
|
turn2 _this t k = do
_t2 <- alloc
turn _this t _t2
turn _t2 t k
| 76
| false
| true
| 0
| 9
| 39
| 62
| 28
| 34
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/SLASHEQ_2.hs
|
mit
|
not :: MyBool -> MyBool;
not MyTrue = MyFalse
| 47
|
not :: MyBool -> MyBool
not MyTrue = MyFalse
| 46
|
not MyTrue = MyFalse
| 20
| false
| true
| 0
| 5
| 10
| 24
| 11
| 13
| null | null |
tek/proteome
|
packages/proteome/lib/Proteome/Project/Activate.hs
|
mit
|
proNext ::
NvimE e m =>
MonadRibo m =>
MonadDeepState s Env m =>
m ()
proNext = do
cycleProjectIndex (+1)
activateCurrentProject
| 140
|
proNext ::
NvimE e m =>
MonadRibo m =>
MonadDeepState s Env m =>
m ()
proNext = do
cycleProjectIndex (+1)
activateCurrentProject
| 140
|
proNext = do
cycleProjectIndex (+1)
activateCurrentProject
| 62
| false
| true
| 0
| 9
| 33
| 56
| 26
| 30
| null | null |
wavewave/ghcjs-vdom
|
example/Example.hs
|
mit
|
step :: State -> State
step (State x y dx dy w h p) =
let dx' = if x==0 then 1 else if x==(w-1) then -1 else dx
dy' = if y==0 then 1 else if y==(h-1) then -1 else dy
x' = x+dx'
y' = y+dy'
p' = setPixel x' y' red (setPixel x y white p)
in State x' y' dx' dy' w h p'
| 296
|
step :: State -> State
step (State x y dx dy w h p) =
let dx' = if x==0 then 1 else if x==(w-1) then -1 else dx
dy' = if y==0 then 1 else if y==(h-1) then -1 else dy
x' = x+dx'
y' = y+dy'
p' = setPixel x' y' red (setPixel x y white p)
in State x' y' dx' dy' w h p'
| 296
|
step (State x y dx dy w h p) =
let dx' = if x==0 then 1 else if x==(w-1) then -1 else dx
dy' = if y==0 then 1 else if y==(h-1) then -1 else dy
x' = x+dx'
y' = y+dy'
p' = setPixel x' y' red (setPixel x y white p)
in State x' y' dx' dy' w h p'
| 273
| false
| true
| 0
| 13
| 99
| 185
| 95
| 90
| null | null |
RaminHAL9001/rose-trie
|
src/Data/Tree/RoseTrie.hs
|
gpl-3.0
|
-- | The empty 'RoseTrie'.
empty :: RoseTrie p o
empty = RoseTrie (Nothing, M.empty)
| 84
|
empty :: RoseTrie p o
empty = RoseTrie (Nothing, M.empty)
| 57
|
empty = RoseTrie (Nothing, M.empty)
| 35
| true
| true
| 0
| 7
| 14
| 28
| 15
| 13
| null | null |
aurapm/aura
|
aura/exec/Aura/Commands/A.hs
|
gpl-3.0
|
reportPkgsToUpgrade :: [(AurInfo, Versioning)] -> [PkgName] -> RIO Env ()
reportPkgsToUpgrade ups pns = do
ss <- asks settings
notify ss reportPkgsToUpgrade_1
liftIO $ putDoc (colourCheck ss . vcat $ map f ups' <> map g devels) >> putTextLn "\n"
where devels = map pnName pns
ups' = map (second prettyV) ups
nLen = maximum $ map (T.length . aurNameOf . fst) ups <> map T.length devels
vLen = maximum $ map (T.length . snd) ups'
g = annotate (color Cyan) . pretty
f (p, v) = hsep [ cyan . fill nLen . pretty $ aurNameOf p
, "::"
, yellow . fill vLen $ pretty v
, "->"
, green . pretty $ aurVersionOf p ]
| 767
|
reportPkgsToUpgrade :: [(AurInfo, Versioning)] -> [PkgName] -> RIO Env ()
reportPkgsToUpgrade ups pns = do
ss <- asks settings
notify ss reportPkgsToUpgrade_1
liftIO $ putDoc (colourCheck ss . vcat $ map f ups' <> map g devels) >> putTextLn "\n"
where devels = map pnName pns
ups' = map (second prettyV) ups
nLen = maximum $ map (T.length . aurNameOf . fst) ups <> map T.length devels
vLen = maximum $ map (T.length . snd) ups'
g = annotate (color Cyan) . pretty
f (p, v) = hsep [ cyan . fill nLen . pretty $ aurNameOf p
, "::"
, yellow . fill vLen $ pretty v
, "->"
, green . pretty $ aurVersionOf p ]
| 767
|
reportPkgsToUpgrade ups pns = do
ss <- asks settings
notify ss reportPkgsToUpgrade_1
liftIO $ putDoc (colourCheck ss . vcat $ map f ups' <> map g devels) >> putTextLn "\n"
where devels = map pnName pns
ups' = map (second prettyV) ups
nLen = maximum $ map (T.length . aurNameOf . fst) ups <> map T.length devels
vLen = maximum $ map (T.length . snd) ups'
g = annotate (color Cyan) . pretty
f (p, v) = hsep [ cyan . fill nLen . pretty $ aurNameOf p
, "::"
, yellow . fill vLen $ pretty v
, "->"
, green . pretty $ aurVersionOf p ]
| 693
| false
| true
| 5
| 14
| 282
| 291
| 142
| 149
| null | null |
kristoff3r/importify
|
test/hspec/Test/File.hs
|
mit
|
loadTestData :: Path Rel Dir -> Path Rel File -> IO (Text, Text)
loadTestData testDirPath testCasePath = do
let fullPathToTest = testDirPath </> testCasePath
goldenExamplePath <- fullPathToTest -<.> ".golden"
goldenExampleSrc <- readFile (fromRelFile goldenExamplePath)
Right importifiedSrc <- importifyFileContent fullPathToTest
return (importifiedSrc, goldenExampleSrc)
| 397
|
loadTestData :: Path Rel Dir -> Path Rel File -> IO (Text, Text)
loadTestData testDirPath testCasePath = do
let fullPathToTest = testDirPath </> testCasePath
goldenExamplePath <- fullPathToTest -<.> ".golden"
goldenExampleSrc <- readFile (fromRelFile goldenExamplePath)
Right importifiedSrc <- importifyFileContent fullPathToTest
return (importifiedSrc, goldenExampleSrc)
| 397
|
loadTestData testDirPath testCasePath = do
let fullPathToTest = testDirPath </> testCasePath
goldenExamplePath <- fullPathToTest -<.> ".golden"
goldenExampleSrc <- readFile (fromRelFile goldenExamplePath)
Right importifiedSrc <- importifyFileContent fullPathToTest
return (importifiedSrc, goldenExampleSrc)
| 332
| false
| true
| 0
| 10
| 67
| 108
| 50
| 58
| null | null |
apyrgio/snf-ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- * Key files for SSH daemon
sshHostDsaPriv :: String
sshHostDsaPriv = sshConfigDir ++ "/ssh_host_dsa_key"
| 108
|
sshHostDsaPriv :: String
sshHostDsaPriv = sshConfigDir ++ "/ssh_host_dsa_key"
| 77
|
sshHostDsaPriv = sshConfigDir ++ "/ssh_host_dsa_key"
| 52
| true
| true
| 0
| 5
| 15
| 16
| 9
| 7
| null | null |
CRogers/stack
|
src/Stack/Build/Execute.hs
|
bsd-3-clause
|
preFetch :: M env m => Plan -> m ()
preFetch plan
| Set.null idents = $logDebug "Nothing to fetch"
| otherwise = do
$logDebug $ T.pack $
"Prefetching: " ++
intercalate ", " (map packageIdentifierString $ Set.toList idents)
menv <- getMinimalEnvOverride
fetchPackages menv idents
where
idents = Set.unions $ map toIdent $ Map.toList $ planTasks plan
toIdent (name, task) =
case taskType task of
TTLocal _ -> Set.empty
TTUpstream package _ -> Set.singleton $ PackageIdentifier
name
(packageVersion package)
| 635
|
preFetch :: M env m => Plan -> m ()
preFetch plan
| Set.null idents = $logDebug "Nothing to fetch"
| otherwise = do
$logDebug $ T.pack $
"Prefetching: " ++
intercalate ", " (map packageIdentifierString $ Set.toList idents)
menv <- getMinimalEnvOverride
fetchPackages menv idents
where
idents = Set.unions $ map toIdent $ Map.toList $ planTasks plan
toIdent (name, task) =
case taskType task of
TTLocal _ -> Set.empty
TTUpstream package _ -> Set.singleton $ PackageIdentifier
name
(packageVersion package)
| 635
|
preFetch plan
| Set.null idents = $logDebug "Nothing to fetch"
| otherwise = do
$logDebug $ T.pack $
"Prefetching: " ++
intercalate ", " (map packageIdentifierString $ Set.toList idents)
menv <- getMinimalEnvOverride
fetchPackages menv idents
where
idents = Set.unions $ map toIdent $ Map.toList $ planTasks plan
toIdent (name, task) =
case taskType task of
TTLocal _ -> Set.empty
TTUpstream package _ -> Set.singleton $ PackageIdentifier
name
(packageVersion package)
| 599
| false
| true
| 1
| 13
| 209
| 209
| 92
| 117
| null | null |
alexander-matsievsky/HackerRank
|
All_Domains/Functional_Programming/Introduction/src/FpFilterPositionsInAList.hs
|
mit
|
main :: IO ()
main = interact run
| 33
|
main :: IO ()
main = interact run
| 33
|
main = interact run
| 19
| false
| true
| 0
| 6
| 7
| 19
| 9
| 10
| null | null |
mcschroeder/ghc
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
-- data TyLit = ...
numTyLitName, strTyLitName :: Name
numTyLitName = libFun (fsLit "numTyLit") numTyLitIdKey
| 109
|
numTyLitName, strTyLitName :: Name
numTyLitName = libFun (fsLit "numTyLit") numTyLitIdKey
| 89
|
numTyLitName = libFun (fsLit "numTyLit") numTyLitIdKey
| 54
| true
| true
| 0
| 7
| 14
| 25
| 14
| 11
| null | null |
acowley/ghc
|
compiler/coreSyn/TrieMap.hs
|
bsd-3-clause
|
xtBndr :: CmEnv -> Var -> XT a -> BndrMap a -> BndrMap a
xtBndr env v f = xtG (D env (varType v)) f
| 99
|
xtBndr :: CmEnv -> Var -> XT a -> BndrMap a -> BndrMap a
xtBndr env v f = xtG (D env (varType v)) f
| 99
|
xtBndr env v f = xtG (D env (varType v)) f
| 42
| false
| true
| 0
| 10
| 24
| 67
| 30
| 37
| null | null |
shlevy/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
narrowOp _ = Nothing
| 33
|
narrowOp _ = Nothing
| 33
|
narrowOp _ = Nothing
| 33
| false
| false
| 0
| 4
| 16
| 10
| 4
| 6
| null | null |
Athas/getflag
|
System/Console/GetFlag.hs
|
mit
|
errUnrec :: String -> String
errUnrec optStr = "unrecognized option `" ++ optStr ++ "'\n"
| 89
|
errUnrec :: String -> String
errUnrec optStr = "unrecognized option `" ++ optStr ++ "'\n"
| 89
|
errUnrec optStr = "unrecognized option `" ++ optStr ++ "'\n"
| 60
| false
| true
| 0
| 6
| 14
| 26
| 13
| 13
| null | null |
gcampax/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
isOverloadedTy _ = False
| 38
|
isOverloadedTy _ = False
| 38
|
isOverloadedTy _ = False
| 38
| false
| false
| 0
| 4
| 17
| 10
| 4
| 6
| null | null |
sdiehl/ghc
|
libraries/base/GHC/IO/Handle/Internals.hs
|
bsd-3-clause
|
wantWritableHandle fun h@(DuplexHandle _ _ m) act
= wantWritableHandle' fun h m act
| 85
|
wantWritableHandle fun h@(DuplexHandle _ _ m) act
= wantWritableHandle' fun h m act
| 85
|
wantWritableHandle fun h@(DuplexHandle _ _ m) act
= wantWritableHandle' fun h m act
| 85
| false
| false
| 0
| 8
| 14
| 35
| 17
| 18
| null | null |
gaeldeest/ocaml-isl
|
scripts/generate-bindings.hs
|
mit
|
mlSigTypes = M.union sigList mlTypes
where sigList = M.fromList [ (VOID, "unit")
, (UINT, "int")
]
-- lookupType t | trace (show t) False = undefined
| 210
|
mlSigTypes = M.union sigList mlTypes
where sigList = M.fromList [ (VOID, "unit")
, (UINT, "int")
]
-- lookupType t | trace (show t) False = undefined
| 210
|
mlSigTypes = M.union sigList mlTypes
where sigList = M.fromList [ (VOID, "unit")
, (UINT, "int")
]
-- lookupType t | trace (show t) False = undefined
| 210
| false
| false
| 0
| 7
| 86
| 45
| 25
| 20
| null | null |
DanielSchuessler/hstri
|
Blender/Blenderable.hs
|
gpl-3.0
|
ba_visibility :: Blenderable s -> AnySimplex2Of s -> Visibility
ba_visibility = pr_visibility . ba_pr
| 101
|
ba_visibility :: Blenderable s -> AnySimplex2Of s -> Visibility
ba_visibility = pr_visibility . ba_pr
| 101
|
ba_visibility = pr_visibility . ba_pr
| 37
| false
| true
| 0
| 8
| 13
| 36
| 15
| 21
| null | null |
yiannist/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
ldpDefaultMetavg :: String
ldpDefaultMetavg = "default-metavg"
| 62
|
ldpDefaultMetavg :: String
ldpDefaultMetavg = "default-metavg"
| 62
|
ldpDefaultMetavg = "default-metavg"
| 35
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
phischu/pem-images
|
src/ImageQuery/Printer.hs
|
bsd-3-clause
|
imageQueryPrinter (AreaHistogram binsize power) = unwords [
"output_area_histogram",show binsize,powerPrinter power]
| 120
|
imageQueryPrinter (AreaHistogram binsize power) = unwords [
"output_area_histogram",show binsize,powerPrinter power]
| 120
|
imageQueryPrinter (AreaHistogram binsize power) = unwords [
"output_area_histogram",show binsize,powerPrinter power]
| 120
| false
| false
| 0
| 7
| 13
| 35
| 17
| 18
| null | null |
x-y-z/cabal
|
Cabal/Distribution/Simple/LocalBuildInfo.hs
|
bsd-3-clause
|
componentDisabledReason (CBench bm)
| not (buildable (benchmarkBuildInfo bm)) = Just DisabledComponent
| not (benchmarkEnabled bm) = Just DisabledAllBenchmarks
| 177
|
componentDisabledReason (CBench bm)
| not (buildable (benchmarkBuildInfo bm)) = Just DisabledComponent
| not (benchmarkEnabled bm) = Just DisabledAllBenchmarks
| 177
|
componentDisabledReason (CBench bm)
| not (buildable (benchmarkBuildInfo bm)) = Just DisabledComponent
| not (benchmarkEnabled bm) = Just DisabledAllBenchmarks
| 177
| false
| false
| 0
| 12
| 35
| 63
| 27
| 36
| null | null |
rcook/hqdsl
|
src/lib/Source.hs
|
mit
|
table :: Source -> Table
table (Source t) = t
| 45
|
table :: Source -> Table
table (Source t) = t
| 45
|
table (Source t) = t
| 20
| false
| true
| 0
| 6
| 9
| 28
| 13
| 15
| null | null |
yav/alsa-haskell
|
Sound/Alsa/Sequencer.hs
|
mit
|
-- | Make a note whose unspecified fields contain 0.
simple_note
:: Word8 -- ^ Channel.
-> Word8 -- ^ Note.
-> Word8 -- ^ Velocity.
-> Note
simple_note c n v = Note { note_channel = c, note_note = n, note_velocity = v
, note_off_velocity = 0, note_duration = 0
}
| 323
|
simple_note
:: Word8 -- ^ Channel.
-> Word8 -- ^ Note.
-> Word8 -- ^ Velocity.
-> Note
simple_note c n v = Note { note_channel = c, note_note = n, note_velocity = v
, note_off_velocity = 0, note_duration = 0
}
| 270
|
simple_note c n v = Note { note_channel = c, note_note = n, note_velocity = v
, note_off_velocity = 0, note_duration = 0
}
| 172
| true
| true
| 0
| 9
| 112
| 72
| 41
| 31
| null | null |
alanz/Blobs
|
lib/DData/IntSet.hs
|
lgpl-2.1
|
withBar bars = "| ":bars
| 27
|
withBar bars = "| ":bars
| 27
|
withBar bars = "| ":bars
| 27
| false
| false
| 0
| 5
| 7
| 13
| 6
| 7
| null | null |
cnc-patch/disass
|
src/Language/Assembly/X86/Parse.hs
|
bsd-3-clause
|
parseGrp8 :: (Stream s m Word8, Monad m) => Word8 -> ParsecT s PState m Instr
parseGrp8 b = do
opsize <- instrOperandSize
(op1, op2, mod, reg, rm) <- parseAddress32 opsize
imm <- anyWord8
case reg of
4 -> return $ Instr BT opsize [op1, OpImm (fromIntegral imm)]
5 -> return $ Instr BTS opsize [op1, OpImm (fromIntegral imm)]
6 -> return $ Instr BTR opsize [op1, OpImm (fromIntegral imm)]
7 -> return $ Instr BTC opsize [op1, OpImm (fromIntegral imm)]
_ -> parseInvalidOpcode b
| 504
|
parseGrp8 :: (Stream s m Word8, Monad m) => Word8 -> ParsecT s PState m Instr
parseGrp8 b = do
opsize <- instrOperandSize
(op1, op2, mod, reg, rm) <- parseAddress32 opsize
imm <- anyWord8
case reg of
4 -> return $ Instr BT opsize [op1, OpImm (fromIntegral imm)]
5 -> return $ Instr BTS opsize [op1, OpImm (fromIntegral imm)]
6 -> return $ Instr BTR opsize [op1, OpImm (fromIntegral imm)]
7 -> return $ Instr BTC opsize [op1, OpImm (fromIntegral imm)]
_ -> parseInvalidOpcode b
| 504
|
parseGrp8 b = do
opsize <- instrOperandSize
(op1, op2, mod, reg, rm) <- parseAddress32 opsize
imm <- anyWord8
case reg of
4 -> return $ Instr BT opsize [op1, OpImm (fromIntegral imm)]
5 -> return $ Instr BTS opsize [op1, OpImm (fromIntegral imm)]
6 -> return $ Instr BTR opsize [op1, OpImm (fromIntegral imm)]
7 -> return $ Instr BTC opsize [op1, OpImm (fromIntegral imm)]
_ -> parseInvalidOpcode b
| 426
| false
| true
| 0
| 15
| 112
| 229
| 114
| 115
| null | null |
Tayacan/Vidar
|
Vidar/Parser.hs
|
mit
|
unordered :: ReadP Block
unordered = do
_ <- symbol '{'
contents <- sepBy element (symbol ',')
_ <- symbol '}'
return $ UnorderedBlock contents
| 159
|
unordered :: ReadP Block
unordered = do
_ <- symbol '{'
contents <- sepBy element (symbol ',')
_ <- symbol '}'
return $ UnorderedBlock contents
| 159
|
unordered = do
_ <- symbol '{'
contents <- sepBy element (symbol ',')
_ <- symbol '}'
return $ UnorderedBlock contents
| 134
| false
| true
| 0
| 10
| 40
| 62
| 27
| 35
| null | null |
Numberartificial/workflow
|
snipets/src/Craft/Chapter19/RegExp.hs
|
mit
|
enumerate (St re)
= result
where
result =
[""] ++ (enumerate re `cartesian` result)
-- Auxiliary functions
-- interleave and product for potentially infinite lists
| 195
|
enumerate (St re)
= result
where
result =
[""] ++ (enumerate re `cartesian` result)
-- Auxiliary functions
-- interleave and product for potentially infinite lists
| 195
|
enumerate (St re)
= result
where
result =
[""] ++ (enumerate re `cartesian` result)
-- Auxiliary functions
-- interleave and product for potentially infinite lists
| 195
| false
| false
| 3
| 10
| 56
| 51
| 24
| 27
| null | null |
onponomarev/ganeti
|
src/Ganeti/Query/Query.hs
|
bsd-2-clause
|
queryFields (QueryFields (ItemTypeOpCode QRExport) fields) =
Ok $ fieldsExtractor Export.fieldsMap fields
| 107
|
queryFields (QueryFields (ItemTypeOpCode QRExport) fields) =
Ok $ fieldsExtractor Export.fieldsMap fields
| 107
|
queryFields (QueryFields (ItemTypeOpCode QRExport) fields) =
Ok $ fieldsExtractor Export.fieldsMap fields
| 107
| false
| false
| 2
| 9
| 12
| 35
| 16
| 19
| null | null |
leshchevds/ganeti
|
src/Ganeti/Runtime.hs
|
bsd-2-clause
|
checkUidMatch :: String -> UserID -> UserID -> IO ()
checkUidMatch name expected actual =
when (expected /= actual) $ do
hPrintf stderr "%s started using wrong user ID (%d), \
\expected %d\n" name
(fromIntegral actual::Int)
(fromIntegral expected::Int) :: IO ()
exitWith $ ExitFailure ConstantUtils.exitFailure
| 367
|
checkUidMatch :: String -> UserID -> UserID -> IO ()
checkUidMatch name expected actual =
when (expected /= actual) $ do
hPrintf stderr "%s started using wrong user ID (%d), \
\expected %d\n" name
(fromIntegral actual::Int)
(fromIntegral expected::Int) :: IO ()
exitWith $ ExitFailure ConstantUtils.exitFailure
| 367
|
checkUidMatch name expected actual =
when (expected /= actual) $ do
hPrintf stderr "%s started using wrong user ID (%d), \
\expected %d\n" name
(fromIntegral actual::Int)
(fromIntegral expected::Int) :: IO ()
exitWith $ ExitFailure ConstantUtils.exitFailure
| 314
| false
| true
| 0
| 10
| 101
| 101
| 49
| 52
| null | null |
ggreif/clash-compiler
|
clash-lib/src/CLaSH/Core/TysPrim.hs
|
bsd-2-clause
|
liftedTypeKind = mkTyConTy liftedTypeKindTyConName
| 50
|
liftedTypeKind = mkTyConTy liftedTypeKindTyConName
| 50
|
liftedTypeKind = mkTyConTy liftedTypeKindTyConName
| 50
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
dorchard/gram_lang
|
frontend/src/Language/Granule/Checker/Monad.hs
|
bsd-3-clause
|
meetConsumption Full Full = Full
| 32
|
meetConsumption Full Full = Full
| 32
|
meetConsumption Full Full = Full
| 32
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
prl-tokyo/bigul-configuration-adaptation
|
Transformations/src/BiFlux/XPath/HXT/XPathParser.hs
|
mit
|
enhanceQN :: AxisSpec -> NsEnv -> QName -> Maybe QName
enhanceQN Attribute = enhanceAttrQName
| 144
|
enhanceQN :: AxisSpec -> NsEnv -> QName -> Maybe QName
enhanceQN Attribute = enhanceAttrQName
| 144
|
enhanceQN Attribute = enhanceAttrQName
| 58
| false
| true
| 0
| 9
| 64
| 34
| 15
| 19
| null | null |
ksaveljev/hake-2
|
src/Render/OpenGL/QGLConstants.hs
|
bsd-3-clause
|
-- TextureParameterName
glTextureMagFilter = 0x2800 :: Int
| 58
|
glTextureMagFilter = 0x2800 :: Int
| 34
|
glTextureMagFilter = 0x2800 :: Int
| 34
| true
| false
| 0
| 4
| 6
| 13
| 7
| 6
| null | null |
nbloomf/carl
|
src/Carl/Data/Natural.hs
|
gpl-3.0
|
natIsZero :: Natural -> Bool
natIsZero = (0==) . unNat
| 54
|
natIsZero :: Natural -> Bool
natIsZero = (0==) . unNat
| 54
|
natIsZero = (0==) . unNat
| 25
| false
| true
| 0
| 6
| 9
| 23
| 13
| 10
| null | null |
ygale/yesod
|
yesod-core/Yesod/Core/Handler.hs
|
mit
|
modSession :: (SessionMap -> SessionMap) -> GHState -> GHState
modSession f x = x { ghsSession = f $ ghsSession x }
| 115
|
modSession :: (SessionMap -> SessionMap) -> GHState -> GHState
modSession f x = x { ghsSession = f $ ghsSession x }
| 115
|
modSession f x = x { ghsSession = f $ ghsSession x }
| 52
| false
| true
| 0
| 9
| 21
| 55
| 26
| 29
| null | null |
vikraman/ghc
|
compiler/main/HscTypes.hs
|
bsd-3-clause
|
-- Extend the type environment
extendTypeEnv :: TypeEnv -> TyThing -> TypeEnv
extendTypeEnv env thing = extendNameEnv env (getName thing) thing
| 143
|
extendTypeEnv :: TypeEnv -> TyThing -> TypeEnv
extendTypeEnv env thing = extendNameEnv env (getName thing) thing
| 112
|
extendTypeEnv env thing = extendNameEnv env (getName thing) thing
| 65
| true
| true
| 0
| 7
| 20
| 38
| 19
| 19
| null | null |
ezyang/ghc
|
compiler/utils/PprColour.hs
|
bsd-3-clause
|
colMagentaFg :: PprColour
colMagentaFg = colCustom "35"
| 55
|
colMagentaFg :: PprColour
colMagentaFg = colCustom "35"
| 55
|
colMagentaFg = colCustom "35"
| 29
| false
| true
| 0
| 6
| 6
| 20
| 8
| 12
| null | null |
noughtmare/yi
|
yi-core/src/Yi/Misc.hs
|
gpl-2.0
|
matchFile :: T.Text -> T.Text -> Maybe T.Text
matchFile path proposedCompletion =
let realPath = replaceShorthands path
in T.append path <$> T.stripPrefix realPath proposedCompletion
| 186
|
matchFile :: T.Text -> T.Text -> Maybe T.Text
matchFile path proposedCompletion =
let realPath = replaceShorthands path
in T.append path <$> T.stripPrefix realPath proposedCompletion
| 186
|
matchFile path proposedCompletion =
let realPath = replaceShorthands path
in T.append path <$> T.stripPrefix realPath proposedCompletion
| 140
| false
| true
| 0
| 9
| 27
| 67
| 30
| 37
| null | null |
ptek/sclent
|
src/Service/CrawlerService.hs
|
bsd-3-clause
|
crawl :: (Text -> IO [Tag Text]) -> Text -> Text -> [Text] -> [Text] -> Int -> IO Bool
crawl _ _ _ _ _ 0 = return False
| 147
|
crawl :: (Text -> IO [Tag Text]) -> Text -> Text -> [Text] -> [Text] -> Int -> IO Bool
crawl _ _ _ _ _ 0 = return False
| 147
|
crawl _ _ _ _ _ 0 = return False
| 60
| false
| true
| 0
| 11
| 57
| 76
| 38
| 38
| null | null |
spaceships/circuit-synthesis
|
src/Circuit/Builder.hs
|
mit
|
-- avoid duplication: there will be only one gate for const 0
constant :: (Gate g, Monad m) => Int -> BuilderT g m Ref
constant val = do
r <- existingConstant val
case r of
Just ref -> return ref
Nothing -> do
id <- nextConstId
ref <- nextRef
insertConst ref id
insertConstVal id val
markConstant val ref
return ref
| 413
|
constant :: (Gate g, Monad m) => Int -> BuilderT g m Ref
constant val = do
r <- existingConstant val
case r of
Just ref -> return ref
Nothing -> do
id <- nextConstId
ref <- nextRef
insertConst ref id
insertConstVal id val
markConstant val ref
return ref
| 351
|
constant val = do
r <- existingConstant val
case r of
Just ref -> return ref
Nothing -> do
id <- nextConstId
ref <- nextRef
insertConst ref id
insertConstVal id val
markConstant val ref
return ref
| 294
| true
| true
| 0
| 12
| 158
| 120
| 53
| 67
| null | null |
phunehehe/deepseq-bounded
|
src/Control/DeepSeq/Bounded/PatUtil.hs
|
bsd-3-clause
|
mptyPat :: Pattern
emptyPat = Node (WI emptyPatNodeAttrs) []
| 63
|
emptyPat :: Pattern
emptyPat = Node (WI emptyPatNodeAttrs) []
| 61
|
emptyPat = Node (WI emptyPatNodeAttrs) []
| 41
| false
| true
| 0
| 7
| 11
| 30
| 13
| 17
| null | null |
urbanslug/ghc
|
compiler/basicTypes/Literal.hs
|
bsd-3-clause
|
pprLiteral add_par (MachLabel l mb fod) = add_par (ptext (sLit "__label") <+> b <+> ppr fod)
where b = case mb of
Nothing -> pprHsString l
Just x -> doubleQuotes (text (unpackFS l ++ '@':show x))
| 228
|
pprLiteral add_par (MachLabel l mb fod) = add_par (ptext (sLit "__label") <+> b <+> ppr fod)
where b = case mb of
Nothing -> pprHsString l
Just x -> doubleQuotes (text (unpackFS l ++ '@':show x))
| 228
|
pprLiteral add_par (MachLabel l mb fod) = add_par (ptext (sLit "__label") <+> b <+> ppr fod)
where b = case mb of
Nothing -> pprHsString l
Just x -> doubleQuotes (text (unpackFS l ++ '@':show x))
| 228
| false
| false
| 1
| 14
| 68
| 108
| 48
| 60
| null | null |
forste/haReFork
|
tools/hs2stratego/StrategoCmds.hs
|
bsd-3-clause
|
moduleSlice needed m =
filter (isNeeded needed m) . splitDecls . hsModDecls . snd # parseModule m
| 99
|
moduleSlice needed m =
filter (isNeeded needed m) . splitDecls . hsModDecls . snd # parseModule m
| 99
|
moduleSlice needed m =
filter (isNeeded needed m) . splitDecls . hsModDecls . snd # parseModule m
| 99
| false
| false
| 0
| 11
| 18
| 41
| 19
| 22
| null | null |
bgold-cosmos/Tidal
|
src/Sound/Tidal/Stream.hs
|
gpl-3.0
|
startTidal :: Target -> Config -> IO Stream
startTidal target config = startStream config [(target, [superdirtShape])]
| 118
|
startTidal :: Target -> Config -> IO Stream
startTidal target config = startStream config [(target, [superdirtShape])]
| 118
|
startTidal target config = startStream config [(target, [superdirtShape])]
| 74
| false
| true
| 0
| 8
| 15
| 48
| 24
| 24
| null | null |
athanclark/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
mapPTermFC f g (PElabError err) = PElabError err
| 48
|
mapPTermFC f g (PElabError err) = PElabError err
| 48
|
mapPTermFC f g (PElabError err) = PElabError err
| 48
| false
| false
| 0
| 6
| 7
| 25
| 10
| 15
| null | null |
jwvg0425/DSAndAlgo3
|
src/fibonacci/fibonacci.hs
|
mit
|
fibonacci 1 = 1
| 15
|
fibonacci 1 = 1
| 15
|
fibonacci 1 = 1
| 15
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.