on master help sign in
Convert Random docs.
2671ac4Justin Leitgeb
libraries/Random.elm+13−5
@@ -1,16 +1,24 @@
1
1
2module Random where
2module Random where
3
3
4+{-| Since the core of Elm is pure, randomness must be handled via signals.
5+
6+# Random Numbers
7+@docs range, float
8+-}
9+
4import Signal (Signal)
10import Signal (Signal)
5import Native.Random
11import Native.Random
6
12
7−-- Given a range from low to high and a signal of values, this produces
13+{-| 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
14+a new signal that changes whenever the input signal changes. The new
9−-- values are random number between 'low' and 'high' inclusive.
15+values are random number between 'low' and 'high' inclusive.
16+-}
10range : Int -> Int -> Signal a -> Signal Int
17range : Int -> Int -> Signal a -> Signal Int
11range = Native.Random.range
18range = Native.Random.range
12
19
13−-- Produces a new signal that changes whenever the input signal changes.
20+{-| Produces a new signal that changes whenever the input signal changes.
14−-- The new values are random numbers in [0..1).
21+The new values are random numbers in [0..1).
22+-}
15float : Signal a -> Signal Float
23float : Signal a -> Signal Float
16float = Native.Random.float
24float = Native.Random.float