ocaml/ocaml — pull request #100 by chambart (2014-09-16 15:03:08+00:00)
Title: First class module dynlink

Adds an interface to get the first class module out of an cmo/cma/cmxs file.
This was started as a joke. I continued it a bit, and push it here to discuss the overall idea.

This adds a syntax to get a type witness of a module:
````(sig Module:Module_type)```` of type ````(module Module_type) sig_t````
and adds two functions to dynlink: ```load_modules : string -> module_info list``` and ```check_module : module_info -> 'a sig_t -> 'a option```

The witness contains only the digest of the cmi file for ```Module``` and ```check_module``` compares it with the digest of the interface a module implements. That way there is no need to add any new dependency to dynlink.