mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-21 08:11:06 +00:00
Add 2-argument higher-order type and move kinds to their own package
I don't think that we will have higher-order types with more than 2 parameters, so I only made K and K2
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package com.dfsek.terra.api.util.generic;
|
package com.dfsek.terra.api.util.generic;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.generic.kinds.K;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.dfsek.terra.api.util.generic;
|
package com.dfsek.terra.api.util.generic;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.generic.kinds.K;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.dfsek.terra.api.util.generic;
|
package com.dfsek.terra.api.util.generic;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.generic.kinds.K;
|
||||||
|
|
||||||
|
|
||||||
public interface Monoid<T, M extends K<M, T>> extends Semigroup<T, M>{
|
public interface Monoid<T, M extends K<M, T>> extends Semigroup<T, M>{
|
||||||
<T1, M1 extends K<M1, T1>> Monoid<T1, M1> identity();
|
<T1, M1 extends K<M1, T1>> Monoid<T1, M1> identity();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.dfsek.terra.api.util.generic;
|
package com.dfsek.terra.api.util.generic;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.generic.kinds.K;
|
||||||
|
|
||||||
|
|
||||||
public interface Semigroup<T, S extends K<S, T>> {
|
public interface Semigroup<T, S extends K<S, T>> {
|
||||||
Semigroup<T, S> multiply(S t);
|
Semigroup<T, S> multiply(S t);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.dfsek.terra.api.util.generic;
|
package com.dfsek.terra.api.util.generic.kinds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kind
|
* Kind
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.dfsek.terra.api.util.generic.kinds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kind of the type T<A, B>
|
||||||
|
*/
|
||||||
|
public interface K2<T, A, B> {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user