kantan.csv.ops

CsvReaderOps

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, NotNull, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CsvReaderOps
  2. AnyVal
  3. NotNull
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

Value Members

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

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

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

    Definition Classes
    Any
  4. val as: CsvReader[ReadResult[A]]

  5. final def asInstanceOf[T0]: T0

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

    Filters on all successful values that match the specified predicate.

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

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

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

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

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

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

  11. def toString(): String

    Definition Classes
    Any

Inherited from AnyVal

Inherited from NotNull

Inherited from Any

Ungrouped