elm-community / elm-community/random-extra
sequence and combine seem to be two different implementations of the same function
Open
- Dominant language
- Elm
- Stars
- 28
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
```elm
{-| Turn a list of generators into a generator of lists.
-}
combine : List (Generator a) -> Generator (List a)
combine generators =
case generators of
[] ->
constant []
g :: gs ->
Random.map2 (::) g (combine gs)
```
```elm
{-| Start with a list of generators, and turn them into a generator that returns a list.
-}
sequence : List (Generator a) -> Generator (List a)
sequence =
List.foldr (Random.map2 (::)) (Random.constant [])
```
The slightly different documentation can also be confusing.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.