diff options
| author | Ben Culkin <scorpress@gmail.com> | 2022-09-16 18:35:06 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2022-09-16 18:35:06 -0400 |
| commit | bbefaad1de12cea3210593c17db6e12334eb7903 (patch) | |
| tree | a7e4165b51ecf319eb41063f8e7f9b10d820020e | |
| parent | e43dc808d7304b90327c1def4452f6e3d9946983 (diff) | |
Adjust a few things
28 files changed, 484 insertions, 135 deletions
diff --git a/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java b/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java index 9be96be..258b17d 100644 --- a/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java +++ b/src/example/java/bjc/funcdata/bst/BinarySearchTreeExample.java @@ -64,11 +64,9 @@ public class BinarySearchTreeExample { * Unused CLI args */ public static void main(final String[] args) { - final Scanner input = new Scanner(System.in); - - runExample(input, System.out); - - input.close(); + try (Scanner input = new Scanner(System.in)) { + runExample(input, System.out); + } } private static void runExample(final Scanner input, OutputStream outpt) { diff --git a/src/main/java/bjc/data/Contexts.java b/src/main/java/bjc/data/Contexts.java index b028ad1..f587fe6 100644 --- a/src/main/java/bjc/data/Contexts.java +++ b/src/main/java/bjc/data/Contexts.java @@ -37,67 +37,67 @@ public class Contexts { public static Context create(Context parent) { return new ContextImpl(parent); } +} - private static class NullContextImpl implements Context { - @Override - public Context getParent() { - return this; - } +class NullContextImpl implements Context { + @Override + public Context getParent() { + return this; + } - @Override - public void register(String name, Object o) { - throw new UnsupportedOperationException(); - } + @Override + public void register(String name, Object o) { + throw new UnsupportedOperationException(); + } - @Override - public Object get(String name) { - throw new NoSuchElementException(); - } - - @Override - public <T> T get(Class<T> contract) { - throw new NoSuchElementException(); - } + @Override + public Object get(String name) { + throw new NoSuchElementException(); } + + @Override + public <T> T get(Class<T> contract) { + throw new NoSuchElementException(); + } +} - private static class ContextImpl implements Context { +class ContextImpl implements Context { - private final Context parent; + private final Context parent; - private final Map<String, Object> objects; + private final Map<String, Object> objects; - public ContextImpl(Context parent) { - this.parent = parent; - this.objects = new HashMap<>(); - } + public ContextImpl(Context parent) { + this.parent = parent; + this.objects = new HashMap<>(); + } - @Override - public void register(String name, Object o) { - objects.put(name, o); - } + @Override + public void register(String name, Object o) { + objects.put(name, o); + } - @Override - public Object get(String name) { - if (objects.containsKey(name)) { - return objects.get(name); - } - return parent.get(name); + @Override + public Object get(String name) { + if (objects.containsKey(name)) { + return objects.get(name); } + return parent.get(name); + } - @SuppressWarnings("unchecked") - @Override - public <T> T get(Class<T> contract) { - for (Object o : objects.values()) { - if (contract.isInstance(o)) { - return (T) o; - } + @SuppressWarnings("unchecked") + @Override + public <T> T get(Class<T> contract) { + for (Object o : objects.values()) { + if (contract.isInstance(o)) { + return (T) o; } - return parent.get(contract); } + return parent.get(contract); + } - @Override - public Context getParent() { - return parent; - } + @Override + public Context getParent() { + return parent; } -} +}
\ No newline at end of file diff --git a/src/main/java/bjc/data/GeneratingIterator.java b/src/main/java/bjc/data/GeneratingIterator.java index f926833..8900b94 100644 --- a/src/main/java/bjc/data/GeneratingIterator.java +++ b/src/main/java/bjc/data/GeneratingIterator.java @@ -42,7 +42,7 @@ public class GeneratingIterator<E> implements Iterator<E> { @Override public boolean hasNext() { - return stpper.test(state); + return !stpper.test(state); } /* diff --git a/src/main/java/bjc/data/MarkListIterator.java b/src/main/java/bjc/data/MarkListIterator.java index 725b050..35baa28 100644 --- a/src/main/java/bjc/data/MarkListIterator.java +++ b/src/main/java/bjc/data/MarkListIterator.java @@ -34,6 +34,15 @@ public class MarkListIterator<E> implements ListIterator<E> { } /** + * Get the current element of the iterator. + * + * @return The current iterator of the element + */ + public E current() { + return cache.get(currIdx); + } + + /** * Create a new marking list iterator. * * @param backing The iterable to get the backing iterator from. diff --git a/src/main/java/bjc/data/Pair.java b/src/main/java/bjc/data/Pair.java index baf1894..1d4be5e 100644 --- a/src/main/java/bjc/data/Pair.java +++ b/src/main/java/bjc/data/Pair.java @@ -1,5 +1,8 @@ package bjc.data; +import java.util.Formattable; +import java.util.FormattableFlags; +import java.util.Formatter; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; @@ -18,7 +21,7 @@ import bjc.funcdata.theory.Bifunctor; * The type of the right side of the pair. * */ -public interface Pair<LeftType, RightType> extends Bifunctor<LeftType, RightType> { +public interface Pair<LeftType, RightType> extends Bifunctor<LeftType, RightType>, Formattable { /** * Bind a function across the values in this pair. * @@ -247,4 +250,13 @@ public interface Pair<LeftType, RightType> extends Bifunctor<LeftType, RightType public static <Left, Right> Pair<Left, Right> pair(Left left, Right right) { return new SimplePair<>(left, right); } + + @Override + default void formatTo(Formatter formatter, int flags, int width, int precision) { + if ((flags & FormattableFlags.ALTERNATE) != 0) { + formatter.format("(%s, %s)", getLeft(), getRight()); + } else { + formatter.format("Pair [l=%s, r=%s", getLeft(), getRight()); + } + } } diff --git a/src/main/java/bjc/esodata/AbbrevMap2.java b/src/main/java/bjc/esodata/AbbrevMap2.java index 259c963..341a28d 100644 --- a/src/main/java/bjc/esodata/AbbrevMap2.java +++ b/src/main/java/bjc/esodata/AbbrevMap2.java @@ -41,7 +41,7 @@ public class AbbrevMap2 { } // Generate all of the strings a given word could be abbreviated as - private List<String> genAbbrevs(String word) { + private static List<String> genAbbrevs(String word) { List<String> retList = new ArrayList<>(); int len = word.length(); diff --git a/src/main/java/bjc/esodata/AbbrevTree.java~ b/src/main/java/bjc/esodata/AbbrevTree.java~ deleted file mode 100644 index a391028..0000000 --- a/src/main/java/bjc/esodata/AbbrevTree.java~ +++ /dev/null @@ -1,75 +0,0 @@ -package bjc.esodata; - -import java.util.*; - -/** - * A labeled tree, where you can reference sub-nodes by their label as long as the reference is unambiguous. - * - * Inspired by the way that you can reference COBOL members by their name, as long as it is unambiguous. If it is ambiguous, you can instead use parent nodes to disambiguate. - * - * @param <Contained> The type of data contained in the nodes. - */ -public class AbbrevTree<Contained> { - /** Represents a single node in an AbbrevTree */ - public interface AbbrevNode<Contained> { - /** The label for the node. */ - public String getLabel(); - /** The data for the node. */ - public Contained getData(); - /** - * Add a child to this node. - * - * If a node already exists with the given label, it will be replaced. - * - * @param label The label for the child. - * @param contained The data contained in the child. - */ - public void addChild(String label, String contained); - /** - * Get a child, starting the search from this node. - * @param labels The label(s) to search for. If the label is ambiguous, provide additional ones to make it unambiguous. - */ - public AbbrevNode<Contained> getNode(String... labels); - } - - public Contained get(String... labels) { - return null; - } -} - -class AbbrevNode<Contained> { - private String label; - private Contained data; - - private List<AbbrevNode<Contained>> children; - private AbbrevTree<Contained> container; - - /** - * Create a new AbbrevNode with a label and contents. - * @param label The label for this node. - * @param data The data contained in the node. - * @param container The tree that contains the node. - */ - public AbbrevNode(String label, Contained data, AbbrevTree<Contained> container) { - this(container); - - this.label = label; - this.data = data; - } - - /** - * Get the label for this node. - * @return The label for this node. - */ - public String getLabel() { - return label; - } - - /** - * Get the data for this node. - * @return The data for this node. - */ - public Contained getData() { - return data; - } -} diff --git a/src/main/java/bjc/esodata/NestList.java b/src/main/java/bjc/esodata/NestList.java index eccaf9d..9d9149c 100644 --- a/src/main/java/bjc/esodata/NestList.java +++ b/src/main/java/bjc/esodata/NestList.java @@ -351,8 +351,7 @@ public class NestList<Element> extends AbstractList<Either<Element, NestList<Ele return backing.get(index); } - @SuppressWarnings("unlikely-arg-type") - @Override + @Override public boolean remove(Object o) { return backing.remove(o); } diff --git a/src/main/java/bjc/esodata/spool/Spool.java b/src/main/java/bjc/esodata/spool/Spool.java new file mode 100644 index 0000000..dbd2ce8 --- /dev/null +++ b/src/main/java/bjc/esodata/spool/Spool.java @@ -0,0 +1,5 @@ +package bjc.esodata.spool; + +public interface Spool<Contained> { + +} diff --git a/src/main/java/bjc/esodata/spool/Spooler.java b/src/main/java/bjc/esodata/spool/Spooler.java new file mode 100644 index 0000000..a222a25 --- /dev/null +++ b/src/main/java/bjc/esodata/spool/Spooler.java @@ -0,0 +1,5 @@ +package bjc.esodata.spool; + +public interface Spooler { + public <E> Spool<E> getSpool(); +} diff --git a/src/main/java/bjc/funcdata/FunctionalList.java b/src/main/java/bjc/funcdata/FunctionalList.java index 88f49c4..c9c3a9f 100644 --- a/src/main/java/bjc/funcdata/FunctionalList.java +++ b/src/main/java/bjc/funcdata/FunctionalList.java @@ -6,6 +6,7 @@ import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; +import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Consumer; @@ -487,4 +488,21 @@ public class FunctionalList<E> implements Cloneable, ListEx<E> { return sb.toString(); } + + @Override + public int hashCode() { + return Objects.hash(wrapped); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + FunctionalList<?> other = (FunctionalList<?>) obj; + return Objects.equals(wrapped, other.wrapped); + } } diff --git a/src/main/java/bjc/functypes/optics/Lens.java b/src/main/java/bjc/functypes/optics/Lens.java new file mode 100644 index 0000000..0a7d4cd --- /dev/null +++ b/src/main/java/bjc/functypes/optics/Lens.java @@ -0,0 +1,13 @@ +package bjc.functypes.optics; + +/** + * A type-invariant var Laarhoven lens. + * + * @author bjcul + * + * @param <Whole> The item this lens can focus on + * @param <Part> The field this lens focuses on + */ +public interface Lens<Whole, Part> extends LensX<Whole, Whole, Part, Part> { + // Alias type +} diff --git a/src/main/java/bjc/functypes/optics/LensX.java b/src/main/java/bjc/functypes/optics/LensX.java new file mode 100644 index 0000000..d2e9c30 --- /dev/null +++ b/src/main/java/bjc/functypes/optics/LensX.java @@ -0,0 +1,67 @@ +package bjc.functypes.optics; + +import static bjc.functypes.optics.Lenses.immutable; + +import java.util.function.BiFunction; +import java.util.function.Function; + +/** + * A type-variant lens + * + * @author Ben Culkin + * + * @param <W1> The first type the lens is used on + * @param <W2> The second 'whole' type + * @param <P1> The first 'part' type + * @param <P2> The second 'part' type + */ +public interface LensX<W1, W2, P1, P2> extends Optic<W1, W2, P1, P2> { + /** + * Retrieve the focused value of this lens. + * + * @param source The item to use the lens on. + * + * @return The value from the given whole this lens focuses on. + */ + P1 get(W1 source); + + /** + * Create an updated version of the item this lens focuses on. + * + * @param source The item to use the lens on. + * @param val The new value. + * + * @return The updated item the lens was used on. + */ + W2 set(W1 source, P2 val); + + /** + * Update the focused value. + * + * NOTE: It will often be more efficient to implement this directly. The + * implementation here is provided for convenience. + * + * @param source The item to use the lens on. + * @param action The action to applied to the focused item. + * + * @return The updated item the lens was used on. + */ + default W2 update(W1 source, Function<P1, P2> action) { + return set(source, action.apply(get(source))); + } + + /** + * Compose two type-variant lenses together. + * + * @param <V1> The first type the second lens focuses on + * @param <V2> The second type the second lens focuses on. + * + * @param other The second lens to use. + * + * @return A lens composed from this one and the given one. + */ + default <V1, V2> LensX<W1, W2, V1, V2> compose(LensX<P1, P2, V1, V2> other) { + return immutable((whole) -> other.get(get(whole)), + (whole, val) -> update(whole, (P1 val2) -> other.set(val2, val))); + } +}
\ No newline at end of file diff --git a/src/main/java/bjc/functypes/optics/Lenses.java b/src/main/java/bjc/functypes/optics/Lenses.java new file mode 100644 index 0000000..05a64e7 --- /dev/null +++ b/src/main/java/bjc/functypes/optics/Lenses.java @@ -0,0 +1,147 @@ +package bjc.functypes.optics; + +import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.Function; + +import bjc.data.Holder; +import bjc.data.Pair; + +/** + * Utility and constructor functions for lenses + * + * @author bjcul + * + */ +public class Lenses { + /** + * Create an immutable lens from a pair of functions. + * + * @param <W1> The first type the lens is used on + * @param <W2> The second type the lens is used on + * @param <P1> The first type the lens focuses on + * @param <P2> The second type the lens focuses on. + * + * @param getter The getter for the lens + * @param setter The setter for the lens + * + * @return The lens composed from the two given functions + */ + public static <W1, W2, P1, P2> LensX<W1, W2, P1, P2> immutable(Function<W1, P1> getter, + BiFunction<W1, P2, W2> setter) { + return new FunctionalLensX<>(getter, setter); + } + + /** + * Create a mutable lens from a pair of functions. + * + * @param <Whole> The type the lens is used on + * @param <Part> The type the lens is focused on + * + * @param getter The getter for the lens + * @param mutator The mutator for the lens + * + * @return The mutable lens composed from the two given functions + */ + public static <Whole, Part> MutableLens<Whole, Part> mutable(Function<Whole, Part> getter, + BiConsumer<Whole, Part> mutator) { + return new FunctionalMutableLens<>(getter, mutator); + } + + /** + * Create a lens that reflects over the value in a holder + * + * @param <Part1> The first type contained in the holder + * @param <Part2> The second type contained in the holder + * + * @return A lens that focuses on the value of a holder + */ + public static <Part1, Part2> LensX<Holder<Part1>, Holder<Part2>, Part1, Part2> holder() { + return immutable((hld) -> hld.getValue(), (hld, val) -> hld.map((vl) -> val)); + } + + /** + * Create a lens for updating tagged pairs. + * + * TODO: Should this be on a Tagged<T, A> class that is isomorphic to pair + * instead? + * + * @param <A> The first data type + * @param <B> The second data type + * @param <T> The tag type + * + * @return A lens that operates on the value of a tagged pair. + */ + public static <A, B, T> LensX<Pair<T, A>, Pair<T, B>, A, B> tagged() { + return immutable((par) -> par.getRight(), (par, val) -> par.mapRight((vl) -> val)); + } + + /** + * Creates a lens which focuses on a piece of internal state. + * + * @param <A> The first state type + * @param <B> The second state type + * + * @param val The initial state value + * + * @return A lens that focuses on the given internal state. + */ + public static <A, B> LensX<?, ?, A, B> state(A val) { + Holder<A> hold = Holder.of(val); + return immutable((whole) -> hold.getValue(), (whole, vl) -> hold.map((arg) -> vl)); + } + + /** + * Creates a lens which focuses on a piece of mutable internal state. + * + * @param <A> The state type + * + * @param val The initial state value + * + * @return A lens that focuses on the given internal state. + */ + public static <A> MutableLens<?, A> stateM(A val) { + Holder<A> hold = Holder.of(val); + return mutable((whole) -> hold.getValue(), (whole, vl) -> hold.replace(vl)); + } +} + +final class FunctionalLensX<W1, W2, P1, P2> implements LensX<W1, W2, P1, P2> { + private final BiFunction<W1, P2, W2> setter; + private final Function<W1, P1> getter; + + FunctionalLensX(Function<W1, P1> getter, BiFunction<W1, P2, W2> setter) { + this.setter = setter; + this.getter = getter; + } + + @Override + public P1 get(W1 source) { + return getter.apply(source); + } + + @Override + public W2 set(W1 source, P2 val) { + return setter.apply(source, val); + } +} + +final class FunctionalMutableLens<Whole, Part> implements MutableLens<Whole, Part> { + private final BiConsumer<Whole, Part> mutator; + private final Function<Whole, Part> getter; + + FunctionalMutableLens(Function<Whole, Part> getter, BiConsumer<Whole, Part> mutator) { + this.mutator = mutator; + this.getter = getter; + } + + @Override + public Part get(Whole source) { + return getter.apply(source); + } + + @Override + public void mutate(Whole source, Part val) { + mutator.accept(source, val); + } +} diff --git a/src/main/java/bjc/functypes/optics/MutableLens.java b/src/main/java/bjc/functypes/optics/MutableLens.java new file mode 100644 index 0000000..b6fca5d --- /dev/null +++ b/src/main/java/bjc/functypes/optics/MutableLens.java @@ -0,0 +1,29 @@ +package bjc.functypes.optics; + +/** + * A type-invariant lens for mutating objects. + * + * Note that there is no type-variant version, because that wouldn't make much sense. + * + * Also, mixing mutable and immutable lenses may lead to confusion. + * + * @author bjcul + * + * @param <Whole> The type the lens is used on + * @param <Part> The type the lens is focused on + */ +public interface MutableLens<Whole, Part> extends Lens<Whole, Part> { + /** + * Apply a mutation to an item. + * + * @param source The item to use the lens on. + * @param val The new value for the focused field. + */ + void mutate(Whole source, Part val); + + @Override + default Whole set(Whole source, Part val) { + mutate(source, val); + return source; + } +} diff --git a/src/main/java/bjc/functypes/optics/Optic.java b/src/main/java/bjc/functypes/optics/Optic.java new file mode 100644 index 0000000..949eeca --- /dev/null +++ b/src/main/java/bjc/functypes/optics/Optic.java @@ -0,0 +1,15 @@ +package bjc.functypes.optics; + +/** + * General interface for optics of varying sorts + * + * @author bjcul + * + * @param <W1> The first item the optic is used on + * @param <W2> The second item the optic is used on + * @param <P1> The first item the optic focuses on + * @param <P2> The second item the optic focuses on + */ +public interface Optic<W1, W2, P1, P2> { + // Marker interface +} diff --git a/src/main/java/bjc/functypes/optics/PrismX.java b/src/main/java/bjc/functypes/optics/PrismX.java new file mode 100644 index 0000000..a9c0dd2 --- /dev/null +++ b/src/main/java/bjc/functypes/optics/PrismX.java @@ -0,0 +1,5 @@ +package bjc.functypes.optics; + +public interface PrismX<W1, W2, P1, P2> extends Optic<W1, W2, P1, P2> { + +} diff --git a/src/main/java/bjc/functypes/optics/impl/package-info.java b/src/main/java/bjc/functypes/optics/impl/package-info.java new file mode 100644 index 0000000..f309401 --- /dev/null +++ b/src/main/java/bjc/functypes/optics/impl/package-info.java @@ -0,0 +1 @@ +package bjc.functypes.optics.impl;
\ No newline at end of file diff --git a/src/main/java/bjc/functypes/optics/package-info.java b/src/main/java/bjc/functypes/optics/package-info.java new file mode 100644 index 0000000..c187df9 --- /dev/null +++ b/src/main/java/bjc/functypes/optics/package-info.java @@ -0,0 +1,4 @@ +/** + * + */ +package bjc.functypes.optics;
\ No newline at end of file diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 84d1b2f..fdbf1b6 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -1,3 +1,9 @@ +/** + * Contains various more esoteric data structures. + * + * @author bjculkin + * + */ module esodata { exports bjc.data; exports bjc.esodata; diff --git a/src/test/java/bjc/test/data/EitherTest.java b/src/test/java/bjc/test/data/EitherTest.java index 5e2613c..04cff09 100644 --- a/src/test/java/bjc/test/data/EitherTest.java +++ b/src/test/java/bjc/test/data/EitherTest.java @@ -8,6 +8,7 @@ import org.junit.*; import bjc.data.Either; +@SuppressWarnings("javadoc") public class EitherTest { private Either<String, String> leftEither; diff --git a/src/test/java/bjc/test/data/GeneratingIteratorTest.java b/src/test/java/bjc/test/data/GeneratingIteratorTest.java new file mode 100644 index 0000000..e1c5fbd --- /dev/null +++ b/src/test/java/bjc/test/data/GeneratingIteratorTest.java @@ -0,0 +1,20 @@ +package bjc.test.data; + +import static bjc.test.TestUtils.assertIteratorEquals; +import java.util.Iterator; + +import org.junit.Test; + +import bjc.data.GeneratingIterator; + +@SuppressWarnings("javadoc") +public class GeneratingIteratorTest { + + @Test + public void test() { + Iterator<String> itr = new GeneratingIterator<>("", str -> str + "A", str -> str.equalsIgnoreCase("AAAA")); + + assertIteratorEquals(false, itr, "A", "AA", "AAA", "AAAA"); + } + +} diff --git a/src/test/java/bjc/data/MarkListIteratorTest.java b/src/test/java/bjc/test/data/MarkListIteratorTest.java index 6eb4994..366755f 100644 --- a/src/test/java/bjc/data/MarkListIteratorTest.java +++ b/src/test/java/bjc/test/data/MarkListIteratorTest.java @@ -1,4 +1,4 @@ -package bjc.data; +package bjc.test.data; import static org.junit.Assert.*; @@ -7,6 +7,7 @@ import java.util.List; import org.junit.Test; +import bjc.data.MarkListIterator; import bjc.test.TestUtils; /** diff --git a/src/test/java/bjc/test/data/SimpleTreeTest.java b/src/test/java/bjc/test/data/SimpleTreeTest.java new file mode 100644 index 0000000..db7457b --- /dev/null +++ b/src/test/java/bjc/test/data/SimpleTreeTest.java @@ -0,0 +1,29 @@ +package bjc.test.data; + +import static org.junit.Assert.*; + +import org.junit.Test; + +import bjc.data.SimpleTree; + +public class SimpleTreeTest { + + @Test + public void test() { + SimpleTree<String> tree1 = new SimpleTree<>("a"); + SimpleTree<String> tree2 = new SimpleTree<>("a"); + + assertEquals(tree1, tree2); + + tree1.addChild("b"); + + assertNotEquals(tree1, tree2); + + tree2.addChild("b"); + + tree1.equals(tree2); + + assertEquals(tree1, tree2); + } + +} diff --git a/src/test/java/bjc/test/data/TransformIteratorTest.java b/src/test/java/bjc/test/data/TransformIteratorTest.java new file mode 100644 index 0000000..8a10b10 --- /dev/null +++ b/src/test/java/bjc/test/data/TransformIteratorTest.java @@ -0,0 +1,22 @@ +package bjc.test.data; + +import static bjc.test.TestUtils.assertIteratorEquals; +import java.util.Iterator; + +import org.junit.Test; + +import bjc.data.ArrayIterator; +import bjc.data.TransformIterator; + +@SuppressWarnings("javadoc") +public class TransformIteratorTest { + + @Test + public void test() { + Iterator<String> itr1 = new ArrayIterator<>("a", "b", "c"); + Iterator<String> itr2 = new TransformIterator<>(itr1, str -> str + "X"); + + assertIteratorEquals(itr2, "aX", "bX", "cX"); + } + +} diff --git a/src/test/java/bjc/test/esodata/NestListTest.java b/src/test/java/bjc/test/esodata/NestListTest.java index 5b91126..c97859e 100644 --- a/src/test/java/bjc/test/esodata/NestListTest.java +++ b/src/test/java/bjc/test/esodata/NestListTest.java @@ -6,7 +6,6 @@ import java.util.*; import org.junit.*; -import bjc.*; import bjc.esodata.NestList; import bjc.test.TestUtils; diff --git a/src/test/java/bjc/test/functypes/optics/LensesTest.java b/src/test/java/bjc/test/functypes/optics/LensesTest.java new file mode 100644 index 0000000..ff13a42 --- /dev/null +++ b/src/test/java/bjc/test/functypes/optics/LensesTest.java @@ -0,0 +1,18 @@ +package bjc.test.functypes.optics; + +import static org.junit.Assert.*; + +import org.junit.Test; + +import bjc.data.Holder; +import bjc.functypes.optics.Lenses; + +public class LensesTest { + + @Test + public void test() { + Holder<Integer> holder = Holder.of(5); + + } + +} diff --git a/src/test/java/bjc/test/functypes/optics/package-info.java b/src/test/java/bjc/test/functypes/optics/package-info.java new file mode 100644 index 0000000..45e69ec --- /dev/null +++ b/src/test/java/bjc/test/functypes/optics/package-info.java @@ -0,0 +1 @@ +package bjc.test.functypes.optics;
\ No newline at end of file |
