33 #include <boost/optional.hpp> 39 template<
typename Applicative>
42 template<
typename AF,
typename AV>
45 template<
template<
typename...>
class Applicative,
typename... Args,
typename T>
51 template<
typename Applicative,
typename T>
57 template<
typename AF,
typename AV>
63 template<
typename AF,
typename AV>
64 auto operator* (
const AF& af,
const AV& av) -> decltype (
GSL (af, av))
79 struct GSLResult<
boost::optional<V>>
81 using Type_t = boost::optional<std::result_of_t<T (const V&)>>;
85 static boost::optional<U>
Pure (
const U& v)
109 struct GSLResult<
std::optional<V>>
111 using Type_t = std::optional<std::result_of_t<T (const V&)>>;
115 static std::optional<U>
Pure (
const U& v)
120 template<
typename AV>
126 return { (*f) (*v) };
std::optional< T > Type_t
static GSLResult_t< Type_t, AV > GSL(const Type_t &f, const AV &v)
std::optional< std::result_of_t< T(const V &)> > Type_t
static boost::optional< U > Pure(const U &v)
boost::optional< std::result_of_t< T(const V &)> > Type_t
constexpr detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, detail::MemberPtrs< Ptr > > f
auto operator*(const AF &af, const AV &av) -> decltype(GSL(af, av))
typename InstanceApplicative< AF >::template GSLResult< AV >::Type_t GSLResult_t
static GSLResult_t< Type_t, AV > GSL(const Type_t &f, const AV &v)
auto Pure(const T &v) -> decltype(InstanceApplicative< Applicative >::Pure(v))
boost::optional< T > Type_t
static std::optional< U > Pure(const U &v)
GSLResult_t< AF, AV > GSL(const AF &af, const AV &av)