Module Std_extra.Instances

Provides implementation for the common interface from Types for most of OCaml's standard librairy types, as well as functors to combine them (e.g. create a module FooBar : TYPE with type t = Foo.t Bar.t from a module Foo : TYPE and a module Bar ; UNARY_TYPE)

Types

type !+'a topbot =
  1. | Bottom
  2. | Elem of 'a
  3. | Top
module Order : Types.TYPE with type t = Types.order
module Int : Types.TYPE with type t = int
module Bool : Types.TYPE with type t = bool
module Char : Types.TYPE with type t = char
module String : Types.TYPE with type t = string

Unary builders

module Compose (A : Types.UNARY_TYPE) (B : Types.UNARY_TYPE) : Types.UNARY_TYPE with type 'a t = 'a A.t B.t
module UnaryOfPoly (P : Types.POLY_TYPE) : Types.UNARY_TYPE with type 'a t = 'a P.t

Unary types

module TopBot : Types.MONAD with type 'a t = 'a topbot
module Option : Types.MONAD with type 'a t = 'a option
module List : Types.MONAD with type 'a t = 'a list
module Seq : Types.MONAD with type 'a t = 'a Stdlib.Seq.t
module Ref : Types.MONAD with type 'a t = 'a Stdlib.ref
module Array : Types.MONAD with type 'a t = 'a array
module Hcons : Types.UNARY_TYPE with type 'a t = 'a Hashconsing.hash_consed

We can instanciate Hcons with fewer paramters, since compare, equal and hash are built-in and don't depend on T.compare, T.equal and T.hash

Binary builders

module InstanciateLeft (T : Types.BINARY_TYPE) (L : Types.TYPE) : Types.UNARY_TYPE with type 'a t = (L.t, 'a) T.t
module InstanciateRight (T : Types.BINARY_TYPE) (R : Types.TYPE) : Types.UNARY_TYPE with type 'a t = ('a, R.t) T.t
module ComposeLeft (T : Types.BINARY_TYPE) (L : Types.UNARY_TYPE) : Types.BINARY_TYPE with type ('a, 'b) t = ('a L.t, 'b) T.t
module ComposeRight (T : Types.BINARY_TYPE) (R : Types.UNARY_TYPE) : Types.BINARY_TYPE with type ('a, 'b) t = ('a, 'b R.t) T.t
module ComposeBinary (T : Types.UNARY_TYPE) (B : Types.BINARY_TYPE) : Types.BINARY_TYPE with type ('a, 'b) t = ('a, 'b) B.t T.t

Binary types

module Pair : Types.BINARY_TYPE with type ('a, 'b) t = 'a * 'b
module Either : Types.BINARY_TYPE with type ('a, 'b) t = ('a, 'b) Stdlib.Either.t
module Result : Types.BINARY_TYPE with type ('a, 'b) t = ('a, 'b) Stdlib.result

Liftings

module Lift (T : Types.TYPE) (I : sig ... end) : Types.TYPE with type t = I.t
module LiftUnary (T : Types.UNARY_TYPE) (I : sig ... end) : Types.UNARY_TYPE with type 'a t = 'a I.t
module LiftBinary (T : Types.BINARY_TYPE) (I : sig ... end) : Types.BINARY_TYPE with type ('a, 'b) t = ('a, 'b) I.t