mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +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;
|
||||
|
||||
import com.dfsek.terra.api.util.generic.kinds.K;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.dfsek.terra.api.util.generic;
|
||||
|
||||
import com.dfsek.terra.api.util.generic.kinds.K;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
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>{
|
||||
<T1, M1 extends K<M1, T1>> Monoid<T1, M1> identity();
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
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>> {
|
||||
Semigroup<T, S> multiply(S t);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.dfsek.terra.api.util.generic;
|
||||
package com.dfsek.terra.api.util.generic.kinds;
|
||||
|
||||
/**
|
||||
* 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