package cconv
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type 'a output = {
unit : 'a;
bool : bool -> 'a;
float : float -> 'a;
char : char -> 'a;
int : int -> 'a;
nativeint : nativeint -> 'a;
int32 : int32 -> 'a;
int64 : int64 -> 'a;
string : string -> 'a;
list : 'a list -> 'a;
option : 'a option -> 'a;
record : (string * 'a) list -> 'a;
tuple : 'a list -> 'a;
sum : string -> 'a list -> 'a;
}
val string_target : string output
Print values. Caution, inefficient! Should be used for debugging only
A way to encode values of type 'src
into any serialization format
val unit : unit encoder
val bool : bool encoder
val float : float encoder
val char : char encoder
val int : int encoder
val nativeint : nativeint encoder
val int32 : int32 encoder
val int64 : int64 encoder
val string : string encoder
Composite Types
val record : 'r record_encoder -> 'r encoder
Encode a record, using the polymorphic record record_encoder
to generate an association list
val record_fix : ('r encoder -> 'r record_encoder) -> 'r encoder
Fixpoint on record definition
Example:
type point = {x:int; y:int; c:string};;
let enc_point = record
{record_emit=fun into {x;y;c} ->
[ "x", into.int x
; "y", into.int y
; "c", into.string c
]
} ;;
val tuple : 'a tuple_encoder -> 'a encoder
General encoding of tuples (returns a list of values)
val sum : 'a sum_encoder -> 'a encoder
val sum0 : ('a -> string) -> 'a encoder
Constant sums, only put the name
val sum_fix : ('a encoder -> 'a sum_encoder) -> 'a encoder
Fixpoint on sum types
Example:
type tree = Empty | Leaf of int | Node of tree * tree;;
let encode_tree = sum_fix
(fun self -> {sum_emit=fun into x -> match x with
| Empty -> "empty", []
| Leaf i -> "leaf", [int.emit into i]
| Node (l,r) -> "node", [self.emit into l; self.emit into r]
});;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page