Iros
Loading...
Searching...
No Matches
monad_unit.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/function/monad/monad_concept.h
"
4
#include "
di/util/forward.h
"
5
6
namespace
di::function::monad
{
7
template
<
template
<
typename
...>
typename
M
,
typename
T
>
8
requires
(concepts::Monad<M> &&
requires
(
T
&&
value
) {
M
{ util::forward<T>(
value
) }; })
9
constexpr
auto
unit
(T&&
value
) ->
concepts::MonadInstance
auto
{
10
return
M { util::forward<T>(
value
) };
11
}
12
}
di::concepts::MonadInstance
Definition
monad_concept.h:45
forward.h
monad_concept.h
di::function::monad
Definition
monad_bind.h:6
di::function::monad::unit
constexpr auto unit(T &&value) -> concepts::MonadInstance auto
Definition
monad_unit.h:9
di::function::value
constexpr auto value
Definition
value.h:34
ttx::Key::M
@ M
Definition
key.h:22
ttx::Key::T
@ T
Definition
key.h:29
libs
di
include
di
function
monad
monad_unit.h
Generated by
1.13.0