Copyright | (C) 2008-2011 Edward Kmett (C) 2008 Iavor S. Diatchki |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Stability | provisional |

Portability | portable |

Safe Haskell | Trustworthy |

Language | Haskell98 |

This library can be used to generate values (for example, new names) without the need to thread state. This means that functions that need to generate new values only need a supply object as an argument, and they do not need to return a new supply object as a result. This decreases the number of data-dependencies in a program, which makes it easier to exploit parallelism.

The technique for generating new values is based on the paper ''On Generating Unique Names'' by Lennart Augustsson, Mikael Rittri, and Dan Synek.

# Documentation

## Instances

Functor Supply # | |

Applicative Supply # | |

Foldable Supply # | |

Defined in Data.Stream.Supply fold :: Monoid m => Supply m -> m # foldMap :: Monoid m => (a -> m) -> Supply a -> m # foldr :: (a -> b -> b) -> b -> Supply a -> b # foldr' :: (a -> b -> b) -> b -> Supply a -> b # foldl :: (b -> a -> b) -> b -> Supply a -> b # foldl' :: (b -> a -> b) -> b -> Supply a -> b # foldr1 :: (a -> a -> a) -> Supply a -> a # foldl1 :: (a -> a -> a) -> Supply a -> a # elem :: Eq a => a -> Supply a -> Bool # maximum :: Ord a => Supply a -> a # minimum :: Ord a => Supply a -> a # | |

Traversable Supply # | |

Comonad Supply # | |

Traversable1 Supply # | |

Foldable1 Supply # | |

Apply Supply # | |

Extend Supply # | |

Eq a => Eq (Supply a) # | |

Data a => Data (Supply a) # | |

Defined in Data.Stream.Supply gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Supply a -> c (Supply a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Supply a) # toConstr :: Supply a -> Constr # dataTypeOf :: Supply a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Supply a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Supply a)) # gmapT :: (forall b. Data b => b -> b) -> Supply a -> Supply a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Supply a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Supply a -> r # gmapQ :: (forall d. Data d => d -> u) -> Supply a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Supply a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Supply a -> m (Supply a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Supply a -> m (Supply a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Supply a -> m (Supply a) # | |

Ord a => Ord (Supply a) # | |

Defined in Data.Stream.Supply | |

Read a => Read (Supply a) # | |

Show a => Show (Supply a) # | |

newEnumSupply :: Enum a => IO (Supply a) #

newNumSupply :: Num a => IO (Supply a) #

newDupableSupply :: (a -> a) -> a -> IO (Supply a) #

newDupableEnumSupply :: Enum a => IO (Supply a) #

newDupableNumSupply :: Num a => IO (Supply a) #

leftSupply :: Supply a -> Supply a #

rightSupply :: Supply a -> Supply a #