scalaz/scalaz-stream — pull request #120 by fthomas (2014-03-03 19:34:51+00:00)
Title: Pass a Codec to fromFile and fromInputStream explicitly

While looking again at the example in the `README.md`, I noticed that there is a disparity between the text decoding and encoding. The decoding is hidden in `io.linesR` while the encoding is explicit by using `process1.utf8Encode`. This PR is about the hidden decoding part in `linesR` and proposes a fix for making the codec used for decoding visible.

`scala.io.Source.fromFile` and `scala.io.Source.fromInputStream` which are used in `linesR` both take an implicit parameter of type `scala.io.Codec` which is used for decoding. One could change the `Codec` that is used by `linesR` by putting an `implicit val codec: Codec` in the scope where `linesR` is called, but this is not obvious if you just look at the signature of `linesR`. You have to look at the source of `linesR` to see that you could change the codec via an implicit. I therefore propose to change `linesR` such that they take an implicit `Codec` themselves which they pass to `fromFile` and `fromInputStream` explicitly.