package core

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Core.TupleSource

Functors and signatures for dealing with modules for tuples.

Sourcemodule T2 : sig ... end

Signature for a 2-tuple module

Sourcemodule T3 : sig ... end

Signature for a 3-tuple module

These functors allow users to write:

  module Foo = struct
    include Tuple.Make       (String) (Int)
    include Tuple.Comparator (String) (Int)
    include Tuple.Comparable (String) (Int)
    include Tuple.Hashable   (String) (Int)
    include Tuple.Binable    (String) (Int)
  end
Sourcemodule Make (T1 : sig ... end) (T2 : sig ... end) : sig ... end
Sourcemodule type Comparable_sexpable = sig ... end
Sourcemodule type Hashable_sexpable = sig ... end

The difference between Hashable and Hashable_t functors is that the former's result type doesn't contain type t and the latter does. Therefore, Hashable can't be used to combine two pairs into 4-tuple. but Hashable_t can. On the other hand result of Hashable_t cannot be combined with Comparable.

Sourcemodule Hasher (H1 : sig ... end) (H2 : sig ... end) : Hashable_sexpable with type t := Make(H1)(H2).t
OCaml

Innovation. Community. Security.