Changes between Version 16 and Version 17 of Records/DeclaredOverloadedRecordFields


Ignore:
Timestamp:
Mar 3, 2012 4:29:29 AM (2 years ago)
Author:
AntC
Comment:

correct an export list

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields

    v16 v17  
    150150{{{ 
    151151{-# OPTIONS_GHC -XDeclaredOverloadedRecordFields             #-} 
    152 module M( x )       where 
     152module M( x, T )       where 
    153153    fieldLabel x,y :: r -> Int 
    154154    data T = MkT { x, y :: Int } 
    155155}}} 
    156 Here only the field selector function `x` is exported. The representation is abstract, the client can't construct or dismantle a record type `T`; 
     156Here 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`; 
    157157 
    158158  The existence of field `y` is hidden altogether. 
     
    168168then you are exporting the `x` field within record type `T`, but __not__ the field selector `x` (nor the generated type 'peg' `Proxy_x`). 
    169169 
    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 }`.) 
     170Type `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.) 
    171171 
    172172  The existence of field `y` is hidden altogether.