Created
July 21, 2016 01:59
-
-
Save DanielleSucher/3710db84af7e7d0ad71450fd63930671 to your computer and use it in GitHub Desktop.
just some ocamling around with fieldslib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core.Std | |
module A : sig | |
type t = { | |
foo : string; | |
bar : int | |
} [@@deriving fields] | |
end = struct | |
type t = { | |
foo : string; | |
bar : int | |
} [@@deriving fields] | |
end | |
let () = | |
(printf "%s\n" (Field.name A.Fields.foo)); | |
(printf "%s\n" (Field.name A.Fields.bar)) | |
(* which can then be built with `ocamlfind ocamlc -linkpkg -thread -package core -package ppx_deriving -package ppx_fields_conv test.ml -o test.byte` *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment