Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
circular types?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: circular types?

> By contrast if the recursivity has to spread over more than one
> module, there is no solution in Caml. This is an active research area
> to design a module system that supports this feature (the so-called
> ``mixins'').

Could you explain how this helps with mixin?  My understanding of
mixin is that you compose types such that you can easily add
"printable" or "drawable" to an object in a lightweight way.  Is this
related in some way I don't see?  Or, does mixin mean something

Templates somewhat obviate the need for mixin, since "printable" just
becomes a constraint that the type support the "print" function,
"sortable" means the type has "<", etc.  This is generic programming
in the Stepanov sense.  I still need to get my head around ocaml's
generic programming constructs, though.  It seems they're more
powerful in some ways and less in others (since you can't overload,
you can't write a single generic function that operates on any types
that satisfy the constraints like you can in C++).  I'm still trying
to figure this out, though, so I could be mistaken.