package regular

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

Regular types models a general concept of value, i.e., something that can be used in way similar to regular int, string, char and other built in types. So that it can be compared, used in maps, sets, hashtables, printer, etc.

Note: this signature is pretty similar to core's Identifiable, but doesn't require of_string function, that is usually much harder to implement in comparison with to_string function. Also, instead of to_string it requires pp function that can be implemented much more efficiently and elegantly. From the pp function the whole plethora of printing functions are derived: str, pps, ppo.

@see <https://ocaml.janestreet.com/ocaml-core/latest/doc/core_kernel/Std/Comparable.mod/S_binable.modt/> Comparable.S_binable

@see <https://ocaml.janestreet.com/ocaml-core/latest/doc/core_kernel/Hashable/S_binable.modt/> Hashable.S_binable

module type S = sig ... end

Regular interface.

module type Minimal = sig ... end
module Make (M : Minimal) : S with type t := M.t

In order to implement Regular interface you need to provide a minimum implementation M

OCaml

Innovation. Community. Security.