Package at.jku.ssw.fp.sect06_3_4
Class Id<T>
- java.lang.Object
-
- at.jku.ssw.fp.sect06_3_4.Id<T>
-
- Type Parameters:
T
- the type of values
public class Id<T> extends Object
Class representing the identity monad.- Author:
- Herbert Praehofer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Id<R>
flatMap(Function<? super T,? extends Id<? extends R>> mapper)
Monad operator.static <T> Id<T>
of(T elem)
Creates an Id monad with a wrapped value.
-
-
-
Field Detail
-
elem
public final T elem
The wrapped value.
-
-
Constructor Detail
-
Id
private Id(T elem)
Constructor wrapping a value.- Parameters:
elem
- the wrapped value
-
-
Method Detail
-
of
public static <T> Id<T> of(T elem)
Creates an Id monad with a wrapped value.- Type Parameters:
T
- the type of the value- Parameters:
elem
- the wrapped value- Returns:
- the monad value with the wrapped value
-
-