[Haskell-cafe] The use of continuation monad in C++

Bartosz Milewski bartosz at fpcomplete.com
Fri Jun 22 02:40:29 CEST 2012

It's an interesting approach. Your Then constructor maps to my Bind object 
more naturally than >>= does. 

The main reason for using objects rather than functions (closures) in C++ 
is that the compiler may be able to optimize/inline more code. Closures are 
not first class citizens in C++ -- they cannot be returned from functions 
or stored in variables without being converted to clunky std::function.

BTW, I'm studying your reactive banana library trying to learn more about 


On Thursday, June 21, 2012 9:21:34 AM UTC-7, Heinrich Apfelmus wrote:
> Bartosz Milewski wrote: 
> > I published a blog for C++ programmers about the advantages of using the 
> > continuation monad in dealing with asynchronous API, concurrency, and 
> > parallelism. I explained the concepts in Haskell and the translated them 
> > into C++. 
> > http://fpcomplete.com/asynchronous-api-in-c-and-the-continuation-monad/ 
> I always found the continuation monad to be hard to understand. An 
> easier yet equivalent approach is presented in my "Operational Monad 
> Tutorial" [1]. 
>    [1]: http://themonadreader.wordpress.com/2010/01/26/issue-15/ 
>    [2]: http://www.haskell.org/haskellwiki/Operational 
> 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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120621/731d1f06/attachment-0001.htm>

More information about the Haskell-Cafe mailing list