diff --git a/src/System/Random.hs b/src/System/Random.hs index 800bb7ea..47fcb135 100644 --- a/src/System/Random.hs +++ b/src/System/Random.hs @@ -340,11 +340,11 @@ class Random a where -- closed interval /[lo,hi]/, together with a new generator. It is unspecified -- what happens if /lo>hi/, but usually the values will simply get swapped. -- - -- >>> let gen = mkStdGen 2021 + -- >>> let gen = mkStdGen 2024 -- >>> fst $ randomR ('a', 'z') gen - -- 't' - -- >>> fst $ randomR ('z', 'a') gen - -- 't' + -- 'k' + -- >>> fst $ randomR ('a', 'z') gen + -- 'k' -- -- For continuous types there is no requirement that the values /lo/ and /hi/ are ever -- produced, but they may be, depending on the implementation and the interval. @@ -353,8 +353,8 @@ class Random a where -- defined on per type basis. For example product types will treat their values -- independently: -- - -- >>> fst $ randomR (('a', 5.0), ('z', 10.0)) $ mkStdGen 2021 - -- ('t',6.240232662366564) + -- >>> fst $ randomR (('a', 5.0), ('z', 10.0)) $ mkStdGen 2024 + -- ('k',7.4063422174704625) -- -- In case when a lawful range is desired `uniformR` should be used -- instead. diff --git a/src/System/Random/Stateful.hs b/src/System/Random/Stateful.hs index 8d0b3bd9..b3eb3ba2 100644 --- a/src/System/Random/Stateful.hs +++ b/src/System/Random/Stateful.hs @@ -299,16 +299,16 @@ withMutableGen_ fg action = thawGen fg >>= action -- ====__Examples__ -- -- >>> import System.Random.Stateful --- >>> let pureGen = mkStdGen 137 +-- >>> let pureGen = mkStdGen 138 -- >>> g <- newIOGenM pureGen -- >>> randomM g :: IO Double --- 0.5728354935654512 +-- 0.4218547487203844 -- -- You can use type applications to disambiguate the type of the generated numbers: -- -- >>> :seti -XTypeApplications -- >>> randomM @Double g --- 0.6268211351114488 +-- 0.4989730462233689 -- -- @since 1.2.0 randomM :: forall a g m. (Random a, RandomGen g, FrozenGen g m) => MutableGen g m -> m a