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

Keean Schupke k.schupke at imperial.ac.uk
Mon Nov 21 12:07:58 EST 2005


Can this not be done with the HList code? I am pretty sure you should be 
able to
map projections over HLists of HLists... (although the HList generic map 
is a bit
ugly, requiring instances of the Apply class).

Actually you should look in the OOHaskell paper (if you haven't already) 
where it
discusses using "narrow" to allow homogeneous lists to be projected from
heterogeneous ones...

    Keean.

John Meacham wrote:

>another thing is that for any record syntax, we would want higher order
>versions of the selection, setting, and updating routines. A quick
>perusal of my source code shows over half my uses of record selectors
>are in a higher order fashion. (which need to be generated with DrIFT
>with the current syntax)
>
>I mean something like 
>
>map (.foo) xs
>to pull all the 'foo' fields out of xs.  (using made up syntax)
>
>or 
>
>map (foo_s 3) xs
>
>to set all the foo fields to 3. (using DrIFT syntax)
>
>
>        John
>
>  
>



More information about the Haskell-Cafe mailing list