File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -20,33 +20,16 @@ type GenState = { newSeed :: Seed, size :: Size }
2020
2121The state of the random generator monad
2222
23- #### ` GenOut `
24-
25- ``` purescript
26- type GenOut a = { state :: GenState, value :: a }
27- ```
28-
29- The output of the random generator monad
30-
3123#### ` Gen `
3224
3325``` purescript
34- data Gen a
26+ type Gen a = State GenState a
3527```
3628
3729The random generator monad
3830
3931` Gen ` is a state monad which encodes a linear congruential generator.
4032
41- ##### Instances
42- ``` purescript
43- instance functorGen :: Functor Gen
44- instance applyGen :: Apply Gen
45- instance applicativeGen :: Applicative Gen
46- instance bindGen :: Bind Gen
47- instance monadGen :: Monad Gen
48- ```
49-
5033#### ` repeatable `
5134
5235``` purescript
@@ -139,6 +122,14 @@ arrayOf1 :: forall a. Gen a -> Gen (Tuple a (Array a))
139122
140123Create a random generator which generates a non-empty array of random values.
141124
125+ #### ` listOf `
126+
127+ ``` purescript
128+ listOf :: forall a. Int -> Gen a -> Gen (List a)
129+ ```
130+
131+ Create a random generator which generates a list of random values of the specified size.
132+
142133#### ` vectorOf `
143134
144135``` purescript
@@ -159,7 +150,7 @@ uniform probability.
159150#### ` runGen `
160151
161152``` purescript
162- runGen :: forall a. Gen a -> GenState -> GenOut a
153+ runGen :: forall a. Gen a -> GenState -> Tuple a GenState
163154```
164155
165156Run a random generator
You can’t perform that action at this time.
0 commit comments