package prr

  1. Overview
  2. Docs

Abstract type conversion iterface.

This interface can be used to provide conversion functions for Jv.t and abstract OCaml types. An identity implementation of the functions of this interface is provided by Id.

This is typically used to provide an escape hatch a bit more formal and controlled than Jv.repr and Obj.magic.

module Mymodule : sig
  type t
  (**/**)
  include Jv.CONV with type t := t
  (**/**)
end = struct
  type t = Jv.t
  include (Jv.Id : Jv.CONV with type t := t)
end
type t

The abtract datatype.

val to_jv : t -> jv

to_jv reveals the JavaScript implementation.

val of_jv : jv -> t

of_jv hides the JavaScript implementation. Implementations usually do not guarantee type safety.

OCaml

Innovation. Community. Security.