Module Std_extra.Types

Common types and modules types used throughout the rest of the code, provides a common interface for useful functions on all types (pretty-printer, equality, comparison) through the TYPE, UNARY_TYPE and BINARY_TYPE module types.

In the rest of the code, whenever reading module Foo : TYPE, it is best to interpret it as a simple type declaration.

type 'a pp = Stdlib.Format.formatter -> 'a -> unit

Type alias for pretty printer

type order =
  1. | Lt
  2. | Eq
  3. | Gt

Global ordering types

type (_, _) poly_equal =
  1. | Diff : ('a, 'b) poly_equal
  2. | Equal : ('a, 'a) poly_equal

Polymorphic equality, to use with GADTs

type (_, _) poly_order =
  1. | P_Lt : ('a, 'b) poly_order
  2. | P_Eq : ('a, 'a) poly_order
  3. | P_Gt : ('a, 'b) poly_order

Polymorphic order, to use with GADTs

module type PRINTABLE = sig ... end

Type with a pretty-printer

module type TYPE = sig ... end

Standard useful functions for types

module type TYPE_TO_INT = sig ... end

Types that can be injected into int

module type UNARY_TYPE = sig ... end

Standard useful functions for unary types

module type BINARY_TYPE = sig ... end

Standard useful functions for binary types

module type PREMONAD = sig ... end

UNARY_TYPE with some monadic operations

module type MONAD = sig ... end

UNARY_TYPE with all monadic operations

module type POLY_TYPE = sig ... end

Polymorphic type (GADT)

module type SET = sig ... end

Extends Stdlib.Set.S with some useful functions

module type MAP = sig ... end

Extends Stdlib.Map.S with some useful functions