ocsigen / eliomlang

Runtime and tools for the eliom language
ISC License
9 stars 1 forks source link

Handle functors with types #4

Closed Drup closed 8 years ago

Drup commented 8 years ago

Functors are difficult to handle, mainly because of code like that:

module type S = sig
  type%client t 
  type%server t' 
end 

module F (M : S) = struct
 ...
end 

Since .cmi should be split between client and server, there is no way to check if a given module fulfill this signature (there is not even a way to export this signature properly ...)

Drup commented 8 years ago

Since we don't split cmis anymore, this is now implemented correctly simply by checking module inclusion.

In particular, that works:

module type S = sig
  type%client t
  type%server t
end

module T = struct
  type%client t = int
  type%server t = float
end

module F (M : S) = struct
  type%server foo = M.t fragment * M.t
end

module M = F(T)