MonadRandom 0.3.0.2 → 0.4
raw patch · 3 files changed
+26/−17 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Control.Monad.Random: evalRand :: RandomGen g => Rand g a -> g -> a
+ Control.Monad.Random: evalRand :: Rand g a -> g -> a
- Control.Monad.Random: evalRandT :: (Monad m, RandomGen g) => RandT g m a -> g -> m a
+ Control.Monad.Random: evalRandT :: Monad m => RandT g m a -> g -> m a
- Control.Monad.Random: liftRand :: RandomGen g => (g -> (a, g)) -> Rand g a
+ Control.Monad.Random: liftRand :: (g -> (a, g)) -> Rand g a
- Control.Monad.Random: liftRandT :: (Monad m, RandomGen g) => (g -> m (a, g)) -> RandT g m a
+ Control.Monad.Random: liftRandT :: Monad m => (g -> m (a, g)) -> RandT g m a
- Control.Monad.Random: runRand :: RandomGen g => Rand g a -> g -> (a, g)
+ Control.Monad.Random: runRand :: Rand g a -> g -> (a, g)
- Control.Monad.Random: runRandT :: (Monad m, RandomGen g) => RandT g m a -> g -> m (a, g)
+ Control.Monad.Random: runRandT :: Monad m => RandT g m a -> g -> m (a, g)
Files
- CHANGES.markdown +19/−9
- Control/Monad/Random.hs +6/−7
- MonadRandom.cabal +1/−1
CHANGES.markdown view
@@ -1,7 +1,17 @@+0.4 (12 May 2015)+-----------------++ - Remove unnecessary `RandomGen g` constraints from `liftRandT`,+ `liftRand`, `evalRandT`, `evalRand`, `runRandT`, `runRand`.++ A major version bump is required by the PVP since the types of all+ the above methods have changed, but this release is again very+ unlikely to break any client code.+ 0.3.0.2 (30 March 2015) ----------------------- - - Add transformers-compat to allow building with newer mtl+ - Add `transformers-compat` to allow building with newer `mtl` 0.3.0.1 (24 November 2014) --------------------------@@ -22,7 +32,7 @@ 0.2.0.1 (24 August 2014) ------------------------ - - Allow building with both transformers-0.3 and 0.4.+ - Allow building with both `transformers-0.3` and `0.4`. 0.2 (20 August 2014) --------------------@@ -37,29 +47,29 @@ 0.1.13 (9 February 2014) ------------------------ - - add simple 'uniform' function for creating a uniform distribution+ - add simple `uniform` function for creating a uniform distribution over a list of values 0.1.12 (30 September 2013) -------------------------- - - add liftRandT and liftRand functions, for lifting explicit- generator-passing functions into RandT and Rand, respectively.+ - add `liftRandT` and `liftRand` functions, for lifting explicit+ generator-passing functions into `RandT` and `Rand`, respectively. 0.1.11 (1 August 2013) ---------------------- - - add MonadRandom and MonadSplit instances for IdentityT- - derive MonadReader and MonadWriter instances instead of declaring+ - add `MonadRandom` and `MonadSplit` instances for `IdentityT`+ - derive `MonadReader` and `MonadWriter` instances instead of declaring them explicitly (thanks again to James Koppel) 0.1.10 (16 July 2013) --------------------- - - add MonadRandom and MonadSplit instances for ContT+ - add `MonadRandom` and `MonadSplit` instances for `ContT` (thanks to James Koppel for the patch) 0.1.9 (26 April 2013) --------------------- - - add MonadRandom and MonadSplit instances for MaybeT+ - add `MonadRandom` and `MonadSplit` instances for `MaybeT`
Control/Monad/Random.hs view
@@ -79,14 +79,13 @@ (<*>) = ap -- | Lift arbitrary action to RandT-liftRandT :: (Monad m, RandomGen g) =>+liftRandT :: (Monad m) => (g -> m (a, g)) -- ^ action returning value and new generator state -> RandT g m a liftRandT = RandT . StateT -- | Lift arbitrary action to Rand-liftRand :: (RandomGen g) =>- (g -> (a, g)) -- ^ action returning value and new generator state+liftRand :: (g -> (a, g)) -- ^ action returning value and new generator state -> Rand g a liftRand = RandT . state @@ -103,12 +102,12 @@ -- | Evaluate a RandT computation using the generator @g@. Note that the -- generator @g@ is not returned, so there's no way to recover the -- updated version of @g@.-evalRandT :: (Monad m, RandomGen g) => RandT g m a -> g -> m a+evalRandT :: (Monad m) => RandT g m a -> g -> m a evalRandT (RandT x) g = evalStateT x g -- | Run a RandT computation using the generator @g@, returning the result and -- the updated generator.-runRandT :: (Monad m, RandomGen g) => RandT g m a -> g -> m (a, g)+runRandT :: (Monad m) => RandT g m a -> g -> m (a, g) runRandT (RandT x) g = runStateT x g -- | A basic random monad.@@ -117,12 +116,12 @@ -- | Evaluate a random computation using the generator @g@. Note that the -- generator @g@ is not returned, so there's no way to recover the -- updated version of @g@.-evalRand :: (RandomGen g) => Rand g a -> g -> a+evalRand :: Rand g a -> g -> a evalRand x g = runIdentity (evalRandT x g) -- | Run a random computation using the generator @g@, returning the result -- and the updated generator.-runRand :: (RandomGen g) => Rand g a -> g -> (a, g)+runRand :: Rand g a -> g -> (a, g) runRand x g = runIdentity (runRandT x g) -- | Evaluate a random computation in the IO monad, splitting the global standard generator to get a new one for the computation.
MonadRandom.cabal view
@@ -1,5 +1,5 @@ name: MonadRandom-version: 0.3.0.2+version: 0.4 synopsis: Random-number generation monad. description: Support for computations which consume random values. license: OtherLicense