Module QCheck2.Observable
An observable is a random function argument.
val make : ?eq:('a -> 'a -> bool) -> ?hash:('a -> int) -> 'a Print.t -> 'a tmake ?eq ?hash printcreates an observable of'a.If
eqisNone, uses the standard polymorphic(=)function.If
hashisNone, uses a default hashing function.
val equal : 'a t -> 'a -> 'a -> boolequal oreturns the equality function ofo.
val hash : 'a t -> 'a -> inthash oreturns the hashing function ofo.
val unit : unit tunitis an observable ofunit.
val bool : bool tboolis an observable ofbool.
val int : int tintis an observable ofint.
val float : float tfloatis an observable offloat.
val string : string tstringis an observable ofstring.
val char : char tcharis an observable ofchar.
val contramap : ('b -> 'a) -> 'a t -> 'b tcontramap f omaps the functionfon observableo.Note the reverse order of types in
fwhich may be conter-intuitive: indeed a function that consumes values of type'bcan be obtained by transforming a value of type'bto'ausingf, and then by consuming this value of type'ausingo.
val option : 'a t -> 'a option toption owraps the observableoof'ainto an observable of'a option.