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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fmapfmapfmap/amazonka | amazonka-cloudhsm/gen/Network/AWS/CloudHSM/DescribeLunaClient.hs | mpl-2.0 | -- | Creates a value of 'DescribeLunaClientResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'drsClientARN'
--
-- * 'drsLastModifiedTimestamp'
--
-- * 'drsCertificateFingerprint'
--
-- * 'drsCertificate'
--
-- * 'drsLabel'
--
-- * 'drsResponseStatus'
describeLunaClientResponse
:: Int -- ^ 'drsResponseStatus'
-> DescribeLunaClientResponse
describeLunaClientResponse pResponseStatus_ =
DescribeLunaClientResponse'
{ _drsClientARN = Nothing
, _drsLastModifiedTimestamp = Nothing
, _drsCertificateFingerprint = Nothing
, _drsCertificate = Nothing
, _drsLabel = Nothing
, _drsResponseStatus = pResponseStatus_
} | 741 | describeLunaClientResponse
:: Int -- ^ 'drsResponseStatus'
-> DescribeLunaClientResponse
describeLunaClientResponse pResponseStatus_ =
DescribeLunaClientResponse'
{ _drsClientARN = Nothing
, _drsLastModifiedTimestamp = Nothing
, _drsCertificateFingerprint = Nothing
, _drsCertificate = Nothing
, _drsLabel = Nothing
, _drsResponseStatus = pResponseStatus_
} | 397 | describeLunaClientResponse pResponseStatus_ =
DescribeLunaClientResponse'
{ _drsClientARN = Nothing
, _drsLastModifiedTimestamp = Nothing
, _drsCertificateFingerprint = Nothing
, _drsCertificate = Nothing
, _drsLabel = Nothing
, _drsResponseStatus = pResponseStatus_
} | 300 | true | true | 0 | 6 | 130 | 72 | 50 | 22 | null | null |
mtraina/seven-languages-seven-weeks | week-7-haskell/day3/drunken_monad.hs | mit | treasureMap pos = pos >>==
stagger >>==
stagger >>==
crawl >>==
rtn | 148 | treasureMap pos = pos >>==
stagger >>==
stagger >>==
crawl >>==
rtn | 148 | treasureMap pos = pos >>==
stagger >>==
stagger >>==
crawl >>==
rtn | 148 | false | false | 0 | 8 | 92 | 25 | 12 | 13 | null | null |
higgsd/euler | hs/107.hs | bsd-2-clause | dropLinks a = dropLinks0 a (reverse $ map fst $ getLinks a) | 59 | dropLinks a = dropLinks0 a (reverse $ map fst $ getLinks a) | 59 | dropLinks a = dropLinks0 a (reverse $ map fst $ getLinks a) | 59 | false | false | 0 | 9 | 11 | 31 | 14 | 17 | null | null |
aemoncannon/woof | compiler/woof_to_scheme.hs | mit | emitScheme (ASTInteger i) = do putStr $ "(woof-integer-instance " ++ (show i) ++ ")" | 84 | emitScheme (ASTInteger i) = do putStr $ "(woof-integer-instance " ++ (show i) ++ ")" | 84 | emitScheme (ASTInteger i) = do putStr $ "(woof-integer-instance " ++ (show i) ++ ")" | 84 | false | false | 0 | 10 | 13 | 36 | 17 | 19 | null | null |
demhydraz/waffle | src/Backend/Lua/Lua.hs | bsd-3-clause | isOp ">" = P.True | 19 | isOp ">" = P.True | 19 | isOp ">" = P.True | 19 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
mightybyte/snaplet-acid-state | src/Snap/Snaplet/AcidState.hs | bsd-3-clause | createCheckpoint :: (MonadIO (m b v),
MonadSnaplet m,
MonadState s (m b b),
HasAcid s st)
=> m b v ()
createCheckpoint = do
st <- getAcidState
liftIO $ A.createCheckpoint st
------------------------------------------------------------------------------
-- | Wrapper for acid-state's createArchive function that works for
-- arbitrary instances of HasAcid. | 445 | createCheckpoint :: (MonadIO (m b v),
MonadSnaplet m,
MonadState s (m b b),
HasAcid s st)
=> m b v ()
createCheckpoint = do
st <- getAcidState
liftIO $ A.createCheckpoint st
------------------------------------------------------------------------------
-- | Wrapper for acid-state's createArchive function that works for
-- arbitrary instances of HasAcid. | 445 | createCheckpoint = do
st <- getAcidState
liftIO $ A.createCheckpoint st
------------------------------------------------------------------------------
-- | Wrapper for acid-state's createArchive function that works for
-- arbitrary instances of HasAcid. | 263 | false | true | 0 | 9 | 136 | 89 | 45 | 44 | null | null |
kawu/dawg-ord | src/Data/DAWG/Gen/HashMap.hs | bsd-2-clause | -- | Insert (key, valye) pair into a hash value.
embed :: Ord a => a -> b -> Value a b -> Value a b
embed x y (Single x' y') = Multi $ M.fromList [(x, y), (x', y')] | 167 | embed :: Ord a => a -> b -> Value a b -> Value a b
embed x y (Single x' y') = Multi $ M.fromList [(x, y), (x', y')] | 118 | embed x y (Single x' y') = Multi $ M.fromList [(x, y), (x', y')] | 67 | true | true | 2 | 12 | 42 | 88 | 44 | 44 | null | null |
ice1000/OI-codes | codewars/1-100/peano-and-church.hs | agpl-3.0 | liftISO2 :: ISO a b -> ISO (a -> a -> a) (b -> b -> b)
liftISO2 (ab, ba) = (\f b1 b2 -> ab $ f (ba b1) $ ba b2, \f a1 a2 -> ba $ f (ab a1) $ ab a2) | 147 | liftISO2 :: ISO a b -> ISO (a -> a -> a) (b -> b -> b)
liftISO2 (ab, ba) = (\f b1 b2 -> ab $ f (ba b1) $ ba b2, \f a1 a2 -> ba $ f (ab a1) $ ab a2) | 147 | liftISO2 (ab, ba) = (\f b1 b2 -> ab $ f (ba b1) $ ba b2, \f a1 a2 -> ba $ f (ab a1) $ ab a2) | 92 | false | true | 0 | 11 | 44 | 120 | 61 | 59 | null | null |
cullina/Extractor | src/MarkovExperts.hs | bsd-3-clause | incPair (f, t) False = (f + 1, t) | 33 | incPair (f, t) False = (f + 1, t) | 33 | incPair (f, t) False = (f + 1, t) | 33 | false | false | 0 | 6 | 8 | 27 | 15 | 12 | null | null |
conal/hermit | src/HERMIT/Kure.hs | bsd-2-clause | -- | Rewrite any children of an expression of the form: @App@ 'CoreExpr' 'CoreExpr'
appAnyR :: (ExtendPath c Crumb, MonadCatch m) => Rewrite c m CoreExpr -> Rewrite c m CoreExpr -> Rewrite c m CoreExpr
appAnyR r1 r2 = unwrapAnyR $ appAllR (wrapAnyR r1) (wrapAnyR r2) | 266 | appAnyR :: (ExtendPath c Crumb, MonadCatch m) => Rewrite c m CoreExpr -> Rewrite c m CoreExpr -> Rewrite c m CoreExpr
appAnyR r1 r2 = unwrapAnyR $ appAllR (wrapAnyR r1) (wrapAnyR r2) | 182 | appAnyR r1 r2 = unwrapAnyR $ appAllR (wrapAnyR r1) (wrapAnyR r2) | 64 | true | true | 0 | 8 | 46 | 84 | 41 | 43 | null | null |
AlexanderPankiv/ghc | compiler/main/HscTypes.hs | bsd-3-clause | typeEnvCoAxioms env = [ax | ACoAxiom ax <- typeEnvElts env] | 59 | typeEnvCoAxioms env = [ax | ACoAxiom ax <- typeEnvElts env] | 59 | typeEnvCoAxioms env = [ax | ACoAxiom ax <- typeEnvElts env] | 59 | false | false | 0 | 8 | 9 | 26 | 12 | 14 | null | null |
jacekszymanski/wxHaskell | wx/src/Graphics/UI/WX/Frame.hs | lgpl-2.1 | - | Create an MDI parent frame with a custom style.
mdiParentFrameEx :: Window a -> Style -> [Prop (MDIParentFrame ())] -> IO (MDIParentFrame ())
mdiParentFrameEx parent stl props
= feed2 props stl $
initialFrame $ \id rect txt -> \props' stl' ->
do f <- mdiParentFrameCreate parent id txt rect stl'
let initProps = (if (containsProperty visible props')
then [] else [visible := True]) ++
(if (containsProperty bgcolor props')
then [] else [bgcolor := colorSystem Color3DFace])
set f initProps
set f props'
return f
-- | Create a MDI child frame.
| 658 | mdiParentFrameEx :: Window a -> Style -> [Prop (MDIParentFrame ())] -> IO (MDIParentFrame ())
mdiParentFrameEx parent stl props
= feed2 props stl $
initialFrame $ \id rect txt -> \props' stl' ->
do f <- mdiParentFrameCreate parent id txt rect stl'
let initProps = (if (containsProperty visible props')
then [] else [visible := True]) ++
(if (containsProperty bgcolor props')
then [] else [bgcolor := colorSystem Color3DFace])
set f initProps
set f props'
return f
-- | Create a MDI child frame. | 605 | mdiParentFrameEx parent stl props
= feed2 props stl $
initialFrame $ \id rect txt -> \props' stl' ->
do f <- mdiParentFrameCreate parent id txt rect stl'
let initProps = (if (containsProperty visible props')
then [] else [visible := True]) ++
(if (containsProperty bgcolor props')
then [] else [bgcolor := colorSystem Color3DFace])
set f initProps
set f props'
return f
-- | Create a MDI child frame. | 511 | true | true | 5 | 17 | 203 | 237 | 112 | 125 | null | null |
vTurbine/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | weakLoopBreaker = IAmALoopBreaker True | 40 | weakLoopBreaker = IAmALoopBreaker True | 40 | weakLoopBreaker = IAmALoopBreaker True | 40 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
ezyang/ghc | compiler/utils/Util.hs | bsd-3-clause | lengthExceeds :: [a] -> Int -> Bool
lengthExceeds lst n
| n < 0
= True
| otherwise
= atLength notNull False lst n | 121 | lengthExceeds :: [a] -> Int -> Bool
lengthExceeds lst n
| n < 0
= True
| otherwise
= atLength notNull False lst n | 121 | lengthExceeds lst n
| n < 0
= True
| otherwise
= atLength notNull False lst n | 85 | false | true | 0 | 8 | 31 | 57 | 27 | 30 | null | null |
dorchard/gram_lang | frontend/src/Language/Granule/Checker/Constraints/SymbolicGrades.hs | bsd-3-clause | sEqTree (SynMeet s s') (SynMeet t t') =
liftM2 (.||) (liftM2 (.&&) (sEqTree s t) (sEqTree s' t'))
-- /\ is commutative
(liftM2 (.&&) (sEqTree s t') (sEqTree s' t)) | 197 | sEqTree (SynMeet s s') (SynMeet t t') =
liftM2 (.||) (liftM2 (.&&) (sEqTree s t) (sEqTree s' t'))
-- /\ is commutative
(liftM2 (.&&) (sEqTree s t') (sEqTree s' t)) | 197 | sEqTree (SynMeet s s') (SynMeet t t') =
liftM2 (.||) (liftM2 (.&&) (sEqTree s t) (sEqTree s' t'))
-- /\ is commutative
(liftM2 (.&&) (sEqTree s t') (sEqTree s' t)) | 197 | false | false | 0 | 9 | 63 | 93 | 49 | 44 | null | null |
osa1/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | highestFC (PGoal fc _ _ _) = Just fc | 36 | highestFC (PGoal fc _ _ _) = Just fc | 36 | highestFC (PGoal fc _ _ _) = Just fc | 36 | false | false | 0 | 6 | 8 | 25 | 11 | 14 | null | null |
music-suite/lilypond | src/Data/Music/Lilypond.hs | bsd-3-clause | separateDots' (div:divs) nv
| isDivisibleBy 2 nv = (nv, 0)
| otherwise = (nv', dots' + 1)
where
(nv', dots') = separateDots' divs (nv*div) | 171 | separateDots' (div:divs) nv
| isDivisibleBy 2 nv = (nv, 0)
| otherwise = (nv', dots' + 1)
where
(nv', dots') = separateDots' divs (nv*div) | 171 | separateDots' (div:divs) nv
| isDivisibleBy 2 nv = (nv, 0)
| otherwise = (nv', dots' + 1)
where
(nv', dots') = separateDots' divs (nv*div) | 171 | false | false | 0 | 9 | 56 | 80 | 41 | 39 | null | null |
neothemachine/monadiccp | examples/Alpha.hs | bsd-3-clause | (@==) :: (MonadTree m, TreeSolver m ~ s, Constraint s ~ Either Model q) => ModelInt -> ModelInt -> m ()
(@==) = (@=) | 116 | (@==) :: (MonadTree m, TreeSolver m ~ s, Constraint s ~ Either Model q) => ModelInt -> ModelInt -> m ()
(@==) = (@=) | 116 | (@==) = (@=) | 12 | false | true | 0 | 10 | 23 | 72 | 36 | 36 | null | null |
prowdsponsor/country-codes | src/Data/CountryCodes/ISO31661.hs | bsd-3-clause | toText PA = "PA" | 16 | toText PA = "PA" | 16 | toText PA = "PA" | 16 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
themoritz/cabal | cabal-install/Distribution/Client/ProjectBuilding/Types.hs | bsd-3-clause | buildStatusRequiresBuild _ = True | 54 | buildStatusRequiresBuild _ = True | 54 | buildStatusRequiresBuild _ = True | 54 | false | false | 0 | 5 | 24 | 9 | 4 | 5 | null | null |
palexand/interpreters | ResumptionMonad/ThreadSemantics.hs | bsd-3-clause | sleep 1 = Sleep | 15 | sleep 1 = Sleep | 15 | sleep 1 = Sleep | 15 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
sseefried/android-helm-space-invaders | app/AndroidMain.hs | bsd-3-clause | main :: CString -> IO ()
main _ = game True | 43 | main :: CString -> IO ()
main _ = game True | 43 | main _ = game True | 18 | false | true | 0 | 7 | 10 | 26 | 12 | 14 | null | null |
circuithub/circuithub-prelude | Data/Either/Validation/Extra.hs | mit | -- | Convert a @Failure e@ into a @Just e@
failureMay :: Validation e a -> Maybe e
failureMay (Success _) = Nothing | 115 | failureMay :: Validation e a -> Maybe e
failureMay (Success _) = Nothing | 72 | failureMay (Success _) = Nothing | 32 | true | true | 0 | 6 | 22 | 37 | 17 | 20 | null | null |
TomMD/ghc | compiler/utils/Outputable.hs | bsd-3-clause | -- | Special combinator for showing bytestring literals.
pprHsBytes :: ByteString -> SDoc
pprHsBytes bs = let escaped = concatMap escape $ BS.unpack bs
in vcat (map text (showMultiLineString escaped)) <> char '#'
where escape :: Word8 -> String
escape w = let c = chr (fromIntegral w)
in if isAscii c
then [c]
else '\\' : show w
-- Postfix modifiers for unboxed literals.
-- See Note [Printing of literals in Core] in `basicTypes/Literal.hs`. | 542 | pprHsBytes :: ByteString -> SDoc
pprHsBytes bs = let escaped = concatMap escape $ BS.unpack bs
in vcat (map text (showMultiLineString escaped)) <> char '#'
where escape :: Word8 -> String
escape w = let c = chr (fromIntegral w)
in if isAscii c
then [c]
else '\\' : show w
-- Postfix modifiers for unboxed literals.
-- See Note [Printing of literals in Core] in `basicTypes/Literal.hs`. | 485 | pprHsBytes bs = let escaped = concatMap escape $ BS.unpack bs
in vcat (map text (showMultiLineString escaped)) <> char '#'
where escape :: Word8 -> String
escape w = let c = chr (fromIntegral w)
in if isAscii c
then [c]
else '\\' : show w
-- Postfix modifiers for unboxed literals.
-- See Note [Printing of literals in Core] in `basicTypes/Literal.hs`. | 452 | true | true | 2 | 12 | 174 | 129 | 63 | 66 | null | null |
erikd/yesod | yesod/Yesod/Default/Config2.hs | mit | -- | Location of the default config file.
configSettingsYml :: FilePath
configSettingsYml = "config/settings.yml" | 113 | configSettingsYml :: FilePath
configSettingsYml = "config/settings.yml" | 71 | configSettingsYml = "config/settings.yml" | 41 | true | true | 0 | 4 | 13 | 12 | 7 | 5 | null | null |
rzil/honours | LeavittPathAlgebras/Example1.hs | mit | u = vertex "u" | 14 | u = vertex "u" | 14 | u = vertex "u" | 14 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
tonyfloatersu/solution-haskell-craft-of-FP | Chapter_7_my_note.hs | mit | subseqMarker_max :: String -> String -> Int
subseqMarker_max xs ys = maximum (subseqMarker xs ys) | 100 | subseqMarker_max :: String -> String -> Int
subseqMarker_max xs ys = maximum (subseqMarker xs ys) | 100 | subseqMarker_max xs ys = maximum (subseqMarker xs ys) | 56 | false | true | 0 | 7 | 17 | 39 | 18 | 21 | null | null |
gridaphobe/ghc | compiler/coreSyn/CoreUtils.hs | bsd-3-clause | mkTicks :: [Tickish Id] -> CoreExpr -> CoreExpr
mkTicks ticks expr = foldr mkTick expr ticks | 92 | mkTicks :: [Tickish Id] -> CoreExpr -> CoreExpr
mkTicks ticks expr = foldr mkTick expr ticks | 92 | mkTicks ticks expr = foldr mkTick expr ticks | 44 | false | true | 0 | 7 | 15 | 37 | 18 | 19 | null | null |
thelostt/climbu | src/Parser.hs | mit | quark (CONST y : rest)
= (Num y, rest) | 40 | quark (CONST y : rest)
= (Num y, rest) | 40 | quark (CONST y : rest)
= (Num y, rest) | 40 | false | false | 0 | 7 | 10 | 29 | 14 | 15 | null | null |
kcharter/spdy-base | test/StreamTests.hs | bsd-3-clause | performOne ts (AddIncoming sc) = addIncomingOrDie ts sc | 55 | performOne ts (AddIncoming sc) = addIncomingOrDie ts sc | 55 | performOne ts (AddIncoming sc) = addIncomingOrDie ts sc | 55 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
dolio/vector | old-testsuite/Testsuite/Stream/AsList.hs | bsd-3-clause | prop_drop = arg2_ty [A] $ Stream.drop ==? drop | 49 | prop_drop = arg2_ty [A] $ Stream.drop ==? drop | 49 | prop_drop = arg2_ty [A] $ Stream.drop ==? drop | 49 | false | false | 0 | 8 | 10 | 22 | 11 | 11 | null | null |
magicant/flesh | hspec-src/Flesh/Language/Parser/TestUtil.hs | gpl-2.0 | runParserT :: Monad m
=> ParserT c m a -> Alias.DefinitionSet -> c
-> m (Either Failure (a, c))
runParserT (ParserT m) ds c = m3
where m1 = runReaderT m ds
m2 = evalPushBackT $ evalReparseT $ evalRecordT m1
m3 = runExceptT $ runCursorT m2 c | 280 | runParserT :: Monad m
=> ParserT c m a -> Alias.DefinitionSet -> c
-> m (Either Failure (a, c))
runParserT (ParserT m) ds c = m3
where m1 = runReaderT m ds
m2 = evalPushBackT $ evalReparseT $ evalRecordT m1
m3 = runExceptT $ runCursorT m2 c | 280 | runParserT (ParserT m) ds c = m3
where m1 = runReaderT m ds
m2 = evalPushBackT $ evalReparseT $ evalRecordT m1
m3 = runExceptT $ runCursorT m2 c | 162 | false | true | 2 | 12 | 86 | 114 | 55 | 59 | null | null |
tamarin-prover/tamarin-prover | lib/theory/src/Theory.hs | gpl-3.0 | -- search process
findProcess :: String -> Theory sig c r p SapicElement -> Maybe (Theory sig c r p SapicElement)
findProcess s thy = do
guard (isJust $ lookupProcessDef s thy)
return thy
-- | Add a new process definition. fails if process with the same name already exists | 307 | findProcess :: String -> Theory sig c r p SapicElement -> Maybe (Theory sig c r p SapicElement)
findProcess s thy = do
guard (isJust $ lookupProcessDef s thy)
return thy
-- | Add a new process definition. fails if process with the same name already exists | 289 | findProcess s thy = do
guard (isJust $ lookupProcessDef s thy)
return thy
-- | Add a new process definition. fails if process with the same name already exists | 193 | true | true | 0 | 10 | 83 | 78 | 37 | 41 | null | null |
IreneKnapp/Faction | faction/Distribution/Client/Dependency/Modular/Flag.hs | bsd-3-clause | showFBool (FN _ f) False = "-" ++ unFlag f | 42 | showFBool (FN _ f) False = "-" ++ unFlag f | 42 | showFBool (FN _ f) False = "-" ++ unFlag f | 42 | false | false | 3 | 6 | 9 | 28 | 12 | 16 | null | null |
markwatkinson/luminous | tests/regression/haskell/Parser.hs | lgpl-2.1 | parseVariant = do symbol "<"
var <- identifier
symbol "="
t <- parseTerm
symbol ">"
reserved "as"
liftM (TmTag var t) parseType | 235 | parseVariant = do symbol "<"
var <- identifier
symbol "="
t <- parseTerm
symbol ">"
reserved "as"
liftM (TmTag var t) parseType | 235 | parseVariant = do symbol "<"
var <- identifier
symbol "="
t <- parseTerm
symbol ">"
reserved "as"
liftM (TmTag var t) parseType | 235 | false | false | 0 | 9 | 129 | 60 | 24 | 36 | null | null |
hamishmack/haskell-gi | lib/Data/GI/CodeGen/Struct.hs | lgpl-2.1 | genZeroSU :: Name -> Int -> Bool -> CodeGen ()
genZeroSU n size isBoxed = group $ do
let name = upperName n
let builder = "newZero" <> name
tsize = tshow size
line $ "-- | Construct a `" <> name <> "` struct initialized to zero."
line $ builder <> " :: MonadIO m => m " <> name
line $ builder <> " = liftIO $ " <>
if isBoxed
then "callocBoxedBytes " <> tsize <> " >>= wrapBoxed " <> name
else "wrappedPtrCalloc >>= wrapPtr " <> name
exportDecl builder
blank
-- Overloaded "new"
group $ do
line $ "instance tag ~ 'AttrSet => Constructible " <> name <> " tag where"
indent $ do
line $ "new _ attrs = do"
indent $ do
line $ "o <- " <> builder
line $ "GI.Attributes.set o attrs"
line $ "return o"
-- | Specialization for structs of `genZeroSU`. | 920 | genZeroSU :: Name -> Int -> Bool -> CodeGen ()
genZeroSU n size isBoxed = group $ do
let name = upperName n
let builder = "newZero" <> name
tsize = tshow size
line $ "-- | Construct a `" <> name <> "` struct initialized to zero."
line $ builder <> " :: MonadIO m => m " <> name
line $ builder <> " = liftIO $ " <>
if isBoxed
then "callocBoxedBytes " <> tsize <> " >>= wrapBoxed " <> name
else "wrappedPtrCalloc >>= wrapPtr " <> name
exportDecl builder
blank
-- Overloaded "new"
group $ do
line $ "instance tag ~ 'AttrSet => Constructible " <> name <> " tag where"
indent $ do
line $ "new _ attrs = do"
indent $ do
line $ "o <- " <> builder
line $ "GI.Attributes.set o attrs"
line $ "return o"
-- | Specialization for structs of `genZeroSU`. | 920 | genZeroSU n size isBoxed = group $ do
let name = upperName n
let builder = "newZero" <> name
tsize = tshow size
line $ "-- | Construct a `" <> name <> "` struct initialized to zero."
line $ builder <> " :: MonadIO m => m " <> name
line $ builder <> " = liftIO $ " <>
if isBoxed
then "callocBoxedBytes " <> tsize <> " >>= wrapBoxed " <> name
else "wrappedPtrCalloc >>= wrapPtr " <> name
exportDecl builder
blank
-- Overloaded "new"
group $ do
line $ "instance tag ~ 'AttrSet => Constructible " <> name <> " tag where"
indent $ do
line $ "new _ attrs = do"
indent $ do
line $ "o <- " <> builder
line $ "GI.Attributes.set o attrs"
line $ "return o"
-- | Specialization for structs of `genZeroSU`. | 873 | false | true | 0 | 18 | 331 | 220 | 103 | 117 | null | null |
phylake/avm3 | abc/util.hs | mit | --toBytes {- 0xC8 -}
--toBytes {- 0xC9 -}
--toBytes {- 0xCA -}
--toBytes {- 0xCB -}
--toBytes {- 0xCC -}
--toBytes {- 0xCD -}
--toBytes {- 0xCE -}
--toBytes {- 0xCF -}
toBytes {- 0xD0 -} (GetLocal0) = 1 | 218 | toBytes {- 0xD0 -} (GetLocal0) = 1 | 34 | toBytes {- 0xD0 -} (GetLocal0) = 1 | 34 | true | false | 0 | 6 | 54 | 21 | 15 | 6 | null | null |
krisajenkins/kashmir | src/Kashmir/ETL/Pipes.hs | epl-1.0 | flattenPipe :: Monad m => Pipe [a] a m ()
flattenPipe =
do xs <- await
_ <- mapM yield xs
flattenPipe | 113 | flattenPipe :: Monad m => Pipe [a] a m ()
flattenPipe =
do xs <- await
_ <- mapM yield xs
flattenPipe | 113 | flattenPipe =
do xs <- await
_ <- mapM yield xs
flattenPipe | 71 | false | true | 0 | 8 | 33 | 60 | 26 | 34 | null | null |
antalsz/hs-to-coq | examples/graph/graph/Data/Graph/Inductive/PatriciaTree.hs | mit | addLists as [a] = a : as | 25 | addLists as [a] = a : as | 25 | addLists as [a] = a : as | 25 | false | false | 0 | 6 | 7 | 18 | 9 | 9 | null | null |
mcschroeder/ghc | compiler/hsSyn/HsUtils.hs | bsd-3-clause | nlHsApps :: id -> [LHsExpr id] -> LHsExpr id
nlHsApps f xs = foldl nlHsApp (nlHsVar f) xs | 89 | nlHsApps :: id -> [LHsExpr id] -> LHsExpr id
nlHsApps f xs = foldl nlHsApp (nlHsVar f) xs | 89 | nlHsApps f xs = foldl nlHsApp (nlHsVar f) xs | 44 | false | true | 0 | 8 | 17 | 46 | 22 | 24 | null | null |
sdiehl/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | pprInline' :: Bool -- True <=> do not display the inl_inline field
-> InlinePragma
-> SDoc
pprInline' emptyInline (InlinePragma { inl_inline = inline, inl_act = activation
, inl_rule = info, inl_sat = mb_arity })
= pp_inl inline <> pp_act inline activation <+> pp_sat <+> pp_info
where
pp_inl x = if emptyInline then empty else ppr x
pp_act Inline AlwaysActive = empty
pp_act NoInline NeverActive = empty
pp_act _ act = ppr act
pp_sat | Just ar <- mb_arity = parens (text "sat-args=" <> int ar)
| otherwise = empty
pp_info | isFunLike info = empty
| otherwise = ppr info | 745 | pprInline' :: Bool -- True <=> do not display the inl_inline field
-> InlinePragma
-> SDoc
pprInline' emptyInline (InlinePragma { inl_inline = inline, inl_act = activation
, inl_rule = info, inl_sat = mb_arity })
= pp_inl inline <> pp_act inline activation <+> pp_sat <+> pp_info
where
pp_inl x = if emptyInline then empty else ppr x
pp_act Inline AlwaysActive = empty
pp_act NoInline NeverActive = empty
pp_act _ act = ppr act
pp_sat | Just ar <- mb_arity = parens (text "sat-args=" <> int ar)
| otherwise = empty
pp_info | isFunLike info = empty
| otherwise = ppr info | 745 | pprInline' emptyInline (InlinePragma { inl_inline = inline, inl_act = activation
, inl_rule = info, inl_sat = mb_arity })
= pp_inl inline <> pp_act inline activation <+> pp_sat <+> pp_info
where
pp_inl x = if emptyInline then empty else ppr x
pp_act Inline AlwaysActive = empty
pp_act NoInline NeverActive = empty
pp_act _ act = ppr act
pp_sat | Just ar <- mb_arity = parens (text "sat-args=" <> int ar)
| otherwise = empty
pp_info | isFunLike info = empty
| otherwise = ppr info | 622 | false | true | 27 | 10 | 274 | 192 | 97 | 95 | null | null |
zsol/visual-graphrewrite | GraphRewrite/Internal/Rewrite.hs | bsd-3-clause | -- | Pattern matching for multiple expressions and patterns. See also 'match'.
matches
:: RewriteSystem
-> Graph
-> [Expr] -- ^ Expressions
-> [Expr] -- ^ Patterns
-> I.IntMap Expr -- ^ Binds
-> (Graph, Maybe (I.IntMap Expr))
matches _ g [] [] bs = (g, Just bs) | 307 | matches
:: RewriteSystem
-> Graph
-> [Expr] -- ^ Expressions
-> [Expr] -- ^ Patterns
-> I.IntMap Expr -- ^ Binds
-> (Graph, Maybe (I.IntMap Expr))
matches _ g [] [] bs = (g, Just bs) | 223 | matches _ g [] [] bs = (g, Just bs) | 35 | true | true | 0 | 16 | 93 | 93 | 48 | 45 | null | null |
RefactoringTools/HaRe | src/Language/Haskell/Refact/Utils/MonadFunctions.hs | bsd-3-clause | getRefactNameMap :: RefactGhc NameMap
getRefactNameMap = do
mtm <- gets rsModule
case mtm of
Nothing -> error $ "Hare.MonadFunctions.getRefacNameMap:no module loaded"
Just tm -> return (rsNameMap tm)
-- --------------------------------------------------------------------- | 286 | getRefactNameMap :: RefactGhc NameMap
getRefactNameMap = do
mtm <- gets rsModule
case mtm of
Nothing -> error $ "Hare.MonadFunctions.getRefacNameMap:no module loaded"
Just tm -> return (rsNameMap tm)
-- --------------------------------------------------------------------- | 286 | getRefactNameMap = do
mtm <- gets rsModule
case mtm of
Nothing -> error $ "Hare.MonadFunctions.getRefacNameMap:no module loaded"
Just tm -> return (rsNameMap tm)
-- --------------------------------------------------------------------- | 248 | false | true | 0 | 13 | 42 | 66 | 29 | 37 | null | null |
mmisamore/directed-cubical | Tests.hs | bsd-3-clause | -- Functions for testing --
rList :: Gen a -> Int -> [a]
rList g n = (unGen (listOf g)) (mkStdGen n) n | 102 | rList :: Gen a -> Int -> [a]
rList g n = (unGen (listOf g)) (mkStdGen n) n | 74 | rList g n = (unGen (listOf g)) (mkStdGen n) n | 45 | true | true | 0 | 9 | 22 | 54 | 27 | 27 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/Dialogs.hs | lgpl-2.1 | -- | Retrieve a text string from a user. Returns the empty string on cancel. Usage:
--
-- > textDialog window message caption defaultText
--
textDialog :: Window a -> String -> String -> String -> IO String
textDialog parent message caption defaultText
= getTextFromUser message caption defaultText parent pointNull False | 323 | textDialog :: Window a -> String -> String -> String -> IO String
textDialog parent message caption defaultText
= getTextFromUser message caption defaultText parent pointNull False | 182 | textDialog parent message caption defaultText
= getTextFromUser message caption defaultText parent pointNull False | 116 | true | true | 0 | 9 | 52 | 59 | 30 | 29 | null | null |
daleooo/barrelfish | tools/flounder/THCBackend.hs | mit | rpc_fifo_vtbl_type :: String -> String
rpc_fifo_vtbl_type ifn = ifscope ifn $ "thc_rpc_fifo" | 92 | rpc_fifo_vtbl_type :: String -> String
rpc_fifo_vtbl_type ifn = ifscope ifn $ "thc_rpc_fifo" | 92 | rpc_fifo_vtbl_type ifn = ifscope ifn $ "thc_rpc_fifo" | 53 | false | true | 0 | 7 | 11 | 31 | 13 | 18 | null | null |
Andrey-Sisoyev/PCLT-DB | Data/MyHelpers_.hs | lgpl-2.1 | cons2' :: Char -> Char -> Lazy.ByteString -> Lazy.ByteString
cons2' c1 c2 s = B.cons' c1 (B.cons' c2 s) | 103 | cons2' :: Char -> Char -> Lazy.ByteString -> Lazy.ByteString
cons2' c1 c2 s = B.cons' c1 (B.cons' c2 s) | 103 | cons2' c1 c2 s = B.cons' c1 (B.cons' c2 s) | 42 | false | true | 0 | 10 | 18 | 57 | 26 | 31 | null | null |
lpeterse/koka | src/Common/Name.hs | apache-2.0 | newImplicitTypeVarName i
= newHiddenName ("t" ++ show i) | 58 | newImplicitTypeVarName i
= newHiddenName ("t" ++ show i) | 58 | newImplicitTypeVarName i
= newHiddenName ("t" ++ show i) | 58 | false | false | 0 | 8 | 9 | 22 | 10 | 12 | null | null |
rueshyna/gogol | gogol-debugger/gen/Network/Google/Resource/CloudDebugger/Controller/Debuggees/Breakpoints/List.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
cdblUploadType :: Lens' ControllerDebuggeesBreakpointsList (Maybe Text)
cdblUploadType
= lens _cdblUploadType
(\ s a -> s{_cdblUploadType = a}) | 222 | cdblUploadType :: Lens' ControllerDebuggeesBreakpointsList (Maybe Text)
cdblUploadType
= lens _cdblUploadType
(\ s a -> s{_cdblUploadType = a}) | 151 | cdblUploadType
= lens _cdblUploadType
(\ s a -> s{_cdblUploadType = a}) | 79 | true | true | 0 | 9 | 34 | 48 | 25 | 23 | null | null |
lih/Epsilon | src/ELisp.hs | bsd-3-clause | match (Sym n _) _ | n==intern "_" = return M.empty | 50 | match (Sym n _) _ | n==intern "_" = return M.empty | 50 | match (Sym n _) _ | n==intern "_" = return M.empty | 50 | false | false | 0 | 9 | 10 | 37 | 16 | 21 | null | null |
fumieval/prelude-kai | src/Prelude/Kai.hs | bsd-3-clause | replicateA_ :: Applicative f => Int -> f a -> f ()
replicateA_ m f = go m where
go 0 = pure ()
go n = f *> go (n - 1)
| 126 | replicateA_ :: Applicative f => Int -> f a -> f ()
replicateA_ m f = go m where
go 0 = pure ()
go n = f *> go (n - 1)
| 126 | replicateA_ m f = go m where
go 0 = pure ()
go n = f *> go (n - 1)
| 75 | false | true | 0 | 9 | 41 | 78 | 37 | 41 | null | null |
dysinger/amazonka | amazonka-datapipeline/gen/Network/AWS/DataPipeline/PollForTask.hs | mpl-2.0 | -- | Identity information for the Amazon EC2 instance that is hosting the task
-- runner. You can get this value by calling the URI, 'http://169.254.169.254/latest/meta-data/instance-id', from the EC2 instance. For more information, go to <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html Instance Metadata> in the /Amazon Elastic Compute Cloud User Guide./ Passing in this value proves that
-- your task runner is running on an EC2 instance, and ensures the proper AWS
-- Data Pipeline service charges are applied to your pipeline.
pftInstanceIdentity :: Lens' PollForTask (Maybe InstanceIdentity)
pftInstanceIdentity =
lens _pftInstanceIdentity (\s a -> s { _pftInstanceIdentity = a }) | 725 | pftInstanceIdentity :: Lens' PollForTask (Maybe InstanceIdentity)
pftInstanceIdentity =
lens _pftInstanceIdentity (\s a -> s { _pftInstanceIdentity = a }) | 158 | pftInstanceIdentity =
lens _pftInstanceIdentity (\s a -> s { _pftInstanceIdentity = a }) | 92 | true | true | 0 | 9 | 99 | 49 | 28 | 21 | null | null |
rleshchinskiy/vector | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | enumFromTo_big_int x y = x `seq` y `seq` Stream step x
where
{-# INLINE_INNER step #-}
step x | x <= y = return $ Yield x (x+1)
| otherwise = return $ Done
#if WORD_SIZE_IN_BITS > 32
| 209 | enumFromTo_big_int x y = x `seq` y `seq` Stream step x
where
{-# INLINE_INNER step #-}
step x | x <= y = return $ Yield x (x+1)
| otherwise = return $ Done
#if WORD_SIZE_IN_BITS > 32
| 209 | enumFromTo_big_int x y = x `seq` y `seq` Stream step x
where
{-# INLINE_INNER step #-}
step x | x <= y = return $ Yield x (x+1)
| otherwise = return $ Done
#if WORD_SIZE_IN_BITS > 32
| 209 | false | false | 2 | 8 | 64 | 79 | 40 | 39 | null | null |
exbb2/BlastItWithPiss | src/GtkBlast/MuVar.hs | gpl-3.0 | setir :: (Functor m, MonadIO m, MuVar v a) => a -> v -> m v
setir = flip setr | 77 | setir :: (Functor m, MonadIO m, MuVar v a) => a -> v -> m v
setir = flip setr | 77 | setir = flip setr | 17 | false | true | 0 | 8 | 19 | 48 | 24 | 24 | null | null |
ezyang/ghc-shake | GhcAction.hs | bsd-3-clause | -- | Pure reimplementation of GHC's @mkHomeModLocationSearched@.
mkHomeModLocationSearched :: DynFlags -> ModuleName -> FileExt
-> FilePath -> BaseName -> ModLocation
mkHomeModLocationSearched dflags mod suff path basename =
mkHomeModLocation2 dflags mod (if path == "." then basename
else path </> basename) suff | 391 | mkHomeModLocationSearched :: DynFlags -> ModuleName -> FileExt
-> FilePath -> BaseName -> ModLocation
mkHomeModLocationSearched dflags mod suff path basename =
mkHomeModLocation2 dflags mod (if path == "." then basename
else path </> basename) suff | 326 | mkHomeModLocationSearched dflags mod suff path basename =
mkHomeModLocation2 dflags mod (if path == "." then basename
else path </> basename) suff | 198 | true | true | 0 | 9 | 118 | 71 | 37 | 34 | null | null |
frms-/aws | Aws/Iam/Core.hs | bsd-3-clause | -- | Parses the IAM @User@ data type.
parseUser :: MonadThrow m => Cu.Cursor -> m User
parseUser cursor = do
userArn <- attr "Arn"
userCreateDate <- attr "CreateDate" >>= parseDateTime . Text.unpack
userPath <- attr "Path"
userUserId <- attr "UserId"
userUserName <- attr "UserName"
return User{..}
where
attr name = force ("Missing " ++ Text.unpack name) $
cursor $// elContent name | 448 | parseUser :: MonadThrow m => Cu.Cursor -> m User
parseUser cursor = do
userArn <- attr "Arn"
userCreateDate <- attr "CreateDate" >>= parseDateTime . Text.unpack
userPath <- attr "Path"
userUserId <- attr "UserId"
userUserName <- attr "UserName"
return User{..}
where
attr name = force ("Missing " ++ Text.unpack name) $
cursor $// elContent name | 410 | parseUser cursor = do
userArn <- attr "Arn"
userCreateDate <- attr "CreateDate" >>= parseDateTime . Text.unpack
userPath <- attr "Path"
userUserId <- attr "UserId"
userUserName <- attr "UserName"
return User{..}
where
attr name = force ("Missing " ++ Text.unpack name) $
cursor $// elContent name | 361 | true | true | 1 | 11 | 126 | 146 | 63 | 83 | null | null |
pedropazello/Haskell_99_problems | lists.hs | mit | -- Problem 19
{--
(**) Rotate a list N places to the left.
Hint: Use the predefined functions length and (++).
--}
rotate :: Eq a => [a] -> Int -> [a]
rotate [] _ = [] | 178 | rotate :: Eq a => [a] -> Int -> [a]
rotate [] _ = [] | 61 | rotate [] _ = [] | 18 | true | true | 0 | 10 | 47 | 49 | 24 | 25 | null | null |
mfpi/OpenGL | Graphics/Rendering/OpenGL/GL/CoordTrans.hs | bsd-3-clause | unmarshalTextureGenMode' :: GLint -> TextureGenMode'
unmarshalTextureGenMode' x
| y == gl_EYE_LINEAR = EyeLinear'
| y == gl_OBJECT_LINEAR = ObjectLinear'
| y == gl_SPHERE_MAP = SphereMap'
| y == gl_NORMAL_MAP = NormalMap'
| y == gl_REFLECTION_MAP = ReflectionMap'
| otherwise = error ("unmarshalTextureGenMode': illegal value " ++ show x)
where y = fromIntegral x
-------------------------------------------------------------------------------- | 466 | unmarshalTextureGenMode' :: GLint -> TextureGenMode'
unmarshalTextureGenMode' x
| y == gl_EYE_LINEAR = EyeLinear'
| y == gl_OBJECT_LINEAR = ObjectLinear'
| y == gl_SPHERE_MAP = SphereMap'
| y == gl_NORMAL_MAP = NormalMap'
| y == gl_REFLECTION_MAP = ReflectionMap'
| otherwise = error ("unmarshalTextureGenMode': illegal value " ++ show x)
where y = fromIntegral x
-------------------------------------------------------------------------------- | 466 | unmarshalTextureGenMode' x
| y == gl_EYE_LINEAR = EyeLinear'
| y == gl_OBJECT_LINEAR = ObjectLinear'
| y == gl_SPHERE_MAP = SphereMap'
| y == gl_NORMAL_MAP = NormalMap'
| y == gl_REFLECTION_MAP = ReflectionMap'
| otherwise = error ("unmarshalTextureGenMode': illegal value " ++ show x)
where y = fromIntegral x
-------------------------------------------------------------------------------- | 413 | false | true | 5 | 8 | 75 | 112 | 53 | 59 | null | null |
nateburgers/antigen | Main.hs | mit | untar :: PackageOperation
untar version package =
vshell $ do
chBuildDir version
untarred <- test_d $ fromText $ packageFolderName package
if untarred
then return ()
else run_ "tar" ["xf", text package] | 236 | untar :: PackageOperation
untar version package =
vshell $ do
chBuildDir version
untarred <- test_d $ fromText $ packageFolderName package
if untarred
then return ()
else run_ "tar" ["xf", text package] | 236 | untar version package =
vshell $ do
chBuildDir version
untarred <- test_d $ fromText $ packageFolderName package
if untarred
then return ()
else run_ "tar" ["xf", text package] | 210 | false | true | 1 | 12 | 64 | 79 | 35 | 44 | null | null |
rootzlevel/brick | src/Brick/Main.hs | bsd-3-clause | -- | Suspend the event loop, save the terminal state, and run the
-- specified action. When it returns an application state value, restore
-- the terminal state, redraw the application from the new state, and
-- resume the event loop.
suspendAndResume :: IO s -> EventM (Next s)
suspendAndResume = return . SuspendAndResume | 323 | suspendAndResume :: IO s -> EventM (Next s)
suspendAndResume = return . SuspendAndResume | 88 | suspendAndResume = return . SuspendAndResume | 44 | true | true | 0 | 8 | 53 | 35 | 19 | 16 | null | null |
capitanbatata/sandbox | free-monads/src/CloudFilesStream.hs | gpl-3.0 | runLogger :: MonadIO m => Stream LogF m r -> m r
runLogger = run . maps interpretLogIO | 89 | runLogger :: MonadIO m => Stream LogF m r -> m r
runLogger = run . maps interpretLogIO | 88 | runLogger = run . maps interpretLogIO | 39 | false | true | 0 | 7 | 20 | 39 | 18 | 21 | null | null |
danplubell/hbase-haskell | src/Database/HBase/Internal/Thrift/Hbase_Client.hs | mit | send_mutateRow op arg_tableName arg_row arg_mutations arg_attributes = do
seq <- seqid
seqn <- readIORef seq
writeMessageBegin op ("mutateRow", M_CALL, seqn)
write_MutateRow_args op (MutateRow_args{f_MutateRow_args_tableName=Just arg_tableName,f_MutateRow_args_row=Just arg_row,f_MutateRow_args_mutations=Just arg_mutations,f_MutateRow_args_attributes=Just arg_attributes})
writeMessageEnd op
tFlush (getTransport op) | 429 | send_mutateRow op arg_tableName arg_row arg_mutations arg_attributes = do
seq <- seqid
seqn <- readIORef seq
writeMessageBegin op ("mutateRow", M_CALL, seqn)
write_MutateRow_args op (MutateRow_args{f_MutateRow_args_tableName=Just arg_tableName,f_MutateRow_args_row=Just arg_row,f_MutateRow_args_mutations=Just arg_mutations,f_MutateRow_args_attributes=Just arg_attributes})
writeMessageEnd op
tFlush (getTransport op) | 429 | send_mutateRow op arg_tableName arg_row arg_mutations arg_attributes = do
seq <- seqid
seqn <- readIORef seq
writeMessageBegin op ("mutateRow", M_CALL, seqn)
write_MutateRow_args op (MutateRow_args{f_MutateRow_args_tableName=Just arg_tableName,f_MutateRow_args_row=Just arg_row,f_MutateRow_args_mutations=Just arg_mutations,f_MutateRow_args_attributes=Just arg_attributes})
writeMessageEnd op
tFlush (getTransport op) | 429 | false | false | 0 | 11 | 43 | 118 | 57 | 61 | null | null |
dorchard/camfort | src/Camfort/Specification/Units/InferenceBackend.hs | apache-2.0 | epsilon = 0.001 | 15 | epsilon = 0.001 | 15 | epsilon = 0.001 | 15 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
JoeyEremondi/elm-type-effect | src/Type/Type.hs | bsd-3-clause | getVarNamesTerm :: Term1 Variable -> IO (Set.Set String)
getVarNamesTerm term =
let go = getVarNames in
case term of
App1 a b ->
Set.union <$> go a <*> go b
Fun1 a b ->
Set.union <$> go a <*> go b
Var1 a ->
go a
EmptyRecord1 ->
return Set.empty
Record1 fields extension ->
do fieldVars <- Set.unions <$> mapM go (concat (Map.elems fields))
Set.union fieldVars <$> go extension
-- COLLECT APPLICATIONS | 483 | getVarNamesTerm :: Term1 Variable -> IO (Set.Set String)
getVarNamesTerm term =
let go = getVarNames in
case term of
App1 a b ->
Set.union <$> go a <*> go b
Fun1 a b ->
Set.union <$> go a <*> go b
Var1 a ->
go a
EmptyRecord1 ->
return Set.empty
Record1 fields extension ->
do fieldVars <- Set.unions <$> mapM go (concat (Map.elems fields))
Set.union fieldVars <$> go extension
-- COLLECT APPLICATIONS | 483 | getVarNamesTerm term =
let go = getVarNames in
case term of
App1 a b ->
Set.union <$> go a <*> go b
Fun1 a b ->
Set.union <$> go a <*> go b
Var1 a ->
go a
EmptyRecord1 ->
return Set.empty
Record1 fields extension ->
do fieldVars <- Set.unions <$> mapM go (concat (Map.elems fields))
Set.union fieldVars <$> go extension
-- COLLECT APPLICATIONS | 426 | false | true | 8 | 15 | 154 | 131 | 66 | 65 | null | null |
aldld/hasp | src/Builtins.hs | bsd-3-clause | divHNum :: HNum -> HNum -> ThrowsError HNum
_ `divHNum` (HInt 0) = throw divideByZeroError | 90 | divHNum :: HNum -> HNum -> ThrowsError HNum
_ `divHNum` (HInt 0) = throw divideByZeroError | 90 | _ `divHNum` (HInt 0) = throw divideByZeroError | 46 | false | true | 0 | 7 | 14 | 39 | 19 | 20 | null | null |
kim/amazonka | amazonka-autoscaling/gen/Network/AWS/AutoScaling/CreateLaunchConfiguration.hs | mpl-2.0 | -- | Indicates whether the instance is optimized for Amazon EBS I/O. By default,
-- the instance is not optimized for EBS I/O. The optimization provides
-- dedicated throughput to Amazon EBS and an optimized configuration stack to
-- provide optimal I/O performance. This optimization is not available with all
-- instance types. Additional usage charges apply. For more information, see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html Amazon EBS-Optimized Instances> in the /Amazon Elastic Compute Cloud User Guide/.
clcEbsOptimized :: Lens' CreateLaunchConfiguration (Maybe Bool)
clcEbsOptimized = lens _clcEbsOptimized (\s a -> s { _clcEbsOptimized = a }) | 680 | clcEbsOptimized :: Lens' CreateLaunchConfiguration (Maybe Bool)
clcEbsOptimized = lens _clcEbsOptimized (\s a -> s { _clcEbsOptimized = a }) | 140 | clcEbsOptimized = lens _clcEbsOptimized (\s a -> s { _clcEbsOptimized = a }) | 76 | true | true | 0 | 9 | 91 | 50 | 29 | 21 | null | null |
mstksg/hledger | hledger-lib/Hledger/Reports/ReportOptions.hs | gpl-3.0 | beginDatesFromRawOpts :: Day -> RawOpts -> [Day]
beginDatesFromRawOpts d = catMaybes . map (begindatefromrawopt d)
where
begindatefromrawopt d (n,v)
| n == "begin" =
either (\e -> usageError $ "could not parse "++n++" date: "++parseErrorPretty e) Just $
fixSmartDateStrEither' d (T.pack v)
| n == "period" =
case
either (\e -> usageError $ "could not parse period option: "++parseErrorPretty e) id $
parsePeriodExpr d (stripquotes $ T.pack v)
of
(_, DateSpan (Just b) _) -> Just b
_ -> Nothing
| otherwise = Nothing
-- Get all end dates specified by -e/--end or -p/--period options, in order,
-- using the given date to interpret relative date expressions. | 780 | beginDatesFromRawOpts :: Day -> RawOpts -> [Day]
beginDatesFromRawOpts d = catMaybes . map (begindatefromrawopt d)
where
begindatefromrawopt d (n,v)
| n == "begin" =
either (\e -> usageError $ "could not parse "++n++" date: "++parseErrorPretty e) Just $
fixSmartDateStrEither' d (T.pack v)
| n == "period" =
case
either (\e -> usageError $ "could not parse period option: "++parseErrorPretty e) id $
parsePeriodExpr d (stripquotes $ T.pack v)
of
(_, DateSpan (Just b) _) -> Just b
_ -> Nothing
| otherwise = Nothing
-- Get all end dates specified by -e/--end or -p/--period options, in order,
-- using the given date to interpret relative date expressions. | 780 | beginDatesFromRawOpts d = catMaybes . map (begindatefromrawopt d)
where
begindatefromrawopt d (n,v)
| n == "begin" =
either (\e -> usageError $ "could not parse "++n++" date: "++parseErrorPretty e) Just $
fixSmartDateStrEither' d (T.pack v)
| n == "period" =
case
either (\e -> usageError $ "could not parse period option: "++parseErrorPretty e) id $
parsePeriodExpr d (stripquotes $ T.pack v)
of
(_, DateSpan (Just b) _) -> Just b
_ -> Nothing
| otherwise = Nothing
-- Get all end dates specified by -e/--end or -p/--period options, in order,
-- using the given date to interpret relative date expressions. | 731 | false | true | 0 | 12 | 230 | 234 | 112 | 122 | null | null |
spechub/Hets | Common/Lib/MapSet.hs | gpl-2.0 | -- | difference of two maps
difference :: (Ord a, Ord b) => MapSet a b -> MapSet a b -> MapSet a b
difference (MapSet m) = MapSet . Map.differenceWith setDifference m . toMap | 174 | difference :: (Ord a, Ord b) => MapSet a b -> MapSet a b -> MapSet a b
difference (MapSet m) = MapSet . Map.differenceWith setDifference m . toMap | 146 | difference (MapSet m) = MapSet . Map.differenceWith setDifference m . toMap | 75 | true | true | 0 | 8 | 34 | 74 | 36 | 38 | null | null |
sweirich/tal | src/F.hs | mit | step (TmPrj e1 i) = do
e1' <- step e1
return (TmPrj e1' i) | 64 | step (TmPrj e1 i) = do
e1' <- step e1
return (TmPrj e1' i) | 64 | step (TmPrj e1 i) = do
e1' <- step e1
return (TmPrj e1' i) | 64 | false | false | 0 | 9 | 19 | 41 | 18 | 23 | null | null |
andreagenso/java2scala | src/J2s/Parser.hs | apache-2.0 | pTypeBound = AGS.sem_TypeBound_TypeBound <$ pKeyWord "extends" <*> pClassOrInterfaceType <*> pAdditionalBoundList | 113 | pTypeBound = AGS.sem_TypeBound_TypeBound <$ pKeyWord "extends" <*> pClassOrInterfaceType <*> pAdditionalBoundList | 113 | pTypeBound = AGS.sem_TypeBound_TypeBound <$ pKeyWord "extends" <*> pClassOrInterfaceType <*> pAdditionalBoundList | 113 | false | false | 1 | 8 | 9 | 27 | 11 | 16 | null | null |
mietek/lambda-pi | LambdaPi.hs | mit | typeI _ c (Free x)
= case lookup x c of
Just t -> return t
Nothing -> throwError "unknown identifier" | 116 | typeI _ c (Free x)
= case lookup x c of
Just t -> return t
Nothing -> throwError "unknown identifier" | 116 | typeI _ c (Free x)
= case lookup x c of
Just t -> return t
Nothing -> throwError "unknown identifier" | 116 | false | false | 1 | 8 | 35 | 52 | 22 | 30 | null | null |
kylcarte/threepenny-extra | src/Graphics/UI/Threepenny/Attributes/Extra.hs | bsd-3-clause | for_ = strMAttr "for" | 38 | for_ = strMAttr "for" | 38 | for_ = strMAttr "for" | 38 | false | false | 0 | 5 | 20 | 9 | 4 | 5 | null | null |
keera-studios/gtk-helpers | gtk3/src/Graphics/UI/Gtk/Extra/BuilderTH.hs | bsd-3-clause | gtkViewAccessor :: String -> String -> String -> String -> Q [Dec]
gtkViewAccessor builderModule uiAccessor name kind = sequenceQ
-- Declaration
[ sigD funcName
-- Builder -> IO Kind
(appT (appT arrowT (conT (mkName "View")))
(appT (conT (mkName "IO")) (conT (mkName kind))))
-- Implementation
, funD funcName
-- castedOnBuilder objectName
[clause [varP builderName]
(normalB (appE (varE funcNameInBuilder)
(appE (varE (mkName uiAccessor))
(varE builderName)
)
)) []]
]
where castedAccess = appE (varE (mkName "fromBuilder")) casting
casting = varE (mkName ("castTo" ++ kind))
funcName = mkName name
funcNameInBuilder = mkName $ builderModule ++ ('.' : name)
builderName = mkName "b" | 1,015 | gtkViewAccessor :: String -> String -> String -> String -> Q [Dec]
gtkViewAccessor builderModule uiAccessor name kind = sequenceQ
-- Declaration
[ sigD funcName
-- Builder -> IO Kind
(appT (appT arrowT (conT (mkName "View")))
(appT (conT (mkName "IO")) (conT (mkName kind))))
-- Implementation
, funD funcName
-- castedOnBuilder objectName
[clause [varP builderName]
(normalB (appE (varE funcNameInBuilder)
(appE (varE (mkName uiAccessor))
(varE builderName)
)
)) []]
]
where castedAccess = appE (varE (mkName "fromBuilder")) casting
casting = varE (mkName ("castTo" ++ kind))
funcName = mkName name
funcNameInBuilder = mkName $ builderModule ++ ('.' : name)
builderName = mkName "b" | 1,015 | gtkViewAccessor builderModule uiAccessor name kind = sequenceQ
-- Declaration
[ sigD funcName
-- Builder -> IO Kind
(appT (appT arrowT (conT (mkName "View")))
(appT (conT (mkName "IO")) (conT (mkName kind))))
-- Implementation
, funD funcName
-- castedOnBuilder objectName
[clause [varP builderName]
(normalB (appE (varE funcNameInBuilder)
(appE (varE (mkName uiAccessor))
(varE builderName)
)
)) []]
]
where castedAccess = appE (varE (mkName "fromBuilder")) casting
casting = varE (mkName ("castTo" ++ kind))
funcName = mkName name
funcNameInBuilder = mkName $ builderModule ++ ('.' : name)
builderName = mkName "b" | 948 | false | true | 4 | 18 | 430 | 286 | 139 | 147 | null | null |
tilltheis/propositional-logic | src/Data/Foldable.hs | bsd-3-clause | -- | 'notElem' is the negation of 'elem'.
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
notElem x = not . elem x | 116 | notElem :: (Foldable t, Eq a) => a -> t a -> Bool
notElem x = not . elem x | 74 | notElem x = not . elem x | 24 | true | true | 0 | 8 | 27 | 48 | 24 | 24 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- | 'v1beta2StatefulSetListItems' Lens
v1beta2StatefulSetListItemsL :: Lens_' V1beta2StatefulSetList ([V1beta2StatefulSet])
v1beta2StatefulSetListItemsL f V1beta2StatefulSetList{..} = (\v1beta2StatefulSetListItems -> V1beta2StatefulSetList { v1beta2StatefulSetListItems, ..} ) <$> f v1beta2StatefulSetListItems | 311 | v1beta2StatefulSetListItemsL :: Lens_' V1beta2StatefulSetList ([V1beta2StatefulSet])
v1beta2StatefulSetListItemsL f V1beta2StatefulSetList{..} = (\v1beta2StatefulSetListItems -> V1beta2StatefulSetList { v1beta2StatefulSetListItems, ..} ) <$> f v1beta2StatefulSetListItems | 271 | v1beta2StatefulSetListItemsL f V1beta2StatefulSetList{..} = (\v1beta2StatefulSetListItems -> V1beta2StatefulSetList { v1beta2StatefulSetListItems, ..} ) <$> f v1beta2StatefulSetListItems | 186 | true | true | 0 | 8 | 22 | 57 | 31 | 26 | null | null |
dolio/vector | Data/Vector/Fusion/Bundle.hs | bsd-3-clause | find f = unId . M.find f | 24 | find f = unId . M.find f | 24 | find f = unId . M.find f | 24 | false | false | 2 | 5 | 6 | 23 | 8 | 15 | null | null |
dudebout/game-theoretic-learning | GTL/Numeric/Probability/Finite.hs | isc | -- |Creates a distribution from a 'Vector'.
fromVector :: (Bounded a, Ix a) => Vector Proba -> Dist a
fromVector = fromList . Lin.toList | 136 | fromVector :: (Bounded a, Ix a) => Vector Proba -> Dist a
fromVector = fromList . Lin.toList | 92 | fromVector = fromList . Lin.toList | 34 | true | true | 0 | 7 | 23 | 43 | 22 | 21 | null | null |
vonavi/hcloud | src/Main.hs | bsd-3-clause | rmSessionFile :: FilePath -> IO ()
rmSessionFile file = removeFile file `catch` fileHandler
where fileHandler e
| isDoesNotExistError e = return ()
| otherwise = throwIO e | 205 | rmSessionFile :: FilePath -> IO ()
rmSessionFile file = removeFile file `catch` fileHandler
where fileHandler e
| isDoesNotExistError e = return ()
| otherwise = throwIO e | 205 | rmSessionFile file = removeFile file `catch` fileHandler
where fileHandler e
| isDoesNotExistError e = return ()
| otherwise = throwIO e | 170 | false | true | 0 | 8 | 60 | 68 | 31 | 37 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Json.hs | gpl-2.0 | parseRules ("JSON","String_Value") =
(((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))
<|>
((pRegExpr regex_'5c'5c'28'3f'3a'5b'22'5c'5c'2fbfnrt'5d'7cu'5b0'2d9a'2dfA'2df'5d'7b4'7d'29 >>= withAttribute CharTok))
<|>
(currentContext >>= \x -> guard (x == ("JSON","String_Value")) >> pDefault >>= withAttribute StringTok)) | 354 | parseRules ("JSON","String_Value") =
(((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))
<|>
((pRegExpr regex_'5c'5c'28'3f'3a'5b'22'5c'5c'2fbfnrt'5d'7cu'5b0'2d9a'2dfA'2df'5d'7b4'7d'29 >>= withAttribute CharTok))
<|>
(currentContext >>= \x -> guard (x == ("JSON","String_Value")) >> pDefault >>= withAttribute StringTok)) | 354 | parseRules ("JSON","String_Value") =
(((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext))
<|>
((pRegExpr regex_'5c'5c'28'3f'3a'5b'22'5c'5c'2fbfnrt'5d'7cu'5b0'2d9a'2dfA'2df'5d'7b4'7d'29 >>= withAttribute CharTok))
<|>
(currentContext >>= \x -> guard (x == ("JSON","String_Value")) >> pDefault >>= withAttribute StringTok)) | 354 | false | false | 0 | 15 | 44 | 106 | 56 | 50 | null | null |
WraithM/haskell-opaleye | src/Opaleye/Internal/HaskellDB/Sql/Print.hs | bsd-3-clause | ppInsert :: SqlInsert -> Doc
ppInsert (SqlInsert table names values onConflict)
= text "INSERT INTO" <+> ppTable table
<+> parens (commaV ppColumn names)
$$ text "VALUES" <+> commaV (parens . commaV ppSqlExpr)
(NEL.toList values)
<+> ppConflictStatement onConflict | 320 | ppInsert :: SqlInsert -> Doc
ppInsert (SqlInsert table names values onConflict)
= text "INSERT INTO" <+> ppTable table
<+> parens (commaV ppColumn names)
$$ text "VALUES" <+> commaV (parens . commaV ppSqlExpr)
(NEL.toList values)
<+> ppConflictStatement onConflict | 320 | ppInsert (SqlInsert table names values onConflict)
= text "INSERT INTO" <+> ppTable table
<+> parens (commaV ppColumn names)
$$ text "VALUES" <+> commaV (parens . commaV ppSqlExpr)
(NEL.toList values)
<+> ppConflictStatement onConflict | 291 | false | true | 0 | 11 | 92 | 96 | 45 | 51 | null | null |
fmapfmapfmap/amazonka | amazonka-sns/test/Test/AWS/Gen/SNS.hs | mpl-2.0 | testListTopics :: ListTopics -> TestTree
testListTopics = req
"ListTopics"
"fixture/ListTopics.yaml" | 108 | testListTopics :: ListTopics -> TestTree
testListTopics = req
"ListTopics"
"fixture/ListTopics.yaml" | 108 | testListTopics = req
"ListTopics"
"fixture/ListTopics.yaml" | 67 | false | true | 0 | 5 | 17 | 20 | 10 | 10 | null | null |
osa1/Idris-dev | src/Idris/Core/ProofState.hs | bsd-3-clause | expandLet :: Name -> Term -> RunTactic
expandLet n v ctxt env tm =
return $ updsubst n v tm | 98 | expandLet :: Name -> Term -> RunTactic
expandLet n v ctxt env tm =
return $ updsubst n v tm | 98 | expandLet n v ctxt env tm =
return $ updsubst n v tm | 59 | false | true | 2 | 8 | 26 | 48 | 21 | 27 | null | null |
NICTA/lets-lens | src/Lets/Lens.hs | bsd-3-clause | -- | An alias for @compose@.
(|.) ::
Lens s t a b
-> Lens q r s t
-> Lens q r a b
(|.) =
compose | 104 | (|.) ::
Lens s t a b
-> Lens q r s t
-> Lens q r a b
(|.) =
compose | 75 | (|.) =
compose | 16 | true | true | 0 | 8 | 35 | 53 | 27 | 26 | null | null |
keera-studios/hsQt | Qtc/Gui/QStyleOptionTabBarBase.hs | bsd-2-clause | qselectedTabRect :: QStyleOptionTabBarBase a -> (()) -> IO (QRect ())
qselectedTabRect x0 ()
= withQRectResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionTabBarBase_selectedTabRect cobj_x0 | 204 | qselectedTabRect :: QStyleOptionTabBarBase a -> (()) -> IO (QRect ())
qselectedTabRect x0 ()
= withQRectResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionTabBarBase_selectedTabRect cobj_x0 | 204 | qselectedTabRect x0 ()
= withQRectResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QStyleOptionTabBarBase_selectedTabRect cobj_x0 | 134 | false | true | 0 | 10 | 32 | 64 | 31 | 33 | null | null |
GaloisInc/halvm-ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (FETCHTOC reg lab) = vcat [
hcat [ text "0:\taddis\t", pprReg reg,
text ",12,.TOC.-0b@ha" ],
hcat [ text "\taddi\t", pprReg reg,
char ',', pprReg reg,
text ",.TOC.-0b@l" ],
hcat [ text "\t.localentry\t",
ppr lab,
text ",.-",
ppr lab]
] | 362 | pprInstr (FETCHTOC reg lab) = vcat [
hcat [ text "0:\taddis\t", pprReg reg,
text ",12,.TOC.-0b@ha" ],
hcat [ text "\taddi\t", pprReg reg,
char ',', pprReg reg,
text ",.TOC.-0b@l" ],
hcat [ text "\t.localentry\t",
ppr lab,
text ",.-",
ppr lab]
] | 362 | pprInstr (FETCHTOC reg lab) = vcat [
hcat [ text "0:\taddis\t", pprReg reg,
text ",12,.TOC.-0b@ha" ],
hcat [ text "\taddi\t", pprReg reg,
char ',', pprReg reg,
text ",.TOC.-0b@l" ],
hcat [ text "\t.localentry\t",
ppr lab,
text ",.-",
ppr lab]
] | 362 | false | false | 0 | 9 | 157 | 111 | 54 | 57 | null | null |
alephcloud/hs-aws-general | tests/SignatureV4.hs | mit | parseTestHeader :: P.CharParsing m => m HTTP.Header
parseTestHeader = (,)
<$> (fromString <$> P.manyTill P.anyChar (P.char ':'))
<*> line | 145 | parseTestHeader :: P.CharParsing m => m HTTP.Header
parseTestHeader = (,)
<$> (fromString <$> P.manyTill P.anyChar (P.char ':'))
<*> line | 145 | parseTestHeader = (,)
<$> (fromString <$> P.manyTill P.anyChar (P.char ':'))
<*> line | 93 | false | true | 5 | 10 | 26 | 70 | 33 | 37 | null | null |
mainland/dph | dph-plugin/DPH/Base/Pretty.hs | bsd-3-clause | - Utils ---------------------------------------------------------------------
-- | Wrap a `Doc` in parens if the predicate is true.
pprParen :: Bool -> Doc -> Doc
pprParen b c
= if b then parens c
else c
| 213 | pprParen :: Bool -> Doc -> Doc
pprParen b c
= if b then parens c
else c | 80 | pprParen b c
= if b then parens c
else c | 49 | true | true | 0 | 8 | 42 | 47 | 23 | 24 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/fromEnum_3.hs | mit | fromEnumMyBool MyTrue = Pos (Succ Zero) | 39 | fromEnumMyBool MyTrue = Pos (Succ Zero) | 39 | fromEnumMyBool MyTrue = Pos (Succ Zero) | 39 | false | false | 0 | 7 | 5 | 19 | 8 | 11 | null | null |
mathologist/hTestMaker | testmaker/src/TestMaker/SageTex.hs | gpl-3.0 | contents' cs n c t = contents' (c : cs) n (T.head t) (T.tail t) | 63 | contents' cs n c t = contents' (c : cs) n (T.head t) (T.tail t) | 63 | contents' cs n c t = contents' (c : cs) n (T.head t) (T.tail t) | 63 | false | false | 1 | 8 | 14 | 54 | 23 | 31 | null | null |
alevy/mappend | db/migrations/20140120093204_add_is_spam_to_comments.hs | agpl-3.0 | up :: Connection -> IO ()
up = migrate $ do
add_column "comment" "is_spam" "boolean NOT NULL DEFAULT false" | 109 | up :: Connection -> IO ()
up = migrate $ do
add_column "comment" "is_spam" "boolean NOT NULL DEFAULT false" | 109 | up = migrate $ do
add_column "comment" "is_spam" "boolean NOT NULL DEFAULT false" | 83 | false | true | 0 | 8 | 20 | 34 | 16 | 18 | null | null |
bartoszw/elca | LoanCapitalSplit.hs | gpl-2.0 | capitalSplit 0 xs _ = (map (0*) xs) ++ [0] | 43 | capitalSplit 0 xs _ = (map (0*) xs) ++ [0] | 43 | capitalSplit 0 xs _ = (map (0*) xs) ++ [0] | 43 | false | false | 0 | 8 | 10 | 32 | 17 | 15 | null | null |
BartAdv/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | safeForgetEnv env (UType u) = Just $ RUType u | 45 | safeForgetEnv env (UType u) = Just $ RUType u | 45 | safeForgetEnv env (UType u) = Just $ RUType u | 45 | false | false | 0 | 6 | 8 | 26 | 11 | 15 | null | null |
brendanhay/gogol | gogol-firestore/gen/Network/Google/FireStore/Types/Product.hs | mpl-2.0 | -- | The maximum number of results to return. Applies after all other
-- constraints. Must be >= 0 if specified.
sqLimit :: Lens' StructuredQuery (Maybe Int32)
sqLimit
= lens _sqLimit (\ s a -> s{_sqLimit = a}) .
mapping _Coerce | 236 | sqLimit :: Lens' StructuredQuery (Maybe Int32)
sqLimit
= lens _sqLimit (\ s a -> s{_sqLimit = a}) .
mapping _Coerce | 123 | sqLimit
= lens _sqLimit (\ s a -> s{_sqLimit = a}) .
mapping _Coerce | 76 | true | true | 0 | 10 | 48 | 56 | 29 | 27 | null | null |
christiaanb/ghc | compiler/types/Type.hs | bsd-3-clause | {-
%************************************************************************
%* *
Size
* *
************************************************************************
-}
typeSize :: Type -> Int
typeSize (LitTy {}) = 1 | 377 | typeSize :: Type -> Int
typeSize (LitTy {}) = 1 | 52 | typeSize (LitTy {}) = 1 | 28 | true | true | 1 | 8 | 181 | 31 | 15 | 16 | null | null |
hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/VertexArrays.hs | bsd-3-clause | vertexAttribArray :: AttribLocation -> StateVar Capability
vertexAttribArray location =
makeStateVar (getVertexAttribArray location) (flip setVertexAttribArray location) | 172 | vertexAttribArray :: AttribLocation -> StateVar Capability
vertexAttribArray location =
makeStateVar (getVertexAttribArray location) (flip setVertexAttribArray location) | 172 | vertexAttribArray location =
makeStateVar (getVertexAttribArray location) (flip setVertexAttribArray location) | 113 | false | true | 0 | 7 | 17 | 45 | 20 | 25 | null | null |
wrengr/bytestring-trie | src/Data/Trie/Internal.hs | bsd-3-clause | mayEpsilon Nothing = id | 24 | mayEpsilon Nothing = id | 24 | mayEpsilon Nothing = id | 24 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
anton-dessiatov/ghc | compiler/basicTypes/ConLike.hs | bsd-3-clause | conLikeInstOrigArgTys :: ConLike -> [Type] -> [Type]
conLikeInstOrigArgTys (RealDataCon data_con) tys =
dataConInstOrigArgTys data_con tys | 142 | conLikeInstOrigArgTys :: ConLike -> [Type] -> [Type]
conLikeInstOrigArgTys (RealDataCon data_con) tys =
dataConInstOrigArgTys data_con tys | 142 | conLikeInstOrigArgTys (RealDataCon data_con) tys =
dataConInstOrigArgTys data_con tys | 89 | false | true | 0 | 7 | 18 | 41 | 21 | 20 | null | null |
chengzh2008/hpffp | src/ch14-Testing/morse/app/Main.hs | bsd-3-clause | convertToMorse :: IO ()
convertToMorse = forever $ do
weAreDone <- hIsEOF stdin
when weAreDone exitSuccess
line <- hGetLine stdin
convertLine line
where
convertLine line = do
case stringToMorse line of
(Just str) -> putStrLn $ intercalate " " str
Nothing -> do
putStrLn $ "Error: " ++ line
exitFailure | 358 | convertToMorse :: IO ()
convertToMorse = forever $ do
weAreDone <- hIsEOF stdin
when weAreDone exitSuccess
line <- hGetLine stdin
convertLine line
where
convertLine line = do
case stringToMorse line of
(Just str) -> putStrLn $ intercalate " " str
Nothing -> do
putStrLn $ "Error: " ++ line
exitFailure | 358 | convertToMorse = forever $ do
weAreDone <- hIsEOF stdin
when weAreDone exitSuccess
line <- hGetLine stdin
convertLine line
where
convertLine line = do
case stringToMorse line of
(Just str) -> putStrLn $ intercalate " " str
Nothing -> do
putStrLn $ "Error: " ++ line
exitFailure | 334 | false | true | 1 | 13 | 106 | 120 | 51 | 69 | null | null |
Blaisorblade/stack | src/Stack/Config/Build.hs | bsd-3-clause | -- | Interprets BuildOptsMonoid options.
buildOptsFromMonoid :: BuildOptsMonoid -> BuildOpts
buildOptsFromMonoid BuildOptsMonoid{..} = BuildOpts
{ boptsLibProfile = fromFirst
(boptsLibProfile defaultBuildOpts)
buildMonoidLibProfile
, boptsExeProfile = fromFirst
(boptsExeProfile defaultBuildOpts)
buildMonoidExeProfile
, boptsHaddock = fromFirst
(boptsHaddock defaultBuildOpts)
buildMonoidHaddock
, boptsHaddockOpts = haddockOptsFromMonoid buildMonoidHaddockOpts
, boptsOpenHaddocks = fromFirst
(boptsOpenHaddocks defaultBuildOpts)
buildMonoidOpenHaddocks
, boptsHaddockDeps = getFirst buildMonoidHaddockDeps
, boptsInstallExes = fromFirst
(boptsInstallExes defaultBuildOpts)
buildMonoidInstallExes
, boptsPreFetch = fromFirst
(boptsPreFetch defaultBuildOpts)
buildMonoidPreFetch
, boptsKeepGoing = getFirst buildMonoidKeepGoing
, boptsForceDirty = fromFirst
(boptsForceDirty defaultBuildOpts)
buildMonoidForceDirty
, boptsTests = fromFirst (boptsTests defaultBuildOpts) buildMonoidTests
, boptsTestOpts = testOptsFromMonoid buildMonoidTestOpts
, boptsBenchmarks = fromFirst
(boptsBenchmarks defaultBuildOpts)
buildMonoidBenchmarks
, boptsBenchmarkOpts = benchmarkOptsFromMonoid buildMonoidBenchmarkOpts
, boptsReconfigure = fromFirst
(boptsReconfigure defaultBuildOpts)
buildMonoidReconfigure
, boptsCabalVerbose = fromFirst
(boptsCabalVerbose defaultBuildOpts)
buildMonoidCabalVerbose
, boptsSplitObjs = fromFirst
(boptsSplitObjs defaultBuildOpts)
buildMonoidSplitObjs
} | 1,764 | buildOptsFromMonoid :: BuildOptsMonoid -> BuildOpts
buildOptsFromMonoid BuildOptsMonoid{..} = BuildOpts
{ boptsLibProfile = fromFirst
(boptsLibProfile defaultBuildOpts)
buildMonoidLibProfile
, boptsExeProfile = fromFirst
(boptsExeProfile defaultBuildOpts)
buildMonoidExeProfile
, boptsHaddock = fromFirst
(boptsHaddock defaultBuildOpts)
buildMonoidHaddock
, boptsHaddockOpts = haddockOptsFromMonoid buildMonoidHaddockOpts
, boptsOpenHaddocks = fromFirst
(boptsOpenHaddocks defaultBuildOpts)
buildMonoidOpenHaddocks
, boptsHaddockDeps = getFirst buildMonoidHaddockDeps
, boptsInstallExes = fromFirst
(boptsInstallExes defaultBuildOpts)
buildMonoidInstallExes
, boptsPreFetch = fromFirst
(boptsPreFetch defaultBuildOpts)
buildMonoidPreFetch
, boptsKeepGoing = getFirst buildMonoidKeepGoing
, boptsForceDirty = fromFirst
(boptsForceDirty defaultBuildOpts)
buildMonoidForceDirty
, boptsTests = fromFirst (boptsTests defaultBuildOpts) buildMonoidTests
, boptsTestOpts = testOptsFromMonoid buildMonoidTestOpts
, boptsBenchmarks = fromFirst
(boptsBenchmarks defaultBuildOpts)
buildMonoidBenchmarks
, boptsBenchmarkOpts = benchmarkOptsFromMonoid buildMonoidBenchmarkOpts
, boptsReconfigure = fromFirst
(boptsReconfigure defaultBuildOpts)
buildMonoidReconfigure
, boptsCabalVerbose = fromFirst
(boptsCabalVerbose defaultBuildOpts)
buildMonoidCabalVerbose
, boptsSplitObjs = fromFirst
(boptsSplitObjs defaultBuildOpts)
buildMonoidSplitObjs
} | 1,723 | buildOptsFromMonoid BuildOptsMonoid{..} = BuildOpts
{ boptsLibProfile = fromFirst
(boptsLibProfile defaultBuildOpts)
buildMonoidLibProfile
, boptsExeProfile = fromFirst
(boptsExeProfile defaultBuildOpts)
buildMonoidExeProfile
, boptsHaddock = fromFirst
(boptsHaddock defaultBuildOpts)
buildMonoidHaddock
, boptsHaddockOpts = haddockOptsFromMonoid buildMonoidHaddockOpts
, boptsOpenHaddocks = fromFirst
(boptsOpenHaddocks defaultBuildOpts)
buildMonoidOpenHaddocks
, boptsHaddockDeps = getFirst buildMonoidHaddockDeps
, boptsInstallExes = fromFirst
(boptsInstallExes defaultBuildOpts)
buildMonoidInstallExes
, boptsPreFetch = fromFirst
(boptsPreFetch defaultBuildOpts)
buildMonoidPreFetch
, boptsKeepGoing = getFirst buildMonoidKeepGoing
, boptsForceDirty = fromFirst
(boptsForceDirty defaultBuildOpts)
buildMonoidForceDirty
, boptsTests = fromFirst (boptsTests defaultBuildOpts) buildMonoidTests
, boptsTestOpts = testOptsFromMonoid buildMonoidTestOpts
, boptsBenchmarks = fromFirst
(boptsBenchmarks defaultBuildOpts)
buildMonoidBenchmarks
, boptsBenchmarkOpts = benchmarkOptsFromMonoid buildMonoidBenchmarkOpts
, boptsReconfigure = fromFirst
(boptsReconfigure defaultBuildOpts)
buildMonoidReconfigure
, boptsCabalVerbose = fromFirst
(boptsCabalVerbose defaultBuildOpts)
buildMonoidCabalVerbose
, boptsSplitObjs = fromFirst
(boptsSplitObjs defaultBuildOpts)
buildMonoidSplitObjs
} | 1,671 | true | true | 0 | 9 | 415 | 276 | 147 | 129 | null | null |
acamino/cis-194-2013 | src/CIS194/Week05/StackVM.hs | mit | execute (_:_:_) (Add:_) = errType "Add" | 59 | execute (_:_:_) (Add:_) = errType "Add" | 59 | execute (_:_:_) (Add:_) = errType "Add" | 59 | false | false | 1 | 7 | 25 | 34 | 16 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.