Changes between Version 23 and Version 24 of Records/OverloadedRecordFields/Plan


Ignore:
Timestamp:
Jul 17, 2013 6:42:35 PM (2 years ago)
Author:
adamgundry
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/OverloadedRecordFields/Plan

    v23 v24  
    213213
    214214{{{
    215 newtype WrapLens f r a = WrapLens
    216   { fieldLens :: forall b . Set r f b => Lens r (SetResult r f b) a b }
     215newtype WrapLens f r a
     216  = MkWrapLens (forall b . Set r f b => Lens r (SetResult r f b) a b)
    217217
    218218instance f ~ g => Accessor (WrapLens f) g where
    219   accessor _ getter setter = WrapLens (\ w s -> setter s <$> w (getter s))
     219  accessor _ getter setter = MkWrapLens (\ w s -> setter s <$> w (getter s))
     220
     221fieldLens :: Set r f b => WrapLens f r a -> Lens r (SetResult r f b) a b
     222fieldLens (MkWrapLens l) = l
    220223}}}
    221224