Support for computations which consume values from a (possibly infinite)
supply. See http:www.haskell.org*haskellwiki*New_monads/MonadSupply for
details.

- class Monad m => MonadSupply s m | m -> s
- data SupplyT s m a
- data Supply s a
- evalSupplyT :: Monad m => SupplyT s m a -> [s] -> m a
- evalSupply :: Supply s a -> [s] -> a
- runSupplyT :: Monad m => SupplyT s m a -> [s] -> m (a, [s])
- runSupply :: Supply s a -> [s] -> (a, [s])
- supplies :: MonadSupply s m => Int -> m [s]

# Documentation

class Monad m => MonadSupply s m | m -> sSource

MonadSupply s (Supply s) | |

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

Supply monad transformer.

Supply monad.

MonadSupply s (Supply s) | |

Monad (Supply s) | |

Functor (Supply s) | |

Monoid a => Monoid (Supply s a) | Monoid instance for the supply monad. Actually any monad/monoid pair gives rise to this monoid instance, but we can't write it like that because it would conflict with existing instances provided by Data.Monoid. |

evalSupplyT :: Monad m => SupplyT s m a -> [s] -> m aSource

evalSupply :: Supply s a -> [s] -> aSource

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

supplies :: MonadSupply s m => Int -> m [s]Source

Get n supplies.