Constructor and Description |
---|
GeneralComonad() |
Modifier and Type | Method and Description |
---|---|
<T> T |
extract(Higher<CRE,T> ds)
Extract value embedded in datastructure
|
<T,R> Higher<CRE,R> |
map(java.util.function.Function<? super T,? extends R> fn,
Higher<CRE,T> ds)
Transform the supplied data structure using the supplied transformation function
|
<T> Higher<CRE,T> |
unit(T value)
Create a new instance of the core type (e.g.
|
public <T> Higher<CRE,T> unit(T value)
Pure
public <T,R> Higher<CRE,R> map(java.util.function.Function<? super T,? extends R> fn, Higher<CRE,T> ds)
Functor
ListX<Integer> listx = ListX.of(1,2,3);
ListType<Integer> mapped1 =Lists.functor().map(a->a+1, ListType.widen(listx));
mapped1.add(1);
ListX<Integer> listxMapped = mapped1.list();