Jan de Wit writes:

> I think that what you want here are 'smart constructors', i.e. functions
> that create a new value but also perform other initializations.
..
> If you define Tree and the smart constructors in a separate module and then
> only export the type Tree (*not* the real constructors!),

OK, I see how this would achieve what I want. 

But then I cannot use record sytax (updates, pattern matching)
outside the defining module. This would essentially mean Haskell-1.0
or thereabouts. Perhaps I need `views' ?

OTOH my suggestion does not seem terribly difficult to implement
(to me - being *not* an Haskell implementor, of course :-)

Best regards,
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- [EMAIL PROTECTED] -- phone/fax (+49) 341 9732 204/252 --

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to