[Haskell] Re: Records

Ketil Malde ketil.malde at bccs.uib.no
Mon Nov 28 11:14:08 EST 2005


Johannes Waldmann <waldmann at imn.htwk-leipzig.de> writes:

> Again, the concrete syntax problem is whether to hide the argument.
> Perhaps  data Foo = Foo { foo :: Int, bar :: Int ; bar = 2 * foo self }
> with a reserved word "self" is better. - Are there semantic problems?

Can't you solve this by writing a fiunction to construct Foo with the
desired properties?  I.e. something like

  mkStdFoo f = Foo f (2*f)

Or is there other functionality you would get by using records in this
way?

-k  
-- 
If I haven't seen further, it is by standing in the footprints of giants



More information about the Haskell mailing list