Changes between Version 4 and Version 5 of Language/Overview/ClosureTyping

Show
Ignore:
Timestamp:
08/26/10 02:15:58 (4 years ago)
Author:
benl (IP: 203.206.176.236)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language/Overview/ClosureTyping

    v4 v5  
    4848The `$c0` annotation tells us that this function has a object free in its closure, and that the object contains region `%r0`. The `x : %r0` syntax gives a name to this term, and is pronounced "x ''of'' region zero".  
    4949 
    50 Similarly to variables in the expression language, the exact names given to closure terms is not significant to the type system. However, to make inferred types easier to read, DDC names the closure terms in a function's type after the free variables that gave rise to those terms. The user is free to use whatever names they wish in type signatures. Two closure terms with different names but identical right hand sides are taken as being equivalent. 
    51  
    5250If we use this new type and apply the first argument we have: 
    5351 
     
    5755}}} 
    5856 
    59 This type says that `f_unit` is a function that takes a unit value and returns an <hask>Int</hask>, but the <hask>Int</hask> is free in its closure so is shared by all calls to it. The type system does not generalise regions which are free in these closures. 
     57This type says that `f_unit` is a function that takes a unit value and returns an `Int`, but the `Int` is free in its closure so is shared by all calls to it. The type system does not generalise regions which are free in these closures.