no continuations
Derek Elkins
ddarius at hotpop.com
Tue Dec 30 18:12:03 EST 2003
On Tue, 30 Dec 2003 10:38:33 -0800 (PST)
Ben Rudiak-Gould <benrg at dark.darkweb.com> wrote:
> On Tue, 30 Dec 2003, Scott wrote:
> > Why does Haskell have no continuations?
> > (http://www.haskell.org/hawiki/CoMonad)
> > If continuations are incompatible with non-strict semantics, I'd
> > appreciate an explanation.
> Unrestricted call/cc seems to be incompatible with referential
> transparency in a very fundamental way, and Haskell is nothing without
> referential transparency. On the other hand, it doesn't cause any
> problems when the evaluation order is fixed by some monad, whence
> MonadCont.
Indeed, the simplest example is probably implementing exceptions with
call/cc.
Assuming a callCC function what does the following return,
callCC (\k -> k 1 + k 2)?
More information about the Haskell
mailing list