Changes between Version 4 and Version 5 of Records/SyntaxDirectedNameResolution


Ignore:
Timestamp:
Feb 27, 2012 11:55:02 PM (2 years ago)
Author:
elaforge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/SyntaxDirectedNameResolution

    v4 v5  
    207207ugly TH splices with a nice deriving clause or would that need to be built in?  At the least I think it would need an extension to suppress record declaration's automatic creation of get functions. 
    208208 
     209An example of an advantage of using lens libraries: fclabels has a notion of "partial lenses" that can return Nothing.  People who like that feature can have the lens deriver generate a partial lenses for `x` but a total lens for `y` in 
     210`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. 
     211 
    209212== pros == 
    210213