Changes between Version 7 and Version 8 of Roles2
 Timestamp:
 May 23, 2014 8:31:50 AM (11 months ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Roles2
v7 v8 124 124 }}} 125 125 126 the instance126 the instance 127 127 128 128 {{{ … … 130 130 }}} 131 131 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. 133 133 134 134 2. Should users be able to write instances for `Rep` by hand? They cannot do so for `Coercible`. … … 155 155 }}} 156 156 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 newtypeunwrapping 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 newtypeunwrapping instance. But, what does this mean if the author wants to export `MyMaybe` abstractly? 158 158 159 159 2. Consider the `StateT` newtype: … … 163 163 }}} 164 164 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`. 166 166 167 167 == Other possible designs ==