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

Language | Haskell2010 |

- data SupplyT s m a
- type Supply s a = SupplyT s Identity a
- class Splitable s i | s -> i where
- freshId :: s -> (i, s)
- splitSupply :: s -> (s, s)

- runSupplyT :: Monad m => SupplyT s m a -> s -> m (a, s)
- evalSupplyT :: Monad m => SupplyT s m a -> s -> m a
- runSupply :: Supply s a -> s -> (a, s)
- evalSupply :: Supply s a -> s -> a
- runSplit :: (Monad m, Splitable s i) => SupplyT s m a -> Supply s (m a)
- getFresh :: (Monad m, Splitable s i) => SupplyT s m i
- getSplit :: (Monad m, Splitable s i) => SupplyT s m s

# Documentation

ID Supply transformer for switchable reflex stacks over splittable ID supplies Fresh variables are obtained using getFresh. Admits a MonadSwitch instance.

MonadState st m => MonadState st (SupplyT s m) Source | |

MonadReader st m => MonadReader st (SupplyT s m) Source | |

MonadWriter w m => MonadWriter w (SupplyT s m) Source | |

MonadSample t m => MonadSample t (SupplyT s m) Source | |

MonadHold t m => MonadHold t (SupplyT s m) Source | |

(MonadSwitch t m, Splitable s i) => MonadSwitch t (SupplyT s m) Source | |

MonadTrans (SupplyT s) Source | |

Monad m => Monad (SupplyT s m) Source | |

Functor m => Functor (SupplyT s m) Source | |

MonadFix m => MonadFix (SupplyT s m) Source | |

Monad m => Applicative (SupplyT s m) Source |

class Splitable s i | s -> i where Source

Abstraction for splittable identifier supplies, priovided is an instance for Enum a => [a]
but a more efficient supply would be for example, found in the concurrent-supply package.
at the cost of determinism.
Two parameters, a state `s`

and an identifier type `i`

splitSupply :: s -> (s, s) Source

runSupplyT :: Monad m => SupplyT s m a -> s -> m (a, s) Source

Run a SupplyT with a Spittable state

evalSupplyT :: Monad m => SupplyT s m a -> s -> m a Source

evalSupply :: Supply s a -> s -> a Source