Boost logo

Boost :

Subject: Re: [boost] [Hana] Informal review request
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2015-03-22 17:44:56

Louis Dionne <ldionne.2 <at>> writes:

> Dear Boost,
> Here is a non-exhaustive list of some issues that were raised during
> the informal review of Hana last week, along with an explanation of
> what I did or am doing to resolve them.
> [...]
> 4. It was suggested that `foldl` and `foldr` be renamed to something else.
> [...]

fold/reverse_fold aliases are now provided (see [1] for commit). Those
aliases follow the behavior of Fusion/MPL closely, with the extension
that it's possible to provide no initial state. Specifically,
    fold(sequence, state, f) == foldl(sequence, state, f)
    fold(sequence, f) == foldl1(sequence, f)

    reverse_fold(sequence, state, f) == foldr(sequence, state, flip(f))
    reverse_fold(sequence, f) == foldr1(sequence, flip(f))

> 7. In a different thread [6], it was suggested that the Logical concept
> should interact well with Lazy computations. [...]

Arbitrary Lazy values and computations can now be used as branches to
`eval_if` (see [2] for commit). More generally, anything that can be
`eval`uated can be used as branches to `eval_if`, which means

nullary lambdas:

        []{ return something; },

unary lambdas (useful for delaying instantiations, explained in the docs):

        [](auto delay) { return delay(f)(something); },

Lazy computations/values:

        lazy(f)(x, y, z),

More syntactic sugar will probably be added so that `eval_if` looks
prettier. Something along the lines of



would be nice. I got this functionality (and more) locally, but I
want to study all the possibilities before I check something in.

Louis Dionne


Boost list run by bdawes at, gregod at, cpdaniel at, john at