diff options
| author | Ben Culkin <scorpress@gmail.com> | 2023-11-08 19:45:47 -0500 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2023-11-08 19:45:47 -0500 |
| commit | 81b2acf9e1294d28ac61d6915c6162dc0008a00c (patch) | |
| tree | 2b09770dfa23d8d238bce6c4ff267d422a03dffa /src/main/java/bjc | |
| parent | 0a3946e579a0c358a13aa1621fecc3e220cd6e38 (diff) | |
| parent | cbf4dda5cc09dc6d2c3c10329e7941923cc04e2e (diff) | |
Merge branch 'trunk' of git@ashardalon.com:esodata.git into trunk
Diffstat (limited to 'src/main/java/bjc')
| -rw-r--r-- | src/main/java/bjc/data/Contexts.java | 17 | ||||
| -rw-r--r-- | src/main/java/bjc/typeclasses/FunList.java | 17 |
2 files changed, 18 insertions, 16 deletions
diff --git a/src/main/java/bjc/data/Contexts.java b/src/main/java/bjc/data/Contexts.java index 699a450..7de1b5f 100644 --- a/src/main/java/bjc/data/Contexts.java +++ b/src/main/java/bjc/data/Contexts.java @@ -117,4 +117,21 @@ class ContextImpl implements Context { public Context getParent() { return parent; } + + @Override + public int hashCode() { + return Objects.hash(objects, parent); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ContextImpl other = (ContextImpl) obj; + return Objects.equals(objects, other.objects) && Objects.equals(parent, other.parent); + } }
\ No newline at end of file diff --git a/src/main/java/bjc/typeclasses/FunList.java b/src/main/java/bjc/typeclasses/FunList.java index 78717af..f849a16 100644 --- a/src/main/java/bjc/typeclasses/FunList.java +++ b/src/main/java/bjc/typeclasses/FunList.java @@ -4,22 +4,7 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Function; -/** - * Represent a FunList data structure which contains a B and zero or more As - * @author bjcul - * - * @param <A> The type for A - * @param <B> The type for B - */ -public sealed interface FunList<A, B> permits FunList.Done<A, B>, FunList.More<A, B> { - /** - * Represents a FunList that contains a B and zero As - * - * @author bjcul - * - * @param <A> Unused type - * @param <B> Type of the contained value - */ +public /*sealed*/ interface FunList<A, B> /*permits FunList.Done<A, B>, FunList.More<A, B>*/ { public final class Done<A, B> implements FunList<A, B> { private final B val; |
