]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/ext/boost/tuple/monad_plus.cpp
1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
5 #include <boost/hana/ext/boost/tuple.hpp>
7 #include <boost/hana/bool.hpp>
8 #include <boost/hana/equal.hpp>
9 #include <boost/hana/functional/always.hpp>
10 #include <boost/hana/tuple.hpp>
12 #include <laws/base.hpp>
13 #include <laws/monad_plus.hpp>
15 #include <boost/tuple/tuple.hpp>
16 namespace hana
= boost::hana
;
20 using eq
= hana::test::ct_eq
<i
>;
23 //////////////////////////////////////////////////////////////////////////
24 // Setup for the laws below
25 //////////////////////////////////////////////////////////////////////////
26 auto eq_tuples
= hana::make_tuple(
27 ::boost::make_tuple(eq
<0>{})
28 , ::boost::make_tuple(eq
<0>{}, eq
<1>{})
29 , ::boost::make_tuple(eq
<0>{}, eq
<1>{}, eq
<2>{})
32 auto eq_values
= hana::make_tuple(eq
<0>{}, eq
<1>{}, eq
<2>{});
33 auto predicates
= hana::make_tuple(
34 hana::equal
.to(eq
<0>{}), hana::equal
.to(eq
<1>{}), hana::equal
.to(eq
<2>{}),
35 hana::always(hana::false_c
), hana::always(hana::true_c
)
38 //////////////////////////////////////////////////////////////////////////
40 //////////////////////////////////////////////////////////////////////////
41 hana::test::TestMonadPlus
<hana::ext::boost::tuple_tag
>{eq_tuples
, predicates
, eq_values
};