README
SEE BELOW FOR UPDATE
--------------------------------------------------------------
Typing `make' in this directory should build both the preprocessor
(syntax/deriving) and the libraries (lib/deriving.cma,
lib/deriving.cmxa).
You can run the tests by changing to the test directory and building
and running the `tests' executable
$ cd tests
$ make
...
$ ./tests
Tests succeeded!
There's very limited documentation at present, but you should be able
to get started by looking at the test files.
Any comments are very welcome.
Jeremy Yallop
jeremy.yallop@ed.ac.uk
--------------------------------------------------------------
UPDATE (20100901)
Original deriving at http://code.google.com/p/deriving
This code lives at http://repo.or.cz/w/deriving.git
Changes:
* fix compilation with ocaml 3.11 [#5]
* fix linking conflict with extlib [#1]
* fix pretty printing of constructors [#4]
* partially fix syntax conflict with operator (<) [#2]
* alternative compilation with ocamlbuild, producing pa_deriving.cma
* installation with ocamlfind
Build with ocamlbuild :
$ make obuild
Result (in directory _build) :
deriving.{cma,cmxa} - runtime library for deriving
pa_deriving.cma - syntax extension library (usage: camlp4o _build/pa_deriving.cma tests/issue2.ml)
deriving.{byte,native} - syntax extension standalone binary (usage: _build/deriving.native tests/issue2.ml)
Original build procedure works too, but you will not get pa_deriving.cma
Build tests :
$ ocamlbuild tests.native
Install with ocamlfind :
$ make install
Example usage with ocamlfind :
$ ocamlfind ocamlopt -o test -linkpkg -package deriving.syntax -syntax camlp4o tests/issue2.ml
Example usage in ocaml toplevel :
#use "topfind";;
#camlp4o;;
#require "deriving.syntax";;
type t = int list deriving (Show);;
Show.show<t>([1;2;3;4]);;
--
ygrek
ygrek@autistici.org