Opam Package mirage-tc.0.3.0

Package info

opam-namemirage-tc
opam-version0.3.0
synopsisMirageOS type-classes
description A set of functors and combinators to pretty-print (using sexplib), to convert to and from and JSON and Cstruct buffers. ```ocaml # Tc.show (module Tc.S) "Hello world!";; - : string = "\"Hello world!\"" # Tc.to_json (module Tc.App2(Tc.P)(Tc.I)(Tc.S)) (3, "foo");; - : Ezjsonm.t = `A [`String "3"; `String "foo"] ``` A slightly more complex example, using autogen code instead of functor composition: ```ocaml # camlp4o;; # require "sexplib.syntax";; # require "comparelib.syntax";; # require "bin_prot.syntax";; # module M = struct type t = { foo: int; bar: string list } with sexp, bin_prot, compare end;; # module X = Tc.I0(M);; # let t = { foo = 3; bar = [ "hello"; "world" ] };; # Tc.to_json (module X) t;; - : Ezjsonm.t = `A [`A [`String "foo"; `String "3"]; `A [`String "bar"; `A [`String "hello"; `String "world"]]] # Tc.write_string (module X) t;; - : string = "\003\002\005hello\005world" ```
authors
  • Thomas Gazagnaire
homepagehttps://github.com/mirage/mirage-tc
licenseISC
deps (9)
revdeps(0)
metas (1)
libraries (1)

Package modules

Package sources

mirage-tc

Package files

lib/tc/tc.mli
lib/tc/tc.cmxs
lib/tc/tc.cmxa
lib/tc/tc.cmx
lib/tc/tc.cmti
lib/tc/tc.cmt
lib/tc/tc.cmi
lib/tc/tc.cma
lib/tc/tc.annot
lib/tc/tc.a
lib/tc/META
lib/tc