on master help sign in
Convert Random docs.
commit2671ac43931e8329f5d8ed5979a396758262f698 authorJustin Leitgeb <justin@stackbuilders.com> dateTue 10 Sep 2013, 12:04 (13 years ago) parentc69ff2a
1 file changed+13−5
libraries/Random.elm+13−5
libraries/Random.elm+13−5
@@ -1,16 +1,24 @@
11
22module Random where
33
4+{-| Since the core of Elm is pure, randomness must be handled via signals.
5+
6+# Random Numbers
7+@docs range, float
8+-}
9+
410import Signal (Signal)
511import Native.Random
612
7−-- Given a range from low to high and a signal of values, this produces
8−-- a new signal that changes whenever the input signal changes. The new
9−-- values are random number between 'low' and 'high' inclusive.
13+{-| Given a range from low to high and a signal of values, this produces
14+a new signal that changes whenever the input signal changes. The new
15+values are random number between 'low' and 'high' inclusive.
16+-}
1017range : Int -> Int -> Signal a -> Signal Int
1118range = Native.Random.range
1219
13−-- Produces a new signal that changes whenever the input signal changes.
14−-- The new values are random numbers in [0..1).
20+{-| Produces a new signal that changes whenever the input signal changes.
21+The new values are random numbers in [0..1).
22+-}
1523float : Signal a -> Signal Float
1624float = Native.Random.float