[Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)
benjamin.franksen at bessy.de
Thu Nov 17 13:52:23 EST 2005
On Thursday 17 November 2005 19:21, Cale Gibbard wrote:
> 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
> Function composition is a very important and fundamental operation on
> functions, and I use it all the time. Haskell is supposed to be a
> functional language. I'd vote against any motion to make it less
> convenient. Of course, it really shouldn't be (.) but a small circle
> centred on the line, which isn't on ordinary keyboards. (°) looks
> closer, but is much less convenient to type. (I need to type
> "<Compose> 0 ^" in order to get that character.) Spelling it as (.)
> really is the best easy-to-type approximation.
Yes, yes, yes. I'd rather use a different operator for record selection.
For instance the colon (:). Yes, I know it is the 'cons' operator for a
certain concrete data type that implements stacks (so called 'lists').
However I am generally opposed to wasting good operator and function
names as well as syntactic sugar of any kind on a /concrete/ data type,
and especially not for stacks aka lists.
For a hypothetical Haskell2 I'd propose to get rid of all special 'list'
constructs and re-use the good symbols and names for /abstract/
interfaces to sequences and collections resp. (in case of the colon)
for record selection.
Just my 2 cent.
More information about the Haskell-Cafe