我使用来自 scalaz 流网站的这段代码,它正在使用 to 方法,但是当我尝试使用 append 时它失败了,它看起来像一个无限循环并且永远不会完成。我想使用 append 方法的原因是我不想使用 to 方法重写文件。
io.linesR(t)
.intersperse("\n")
.pipe(text.utf8Encode)
.to(io.fileChunkW(target))
.run.run //success
files.foreach(t => {
io.linesR(t)
.intersperse("\n")
.pipe(text.utf8Encode)
.append(io.fileChunkW(target))
.run.run
}) //the program keeps running, it looks like in an infinite loop
我对此感到困惑,有人可以向我解释这里发生了什么
提前谢谢了