Changes between Version 16 and Version 17 of Records/DeclaredOverloadedRecordFields
- Timestamp:
- 03/02/12 20:29:29 (15 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Records/DeclaredOverloadedRecordFields
v16 v17 150 150 {{{ 151 151 {-# OPTIONS_GHC -XDeclaredOverloadedRecordFields #-} 152 module M( x ) where152 module M( x, T ) where 153 153 fieldLabel x,y :: r -> Int 154 154 data T = MkT { x, y :: Int } 155 155 }}} 156 Here only the field selector function `x` isexported. The representation is abstract, the client can't construct or dismantle a record type `T`;156 Here only the field selector function `x` and type `T` are exported. The representation is abstract, the client can't construct or dismantle a record type `T`; 157 157 158 158 The existence of field `y` is hidden altogether. … … 168 168 then you are exporting the `x` field within record type `T`, but __not__ the field selector `x` (nor the generated type 'peg' `Proxy_x`). 169 169 170 Type `T` and field label `x` are exported, but not data constructor `MkT`, so `x` is (almost) unusable. (It can be used to update an existing record (without changing its record constructor) using syntax: `r{ x = 57 }`.)170 Type `T` and field label `x` are exported, but not data constructor `MkT`, so `x` is unusable. (It can't even be used to update an existing record using syntax: `r{ x = 57 }`, because that syntax now has a different semantics.) 171 171 172 172 The existence of field `y` is hidden altogether.
