Copyright | (c) Fumiaki Kinoshita 2014 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <[email protected]> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Control.Monad.Objective.Class
Description
MonadObjective
class and operations
- type Inst' f g = Inst g f g
- class Monad b => ObjectiveBase b where
- type MonadObjective b m = (ObjectiveBase b, Elevate b m, Monad m)
- (.-) :: (MonadObjective b m, Elevate g m) => Inst b f g -> f a -> m a
- (.^) :: (MonadObjective b m, Elevate g m, Elevate e f) => Inst b f g -> e a -> m a
- (.&) :: (MonadObjective b m, Elevate g m, Elevate (State s) f) => Inst b f g -> StateT s m a -> m a
- (.!) :: (MonadObjective b m, Elevate g m) => Inst b f g -> Program f a -> m a
- invocation :: (MonadObjective b m, Elevate g m) => Inst b f g -> Object f m
Documentation
class Monad b => ObjectiveBase b where Source
Methods
new :: Object f g -> b (Inst b f g) Source
invoke :: Monad m => (forall x. b x -> m x) -> (forall x. g x -> m x) -> Inst b f g -> f a -> m a Source
Instances
type MonadObjective b m = (ObjectiveBase b, Elevate b m, Monad m) Source
(.-) :: (MonadObjective b m, Elevate g m) => Inst b f g -> f a -> m a infixr 5 Source
(.^) :: (MonadObjective b m, Elevate g m, Elevate e f) => Inst b f g -> e a -> m a infixr 5 Source
Invoke a method.
(.&) :: (MonadObjective b m, Elevate g m, Elevate (State s) f) => Inst b f g -> StateT s m a -> m a infixr 5 Source
(.^) for StateT
invocation :: (MonadObjective b m, Elevate g m) => Inst b f g -> Object f m Source
We can convert method invocation into an object trivially.
invocation i = liftO (i.-)