Passing values taking implicit parameters / smart constructors

Johannes Waldmann joe@isun.informatik.uni-leipzig.de
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 ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --