Changes between Version 3 and Version 4 of Language/Variables

Show
Ignore:
Timestamp:
06/24/09 10:44:05 (5 years ago)
Author:
benl (IP: 150.203.160.45)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language/Variables

    v3 v4  
    3737||The variable||%r1||has kind %||and is in name space % (regions)|| 
    3838 
    39 The exception to this rule is the kinds given to type class constraints such as Eq and Mutable. Eq has kind * -> + and Mutable has kind % -> +, but we put the constructors Eq and Mutable in the * (type) name space instead of making a new name space for +. We follow Haskell in this respect. Note that although Haskell98 doesn't assign a kind to type class constraints, constrains and type constructors are still in the same name space, so you can't have a type constructor Eq as well as a type class Eq in the same scope. 
     39The exception to this rule type class constructors such as Eq and Mutable. Eq has kind * -> + and Mutable has kind % -> +, but we put the constructors Eq and Mutable in the * (type) name space instead of making a new name space for +. We follow Haskell in this respect. Note that although Haskell98 doesn't assign a kind to type class constraints, constrains and type constructors are still in the same name space, so you can't have a type constructor Eq as well as a type class Eq in the same scope. 
    4040 
    4141There is also a name space associated with each type. Projection function are added to these name spaces by defining data types to have fields, and by explicitly declaring projection dictionaries. For example, if {{{xs}}} has type {{{List Int}}} then the expression {{{xs.length}}} calls the projection function {{{length}}} located in the name space for {{{List Int}}}. If there is no {{{length}}} projection in the {{{List Int}}} name space, but there is in a more general name space such as {{{List a}}}, then that is used instead.