Safe Haskell | None |
---|---|

Language | Haskell2010 |

- 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 ActionT base zoomed m a Source #

Base Action type. Allows paramaterization over application state, zoomed state and underlying monad.

Monad m => MonadState zoomed (ActionT base zoomed m) Source # | |

MonadTrans (ActionT base zoomed) Source # | |

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 # | |

MonadIO m => MonadIO (ActionT base zoomed m) Source # | |

Monad m => Zoom (ActionT base s m) (ActionT base t m) s t Source # | |

(Monoid a, Monad m) => Monoid (ActionT base zoomed m a) Source # | |

type Zoomed (ActionT base zoomed m) Source # | |

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 `Action MyState a` over the MyState which is
stored in the currently focused state and returns the result.
Use `runActionOver`

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`