Changes between Version 38 and Version 39 of Records/NameSpacing


Ignore:
Timestamp:
Jan 18, 2012 10:37:12 AM (4 years ago)
Author:
GregWeber
Comment:

quote code

Legend:

Unmodified
Added
Removed
Modified
  • Records/NameSpacing

    v38 v39  
    7070Here's a complex example:
    7171
     72{{{
    7273  type family F a b
    7374  data instance F Int [a] = Mk { f :: Int }
     
    7778
    7879  k x = (g x, x.f, h x)
     80}}}
    7981
    8082Consider type inference on k.  Initially we know nothing about the
     
    106108and solving them later.  We express it like this:
    107109
     110{{{
    108111  G, r:t1  |-  r.f : t2,  (Has t1 "f" t2)
     112}}}
    109113
    110114This says that if r is in scope with type t1, then (r.f) has type t2,
    111115plus the constraint (Has t1 "f" t2), which we read as saying
    112116
     117{{{
    113118  Type t1 must have a field "f" of type t2
     119}}}
    114120
    115121We gather up all the constraints and solve them.  In solving them