StricterLabelledFieldSyntax

Ian Lynagh igloo at earth.li
Sun Jul 26 07:38:04 EDT 2009


On Sat, Jul 25, 2009 at 09:45:18PM -0400, Isaac Dupree wrote:
> Ian Lynagh wrote:
>> Hi all,
>>
>> I've made a ticket and proposal page for making the labelled field
>> syntax stricter, e.g. making this illegal:
>>
>>     data A = A {x :: Int}
>>
>>     y :: Maybe A
>>     y = Just A {x = 5}
>>
>> and requiring this instead:
>>
>>     data A = A {x :: Int}
>>
>>     y :: Maybe A
>>     y = Just (A {x = 5})
>
> and, as currently, "(f some expression) {x=5}" still requires those  
> parentheses also?  Although depending on the surroundings, after this  
> proposal, it might need to become "((f some expression) {x=5})"

Yes, exactly. I've added this to the wiki page:

    No additional programs are accepted by this change, and no programs
    have their behaviour changed. This change only rejects some programs
    that were previously accepted.


Thanks
Ian



More information about the Haskell-prime mailing list