PROPOSAL: Include record puns in Haskell 2011

Thomas Davie tatd2 at kent.ac.uk
Wed Feb 24 13:54:44 EST 2010


On 24 Feb 2010, at 18:52, John Meacham wrote:

> On Wed, Feb 24, 2010 at 06:23:39PM +0000, Ian Lynagh wrote:
>> On Tue, Feb 23, 2010 at 07:07:30PM -0800, Iavor Diatchki wrote:
>> I have a feeling I'm in the minority, but I find record punning an ugly
>> feature.
>> 
>> Given
>>    data T = C { f :: Int }
>> we implicitly get
>>    f :: T -> Int
>> which punning shadows with
>>    f :: Int
>> whereas I generally avoid shadowing completely.
> 
> I can see the thinking here, but I don't like for the language to try to
> enforce 'style' or make decisions based on it. I think it is more in the
> spirit of haskell to provide multiple mechanisms when it makes sense and
> let the users figure out what works for them stylistically. 

The problem though, unless I'm misunderstanding, is that you *must* enforce one or other convention here.  Either you force everyone who's style is to never shadow things to do so because of this language feature, or you remove the language feature and trample on the other crowd.

For what it's worth, I'd side with Ian on this one.

Bob


More information about the Haskell-prime mailing list