[Haskell-cafe] Re: ANNOUNCE: GotoT-transformers version 1.0

Antoine Latter aslatter at gmail.com
Thu Sep 9 00:24:12 EDT 2010


On Wed, Sep 8, 2010 at 9:43 PM, Gregory Crosswhite
<gcross at phys.washington.edu> wrote:
>
> Of course, if someone can prove to me that I am wrong and that GotoT
> semantics can be implemented with continuations, then I would welcome
> this information.  :-)
>

Here's an implementation of GotoT with double-continuations:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29823

I also have a sketch of me trying to use a single-continuation, but I
was defeated:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=29824

The idea is that on 'goto', we throw away the passed down continuation
in favor of an alternate return. The double-continuation approach is a
bit overkill since we don't have the equivalent of 'catch', to add
local scope to an alternate return.

My single continuation approach has two type-check errors I haven't
been able to understand yet, but hopefully you can see what I was
going for.

Antoine


More information about the Haskell-Cafe mailing list