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

Language | Haskell2010 |

- newtype AppF base m next = LiftApp (StateT base m next)
- newtype ActionT base zoomed m a = ActionT {}
- type AppT s m a = ActionT s s m a
- runApp :: Monad m => base -> AppT base m a -> m (a, base)
- evalApp :: Monad m => base -> AppT base m a -> m a
- execApp :: Monad m => base -> AppT base m a -> m base
- liftApp :: Monad m => AppT base m a -> ActionT base zoomed m a
- runAction :: 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 # | |

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

runApp :: Monad m => base -> AppT base m a -> m (a, base) Source #

Runs an application and returns the value and state.

evalApp :: Monad m => base -> AppT base m a -> m a Source #

Runs an application and returns the resulting value.

execApp :: Monad m => base -> AppT base m a -> m base Source #

Runs an application and returns the resulting state.

liftApp :: Monad m => AppT base m a -> ActionT base zoomed m a Source #

Allows you to run an `App`

or `AppM`

inside of an `Action`

or `ActionM`

runAction :: Zoom m n s t => LensLike' (Zoomed m c) t s -> m c -> n c Source #

Given a `Lens`

or `Traversal`

or something similar 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`

.

Given a lens `HasStates s => Lens' s t`

it can also convert `Action t a -> App a`