boostorg / hana

Your standard library for metaprogramming
http://boostorg.github.io/hana
Boost Software License 1.0
1.69k stars 215 forks source link

Please document hana::transform side effect ordering #448

Open dcolascione opened 5 years ago

dcolascione commented 5 years ago

GCC appears to evaluate transform function calls out of order, which I think it's allowed to do because function argument evaluation order is undefined. Hana should explicitly document the lack of ordering guarantees in transform.

ricejasonf commented 5 years ago

It is documented in the manual here: http://boostorg.github.io/hana/index.html#tutorial-algorithms-effects

The issue with documenting it for hana::transform itself is that each data-type can have it's own implementation that behaves differently. I'm guessing the one you are considering is for any hana::Sequence.

Take a look at the algorithms for hana::Monad.