Extension to OCaml for deriving functions from type declarations.
OCaml Other
Pull request Compare This branch is 151 commits ahead of jaked:master.
Latest commit d0c7194 Jun 14, 2016 @vasilisp vasilisp OPAM file hack for *BSD
Permalink
Failed to load latest commit information.
doc doc Jul 3, 2014
lib Add missing dependencies on 'bytes' in META Sep 6, 2014
syntax Fix DELETE_RULE for 4.03 (nonrec flag) Apr 30, 2016
tests Simplify _tags Jan 25, 2014
.gitignore
.jenkins.sh Update .jenkins.sh and Makefile for documentation Aug 19, 2014
CHANGES
COPYING deriving 0.1.1a Sep 3, 2010
Makefile Update .jenkins.sh and Makefile for documentation Aug 19, 2014
Makefile.dist Fix Makefile.dist Apr 10, 2014
README.md Oasis: fix optional dependency on type_conv Apr 9, 2014
_oasis Prepare for 0.7.1 May 25, 2016
_tags
configure Update against oasis dev (fix a bug in configure) Apr 5, 2014
myocamlbuild.ml doc Jul 3, 2014
opam
setup.ml Use the OASIS alpha feature: compiled_setup_ml Mar 26, 2014

README.md

Deriving (was Deriving-ocsigen)

This release of deriving is based on the library by Jeremy Yallop. See:

Compared to the original library, it adds:

  • META file for ocamlfind compatibility
  • a type-conv compatibility mode
  • the generated code do not rely on recursive modules (this allows compatibility with js_of_ocaml)
  • minimalistic support of GADT

See CHANGES for more details.

Requirements:

  • ocaml and camlp4 (>= 3.12)
  • optcomp
  • type-conv (optionnal)

Build intructions:

 $ ./configure [--disable-tc]
 $ make

 # make install

Documention and examples of the original library:

Examples:

 $ ocaml
        Objective Caml version 4.01.0

 # #use "topfind";;
 - : unit = ()
 # #camlp4o;;
    Camlp4 Parsing version 4.01.0

 # #require "deriving";;
 # 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 4.01.0@

 # #use "topfind";;
 - : unit = ()
 # #camlp4o;;
    Camlp4 Parsing version 4.01.0

 # #require "deriving.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