Safe Haskell | None |
---|---|
Language | Haskell2010 |
Continuation based control-flow
Synopsis
- newtype ContFlow (xs :: [*]) r = ContFlow (ContListToTuple xs r -> r)
- (>::>) :: ContFlow xs r -> ContListToTuple xs r -> r
- (>:-:>) :: ContFlow '[a] r -> (a -> r) -> r
- (>:%:>) :: forall ts xs r. ReorderTuple ts (ContListToTuple xs r) => ContFlow xs r -> ts -> r
- type family ContListToTuple (xs :: [*]) r where ...
- type family ContTupleToList t r :: [*] where ...
- type family StripR f r where ...
- type family AddR f r where ...
- class MultiCont a where
- type MultiContTypes a :: [*]
- toCont :: a -> ContFlow (MultiContTypes a) r
- toContM :: Monad m => m a -> ContFlow (MultiContTypes a) (m r)
Documentation
newtype ContFlow (xs :: [*]) r Source #
A continuation based control-flow
ContFlow (ContListToTuple xs r -> r) |
(>::>) :: ContFlow xs r -> ContListToTuple xs r -> r infixl 0 Source #
Bind a flow to a tuple of continuations
(>:-:>) :: ContFlow '[a] r -> (a -> r) -> r infixl 0 Source #
Bind a flow to a 1-tuple of continuations
(>:%:>) :: forall ts xs r. ReorderTuple ts (ContListToTuple xs r) => ContFlow xs r -> ts -> r infixl 0 Source #
Bind a flow to a tuple of continuations and reorder fields if necessary
type family ContListToTuple (xs :: [*]) r where ... Source #
Convert a list of types into the actual data type representing the continuations.
ContListToTuple xs r = ListToTuple (AddR xs r) |
type family ContTupleToList t r :: [*] where ... Source #
Convert a tuple of continuations into a list of types
ContTupleToList t r = StripR (TupleToList t) r |
class MultiCont a where Source #
type MultiContTypes a :: [*] Source #
toCont :: a -> ContFlow (MultiContTypes a) r Source #
Convert a data into a multi-continuation
toContM :: Monad m => m a -> ContFlow (MultiContTypes a) (m r) Source #
Convert a data into a multi-continuation (monadic)