Open Source+

rinus plasmeijer rinus@cs.kun.nl
Thu, 28 Jan 1999 09:02:21 +0100


leon wrote;

> 6.  I like monads.  I haven't used uniqueness typing a lot, but I like the
> idea.  Is there some reason that a language cannot have both?

One can have both. The uniqueness type system guarantees that it is safe
to do a distructive update. It is very flexible, because you can have
unique updateable objects at any place (any argument of a function can
be attributed)
The tric with monads is that you hide the object to be updated to avoid
that the object becomes shared, anf therefore such an object cannot be
passed around explicitly but must be handled by the system.
You can use uniqueness typing to type the system functions which do have
explicit access to the monads.
So, you can use uniqueness typing to make a correct implementation of
monads or a monadic style of programming.


Greetings,

Rinus