package orsetto

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

The signature of modules for extracting opaque values within a given type equivalence horizon. Because all the functions in this module use the equiv method on the horizon used to construct it, expressions that directly match on the `Witness (_, nym)` type constructor are likely to be substantially more efficient.

val req : 'a nym -> opaque -> 'a

Use opt n v to extract v' if n is equivalent to the encapsulated runtime type, otherwise raises an exception (conventionally Type_error).

val opt : 'a nym -> opaque -> 'a option

Use opt n v to extract Some v' if n is equivalent to the encapsulated runtime type, otherwise returns None.

val eq : 'a nym -> 'b nym -> ('a, 'b) eq

Use eq a b to produce the equivalence constraint for the types associated with nyms a and b under the horizon. Returns Eq if a and b are nyms for equivalent types, otherwise raises Type_error.

val ck : 'a nym -> opaque -> bool

Use ck n v to test whether n is equivalent to the encapsulated runtime type.