A
- the Maybe value parameter typepublic final class Present<A> extends Object implements MonoidFactory<Semigroup<A>,Maybe<A>>
Monoid
instance formed by Maybe
<A>
and a semigroup over A
. The
application to two Maybe
values is presence-biased, such that for a given Maybe
x
and y
:
x
is present and y
is absent, the result is x
x
is absent, the result is y
x
and y
are present, the result is the application of the x and y values in
terms of the provided semigroup, wrapped in Maybe.just(A)
Modifier and Type | Method and Description |
---|---|
Monoid<Maybe<A>> |
checkedApply(Semigroup<A> aSemigroup)
Invoke this function with the given argument, potentially throwing any
Throwable . |
static <A> Present<A> |
present() |
static <A> Monoid<Maybe<A>> |
present(Semigroup<A> semigroup) |
static <A> Fn1<Maybe<A>,Maybe<A>> |
present(Semigroup<A> aSemigroup,
Maybe<A> x) |
static <A> Maybe<A> |
present(Semigroup<A> semigroup,
Maybe<A> x,
Maybe<A> y) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, apply
checkedApply
apply, checkedApply, compose, contraMap, diMapL, discardR, flip, fn3, fn3, fn3, uncurry, widen
curried, curry, fn2, fromBiFunction, toBiFunction
public Monoid<Maybe<A>> checkedApply(Semigroup<A> aSemigroup)
Fn2
Throwable
.checkedApply
in interface Fn1<Semigroup<A>,Fn1<Maybe<A>,Fn1<Maybe<A>,Maybe<A>>>>
checkedApply
in interface Fn2<Semigroup<A>,Maybe<A>,Fn1<Maybe<A>,Maybe<A>>>
checkedApply
in interface MonoidFactory<Semigroup<A>,Maybe<A>>
checkedApply
in interface SemigroupFactory<Semigroup<A>,Maybe<A>>
aSemigroup
- the argumentpublic static <A> Present<A> present()