random-extra icon indicating copy to clipboard operation
random-extra copied to clipboard

Extra functions for the core Random library.

Results 5 random-extra issues
Sort by recently updated
recently updated
newest added

I am using this helper eg. for rolling percentual probabilities in my Dungeons-and-Dragons-like game. It's a generalization of `Random.Extra.bool`. One unanswered question is: Should `Random.Extra.bool` be moved here? Should perhaps...

```elm {-| Turn a list of generators into a generator of lists. -} combine : List (Generator a) -> Generator (List a) combine generators = case generators of [] ->...

I think having Generator adapted fold functions might help make cleaner code in some cases. (The idea is [not new](https://package.elm-lang.org/packages/NoRedInk/elm-random-extra/latest/Random-Extra#fold).) Signatures like: ```elm foldl : (a -> b -> Generator...

Works similarly to https://package.elm-lang.org/packages/elm/parser/latest/Parser#loop and allows indefinitely looping generators without blowing the stack. This also makes it easier to implement combinators like `chain` and `repeat` as described in #20 without...

Wrote two new combinators that let you create Markov chains with lists chain : a -> List (a -> Generator a) -> Generator (List a) repeat : Int -> a...