[Haskell-cafe] typesafe non-local returns in the IO monad

John Meacham john at repetae.net
Tue Feb 21 19:55:52 EST 2006


On Tue, Feb 21, 2006 at 01:07:51PM -0000, Simon Peyton-Jones wrote:
> I'm not sure this works. Consider this
> 
> 	newContinuation (\k -> return (callContinuation k)) ...
> 
> The partial application (callContinuation k) has no 's' in its type, and so can go anywhere.

Ah, you are right. silly me, I thought I had come up with something
clever.. I don't see any good way to fix this in the IO monad proper off
the top of my head.. I think I will still provide the primitives in jhc
for now but put a big caveat in the docs since they might still be
useful to use internally in some safe library (and you can already shoot
yourself in the IO monad).

but I am much less happy about them.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell-Cafe mailing list