Changes between Version 7 and Version 8 of Language

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

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v7 v8  
    1414Modules start with an optional module identifier, followed by a list of export and import declarations. Export declarations must come before import declarations.  
    1515 
     16Although we use semicolons as terminators instead of separators, in all cases the parser will accept a missing semicolon before a closing brace. 
     17 
    1618[[br]] 
    1719 
     
    2123    ::= export  Var 
    2224     |  export type  Con 
     25     |  export region  RVar 
     26     |  export effect  ECon 
     27     |  export class   Con  
    2328}}} 
    2429 
     
    9095}}} 
    9196 
    92 Sets the kind of an abstract type constructor. 
     97Sets the kind of an abstract value type constructor. 
    9398 
    9499[[br]] 
     
    150155}}} 
    151156 
     157[[br]] 
     158 
     159 
     160== !EffectDecl == 
     161 
     162{{{ 
     163EffectDecl  
     164    ::=  effect  ECon  ::  Kind   
     165}}} 
     166 
     167Defines a new effect constructor and sets its kind. The result kind of the constructor must be !. 
     168 
     169Inference involving effect constructors of kinds other than {{{!}}} and {{{(% -> !)}}} is not well tested #89. 
     170 
     171[[br]] 
     172 
     173== !RegionDecl == 
     174 
     175{{{ 
     176RegionDecl 
     177    ::=  region  RVar  (:-  TyConstraint  ,TyConstraint*)? 
     178}}} 
     179 
     180Defines a top-level (global) region.  
     181 
     182Although explicitly binding top-level region variables is not nessesary, it can be useful to define the constraints on a global region in a single place in the source file, instead of trying to repeat them in each type signature that uses it. For example: 
     183 
     184{{{ 
     185region %r :- Const %r 
     186 
     187pi :: Float %r 
     188pi = 3.1415926535 
     189 
     190e :: Float %r 
     191e = 2.71828183 
     192}}} 
     193 
     194[[br]] 
     195 
     196== !ClassDecl == 
     197 
     198{{{ 
     199ClassDecl 
     200    ::=  class  Con  ::  Kind                             -- abstract class constraint 
     201     |   class  Con  TyVar+  where  {  TypeSig;+  }       -- value type class definition 
     202}}} 
     203 
     204The return kind of abstract class constraints must be {{{+}}}. We don't yet support default instances in type class declarations #90.