These are chat archives for boostorg/hana

24th
Feb 2016
Jason Rice
@ricejasonf
Feb 24 2016 20:06
#include<boost/hana.hpp>
#include<boost/hana/experimental/types.hpp>

namespace hana = boost::hana;
namespace hanax = boost::hana::experimental;

int main() {
  {
    constexpr auto xs = hanax::types<
      hana::int_<1>,
      hana::int_<2>,
      hana::int_<3>
    >{};

    BOOST_HANA_CONSTANT_ASSERT(
        hana::equal(xs, hanax::make_types(
            hana::int_c<1>,
            hana::int_c<2>,
            hana::int_c<3>
        ))
    );

    BOOST_HANA_CONSTANT_ASSERT(
        hana::equal(xs, hanax::make_types(
            hana::type_c<hana::int_<1>>,
            hana::type_c<hana::int_<2>>,
            hana::type_c<hana::int_<3>>
        ))
    );

    BOOST_HANA_CONSTANT_ASSERT(
        hana::equal(
            hanax::make_types(xs, xs, xs),
            hanax::make_types(
                hanax::make_types(
                    hana::type_c<hana::int_<1>>,
                    hana::type_c<hana::int_<2>>,
                    hana::type_c<hana::int_<3>>
                ),
                hanax::make_types(
                    hana::int_c<1>,
                    hana::int_c<2>,
                    hana::int_c<3>
                ),
                hanax::make_types(
                    hana::int_c<1>,
                    hana::int_c<2>,
                    hana::int_c<3>
                )
            )
        )
    );
  }
}
:grin:
sorry.. maybe i should have gisted that
If I accidentally call hana::make_types it says the only candidate function takes a single argument which is really, really weird considering there is no hana::make_types
flatten doesn't work yet because it unpacks as type_impl<types<T...>>
Jason Rice
@ricejasonf
Feb 24 2016 22:37
ricejasonf/hana@8cc5f32
Louis Dionne
@ldionne
Feb 24 2016 23:57
Actually, if you think of it, I don’t think it makes sense for hana::experimental::types to be a Monad, since it’s not possible for it to contain another hana::experimental::types.
For some Monad M, flatten needs to havea signature M(M(T)) -> M(T), which does not make sense for experimental::types since M(M(T)) does not exist.