|
Boost : |
Subject: [boost] Monad (was: Re: [Boost-users] [afio] Formal review of Boost.AFIO)
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-08-24 16:18:13
On 24 Aug 2015 at 18:59, Sam Kellett wrote:
> i've played with the idea in my head for the past half an hour and i think
> i would quite like boost::monad to be maybe a few customisation points:
> bind, return, fail, even >> and >>= (although i would imagine associativity
> and precedence would get in the way of the last two) that your own
> monadic-like classes could specialise and then use as first class monads.
> this is maybe getting a bit off topic now so i'll stop.
Monad has all those items you mention. See
https://ned14.github.io/boost.monad/singletonboost_1_1monad_1_1basic__
monad.html under the section "Functional programming extensions
(optional)".
You also get to customise them to your heart's content via the policy
class infrastructure. After all, basic_future<> which subclasses
basic_monad<> implements binds as continuations.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk