Defined in Call signatures Return value A monadic type of the same kind Examples struct Error final std string what fn expected<int Error> ex 42 auto value ex | fn filter auto &&i return i > 42 Filter out values less than 42 auto return Error Less than 42 Return error if predicate fails REQUIRE value value 42 The resulting value is because the filter predicate returns for as it is not less than 42 true 42 42 struct Error final std string what fn expected<int Error> ex 12 auto value ex | fn filter auto &&i return i > 42 auto return Error Less than 42 REQUIRE value error what Less than 42 The error is set to because the predicate returns for since it s less than Less than 42 false 12 42 Filter the value of the monadic type using a predicate and an error handler When used on fn expected this operation takes both a predicate and an error handler However when used on fn optional this operation only takes a predicate Use through the fn filter nielbloid Filter the value of the monadic type using a predicate and an error handler return A functor that will filter the value of the monadic type pred auto && The predicate to filter the value takes the value by const reference and returns bool on_err auto && The error handler takes the value by const reference and returns the error type Filter the value of the monadic type using a predicate and an error handler return A functor that will filter the value of the monadic type pred auto && The predicate to filter the value takes the value by const reference and returns bool on_err auto && The error handler takes the value by const reference and returns the error type