Skip to content

Instantly share code, notes, and snippets.

@alavrik
Created December 16, 2012 06:58

Revisions

  1. alavrik created this gist Dec 16, 2012.
    30 changes: 30 additions & 0 deletions t.piqi
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    .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
    ]
    18 changes: 18 additions & 0 deletions t_piqi.ml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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