ocsigen/js_of_ocaml — pull request #175 by hhugo (2014-06-19 12:27:33+00:00)
Title: squash closure

functors with more than one arguments are compiled with nested closures.
```
function F (MA){
return function(MB) { ... } }
```
this PR converts this pattern into a single closure ``` function F(MA,MB) { ... }```

when applying such functor, the generated code change from ```call_gen_1(F(MA),MB)``` to ```F(MA,MB)```
This allows to eliminate more deadcode
In the following example, `M1` and `M2` can be removed if not used.
```
module type T = sig
type t
val x : t
end
module Make(C : T)(D : T with type t = C.t) = struct
let a = C.x
let b = D.x
end

module M1 = Make
(struct type t = int let x = 10 end)
(struct type t = int let x = 10 end)

module M2 = Make
(struct type t = float let x = 10. end)
(struct type t = float let x = 10. end)
```