Changes between Version 11 and Version 12 of Language/Ponies


Ignore:
Timestamp:
Mar 9, 2014, 8:44:39 AM (3 years ago)
Author:
benl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language/Ponies

    v11 v12  
    2929
    3030Perhaps we should use a different keyword, maybe 'mdo', to invoke monadic desugaring.
    31 
    32 == Mask mutability constraints on fresh data ==
    33 
    34 In a type like
    35 {{{
    36  fun :: forall r1 r2
    37      .  Int r1 -> Int r2
    38      :- Mutable r2
    39 }}}
    40 
    41 The returned Int is fresh, that its region does not appear on the lhs of an arrow or in a closure. In this case it does not matter that the data is Mutable, and this fetter can be masked.
    42 
    43 We'll want to use the closure information the core language for this, so make sure the core type checker works.
    44 
    45 == Mask effects on fresh data ==
    46 
    47 In a type like
    48 {{{
    49  fun :: forall r1 r2
    50      .  Int r1 -(e1 | $0)> Int r2
    51      :- e1 = Read r2
    52 }}}
    53 The effect Read r2 isn't being masked because r2 is visible in the shape of the type. However, as the data is fresh the fact that there was a read when constructing it does matter, so it can be masked.
    54 
    55 Jared: This also causes a spurious Write effect in primString_eq, which gets it from string_flatten. The result is that string equality can't be used as a guard to a top-level function. The following code can be used as a test case.
    56 {{{
    57 foo () = do
    58     result = newString 6
    59     dangerPack "effect" result
    60     result
    61 }}}