Maintainer | Ertugrul Soeylemez <es@ertes.de> |
---|---|

Safe Haskell | None |

Suspension/continuation utilities.

- addCont_ :: MonadContinue e f m => f (m ()) -> m ()
- continue :: MonadContinue e f m => Either e a -> f (Either e a) -> m a
- continue_ :: MonadContinue e f m => f () -> m ()
- suspend :: MonadContinue e f m => e -> m a

# Basic utilities

addCont_ :: MonadContinue e f m => f (m ()) -> m ()Source

Add the given set of continuations without suspending.

:: MonadContinue e f m | |

=> Either e a | What to return now (left suspends). |

-> f (Either e a) | What to return when reentering (left suspends). |

-> m a |

Allow to continue here with the given value.

suspend :: MonadContinue e f m => e -> m aSource

Suspend with the given value. Does not register any continuation
spots. Note that `suspend mempty`

is equivalent to `empty`

.