Module STM

Module with combinators and definitions to specify an STM test

type 'a ty = ..

Extensible type to represent result values

type ty +=
| Unit : unit ty
| Bool : bool ty
| Char : char ty
| Int : int ty
| Int32 : int32 ty
| Int64 : int64 ty
| Float : float ty
| String : string ty
| Bytes : bytes ty
| Exn : exn ty
| Option : 'a ty -> 'a option ty
| Result : 'a ty * 'b ty -> ( 'a, 'b ) Stdlib.result ty
| List : 'a ty -> 'a list ty
| Array : 'a ty -> 'a array ty
| Seq : 'a ty -> 'a Stdlib.Seq.t ty

A range of constructors to represent built-in types

type 'a ty_show = 'a ty * ( 'a -> string )

Combinator type to represent an OCaml type along with an associated to_string function

val unit : unit ty_show

Combinator to represent the unit type

val bool : bool ty_show

Combinator to represent the bool type

val char : char ty_show

Combinator to represent the char type

val int : int ty_show

Combinator to represent the int type

val int32 : int32 ty_show

Combinator to represent the int32 type

val int64 : int64 ty_show

Combinator to represent the int64 type

val float : float ty_show

Combinator to represent the float type

val string : string ty_show

Combinator to represent the string type

val bytes : bytes ty_show

Combinator to represent the bytes type

val option : 'a ty_show -> 'a option ty_show

option t builds a t option type representation

val exn : exn ty_show

Combinator to represent the exception type

val result : 'a ty_show -> 'b ty_show -> ( 'a, 'b ) Stdlib.Result.t ty_show

result a b builds an (a,b) result type representation

val list : 'a ty_show -> 'a list ty_show

list t builds a t list type representation

val array : 'a ty_show -> 'a array ty_show

array t builds a t array type representation

val seq : 'a ty_show -> 'a Stdlib.Seq.t ty_show

seq t builds a t Seq.t type representation

type res =
| Res : 'a ty_show * 'a -> res
val show_res : res -> string
module type Spec = sig ... end

The specification of a state machine.

module Internal : sig ... end
val protect : ( 'a -> 'b ) -> 'a -> ( 'b, exn ) Stdlib.result

protect f turns an exception-throwing function into a result-returning function.