Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Monad.Static
Synopsis
- class StaticApply m => StaticBind (m :: Type -> Type) where
- staticBind :: (Typeable a, Typeable b) => m a -> Closure (a -> m b) -> m b
- staticJoin :: Typeable a => m (m a) -> m a
- class (StaticApplicative m, StaticBind m) => StaticMonad (m :: Type -> Type)
- staticReturn :: (StaticApplicative m, Typeable a) => Closure a -> m a
Documentation
class StaticApply m => StaticBind (m :: Type -> Type) where Source #
Instances of StaticBind
should satisfy the following laws (writing
staticMap
, staticApply
, staticBind
as infix (
, <$>
)(
, <*>
)(>>=)
,
respectively):
(m >>= f) >>= g = m >>= static (.)`cap`
(staticFlippedBind g)cap
fstaticJoin
.staticJoin
=staticJoin
.staticMap
(staticstaticJoin
)
where
staticFlippedBind :: Closure (b -> m c) -> Closure (m b -> m c) staticFlippedBind = capDup (static (flip staticBind))
Minimal complete definition
Methods
staticBind :: (Typeable a, Typeable b) => m a -> Closure (a -> m b) -> m b Source #
staticJoin :: Typeable a => m (m a) -> m a Source #
class (StaticApplicative m, StaticBind m) => StaticMonad (m :: Type -> Type) Source #
Instances
(StaticApplicative m, StaticBind m) => StaticMonad m Source # | |
Defined in Control.Monad.Static |
staticReturn :: (StaticApplicative m, Typeable a) => Closure a -> m a Source #