Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype AppF base m next = RunApp (StateT base m next)
- newtype ActionT base zoomed m a = ActionT {}
- type AppT s m a = ActionT s s m a
- runEve :: Monad m => base -> AppT base m a -> m (a, base)
- evalEve :: Monad m => base -> AppT base m a -> m a
- execEve :: Monad m => base -> AppT base m a -> m base
- runApp :: Monad m => AppT base m a -> ActionT base zoomed m a
- runAction :: (HasStates t, Functor (Zoomed m c), Default s, Typeable s, Zoom m n s t) => m c -> n c
- runActionOver :: Zoom m n s t => LensLike' (Zoomed m c) t s -> m c -> n c
Documentation
newtype AppF base m next Source #
A Free Functor for storing lifted App actions.
newtype ActionT base zoomed m a Source #
Base Action type. Allows paramaterization over application state, zoomed state and underlying monad.
Instances
Monad m => MonadState zoomed (ActionT base zoomed m) Source # | |
MonadTrans (ActionT base zoomed) Source # | |
Defined in Eve.Internal.Actions | |
Monad n => MonadFree (AppF base n) (ActionT base zoomed n) Source # | |
Monad m => Monad (ActionT base zoomed m) Source # | |
Monad m => Functor (ActionT base zoomed m) Source # | |
Monad m => Applicative (ActionT base zoomed m) Source # | |
Defined in Eve.Internal.Actions pure :: a -> ActionT base zoomed m a # (<*>) :: ActionT base zoomed m (a -> b) -> ActionT base zoomed m a -> ActionT base zoomed m b # liftA2 :: (a -> b -> c) -> ActionT base zoomed m a -> ActionT base zoomed m b -> ActionT base zoomed m c # (*>) :: ActionT base zoomed m a -> ActionT base zoomed m b -> ActionT base zoomed m b # (<*) :: ActionT base zoomed m a -> ActionT base zoomed m b -> ActionT base zoomed m a # | |
MonadIO m => MonadIO (ActionT base zoomed m) Source # | |
Defined in Eve.Internal.Actions | |
Monad m => Zoom (ActionT base s m) (ActionT base t m) s t Source # | |
(Semigroup a, Monad m) => Semigroup (ActionT base zoomed m a) Source # | |
(Monoid a, Monad m) => Monoid (ActionT base zoomed m a) Source # | |
type Zoomed (ActionT base zoomed m) Source # | Allows |
runEve :: Monad m => base -> AppT base m a -> m (a, base) Source #
Runs an application and returns the value and state.
evalEve :: Monad m => base -> AppT base m a -> m a Source #
Runs an application and returns the resulting value.
execEve :: Monad m => base -> AppT base m a -> m base Source #
Runs an application and returns the resulting state.
runApp :: Monad m => AppT base m a -> ActionT base zoomed m a Source #
Allows you to run an App
inside of an Action
runAction :: (HasStates t, Functor (Zoomed m c), Default s, Typeable s, Zoom m n s t) => m c -> n c Source #
This runs an
over the MyState which is
stored in the currently focused state and returns the result.
Use Action
MyState arunActionOver
if you'd like to specify a particular MyState
which is accessed by a Lens
or Traversal
.
runActionOver :: Zoom m n s t => LensLike' (Zoomed m c) t s -> m c -> n c Source #
Given a Lens
or Traversal
or LensLike from Control.Lens
which focuses the state (t) of an Action
from a base state (s),
this will convert Action t a -> Action s a
so that it may be run
in an Action s a