summaryrefslogtreecommitdiff
path: root/src/main/java/bjc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/bjc')
-rw-r--r--src/main/java/bjc/data/Contexts.java17
-rw-r--r--src/main/java/bjc/typeclasses/FunList.java17
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;