Changes between Version 13 and Version 14 of ExistingRecords
- Timestamp:
- 07/16/09 09:27:06 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ExistingRecords
v13 v14 36 36 This would mitigate the problems caused by accessors being partial functions since you can use a simple case statement to get the effect of an accesor that returns its result in a Maybe. 37 37 38 Note from Simon. I hate that the above defn of 'f' has just one argument (val {x="foo")),38 '''Note from Simon'''. I hate that the above defn of 'f' has just one argument (val {x="foo")), 39 39 whereas it looks as if it has two. (This is a problem with existing Haskell.) It looks 40 40 like 'f' has an argument 'val' and another arguement that is a free-standing record, … … 69 69 Note the change in the type of the stored field. 70 70 At the moment, such a record update must be written using the data constructor, not the update syntax. 71 72 '''SLPJ:''' That isn't true. Haskell 98 already supports what you suggest here, and the code above compiles with GHC without flags. 73 74 However I would like to argue for ''removing'' this feature. It causes a quite unreasonable amount of 75 pain in the type checker, especially once we start thinking about GADTs and existentials. And I think the benefit is modest at best. I don't think programmers generally expect record update to be a type-changing operation. 76 77 71 78 == 'Open' statement == 72 79
