Records (was Re: [Haskell] Improvements to GHC)

Georg Martius mai99dgf at
Sun Nov 20 07:40:01 EST 2005

Hi folks,

rather than discussing about which operator symbol to use for record access, 
which is really a question of personal taste we should try to seriously 
discuss the proposals and get to a solutions! 

We all seem to agree that records are broken in Haskell. In order to fix that 
we need a new and most probably incompatible solution. However, I think the 
new solution should go in a new version of the Haskell standard (among other 
things :-) ). 
I would strongly disadvice to try to stick with the old system and improve it.
Just because there are lots of different opinions we should still try to find 
a reasonable solution soon.

Desite the minor problem of '.' that dominated the discussion so far, what are  
the REAL offences against Simons proposal [1] (denoted as SR in the 
To me it sounds like a very reasonable starting point. 
Which other proposals exist?

I quote David Roundy's list of problems [2] with a short annotation whether SR 
solves them:

1. The field namespace issue.
	solved by not sharing the same namespace with functions 
2. Multi-constructor getters, ideally as a function.
	not solved. only possible by hand
	- As stated by Wolfgang Jeltsch [3]  another datatype design might be better
	- I can image a solution is within SR example:
>	 data Decl = DeclType { name :: String, ... }
>                          | DeclData { name :: String, ... }
>                          | ...
>	d :: Decl 
in addition to 
we provide (only if save, see 3.)

3. "Safe" getters for multi-constructor data types.
	not supported as it is
	- with the above suggestion it could be possible (don't know if desireable)

4. Getters for multiple data types with a common field.
	- solved with contrains 
	>  getx :: (r <: { x :: a }) => r -> a

5. Setters as functions.
	doesn't seem to be supported, or I don't see it right now.

6. Anonymous records.

7. Unordered records.
	I don' t understand it. 

points added from me:
8. Subtyping
	Supported, quite nicely

9. higher order versions for selecting, updateing ... [4]
	not supported
	seems important to me, any solutions?



Am Donnerstag, 17. November 2005 19:08 schrieb Dimitry Golubovsky:
> Sebastian Sylvan wrote:
> >Personally I think that the dot is way to good of a symbol to be
> >"wasted" on function composition. I mean, how often do you really use
> >function composition in a way which doesn't obfuscate your code? I use
> >($) way more often than (.). Some people do use it more often than I
> I found it useful to use (mainly for debugging purposes)
> mapM (putStrLn . show) <some list>
> if I want to print its elements each on a new line.
> --
> Dimitry Golubovsky
> Anywhere on the Web

---- Georg Martius,  Tel: (+49 34297) 89434 ----
------- ---------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the Haskell mailing list