3
BufferedReader의 열거자를 어떻게 만들 수 있습니까? Scalaz iteratee, BufferedReader의 열거 자 생성
는 차라리 옛날 기사를 발견 http://apocalisp.wordpress.com/2010/10/17/scalaz-tutorial-enumeration-based-io-with-iteratees/하고 여기에서 예를 기반 열거를 만들려고 Scalaz 6.0.4로작동하지 않는 것 같습니다 : Idiomatic construction to check whether a collection is ordered
implicit val ListEnumerator = new Enumerator[List] {
def apply[E, A](e: List[E], i: IterV[E, A]): IterV[E, A] = e match {
case List() => i
case x :: xs => i.fold(done = (_, _) => i,
cont = k => apply(xs, k(El(x))))
}
}
을하지만 IO 모나드와 열거 자의 결합 방법을 이해할 수 없다.
감사합니다. 하지만 스칼라 진화를 이해하는 것처럼 6 버전에서 더 편리한 방법은 Enumerator –