diff --git a/cyclops/src/main/java/com/oath/cyclops/hkt/Higher.java b/cyclops/src/main/java/com/oath/cyclops/hkt/Higher.java deleted file mode 100644 index f97f9045a2..0000000000 --- a/cyclops/src/main/java/com/oath/cyclops/hkt/Higher.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.oath.cyclops.hkt; - -import io.kindedj.Hk; - -import java.util.function.BiFunction; -import java.util.function.Function; - - - -/** - * Higher Kinded Type - a core type (e.g. a List) and a data type of the elements within the List (e.g. Integers). - * - * - * @author johnmcclean - * - * @param Core type - * @param Data type of elements in Core Type - */ -public interface Higher extends Convert>, Hk { - - - default Higher applyHKT_(BiFunction,? extends Higher> biFn, T3 param ){ - return biFn.apply(param,this); - } - default Higher applyHKT(Function,? extends Higher> fn){ - return fn.apply(this); - } - - default Higher applyHKT(T3 param, BiFunction,? super T3,? extends Higher> biFn ){ - return biFn.apply(this,param); - } - - - -} diff --git a/cyclops/src/main/java/com/oath/cyclops/hkt/HigherDefault.java b/cyclops/src/main/java/com/oath/cyclops/hkt/HigherDefault.java new file mode 100644 index 0000000000..577f915a67 --- /dev/null +++ b/cyclops/src/main/java/com/oath/cyclops/hkt/HigherDefault.java @@ -0,0 +1,30 @@ +package cyclops.hkt + +import io.kindedj.Hk + +import java.util.function.BiFunction +import java.util.function.Function + + + +/** + * Higher Kinded Type - a core type (e.g. a List) and a data type of the elements within the List (e.g. Integers). + * + * + * @credits - johnmcclean + * + * @param Core type + * @param Data type of elements in Core Type + */ +public interface Higher extends Hk { + + + default = Higher applyHKT_(BiFunction>?) super T3? super Higher? extends Higher T3 param ){ + return apply(param,this) + } + default Higher applyHKT(Function>?) super Higher? extends Higher? + return apply(this) + + default Higher applyHKT(T3 param,super Higher,? super T3,? extends Higher{ + return apply(this,param) + }