Class Absent<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.semigroup.builtin.Absent<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>>
,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>,?>>
public final class Absent<A> extends java.lang.Object implements SemigroupFactory<Semigroup<A>,Maybe<A>>
ASemigroup
instance formed by
and a semigroup overMaybe
<A>A
. The application to twoMaybe
values is absence-biased, such that for a givenMaybe
x
andy
:- if
x
is absent, the result isx
- if
x
is present andy
is absent, the result isy
- if both
x
andy
are present, the result is the application of the x and y values in terms of the provided semigroup, wrapped inMaybe.just(A)
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Absent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A> Absent<A>
absent()
static <A> Semigroup<Maybe<A>>
absent(Semigroup<A> aSemigroup)
static <A> Fn1<Maybe<A>,Maybe<A>>
absent(Semigroup<A> aSemigroup, Maybe<A> x)
static <A> Maybe<A>
absent(Semigroup<A> semigroup, Maybe<A> x, Maybe<A> y)
Semigroup<Maybe<A>>
checkedApply(Semigroup<A> aSemigroup)
Invoke this function with the given argument, potentially throwing anyThrowable
.private static <A> Semigroup<Maybe<A>>
shortCircuitSemigroup(Semigroup<A> aSemigroup)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods 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, zip
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn2
toBiFunction
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn3
apply, apply, checkedApply, compose, contraMap, diMapL, discardR, flip, uncurry, widen
-
Methods inherited from interface com.jnape.palatable.lambda.functions.specialized.SemigroupFactory
apply, checkedApply
-
-
-
-
Field Detail
-
INSTANCE
private static final Absent<?> INSTANCE
-
-
Method Detail
-
checkedApply
public Semigroup<Maybe<A>> checkedApply(Semigroup<A> aSemigroup)
Description copied from interface:Fn2
Invoke this function with the given argument, potentially throwing anyThrowable
.- Specified by:
checkedApply
in interfaceFn1<Semigroup<A>,Fn1<Maybe<A>,Fn1<Maybe<A>,Maybe<A>>>>
- Specified by:
checkedApply
in interfaceFn2<Semigroup<A>,Maybe<A>,Fn1<Maybe<A>,Maybe<A>>>
- Specified by:
checkedApply
in interfaceSemigroupFactory<Semigroup<A>,Maybe<A>>
- Parameters:
aSemigroup
- the argument- Returns:
- the result of the function application
-
absent
public static <A> Absent<A> absent()
-
-