[Haskell-cafe] ContT and ST stack

Bas van Dijk v.dijk.bas at gmail.com
Thu Mar 10 17:15:29 CET 2011

On 10 March 2011 14:47, Daniel Fischer <daniel.is.fischer at googlemail.com> wrote:
> If memory serves correctly, it's impredicative polymorphism.

Indeed. For example the following also doesn't type check in GHC-7:

foo :: (forall s. ST s a) -> a
foo st = ($) runST st

Surprisingly the following does:

foo :: (forall s. ST s a) -> a
foo st = runST $ st

Because GHC contains a special rule for infix $. Also see:



More information about the Haskell-Cafe mailing list