Changes between Version 18 and Version 19 of Records/SyntaxDirectedNameResolution


Ignore:
Timestamp:
Dec 29, 2013 12:46:28 AM (4 months ago)
Author:
aavogt
Comment:

note a preprocessor that implements this concept (for HList records only however)

Legend:

Unmodified
Added
Removed
Modified
  • Records/SyntaxDirectedNameResolution

    v18 v19  
    202202`data R = R1 { x, y :: Int } | R2 { y :: Int }` which would solve the problem in a nice typesafe way rather than generating a `x` function that fails at runtime.  If we have built in lenses, or a record system with a built-in way of generating record accessors (morally equivalent), then we are stuck with whatever choice was baked into ghc.  Hopefully it's Maybe rather than runtime errors, but at least using an external lens library lets you retroactively fix things like that. 
    203203 
     204I (aavogt) wrote a preprocessor <http://code.haskell.org/~aavogt/recordlabel-preprocessor/perf.html>, which uses ` instead of #. 
     205It takes a different perspective, in that `x is just a way to write a type level string 
     206`Symbol` "x", but that's only useful with extensible records. Regardless, user code seems to be very similar. 
     207 
    204208== pros == 
    205209