on master help sign in
Merge pull request #252 from jsl/convert_random_docs

Convert Random docs

commitdb72bdb856f0f3b3fefe234b9ac5a7d14673925c authorEvan Czaplicki <info@elm-lang.org> dateTue 10 Sep 2013, 17:59 (13 years ago) parent9ed64202671ac4
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