mpc
Haskell-like feature supports in C++
mpc::cpo Namespace Reference

Customization point objects are here. More...

Variables

template<class F >
constexpr detail::empty_op< F > empty {}
 empty :: f a More...
 
constexpr partial< detail::combine_opcombine {}
 combine :: f a -> f a -> f a More...
 
template<class F >
constexpr partial< detail::pure_op< F > > pure {}
 pure :: a -> f a More...
 
constexpr partial< detail::seq_apply_opseq_apply {}
 seq_apply :: f (a -> b) -> f a -> f b More...
 
constexpr partial< detail::liftA2_opliftA2 {}
 liftA2 :: (a -> b -> c) -> f a -> f b -> f c More...
 
constexpr partial< detail::discard2nd_opdiscard2nd {}
 discard2nd :: f a -> f b -> f a More...
 
constexpr partial< detail::discard1st_opdiscard1st {}
 discard1st :: f a -> f b -> f b More...
 
template<std::size_t N>
constexpr partial< detail::liftA_op< N > > liftA {}
 liftA :: Applicative f => (a -> b -> ... -> z) -> f a -> f b -> ... -> f z More...
 
constexpr partial< detail::fmap_opfmap {}
 fmap :: (a -> b) -> f a -> f b More...
 
constexpr partial< detail::replace2nd_opreplace2nd {}
 replace2nd :: a -> f b -> f a More...
 
constexpr auto replace1st = flip % mpc::replace2nd
 replace1st :: Functor f => f a -> b -> f b More...
 
constexpr partial< detail::bind_opbind {}
 bind :: forall a b. m a -> (a -> m b) -> m b More...
 
template<class M >
constexpr auto returns = mpc::pure<M>
 returns :: a -> m a More...
 
constexpr partial< detail::karrow_opkarrow {}
 karrow :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) More...
 
template<class ST >
constexpr partial< detail::state_op< ST > > state {}
 state :: (s -> (a, s)) -> m a
 
template<class ST >
constexpr detail::gets_op< ST > gets {}
 gets :: m s
 
template<class ST >
constexpr partial< detail::put_op< ST > > put {}
 put :: s -> m ()
 
template<class ST >
constexpr partial< detail::modify_op< std::remove_cvref_t< ST > > > modify {}
 modify :: MonadState s m => (s -> s) -> m ()
 
template<class ST >
constexpr partial< detail::getss_op< std::remove_cvref_t< ST > > > getss {}
 getss :: MonadState s m => (s -> a) -> m a
 
template<class S >
constexpr partial< detail::make_State_op< S > > make_State {}
 
constexpr partial< detail::run_State_oprun_State {}
 
constexpr partial< detail::eval_State_opeval_State {}
 
constexpr partial< detail::exec_State_opexec_State {}
 
constexpr partial< detail::map_State_opmap_State {}
 
constexpr auto with_State = with_StateT
 
template<class S >
constexpr partial< detail::make_StateT_op< S > > make_StateT {}
 
constexpr partial< detail::run_StateT_oprun_StateT {}
 
constexpr partial< detail::eval_StateT_opeval_StateT {}
 
constexpr partial< detail::exec_StateT_opexec_StateT {}
 
constexpr partial< detail::map_StateT_opmap_StateT {}
 
constexpr partial< detail::with_StateT_opwith_StateT {}
 
template<class TR >
constexpr partial< detail::lift_op< TR > > lift {}
 lift :: (Monad m) => m a -> t m a
 
constexpr partial< detail::isalnum_opisalnum {}
 Partially applicable std::isalnum.
 
constexpr partial< detail::isalpha_opisalpha {}
 Partially applicable std::isalpha.
 
constexpr partial< detail::islower_opislower {}
 Partially applicable std::islower.
 
constexpr partial< detail::isupper_opisupper {}
 Partially applicable std::isupper.
 
