more explicit type declaration

This commit is contained in:
Simon Cruanes 2014-06-09 18:10:53 +02:00
parent b5fb3f0ff0
commit 9ca1f76bd7
2 changed files with 6 additions and 1 deletions

View file

@ -81,6 +81,11 @@ let fold_right f l acc =
List.fold_left (+) 0 (1 -- 1_000_000) List.fold_left (+) 0 (1 -- 1_000_000)
*) *)
(*$Q
(Q.list Q.small_int) (fun l -> \
l = fold_right (fun x y->x::y) l [])
*)
let rec compare f l1 l2 = match l1, l2 with let rec compare f l1 l2 = match l1, l2 with
| [], [] -> 0 | [], [] -> 0
| _, [] -> 1 | _, [] -> 1

View file

@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This module defines state machines that should help design applications This module defines state machines that should help design applications
with a more explicit control of state (e.g. for networking applications). *) with a more explicit control of state (e.g. for networking applications). *)
type ('a, 's, 'b) t = 's -> 'a -> ('b * 's) option type ('input, 'state, 'output) t = 'state -> 'input -> ('output * 'state) option
(** transition function that fully describes an automaton. It returns (** transition function that fully describes an automaton. It returns
[None] to indicate that it stops. *) [None] to indicate that it stops. *)