Package com.jnape.palatable.lambda.adt
Class Maybe.Nothing<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.adt.Maybe<A>
-
- com.jnape.palatable.lambda.adt.Maybe.Nothing<A>
-
- All Implemented Interfaces:
CoProduct2<Unit,A,Maybe<A>>
,Applicative<A,Maybe<?>>
,Functor<A,Maybe<?>>
,Monad<A,Maybe<?>>
,MonadError<Unit,A,Maybe<?>>
,MonadRec<A,Maybe<?>>
,Traversable<A,Maybe<?>>
private static final class Maybe.Nothing<A> extends Maybe<A>
-
-
Field Summary
Fields Modifier and Type Field Description private static Maybe.Nothing<?>
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
Nothing()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
match(Fn1<? super Unit,? extends R> aFn, Fn1<? super A,? extends R> bFn)
Type-safe convergence requiring a match against all potential types.java.lang.String
toString()
-
Methods inherited from class com.jnape.palatable.lambda.adt.Maybe
catchError, discardL, discardR, diverge, filter, flatMap, fmap, fromEither, fromOptional, invert, just, lazyZip, maybe, nothing, orElse, orElseGet, orElseThrow, peek, project, pure, pureMaybe, throwError, toEither, toOptional, trampolineM, traverse, zip
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.adt.coproduct.CoProduct2
embed, projectA, projectB
-
-
-
-
Field Detail
-
INSTANCE
private static final Maybe.Nothing<?> INSTANCE
-
-
Method Detail
-
match
public <R> R match(Fn1<? super Unit,? extends R> aFn, Fn1<? super A,? extends R> bFn)
Description copied from interface:CoProduct2
Type-safe convergence requiring a match against all potential types.- Type Parameters:
R
- result type- Parameters:
aFn
- morphismA -> R
bFn
- morphismB -> R
- Returns:
- the result of applying the appropriate morphism to this coproduct's unwrapped value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-