constexpr partial< detail::isdigit_opisdigit {}
 Partially applicable std::isdigit.
 
constexpr partial< detail::isxdigit_opisxdigit {}
 Partially applicable std::isxdigit.
 
constexpr partial< detail::iscntrl_opiscntrl {}
 Partially applicable std::iscntrl.
 
constexpr partial< detail::isgraph_opisgraph {}
 Partially applicable std::isgraph.
 
constexpr partial< detail::isspace_opisspace {}
 Partially applicable std::isspace.
 
constexpr partial< detail::isblank_opisblank {}
 Partially applicable std::isblank.
 
constexpr partial< detail::isprint_opisprint {}
 Partially applicable std::isprint.
 
constexpr partial< detail::ispunct_opispunct {}
 Partially applicable std::ispunct.
 
constexpr partial< detail::make_Identity_opmake_Identity {}
 
constexpr partial< detail::run_Identity_oprun_Identity {}
 
constexpr partial< detail::cons_opcons
 
constexpr partial< detail::uncons_opuncons
 
constexpr partial< detail::append_opappend
 
constexpr partial< detail::foldr_opfoldr
 
constexpr partial< detail::sequence_opsequence
 
constexpr partial< detail::compose_opcompose
 Function composition.
 
constexpr partial< detail::constant_opconstant
 Returns a unary function always returning the first input.
 
constexpr partial< detail::flip_opflip
 Returns a binary function which flips the first and second argument.
 
constexpr partial< detail::_fst::get_op< 0 > > fst
 Returns the first element of the given tuple-like object.
 
constexpr partial< detail::_fst::get_op< 1 > > snd
 Returns the second element of the given tuple-like object.
 
constexpr partial< std::identity > identity {}
 Identity mapping.
 
constexpr partial< std::plus<> > plus
 Partially applicable std::plus<>.
 
constexpr partial< std::minus<> > minus
 Partially applicable std::minus<>.
 
constexpr partial< std::multiplies<> > multiplies
 Partially applicable std::multiplies<>.
 
constexpr partial< std::divides<> > divides
 Partially applicable std::divides<>.
 
constexpr partial< std::modulus<> > modulus
 Partially applicable std::modulus<>.
 
constexpr partial< std::negate<> > negate
 Partially applicable std::negate<>.
 
constexpr partial< std::ranges::equal_to > equal_to
 Partially applicable std::ranges::equal_to.
 
constexpr partial< std::ranges::not_equal_to > not_equal_to
 Partially applicable std::ranges::not_equal_to.
 
constexpr partial< std::ranges::greater > greater
 Partially applicable std::ranges::greater.
 
constexpr partial< std::ranges::less > less
 Partially applicable std::ranges::less.
 
constexpr partial< std::ranges::greater_equal > greater_equal
 Partially applicable std::ranges::greater_equal.
 
constexpr partial< std::ranges::less_equal > less_equal
 Partially applicable std::ranges::less_equal.
 
constexpr partial< std::logical_and<> > logical_and
 Partially applicable std::logical_and<>.
 
constexpr partial< std::logical_or<> > logical_or
 Partially applicable std::logical_or<>.
 
constexpr partial< std::logical_not<> > logical_not
 Partially applicable std::logical_not<>.
 
constexpr partial< std::bit_and<> > bit_and
 Partially applicable std::bit_and<>.
 
constexpr partial< std::bit_or<> > bit_or
 Partially applicable std::bit_or<>.
 
constexpr partial< std::bit_xor<> > bit_xor
 Partially applicable std::bit_xor<>.
 
constexpr partial< std::bit_not<> > bit_not
 Partially applicable std::bit_not<>.
 

Detailed Description

Customization point objects are here.

Variable Documentation

◆ bind

constexpr partial<detail::bind_op> mpc::cpo::bind {}
inlineconstexpr

bind :: forall a b. m a -> (a -> m b) -> m b

(>>=) in Haskell

◆ combine

constexpr partial<detail::combine_op> mpc::cpo::combine {}
inlineconstexpr

combine :: f a -> f a -> f a

(<|>) in Haskell

◆ discard1st

constexpr partial<detail::discard1st_op> mpc::cpo::discard1st {}
inlineconstexpr

discard1st :: f a -> f b -> f b

(*>) in Haskell

◆ discard2nd

constexpr partial<detail::discard2nd_op> mpc::cpo::discard2nd {}
inlineconstexpr

discard2nd :: f a -> f b -> f a

(<*) in Haskell

◆ empty

template<class F >
constexpr detail::empty_op<F> mpc::cpo::empty {}
inlineconstexpr

empty :: f a

Use operator* to access the value.

◆ fmap

constexpr partial<detail::fmap_op> mpc::cpo::fmap {}
inlineconstexpr

fmap :: (a -> b) -> f a -> f b

◆ karrow

constexpr partial<detail::karrow_op> mpc::cpo::karrow {}
inlineconstexpr

karrow :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)

(>=>) in Haskell

karrow f g x = f x `bind` g
constexpr partial< detail::bind_op > bind
bind :: forall a b. m a -> (a -> m b) -> m b
Definition: monad.hpp:45
constexpr partial< detail::karrow_op > karrow
karrow :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)
Definition: monad.hpp:146

◆ liftA

template<std::size_t N>
constexpr partial<detail::liftA_op<N> > mpc::cpo::liftA {}
inlineconstexpr

liftA :: Applicative f => (a -> b -> ... -> z) -> f a -> f b -> ... -> f z

liftA f a b ... z = f `fmap` a `seq_apply` b `seq_apply` ... `seq_apply` z
constexpr partial< detail::liftA_op< N > > liftA
liftA :: Applicative f => (a -> b -> ... -> z) -> f a -> f b -> ... -> f z
Definition: applicative.hpp:249
constexpr partial< detail::fmap_op > fmap
fmap :: (a -> b) -> f a -> f b
Definition: functor.hpp:50
constexpr partial< detail::seq_apply_op > seq_apply
seq_apply :: f (a -> b) -> f a -> f b
Definition: applicative.hpp:99

◆ liftA2

constexpr partial<detail::liftA2_op> mpc::cpo::liftA2 {}
inlineconstexpr

liftA2 :: (a -> b -> c) -> f a -> f b -> f c

◆ pure

template<class F >
constexpr partial<detail::pure_op<F> > mpc::cpo::pure {}
inlineconstexpr

pure :: a -> f a

◆ replace1st

constexpr auto mpc::cpo::replace1st = flip % mpc::replace2nd
inlineconstexpr

replace1st :: Functor f => f a -> b -> f b

($>) in Haskell

constexpr partial< detail::replace2nd_op > replace2nd
replace2nd :: a -> f b -> f a
Definition: functor.hpp:53
constexpr partial< detail::flip_op > flip
Returns a binary function which flips the first and second argument.
Definition: flip.hpp:32
constexpr auto replace1st
replace1st :: Functor f => f a -> b -> f b
Definition: functor.hpp:78

◆ replace2nd

constexpr partial<detail::replace2nd_op> mpc::cpo::replace2nd {}
inlineconstexpr

replace2nd :: a -> f b -> f a

(<$) in Haskell

◆ returns

template<class M >
constexpr auto mpc::cpo::returns = mpc::pure<M>
inlineconstexpr

returns :: a -> m a

constexpr auto returns
returns :: a -> m a
Definition: monad.hpp:143
constexpr partial< detail::pure_op< F > > pure
pure :: a -> f a
Definition: applicative.hpp:96

◆ seq_apply

constexpr partial<detail::seq_apply_op> mpc::cpo::seq_apply {}
inlineconstexpr

seq_apply :: f (a -> b) -> f a -> f b

(<*>) in Haskell