// Copyright Louis Dionne 2013-2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include namespace hana = boost::hana; template using eq = hana::test::ct_eq; int main() { ////////////////////////////////////////////////////////////////////////// // Setup for the laws below ////////////////////////////////////////////////////////////////////////// auto eq_tuples = hana::make_tuple( ::boost::make_tuple() , ::boost::make_tuple(eq<0>{}) , ::boost::make_tuple(eq<0>{}, eq<1>{}) ); auto eq_values = hana::make_tuple(eq<0>{}, eq<2>{}); auto eq_tuples_tuples = hana::make_tuple( ::boost::make_tuple() , ::boost::make_tuple( ::boost::make_tuple(eq<0>{})) , ::boost::make_tuple( ::boost::make_tuple(eq<0>{}), ::boost::make_tuple(eq<1>{}, eq<2>{})) , ::boost::make_tuple( ::boost::make_tuple(eq<0>{}), ::boost::make_tuple(eq<1>{}, eq<2>{}), ::boost::make_tuple(eq<3>{}, eq<4>{})) ); ////////////////////////////////////////////////////////////////////////// // Functor up to Monad ////////////////////////////////////////////////////////////////////////// hana::test::TestFunctor{eq_tuples, eq_values}; hana::test::TestApplicative{eq_tuples}; hana::test::TestMonad{eq_tuples, eq_tuples_tuples}; }