Pietro Abate
ocaml
Recursive subtyping revealed
The other day I read the article: "Recursive Subtyping revealed". A Functional Pearl by Gapeyev, Levin and Pierce. This is a bit of code I wrote to convince myself of the algorithm described in the paper.
You can get the article here
<code> type at = |Top |Nat |Bool |Even | Odd |Times of ( at * at ) |Arrow of ( at * at ) |Mu of ( string * at ) |Var of string
module S = SortedList.Make( struct type t = (at * at) let compare = compare let hash = Hashtbl.hash
ocamlbuild + camlp4 + ocamlfind
Recently I tried to answer to a problem posed on the OCaml mailing list. Basically the problem is how to compile using ocamlbuild using ocamlfind and camlp4. The Camlp4 wiki has already all the ingredients. Here I mix them up in a short example.
- _tags : is the ocamlbuild dep file
- bar.ml : is a ml file that uses the syntax extension pa_float to compile.
- foo.ml : is a ml file that depends on bar.ml and the str module (fetched via ocamlfind)
- pa_float.ml : is the source code of the camlp4 syntax extension.
The code
_tags <code>
Patch to mod-caml
I've done a bit of work to use mod-caml with apache 2.2 . I've uploaded everything on the debian gforge website alioth.
to recompile the package you can get it via svn
Then you can compile the package with svn-buildpackage.
I've also wrote a small patch to recursively load dependent modules. I attached a simple loader module that is partially a rip-off of some GPL code I found on the net.