Passing values taking implicit parameters / smart constructors

Johannes Waldmann
Thu, 31 Jan 2002 10:28:11 +0100 (MET)

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 ---- --
-- -- phone/fax (+49) 341 9732 204/252 --