[Haskell] Real life examples

Keean Schupke k.schupke at imperial.ac.uk
Fri Nov 26 06:39:42 EST 2004

Adrian Hey wrote:

>Well it can be written in Haskell, but not using a module that was
>specifically designed to prevent this.
Well, It can be written in Haskell as it stands at the moment... This 
would break that...

You want the library programmer to have final say.
I want the library user to have final say.

An acceptable compromise would seem to be to make it the default that
it can only be run once, but allow the 'world' to be encapsulated at a
higher level of virtual machine... That is why I suggested the modified
import syntax.

>You've gotta make a sensible
>choice as to what the purpose of module you're writing really is of
>course. But this is always the case I think, no magic bullets here.
Exactly ... not. I think the user of the library should be free to
(ab)use the library if they see fit. To me the property of encapsulation
is more important than the ability to ensure a function gets
run once and only once... If you want functions that can only be
run once within a process, then a process must become a
Haskell primitive, so that they can be manipulated, and encapsulated.


More information about the Haskell mailing list