Class

kantan.csv.ops

CsvReaderOps

Related Doc: package ops

Permalink

implicit final class CsvReaderOps[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)
Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CsvReaderOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CsvReaderOps(results: CsvReader[ReadResult[A]])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def filterResult(f: (A) ⇒ Boolean): CsvReader[ReadResult[A]]

    Permalink

    Filters on all successful values that match the specified predicate.

  6. def flatMapResult[B](f: (A) ⇒ ReadResult[B]): CsvReader[ReadResult[B]]

    Permalink

    Turns a CsvReader[ReadResult[A]] into a CsvReader[ReadResult[B]].

  7. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  9. def mapResult[B](f: (A) ⇒ B): CsvReader[ReadResult[B]]

    Permalink

    Turns a CsvReader[ReadResult[A]] into a CsvReader[ReadResult[B]].

  10. val results: CsvReader[ReadResult[A]]

    Permalink
  11. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped