File: README.md

package info (click to toggle)
ocaml-deriving-ocsigen 0.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 628 kB
  • ctags: 1,159
  • sloc: ml: 6,334; makefile: 63; sh: 18
file content (76 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download | duplicates (2)
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
68
69
70
71
72
73
74
75
76
Deriving (was Deriving-ocsigen)
===============================

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

 * http://code.google.com/p/deriving/

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:
-------------------------------------------------

 * http://code.google.com/p/deriving/wiki/Introduction
 * http://code.google.com/p/deriving/wiki/Classes

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
```