Changes between Version 10 and Version 11 of Records/SyntaxDirectedNameResolution


Ignore:
Timestamp:
Feb 28, 2012 12:17:16 AM (3 years ago)
Author:
elaforge
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/SyntaxDirectedNameResolution

    v10 v11  
    109109make ghc generate lenses for the fields instead of get functions.
    110110
    111 M.hs:
    112 {{{
    113 data M.Record = Record { a :: Int } deriving (Lens)
    114 }}}
    115 
    116 Main.hs:
    117111{{{
    118112import qualified M
     113-- In M.hs: data Record = Record { a :: Int } deriving (Lens)
    119114
    120115get :: Lens record field -> record -> field
     
    133128`set ((#b.#a) record) 42` should become `set ((Inner.b . Outer.a) record) 42`
    134129
    135 Outer.hs:
    136 {{{
    137 data Outer = Outer { a :: Inner.Inner } deriving (Lens)
    138 }}}
    139 
    140 Inner.hs:
    141 {{{
    142 data Inner = Inner { b :: Int } deriving (Lens)
    143 }}}
    144 
    145 Main.hs:
    146 {{{
     130{{{
     131import qualified Outer
     132-- Outer.hs: data Outer = Outer { a :: Inner.Inner } deriving (Lens)
     133import qualified Inner
     134-- Inner.hs: data Inner = Inner { b :: Int } deriving (Lens)
     135
    147136-- A lens composition operator.  Most lens libraries overload (.) with this,
    148137-- so we'd either need to make a new operator or move Control.Category into