1 #ifndef META_HS_SEMANTIC_HPP
2 #define META_HS_SEMANTIC_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
12 #include <boost/mpl/if.hpp>
13 #include <boost/mpl/apply_wrap.hpp>
14 #include <boost/mpl/front.hpp>
15 #include <boost/mpl/back.hpp>
16 #include <boost/mpl/at.hpp>
17 #include <boost/mpl/pair.hpp>
26 struct apply : ast::ref<Name> {};
34 struct apply : ast::value<V> {};
41 template <class F, class ArgName>
42 struct apply : ast::lambda<F, ArgName> {};
47 typedef application type;
49 template <class F, class Arg>
50 struct apply : ast::application<F, Arg> {};
56 template <class C, class T, class F>
57 struct lazy_if : boost::mpl::if_<typename C::type, T, F> {};
63 boost::mpl::apply_wrap2<
65 typename boost::mpl::apply_wrap2<
67 typename boost::mpl::apply_wrap2<
69 ast::value<curry3<lazy_if> >,
70 typename boost::mpl::at_c<Seq, 0>::type
72 typename boost::mpl::at_c<Seq, 1>::type
74 typename boost::mpl::at_c<Seq, 2>::type
81 typedef binary_op type;
83 template <class Exp, class C>
85 boost::mpl::apply_wrap2<
87 typename boost::mpl::apply_wrap2<
89 typename boost::mpl::apply_wrap1<
91 typename boost::mpl::front<C>::type
95 typename boost::mpl::back<C>::type
107 typename boost::mpl::front<Seq>::type,
108 ast::top_bound<typename boost::mpl::back<Seq>::type>