Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
fresh :: (Member Fresh sig, Carrier sig m) => m Int Source #
Produce a fresh (i.e. unique) Int
.
run (runFresh (replicateM n fresh)) == nub (run (runFresh (replicateM n fresh)))
resetFresh :: (Member Fresh sig, Carrier sig m) => m a -> m a Source #
Reset the fresh counter after running a computation.
run (runFresh (resetFresh (replicateM m fresh) *> replicateM n fresh)) == run (runFresh (replicateM n fresh))