BTW, this was a perfect case where type based search is useful. You know what type you want, because you know the Haskell function that you want an analogue for.
So, go to https://klaftertief.github.io/elm-search/, enter List (Generator a) -> Generator a into the search box, and you will be pointed directly to the function you need. 2016-08-07 14:03 GMT+02:00 John Watson <[email protected]>: > Ah - I see. Many thanks, Janis. > > On Sunday, 7 August 2016 12:41:48 UTC+1, Janis Voigtländer wrote: >> >> Haskell’s `oneOf´ is Elm’s http://package.elm-lang.org/pa >> ckages/elm-community/random-extra/1.0.0/Random-Extra#choices. >> >> >> 2016-08-07 13:07 GMT+02:00 John Watson <[email protected]>: >> >>> Suppose my ADT has four or five constructors and I want to randomly >>> select one of them with equal likelihood in my Producer. How do I do this? >>> (Haskell's QuickCheck has *oneOf* for example) >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Elm Discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "Elm Discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
