1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
This release of deriving-ocsigen library is based on the deriving
library by Jeremy Yallop. See:
http://code.google.com/p/deriving/
https://github.com/jaked/deriving
See CHANGES for a summary of changes.
######
Requirements:
=============
* ocaml and camlp4 (>= 3.12)
* type-conv (optionnal)
Build intructions:
==================
$ ${EDITOR} Makefile.config
$ make
$ make tests
# make install
Examples:
=========
$ ocaml
Objective Caml version 3.12.0
# #use "topfind";;
- : unit = ()
# #camlp4o;;
Camlp4 Parsing version 3.12.0
# #require "deriving-ocsigen.syntax";;
# type t = A of int | B of t deriving (Show);;
type t = A of int | B of t
module rec Show_t : sig ... end
# Show.show<t> (B (A 4));;
- : string = "B A 4"
Examples with type-conv:
========================
$ ocaml
Objective Caml version 3.12.0
# #use "topfind";;
- : unit = ()
# #camlp4o;;
Camlp4 Parsing version 3.12.0
# #require "type-conv";;
# #require "deriving-ocsigen.syntax_tc";;
# type t = A of int | B of t with show;;
type t = A of int | B of t
module rec Show_t : sig ... end
Documention and examples of the original library:
=================================================
http://code.google.com/p/deriving/wiki/Introduction
http://code.google.com/p/deriving/wiki/Classes
|