Skip to content
Extension to OCaml for deriving functions from type declarations.
Branch: master
Clone or download
Pull request Compare This branch is 164 commits ahead of jaked:master.
balat Merge pull request #44 from ocsigen/rm-how-master
Remove html_of_wiki from CI.
Latest commit 6fbef90 Dec 18, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Implemented feedback. Using Marshal.of_bytes instead of Marshal.of_st… Nov 24, 2017
syntax Remove optcomp and support for OCaml < 4.03 (#42) Dec 19, 2017
tests Remove optcomp and support for OCaml < 4.03 (#42) Dec 19, 2017
.gitignore Merge remote-tracking branch 'origin/oasis.0.4.4' into HEAD Apr 20, 2014
.jenkins.sh Update .jenkins.sh and Makefile for documentation Aug 19, 2014
CHANGES Declare num ocamlfind dependency, call it 0.8.1 Feb 1, 2018
COPYING deriving 0.1.1a Sep 3, 2010
Makefile Declare num ocamlfind dependency, call it 0.8.1 Feb 1, 2018
Makefile.dist Fix Makefile.dist Apr 10, 2014
README.md Oasis: fix optional dependency on type_conv Apr 9, 2014
_oasis Declare num ocamlfind dependency, call it 0.8.1 Feb 1, 2018
_tags Bugfix in _tags (bug in 'oasis' to be reported) Mar 11, 2014
configure Declare num ocamlfind dependency, call it 0.8.1 Feb 1, 2018
myocamlbuild.ml
opam
setup.ml

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
You can’t perform that action at this time.