diff options
| author | Ben Culkin <scorpress@gmail.com> | 2022-09-24 12:35:20 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2022-09-24 12:35:20 -0400 |
| commit | 2d5c3288134f19088941c980e852521e9838db56 (patch) | |
| tree | f2b0048ec5c8fbc438979191e7789ae29287566d /src/main/java/bjc/funcdata/theory | |
| parent | f8643f98c9a091cd9b56fc9468197ae58df0364b (diff) | |
Various changes
Diffstat (limited to 'src/main/java/bjc/funcdata/theory')
| -rw-r--r-- | src/main/java/bjc/funcdata/theory/Category.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/bjc/funcdata/theory/Category.java b/src/main/java/bjc/funcdata/theory/Category.java new file mode 100644 index 0000000..730465d --- /dev/null +++ b/src/main/java/bjc/funcdata/theory/Category.java @@ -0,0 +1,28 @@ +package bjc.funcdata.theory; + +import java.util.Set; +import java.util.function.Function; + +import bjc.data.Pair; +import bjc.esodata.PairMap; + +// NOTE: haskell uses Category cat: ... where the parameter is the arrow type +public interface Category<Element, Arrow> { + Arrow identity(Element elem); + Arrow compose(Arrow left, Arrow right); +} +// Java objects would form a category as Category<Class<?>, Function<?, ?>> + +class FuncCategory implements Category<Class<?>, Function<?, ?>> { + @Override + public Function<?, ?> identity(Class<?> elem) { + return (vl) -> vl; + } + + @Override + public Function<?, ?> compose(Function<?, ?> left, Function<?, ?> right) { + // right.compose((Function<? super V, ?>) left); + return null; + } + +}
\ No newline at end of file |
