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

Language | Haskell2010 |

## Synopsis

- type family CmdTypes c cmd :: [Type]
- newtype NoIOCmd cmd = NoIOCmd {}
- maybeExec :: (Applicative m, AsFacet a c) => (a -> m b) -> c -> MaybeT m (Proxy '[a], b)
- fixExec :: Functor m => ((cmd -> m ()) -> cmd -> MaybeT m (Proxy cmds, ())) -> cmd -> m (Proxy cmds, ())
- verifyExec :: (AppendUnique '[] ys ~ ys, AppendUnique xs ys ~ xs, AppendUnique ys xs ~ ys, Functor m) => (cmd -> Which xs) -> (cmd -> m (Proxy ys, b)) -> cmd -> m b
- verifyFixExec :: (AppendUnique '[] ys ~ ys, AppendUnique xs ys ~ xs, AppendUnique ys xs ~ ys, Functor m, Functor m) => (cmd -> Which xs) -> ((cmd -> m ()) -> cmd -> MaybeT m (Proxy ys, ())) -> cmd -> m ()
- orMaybeExec :: (Monad m, a'' ~ Append a a') => MaybeT m (Proxy a, b) -> MaybeT m (Proxy a', b) -> MaybeT m (Proxy a'', b)
- execConcur :: MonadUnliftIO m => (cmd -> m ()) -> Concur cmd a -> m a

# Documentation

type family CmdTypes c cmd :: [Type] Source #

type function to get the list of effects in a `c`

, parameterized over `cmd`

A command type that removes the `IO cmd`

from the `CmdTypes`

of the input `cmd`

maybeExec :: (Applicative m, AsFacet a c) => (a -> m b) -> c -> MaybeT m (Proxy '[a], b) Source #

Create an executor for a variant in the command type.
returns a `Proxy`

to keep track of the the types handled by the executor.

fixExec :: Functor m => ((cmd -> m ()) -> cmd -> MaybeT m (Proxy cmds, ())) -> cmd -> m (Proxy cmds, ()) Source #

Tie an executor with itself to get the final interpreter

verifyExec :: (AppendUnique '[] ys ~ ys, AppendUnique xs ys ~ xs, AppendUnique ys xs ~ ys, Functor m) => (cmd -> Which xs) -> (cmd -> m (Proxy ys, b)) -> cmd -> m b Source #

Use this function to verify at compile time that the given executor will fullfill all the variant types in a command type. redundant-constraints: used to constrain xs and ys

verifyFixExec :: (AppendUnique '[] ys ~ ys, AppendUnique xs ys ~ xs, AppendUnique ys xs ~ ys, Functor m, Functor m) => (cmd -> Which xs) -> ((cmd -> m ()) -> cmd -> MaybeT m (Proxy ys, ())) -> cmd -> m () Source #

orMaybeExec :: (Monad m, a'' ~ Append a a') => MaybeT m (Proxy a, b) -> MaybeT m (Proxy a', b) -> MaybeT m (Proxy a'', b) infixl 3 Source #

Combines executors, keeping track of the combined list of types handled. redundant-constraints: used to constrain a''

execConcur :: MonadUnliftIO m => (cmd -> m ()) -> Concur cmd a -> m a Source #