Skip to content

Instantly share code, notes, and snippets.

@alavrik
Created December 16, 2012 06:58
Show Gist options
  • Save alavrik/4303915 to your computer and use it in GitHub Desktop.
Save alavrik/4303915 to your computer and use it in GitHub Desktop.
Piqi definitions of OCaml's `type example = ConsOne of int array | ConsTwo of float array` `t_piqi.ml` generated from `t.piqi` by running `piqic ocaml --pp t.piqi`
.variant [
.name example
.option [
.name ConsOne
.type int-array
.ocaml-name "ConsOne"
]
.option [
.name ConsTwo
.type float-array
.ocaml-name "ConsTwo"
]
]
.list [
.name float-array
.type float
.ocaml-array
]
.list [
.name int-array
.type int
.ocaml-array
]
module rec T_piqi :
sig
type float64 = float
type float = T_piqi.float64
type example =
[
| `ConsOne of T_piqi.int_array
| `ConsTwo of T_piqi.float_array
]
type float_array = T_piqi.float array
type int_array = int array
end = T_piqi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment