Changes between Version 7 and Version 8 of Roles2


Ignore:
Timestamp:
May 23, 2014 8:31:50 AM (14 months ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Roles2

    v7 v8  
    124124}}} 
    125125 
    126 the instance 
     126  the instance 
    127127 
    128128{{{ 
     
    130130}}} 
    131131 
    132 can be written. Should this be inferred? I (Richard) can imagine a beefed up role inference algorithm which could figure this out. But, perhaps there exist harder cases that would not be inferrable. 
     132  can be written. Should this be inferred? I (Richard) can imagine a beefed up role inference algorithm which could figure this out. But, perhaps there exist harder cases that would not be inferrable. 
    133133 
    1341342. Should users be able to write instances for `Rep` by hand? They cannot do so for `Coercible`. 
     
    155155}}} 
    156156 
    157 Here, we have `Rep Maybe` and `Coercible Maybe MyMaybe` but not `Rep MyMaybe`. This is all very strange. Of course, we ''could'' define an instance `Rep MyMaybe`, despite the role annotation, by using the newtype-unwrapping instance. But, what does this mean if the author wants to export `MyMaybe` abstractly? 
     157  Here, we have `Rep Maybe` and `Coercible Maybe MyMaybe` but not `Rep MyMaybe`. This is all very strange. Of course, we ''could'' define an instance `Rep MyMaybe`, despite the role annotation, by using the newtype-unwrapping instance. But, what does this mean if the author wants to export `MyMaybe` abstractly? 
    158158 
    1591592. Consider the `StateT` newtype: 
     
    163163}}} 
    164164 
    165 Its roles are `nominal representational nominal`. But, if we have `Rep m`, then the roles could all be representational. For the `a` parameter, this is just like `ReaderT`. But, we are stuck with the `s` parameter, simply because the `s` parameter comes ''before'' `m` in the parameter list. There's no way to assert something about `m` when describing a property of `s`. 
     165  Its roles are `nominal representational nominal`. But, if we have `Rep m`, then the roles could all be representational. For the `a` parameter, this is just like `ReaderT`. But, we are stuck with the `s` parameter, simply because the `s` parameter comes ''before'' `m` in the parameter list. There's no way to assert something about `m` when describing a property of `s`. 
    166166 
    167167== Other possible designs ==