3 Forward declares `boost::hana::concat`.
5 @copyright Louis Dionne 2013-2017
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_FWD_CONCAT_HPP
11 #define BOOST_HANA_FWD_CONCAT_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Combine two monadic structures together.
19 //! @ingroup group-MonadPlus
21 //! Given two monadic structures, `concat` combines them together and
22 //! returns a new monadic structure. The exact definition of `concat`
23 //! will depend on the exact model of MonadPlus at hand, but for
24 //! sequences it corresponds intuitively to simple concatenation.
26 //! Also note that combination is not required to be commutative.
27 //! In other words, there is no requirement that
29 //! concat(xs, ys) == concat(ys, xs)
31 //! and indeed it does not hold in general.
36 //! Given a `MonadPlus` `M`, the signature of `concat` is
37 //! @f$ \mathtt{concat} : M(T) \times M(T) \to M(T) @f$.
40 //! Two monadic structures to combine together.
45 //! @include example/concat.cpp
46 #ifdef BOOST_HANA_DOXYGEN_INVOKED
47 constexpr auto concat = [](auto&& xs, auto&& ys) {
48 return tag-dispatched;
51 template <typename M, typename = void>
52 struct concat_impl : concat_impl<M, when<true>> { };
55 template <typename Xs, typename Ys>
56 constexpr auto operator()(Xs&& xs, Ys&& ys) const;
59 constexpr concat_t concat{};
61 BOOST_HANA_NAMESPACE_END
63 #endif // !BOOST_HANA_FWD_CONCAT_HPP