2 ms·
No, not strictly true! ($) has a compiler hack to let it handle impredicativity. import Control.Monad.ST infix 0 % (%) = id runST $ return ()
by tel 14y ago
No, not strictly true! ($) has a compiler hack to let it handle impredicativity.
import Control.Monad.ST
infix 0 %
(%) = id
runST $ return () -- :: ()
runST % return () -- Type error!
Couldn't match expected type `forall s. ST s a0'
with actual type `m0 a1'
In the return type of a call of `return'
In the second argument of `id', namely `(return ())'
In the expression: runST `id` (return ())