Created
January 12, 2011 02:47
-
-
Save m2ym/775606 to your computer and use it in GitHub Desktop.
Haskell "deriving show" in OCaml (Concept)
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
type r = { name : string; age : int } with value | |
type t = Foo of r | Bar of int * string with value | |
let _ = | |
let t = Foo { name = "Foo"; age = 100 } in | |
print_endline (Value.to_string (value_of_t t)) | |
(* => E/t/2/<Foo;E/r/2/{name:S(Foo);age:I(100)}> *) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment