[Haskell-cafe] Where are rank-3 types necessary in practice for maintaining abstraction?
timotomandl at gmail.com
Tue Apr 3 06:54:20 UTC 2018
Ok, I thought about it a bit more and realized mask in Control.Exception is
the one where rank-3 is necessary, which is the example I was looking for.
Sorry for the spam.
On Tue, Apr 3, 2018 at 4:36 AM, Timotej Tomandl <timotomandl at gmail.com>
> So we need rank-2 type in runST :: (forall s. ST
> s a) -> a, to prevent s from appearing in a.
> I have been thinking about this for a bit, but I failed to come up with a
> practical situation, where rank-3 types are necessary for safety of some
> The rank-3 example in here and any other I found, look very synthetic,
> i.e. limiting computation to id:
> and compared to the runST example of limiting a scope of a type variable
> for purposes of safety looks unnatural.
> Could anyone please point me to a practical example of rank-3
> polymorphism, where it is necessary for safety of an abstraction, if it
> I suspect there is a situation, where rank-3 is necessary for maintaining
> abstration exists, but I can't think of any.
> Any ideas about such situations and even better situations where this is
> used on hackage?
> Timotej Tomandl
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe