already_monadic

Synopsis

template <class Expr>
struct already_monadic
{
  // unspecified
};

Description

It can be used to mark a subexpression of a make_monadic expression as already monadic and avoid it being transformed.

#include <mpllibs/metamonad/already_monadic.hpp>

Expression semantics

For any monad_tag tag, n > 0, f metafunction taking n arguments and t1, ..., tn classes

make_monadic<monad_tag, syntax<already_monadic<f<t1, ..., tn>>>>::type

is equivalent to

f<t1, ..., tn>::type

Example

MPLLIBS_METAFUNCTION(f, (N)) ((just<N>));
MPLLIBS_METAFUNCTION(maybe_divides, (A)(B)) ((just<divides<A, B>>));

make_monadic<
  maybe_tag,
  syntax<
    maybe_divides<already_monadic<f<int_<26>>>, already_monadic<f<int_<2>>>>
  >
>::type

[up]