Posix.IO.Random

This module is a workaround for the Random module not supporting creating Tasks.

Uses NodeJs crypto.randomBytes() to generate a 32bit seed.

generate : Generator a -> IO x a

Generate a random value using a Generator.

roll : IO x Int
roll =
    generate (Random.int 1 6)
seed : IO x Seed

Generate a seed than can be used with Random.step from elm/random.

roll : IO x Int
roll =
    seed
        |> IO.map
            (Random.step (Random.int 1 6)
                |> Tuple.first
            )