Changes between Version 7 and Version 8 of Records/DeclaredOverloadedRecordFields/ImplementorsView


Ignore:
Timestamp:
Feb 20, 2012 8:51:22 PM (2 years ago)
Author:
guest
Comment:

fix some typo's/formatting

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields/ImplementorsView

    v7 v8  
    6363    data Customer_NameAddress = Cust_NA { customer_id :: Int, ... }  
    6464}}} 
    65 Does _not_ create a field selector function `customer_id`. Instead it creates a `Has` instance: 
     65Does __not__ create a field selector function `customer_id`. Instead it creates a `Has` instance: 
    6666{{{ 
    6767    instance (t ~ Int)  
    6868       => Has Customer_NameAddress Proxy_customer_id t where 
    69                get Cust_NA{customer_id} = customer_id 
     69               get Cust_NA{customer_id} _ = customer_id 
    7070}}} 
    7171Note the bare `t` with type equality constraint. This is unashamedly stolen from SORF's "functional-dependency-like mechanism (but using equalities) for the result type". So type inference binds to this instance based only on the record type and field (type 'peg'), then 'improves' the type of the result. 
     
    8585        set :: (Has r fld t) => fld -> t -> r -> r 
    8686}}} 
    87 `set`s instances are defined using explicit data constructor: 
     87`set`'s instances are defined using explicit data constructor: 
    8888{{{ 
    8989    instance (t ~ String) =>