ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
ldionne on gh-pages
Update benchmarks to 490dbf6 fo… (compare)
Is monadic_fold_left the best way to flatten something like this (an edge list)...
hana::tuple<
hana::pair<A, B>,
hana::pair<A, C>,
hana::pair<A, D>,
hana::pair<B, C>,
hana::pair<B, D>>
...into something like this (an adjacency list)?
hana::tuple<
hana::pair<A, hana::tuple<B, C, D>>,
hana::pair<B, hana::tuple<C, D>>>
#include <utility>
#include <type_traits>
#include <boost/hana.hpp>
namespace hana = boost::hana;
struct A{};
struct B{};
struct C{};
struct D{};
int main() {
auto grouped = hana::group(
hana::make_tuple(
std::pair<A, B>{},
std::pair<A, C>{},
std::pair<B, C>{},
std::pair<A, D>{},
std::pair<B, D>{}),
hana::comparing([](auto t){ return hana::type_c<decltype(t.first)>; }));
// print type as error message
decltype(grouped)::asdfasdfasdf();
}
iostream
, compile and run the program to see what T is. still a neat trick