Changes between Version 8 and Version 9 of Language

Show
Ignore:
Timestamp:
06/24/09 09:58:50 (5 years ago)
Author:
benl (IP: 150.203.160.45)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v8 v9  
    203203 
    204204The return kind of abstract class constraints must be {{{+}}}. We don't yet support default instances in type class declarations #90. 
     205 
     206[[br]] 
     207 
     208== !InstanceDecl == 
     209 
     210{{{ 
     211InstanceDecl 
     212    ::=  instance  Con  SimpleType+  where  {  Binding;+  } 
     213}}} 
     214 
     215[[br]] 
     216 
     217== !ProjectionDecl == 
     218 
     219{{{ 
     220ProjectionDecl 
     221    ::=  project  Con  SimpleType*  where  {  (TypeSig|Binding)+  }    -- projection dictionary 
     222     |   project  Con  SimpleType*  with   {  Var+  }                  -- projection punning 
     223}}} 
     224 
     225The first form defines some projection functions associated with a given type. Presently, all projections associated with a type must be declared in the same projection declaration and in the same source module, but there is a plan to relax this #7. 
     226 
     227If two projection dictionaries are defined for types that overlap, eg List Int and List a, then the result is currently undefined. There is a ticket to fix this #40. 
     228 
     229The projection punning syntax imports bindings at top level into the projection name space. For example: 
     230 
     231{{{ 
     232project Set a with { insert; delete; size } 
     233}}} 
     234 
     235Is equivalent to 
     236{{{ 
     237project Set a where { insert = insert; delete = delete; size = size } 
     238}}} 
     239 
     240This is useful when implementations of {{{insert}}}, {{{delete}}} and {{{size}}} are in the current module, but only the type {{{Set}}} is exported. All projections associated with a certain type are exported when the type is. 
     241 
     242 
     243== !TypeSig == 
     244 
     245{{{ 
     246TypeSig 
     247    ::=  Var  ::  Type 
     248}}} 
     249 
     250