Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Continuation based control-flow
Synopsis
- newtype ContFlow (xs :: [Type]) r = ContFlow (ContTuple xs r -> r)
- type family ContTuple (xs :: [Type]) r where ...
- (>:>) :: MultiCont a => a -> ContTuple (MultiContTypes a) r -> r
- (>-:>) :: (MultiCont a, MultiContTypes a ~ '[b]) => a -> (b -> r) -> r
- (>%:>) :: (MultiCont a, ReorderTuple ts (ContTuple (MultiContTypes a) r)) => a -> ts -> r
- (>::>) :: ContFlow xs r -> ContTuple xs r -> r
- (>:-:>) :: ContFlow '[a] r -> (a -> r) -> r
- (>:%:>) :: forall ts xs r. ReorderTuple ts (ContTuple xs r) => ContFlow xs r -> ts -> r
- type family ToMultiCont xs r where ...
- class MultiCont a where
- type MultiContTypes a :: [Type]
- toCont :: a -> ContFlow (MultiContTypes a) r
- toContM :: Monad m => m a -> ContFlow (MultiContTypes a) (m r)
Documentation
type family ContTuple (xs :: [Type]) r where ... Source #
Convert a list of types into the actual data type representing the continuations.
ContTuple xs r = Tuple (ToMultiCont xs r) |
(>:>) :: MultiCont a => a -> ContTuple (MultiContTypes a) r -> r infixl 0 Source #
Bind a multi-continuable type to a tuple of continuations
(>-:>) :: (MultiCont a, MultiContTypes a ~ '[b]) => a -> (b -> r) -> r infixl 0 Source #
Bind a single-continuable type to a 1-tuple of continuations
(>%:>) :: (MultiCont a, ReorderTuple ts (ContTuple (MultiContTypes a) r)) => a -> ts -> r infixl 0 Source #
Bind a multi-continuable type to a tuple of continuations and reorder fields if necessary
(>::>) :: ContFlow xs r -> ContTuple 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 (ContTuple 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 ToMultiCont xs r where ... Source #
ToMultiCont '[] r = '[] | |
ToMultiCont (x ': xs) r = (x -> r) ': ToMultiCont xs r |
class MultiCont a where Source #
A multi-continuable type
type MultiContTypes a :: [Type] 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)
Instances
ContVariant xs => MultiCont (V xs) Source # | |
(Functor (VariantF xs), ContVariant (ApplyAll (EADT xs) xs)) => MultiCont (EADT xs) Source # | MultiCont instance
|
ContVariant (ApplyAll e xs) => MultiCont (VariantF xs e) Source # | |