The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

johnicello (8) [Avatar] Offline
#1
With the Random.generate example in chapter 3, is it possible to execute the resulting Cmd in elm-repl?

The concept of Commands is new to me and you explained them well in chapter 3. However, it would be nice be able to actually generate the random numbers in the shell, using similar code (without resorting to seeds), using a union type like Msg.


> type Msg = Nothing | SelectByIndex Int
> import Random
>
> cmd = Random.generate SelectByIndex (Random.int 0 2)

Can I somehow execute the 'cmd' manually in the shell?
rtfeldman (60) [Avatar] Offline
#2
Hi John,

Unfortunately elm-repl is only for expressions, not for running commands. Sorry! smilie