Created
November 3, 2015 16:58
-
-
Save Atry/328b4c163289e487c727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
) | |
) | |
) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is the answer at http://www.zhihu.com/question/37118044/answer/70676748