Skip to content

Instantly share code, notes, and snippets.

@Atry
Created November 3, 2015 16:58
Show Gist options
  • Save Atry/328b4c163289e487c727 to your computer and use it in GitHub Desktop.
Save Atry/328b4c163289e487c727 to your computer and use it in GitHub Desktop.
object Zhihu37118044 {
def printDeep(vector: IndexedSeq[_]) {
import scalaz.std.indexedSeq._
import scalaz.syntax.traverse._
((0 until 100):IxSq[Int]).foldLeftM[IxSq, Any](vector) {
case (vector: IxSq[Any], _) =>
vector
case (value: Any , _) =>
println(value)
Vector.empty
}
}
def main(arguments: Array[String]): Unit = {
printDeep(
Vector(
Vector(
Vector(
Vector("000"), Vector("001")
),
Vector(
Vector("010"), Vector("011")
)
),
Vector(
Vector(
Vector("100"), Vector("101")
),
Vector(
Vector("110"), Vector("111")
)
)
)
)
}
}
@Atry
Copy link
Author

Atry commented Nov 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment