Programming

Elm

6 thoughts
last posted Oct. 2, 2016, 9:53 a.m.
0
get stream as: markdown or atom
0

The correct statement to extract a value from a Random.Generator is Random.step.

0

As of 0.17 elm-reactor cannot stub out ports that are required by the program it is running.

0

Elm doesn't have access to the system clock or even the initialisation time of the runtime.

0

The documentation for Random suggests using system time for creating seeds but this is not available in the standard runtime and even if it was a Github comment suggests it doesn't sufficient spread itself across the bit space to give a good seed.

The recommended way is to use native Javascript's Math.random and pass it via a port.

 Math.random() * Math.pow(2,32)
0

To partial apply a function use the invocation syntax:

(function initial_arg1 initial_arg2 ...)