An extensible "universal" variant type.
Every type id (Type_equal.Id.t
) corresponds to one branch of the variant type.
does_match t id
returns true
iff t
was created by create id v
.
match_ t id
returns Some v
if t
was created by create id v
, and returns None
otherwise.
match_exn t id
returns v
if t
was created by create id v
, and raises
otherwise.