data label overloading

Serge D. Mechveliani mechvel at botik.ru
Tue Jan 13 15:47:30 EST 2004


Dear Haskellers,

It is desirable to have shorter names for the data labels.

Making a module out of a labeled data declaration does not look
convenient.
Providing the corresponding class operation is not always convenient.

Maybe, future Haskell language could apprehend some special construct, 
like, say, in the following example

  data Foo1 = Foo1 {size :: Int ...}
  ...
  data Foo2 = Foo2 {size :: Int ...}
  ...
  f x y z = let size = Foo1..size 
            in
            (size x) + (size y) + (Foo2..size z)  

?

"Foo.." is added when more than one type with the given label is
visible in the scope. 

Copy, please, the answer to  mechvel at botik.ru

With kind regards,

-----------------
Serge Mechveliani
mechvel at botik.ru

 


More information about the Haskell mailing list