Class Present<A>
java.lang.Object
com.jnape.palatable.lambda.monoid.builtin.Present<A>
- Type Parameters:
A- the Maybe value parameter type
- All Implemented Interfaces:
Fn1<Semigroup<A>,,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>> Fn2<Semigroup<A>,,Maybe<A>, Fn1<Maybe<A>, Maybe<A>>> Fn3<Semigroup<A>,,Maybe<A>, Maybe<A>, Maybe<A>> MonoidFactory<Semigroup<A>,,Maybe<A>> SemigroupFactory<Semigroup<A>,,Maybe<A>> Applicative<Fn1<Maybe<A>,,Fn1<Maybe<A>, Maybe<A>>>, Fn1<Semigroup<A>, ?>> Cartesian<Semigroup<A>,,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>, Fn1<?, ?>> Cocartesian<Semigroup<A>,,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>, Fn1<?, ?>> Contravariant<Semigroup<A>,,Profunctor<?, Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>, Fn1<?, ?>>> Functor<Fn1<Maybe<A>,,Fn1<Maybe<A>, Maybe<A>>>, Fn1<Semigroup<A>, ?>> Profunctor<Semigroup<A>,,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>, Fn1<?, ?>> Monad<Fn1<Maybe<A>,,Fn1<Maybe<A>, Maybe<A>>>, Fn1<Semigroup<A>, ?>> MonadReader<Semigroup<A>,,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>, Fn1<Semigroup<A>, ?>> MonadRec<Fn1<Maybe<A>,,Fn1<Maybe<A>, Maybe<A>>>, Fn1<Semigroup<A>, ?>> MonadWriter<Semigroup<A>,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>, Fn1<Semigroup<A>, ?>>
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:
- if
xis present andyis absent, the result isx - if
xis absent, the result isy - if both
xandyare present, the result is the application of the x and y values in terms of the provided semigroup, wrapped inMaybe.just(A)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zipMethods inherited from interface com.jnape.palatable.lambda.functions.Fn2
toBiFunctionMethods inherited from interface com.jnape.palatable.lambda.functions.Fn3
apply, checkedApply, compose, contraMap, diMapL, discardR, flip, uncurry, widenMethods inherited from interface com.jnape.palatable.lambda.functions.specialized.MonoidFactory
apply, applyMethods inherited from interface com.jnape.palatable.lambda.functions.specialized.SemigroupFactory
checkedApply
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
Present
private Present()
-
-
Method Details
-
checkedApply
Description copied from interface:Fn2Invoke this function with the given argument, potentially throwing anyThrowable.- Specified by:
checkedApplyin interfaceFn1<Semigroup<A>,Fn1<Maybe<A>, Fn1<Maybe<A>, Maybe<A>>>> - Specified by:
checkedApplyin interfaceFn2<Semigroup<A>,Maybe<A>, Fn1<Maybe<A>, Maybe<A>>> - Specified by:
checkedApplyin interfaceMonoidFactory<Semigroup<A>,Maybe<A>> - Specified by:
checkedApplyin interfaceSemigroupFactory<Semigroup<A>,Maybe<A>> - Parameters:
aSemigroup- the argument- Returns:
- the result of the function application
-
present
-
present
-
present
-
present
-