Gizra/elm-compat-019/1.0.0

NOTE: the latest version is 1.1.0

Random017

Like in other modules, the paramenters of andThen were flipped in Elm 0.18.

andThen : Generator a -> (a -> Generator b) -> Generator b

Chain random operations, threading through the seed. In the following example, we will generate a random letter by putting together uppercase and lowercase letters.

letter : Generator Char
letter =
    bool
        `andThen`
            (\b ->
                if b then
                    uppercaseLetter


                else
                    lowercaseLetter
            )




-- bool : Generator Bool
-- uppercaseLetter : Generator Char
-- lowercaseLetter : Generator Char