You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The counterexample by Russo is due to open-scope unpacking of first-class modules and applicative functors. The easiest way to fix the problem is using generative functors. That is, when unpack occurs in the body of a functor F, then it should be generative, meaning that each application of F should yield fresh abstract types. Moscow ML, Alice ML and OCaml take this approach.
If one wants to stick to applicative functors, then we must at least track dependencies of types on values. Moreover, types must be effect-free to make type equivalence reflexive. But this is not the case for existing major implementations: neither Moscow ML nor OCaml prohibits effects inside types (because of functor application!) so unpack is only allowed in generative functors.
Finally, the interaction between first-class modules and effects was briefly discussed by Harper and Lillibridge in 1994 [1], earlier than Russo.
First of all, thanks for the great work!
http://counterexamples.org/unstable-types.html
The counterexample by Russo is due to open-scope unpacking of first-class modules and applicative functors. The easiest way to fix the problem is using generative functors. That is, when
unpack
occurs in the body of a functorF
, then it should be generative, meaning that each application ofF
should yield fresh abstract types. Moscow ML, Alice ML and OCaml take this approach.If one wants to stick to applicative functors, then we must at least track dependencies of types on values. Moreover, types must be effect-free to make type equivalence reflexive. But this is not the case for existing major implementations: neither Moscow ML nor OCaml prohibits effects inside types (because of functor application!) so
unpack
is only allowed in generative functors.Finally, the interaction between first-class modules and effects was briefly discussed by Harper and Lillibridge in 1994 [1], earlier than Russo.
[1] https://doi.org/10.1145/174675.176927
The text was updated successfully, but these errors were encountered: