104 template<
typename T,
typename F>
153 template<
typename T,
typename F>
179 template<
typename T,
typename F>
225 if constexpr (std::is_same_v<FmapResult_t<F>, std::optional<Void>>)
231 return { std::invoke (f, *
t) };
235 template<
typename L,
typename R>
typename WrapVoidResult< T >::Type WrapVoidResult_t
constexpr bool IsFunctorImpl(int, typename InstanceFunctor< T >::UndefinedTag *=nullptr)
Container< T > Filter(const Container< T > &c, F f)
typename InstanceFunctor< T >::template FmapResult_t< F > FmapResult_t
The result type of the contents of the functor T mapped by function F.
constexpr bool IsFunctor()
Checks whether the given type has a Functor instance for it.
FmapResult_t< T, F > Fmap(const T &functor, const F &function)
Apply the function f to the elements in functor.
auto operator*(const AF &af, const AV &av) -> decltype(GSL(af, av))
static FmapResult_t< F > Apply(const Either< L, R > &either, const F &f)
std::optional< detail::WrapVoidResult_t< std::decay_t< std::result_of_t< F(T)> > > > FmapResult_t
static FmapResult_t< F > Apply(const std::optional< T > &t, const F &f)
The Functor class is used for types that can be mapped over.
static FmapResult_t< F > Apply(const T &functor, const F &function)
Applies the function to the each of the elements inside the functor.
A proper void type, akin to unit (or ()) type in functional languages.