I love coding in Elm, but I dread having to deal with the Random or elm-community Random packages.
I’m trying to get it to work, and I just don’t understand why it doesn’t. I’m trying at the very basic super-simple level.
I’ve opened up a repl and I’m going through the example in the generate function.
$ elm repl
---- Elm 0.19.1 ----------------------------------------------------------------
Say :help for help and :exit to exit! More at <https://elm-lang.org/0.19.1/repl>
--------------------------------------------------------------------------------
> import Random
>
> point =
| Random.pair (Random.int -100 100) (Random.int -100 100)
|
Generator <function> : Random.Generator ( Int, Int )
> type Msg = NewPoint (Int, Int)
>
> newPoint =
| Random.generate NewPoint point
|
<internals> : Cmd Msg
> newPoint
<internals> : Cmd Msg
The document says:
Each time you run the
newPoint
command, it will produce a new 2D point like(57, 18)
or(-82, 6)
.
So why do I see <internals> : Cmd Msg
instead of a new 2D point? What am I doing wrong? Am I missing something? Do I need to do something further?
Thanks.
– Mitchell