[Haskell-cafe] Really Simple explanation of Continuations Needed

Yves Parès limestrael at gmail.com
Sat Oct 1 12:55:14 CEST 2011


Having worked with the operational-package, I only can recommend it. In fact
I was trying to do the same thing you are now.
The only thing is that operational needs the use of GADTs, which come as an
extension, but still are a useful and heavily used feature.

BTW Heinrich, the

evalState (sequence . repeat . State $ \s -> (s,s+1)) 0

at the end doesn't work anymore. It should be replaced by :
evalState (sequence . repeat . StateT $ \s -> Identity (s,s+1)) 0


2011/10/1 Mark Spezzano <mark.spezzano at chariot.net.au>

> Hi Heinrich,
>
> I'm really looking to use the Cont monad itself--but the link you gave me
> is also helpful, so thank you.
>
> If anyone else has words of wisdom to add to this thread please feel free
> to pitch in.
>
> Thanks,
>
> Mark
>
> On 01/10/2011, at 5:08 PM, Heinrich Apfelmus wrote:
>
> > Mark Spezzano wrote:
> >> Can someone please give me a _lucid_ and  _simple_ explanation of
> >> exactly how continuations can be used in Haskell?
> >> I've already had a look at most of the tutorials and explanations on
> >> the web, but I'm still confused. Continuations and CPS have me
> >> baffled. (I have most of the Haskell textbooks and even these are
> >> sketchy on Continuations)
> >> I don't understand the notion of the Cont monad and how it can be
> >> used for multitasking, backtracking and interrupting computations. I
> >> understand that functions  take in a (continuation) function that
> >> represents the work remaining to do, but all of the explanations on
> >> the web and in technical papers seems to trip over themselves in
> >> explaining the fundamentals to a CPS-newbie.
> >
> > If you just want to implement multitasking, backtracking or interrupting
> computations, without continuations, I recommend my "Operational Monad
> Tutorial"
> >
> >  http://apfelmus.nfshost.com/articles/operational-monad.html
> >
> > The link to the Cont monad is explained at the very end.
> >
> >
> > Best regards,
> > Heinrich Apfelmus
> >
> > --
> > http://apfelmus.nfshost.com
> >
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> >
> >
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111001/a65059bb/attachment.htm>


More information about the Haskell-Cafe mailing list