implicit final classCsvReaderOps[A] extends AnyVal
Provides useful syntax for CsvReader[ReadResult[A]].
When parsing CSV data, a very common scenario is to get an instance of CsvReader and then use common
combinators such as map and flatMap on it. This can be awkward when the actual interesting value is
itself within a ReadResult which also needs to be mapped into. CsvReaderOps provides shortcuts, such as:
val reader: CsvReader[ReadResult[List[Int]]] = ???
// Not the most useful code in the world, but shows how one can map and filter directly on the nested value.
reader.mapResult(_.sum).filterResult(_ % 2 == 0)
Provides useful syntax for
CsvReader[ReadResult[A]]
.When parsing CSV data, a very common scenario is to get an instance of CsvReader and then use common combinators such as
map
andflatMap
on it. This can be awkward when the actual interesting value is itself within a ReadResult which also needs to be mapped into. CsvReaderOps provides shortcuts, such as: