[Haskell] Proposal: Allow "\=" for field update in record update syntax

Keean Schupke k.schupke at imperial.ac.uk
Sun Feb 20 08:19:29 EST 2005


TH has supported multi-parameter classes for a while... new in 6.4 is 
support for fundeps.

    Keean.

Benjamin Franksen wrote:

>Two clarifications:
>
>On Saturday 19 February 2005 22:33, Benjamin Franksen wrote:
>  
>
>>	instance RecordField R Label_field1 T1 where
>>	  getField (Rec x _) _ = x
>>	  putField (Rec _ y) _ v = Rec v x
>>    
>>
>
>s/Rec/R/
>
>  
>
>>I wonder if something similar could be done with TH. The labels would need
>>to have a different name (e.g. l_field1, l_field2), so they don't collide
>>with their Haskell98 definitions, but otherwise everything should be as
>>above.
>>    
>>
>
>What I mean is: keep the record syntax and everything as it is now, but 
>additionally use TH in order derive the corresponding first class labels as 
>indicated above. The question is if a function 'generateLabels' can be 
>defined with TH. I remember darkly that TH is (or once was) restricted to 
>Haskell98, and so cannot be used to generate multi parameter class instances.
>
>Ben
>_______________________________________________
>Haskell mailing list
>Haskell at haskell.org
>http://www.haskell.org/mailman/listinfo/haskell
>  
>



More information about the Haskell mailing list