serialize.mli 598 Bytes
Newer Older
1 2 3 4 5
module Put : sig
  type t
  type 'a f = t -> 'a -> unit
  val run: 'a f -> 'a -> string

6
  val bits: int -> int f
7 8 9 10 11 12
  val int: int f
  val string: string f
  val bool: bool f

  val list: 'a f -> 'a list f
  val pair: 'a f -> 'b f -> ('a * 'b) f
13 14 15 16

  type 'b property
  val mk_property: (t -> 'b) -> 'b property
  val get_property: 'b property -> t -> 'b
17 18 19 20 21 22 23
end

module Get : sig
  type t
  type 'a f = t -> 'a
  val run : 'a f -> string -> 'a

24
  val bits: int -> int f
25 26 27 28 29 30 31
  val int : int f
  val string: string f
  val bool: bool f

  val list: 'a f -> 'a list f
  val pair: 'a f -> 'b f -> ('a * 'b) f
end