[MLton-user] opaque types and ffi

Stephen Weeks sweeks@sweeks.com
Mon, 24 Nov 2003 12:35:46 -0800


> I think what Tom was getting at was that it would be nice to have;
> 
> structure Lib1 :> sig  type x  type t = x MLton.pointer ... end
> structure Lib2 :> sig  type y  type t = y MLton.pointer ... end
> 
> You can't use a Lib1.t where a Lib2.t is expected.  One still want's
> Lib1.t to be an FFI type, because maybe the author of Lib1 forgot a C
> function that the programmer wants.  Or, for reasons of modularity, it
> would be nice to define Lib1.t functions outside of Lib1.

Ah.  This makes sense.  I was only thinking of the case where you can
hide the type definition and the ffi declarations behind the :>.

I'll think about adding this for the next release.  Unfortunately it
requires a little bit of compiler support, so I'd like to see if I can
think of an easier solution (doubtful, I admit).