diff --git a/core/src/main/java/fj/data/Stream.java b/core/src/main/java/fj/data/Stream.java
index a523515b..e05e26bf 100644
--- a/core/src/main/java/fj/data/Stream.java
+++ b/core/src/main/java/fj/data/Stream.java
@@ -4,6 +4,7 @@
import fj.F0;
import fj.F3;
import fj.Hash;
+import fj.Semigroup;
import fj.Show;
import fj.F;
import fj.F2;
@@ -14,6 +15,7 @@
import fj.P1;
import fj.P2;
import fj.Unit;
+import fj.control.Trampoline;
import fj.control.parallel.Promise;
import fj.control.parallel.Strategy;
import fj.Ordering;
@@ -1094,27 +1096,6 @@ public final Stream takeWhile(final F f) {
Stream.nil();
}
- /**
- * Traversable instance of Stream for IO.
- *
- * @return traversed value
- */
- public final IO> traverseIO(F> f) {
- return this.foldRight1((a, acc) ->
- IOFunctions.bind(acc, (Stream bs) ->
- IOFunctions.map(f.f(a), bs::cons)), IOFunctions.unit(Stream.nil()));
-
- }
-
- /**
- * Traversable instance of Stream for Option.
- *
- * @return traversed value
- */
- public final Option> traverseOption(F> f) {
- return this.foldRight1((a, acc) -> acc.bind(bs -> f.f(a).map(bs::cons)), some(Stream.nil()));
- }
-
/**
* Removes elements from the head of this stream that do not match the given predicate function
* until an element is found that does match or the stream is exhausted.
@@ -1669,4 +1650,413 @@ public static F>, F, Stream>> bind_() {
public static F, B>>, F, B>>> foldRight() {
return curry((f, b, as) -> as.foldRight(f, b));
}
+
+ /**
+ * Sequence the given stream and collect the output on the right side of an either.
+ *
+ * @param stream the given stream
+ * @param the type of the right value
+ * @param the type of the left value
+ * @return the either
+ */
+ public static Either> sequenceEither(
+ final Stream> stream) {
+ return stream.traverseEither(identity());
+ }
+
+ /**
+ * Sequence the given stream and collect the output on the left side of an either.
+ *
+ * @param stream the given stream
+ * @param the type of the right value
+ * @param the type of the left value
+ * @return the either
+ */
+ public static Either, R> sequenceEitherLeft(
+ final Stream> stream) {
+ return stream.traverseEitherLeft(identity());
+ }
+
+ /**
+ * Sequence the given stream and collect the output on the right side of an either.
+ *
+ * @param stream the given stream
+ * @param the type of the right value
+ * @param the type of the left value
+ * @return the either
+ */
+ public static Either> sequenceEitherRight(
+ final Stream> stream) {
+ return stream.traverseEitherRight(identity());
+ }
+
+ /**
+ * Sequence the given stream and collect the output as a function.
+ *
+ * @param stream the given stream
+ * @param the type of the input value
+ * @param the type of the output value
+ * @return the either
+ */
+ public static F> sequenceF(
+ final Stream> stream) {
+ return stream.traverseF(identity());
+ }
+
+ /**
+ * Sequence the given stream and collect the output as an IO.
+ *
+ * @param stream the given stream
+ * @param the type of the IO value
+ * @return the IO
+ */
+ public static IO> sequenceIO(
+ final Stream> stream) {
+ return stream.traverseIO(identity());
+ }
+
+ /**
+ * Sequence the given stream and collect the output as a list.
+ *
+ * @param stream the given stream
+ * @param the type of the list value
+ * @return the list
+ */
+ public static List> sequenceList(
+ final Stream> stream) {
+ return stream.traverseList(identity());
+ }
+
+ /**
+ * Sequence the given stream and collect the output as an stream.
+ *
+ * @param stream the given stream
+ * @param the type of the option value
+ * @return the stream
+ */
+ public static Option> sequenceOption(
+ final Stream