package datalog

  1. Overview
  2. Docs
type t

The universal type

type 'a key

Conversion between the universal type and 'a

val new_key : ?eq:('a -> 'a -> bool) -> ?hash:('a -> int) -> ?print:('a -> string) -> unit -> 'a key

Create a new key. Values packed with a given key can only be unpacked by the same key.

  • parameter print

    a printing function to print the content of a universal value. Default just returns "opaque".

  • parameter hash

    hash values (default: Hashtbl.hash)

  • parameter eq

    equality on values (default: structural equality)

val pack : key:'a key -> 'a -> t
val unpack : key:'a key -> t -> 'a option
val compatible : key:'a key -> t -> bool
val eq : t -> t -> bool
val hash : t -> int
val print : t -> string
val string : string key
val int : int key
val float : float key
val bool : bool key
val unit : unit key
val pair : 'a key -> 'b key -> ('a * 'b) key
val list : 'a key -> 'a list key
val array : 'a key -> 'a array key
OCaml

Innovation. Community. Security.