Type.Coded
Coded types.
type 'a repr = 'a t
See Rel.Type.t
.
The type for partially mapping values of type 'a
to values of type 'b
.
val v :
?pp:( Stdlib.Format.formatter -> 'a -> unit ) ->
name:string ->
( 'a, 'b ) map ->
( 'b, 'a ) map ->
'b repr ->
( 'a, 'b ) t
v ~pp ~name enc dec
is a coding using enc
to encode values and dec
to decode them. name
is a name for the coded type. pp
is an optional formatter.
val name : ( 'a, 'b ) t -> string
name c
is c
's name.
val pp : ( 'a, 'b ) t -> ( Stdlib.Format.formatter -> 'a -> unit ) option
pp c
is c
's pretty printer (if any).