Changes between Version 16 and Version 17 of Records/OverloadedRecordFields


Ignore:
Timestamp:
Apr 29, 2013 12:18:37 PM (2 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/OverloadedRecordFields

    v16 v17  
    333333upd r = r { x = True }
    334334}}}
    335  But `set` cannot accomodate this change of type, at least not without much more complexity.  Maybe one solution here is to give up on type-checking updates.
     335 But `set` cannot accomodate this change of type, at least not without much more complexity.  Moreover, '''NO''' field-at-a-time encoding can deal with the case when more than one field shares the changed type. For example, this is legal Haskell:
     336{{{
     337data S a = S { x,y :: a }
     338upd :: S Int -> S Bool
     339upd s = s { x = True, y = False }
     340}}}
     341 But any system that updates `x` and then `y` will have an ill-typed intermediate in which `x` has a `Bool` while `y` has an `Int`.  This is really the death-knell for any field-at-a-time story that seeks to be compatible with Haskell as she is now.
    336342
    337343 * This approach doesn't work at all in the higher-rank case.  For example, if `r :: HR`, we are currently allowed to say