Changes between Version 1 and Version 2 of Language/Overview/ClassSystem

Show
Ignore:
Timestamp:
06/17/10 03:11:17 (4 years ago)
Author:
benl (IP: 129.94.242.38)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language/Overview/ClassSystem

    v1 v2  
    3535 
    3636In Disciple, we can do a similar thing with regions: 
     37 
    3738{{{ 
    3839csucc :: forall %r1 %r2 
    39      .  Int %r1 -> Int %r2 
    40      :- Const %r1 
    41 }}} 
     40      .  Int %r1 -> Int %r2 
     41      :- Const %r1 
     42}}} 
    4243 
    4344The ''region class'' constraint `Const %r1` restricts `csucc` so that it only accepts arguments that are constant. Data in `Const` regions is guaranteed by the type system never to be destructively updated. In Disciple we write the class constraints at the end of the type for clarity, though there is a plan to allow the standard Haskell syntax as well. 
     
    9798{{{ 
    9899(+)  :: forall %r1 %r2 %r3 !e1 
    99        .  Int %r1 -> Int %r2 -(!e1)> Int %r3 
    100        :- !e1 = !{ !Read %r1; !Read %r2 } 
     100     .  Int %r1 -> Int %r2 -(!e1)> Int %r3 
     101     :- !e1 = !{ !Read %r1; !Read %r2 } 
    101102}}} 
    102103