Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 2009 Matthew Fluet. |
2 | * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh | |
3 | * Jagannathan, and Stephen Weeks. | |
4 | * | |
5 | * MLton is released under a BSD-style license. | |
6 | * See the file MLton-LICENSE for details. | |
7 | *) | |
8 | ||
9 | signature RANDOM = | |
10 | sig | |
11 | val alphaNumString: int -> string | |
12 | val charFrom: string -> char | |
13 | val bool: unit -> bool | |
14 | val list: 'a list -> 'a option | |
15 | (* natLessThan n returns a random number uniform in [0, n). *) | |
16 | val natLessThan: int -> int | |
17 | val nRandom: {list: 'a list, length: int, n: int} -> 'a list | |
18 | (* 0.0 <= real() <= 1.0 *) | |
19 | val real: unit -> real | |
20 | val seed: unit -> Word.t option | |
21 | val srand: Word.t -> unit | |
22 | val useed: unit -> Word.t option | |
23 | val word: unit -> Word.t | |
24 | (* word w returns a random number uniform in [0, w). *) | |
25 | val wordLessThan: Word.t -> Word.t | |
26 | end |