CellDecoder

@implicitNotFound("No implicit CellDecoder found for type ${T}.\nYou can define one using CellDecoder.instance, by calling map on another CellDecoder or by using generic derivation for coproducts and unary products.\nFor that, add the fs2-data-csv-generic module to your dependencies and use either full-automatic derivation:\nimport fs2.data.csv.generic.auto._\nor the recommended semi-automatic derivation:\nimport fs2.data.csv.generic.semiauto._\nimplicit val cellDecoder: CellDecoder[${T}] = deriveCellDecoder\n\n") @FunctionalInterface
trait CellDecoder[T]

Describes how a cell can be decoded to the given type.

CellDecoder provides convenient methods such as map, emap, or flatMap to build new decoders out of more basic one.

Actually, CellDecoder has a https://typelevel.org/cats/api/cats/MonadError.htmlcats`MonadError` instance. To get the full power of it, import cats.implicits._.

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def apply(cell: String): DecoderResult[T]
Implicitly added by decoderResultDecoder
def apply(cell: String): DecoderResult[T]
Implicitly added by rawOrResultDecoder
def apply(cell: String): DecoderResult[T]

Concrete methods

def either[B](cd: CellDecoder[B]): CellDecoder[Either[T, B]]
Implicitly added by decoderResultDecoder

Similar to or, but return the result as an Either signaling which cell decoder succeeded. Allows for parsing an unrelated type in case of failure.

Similar to or, but return the result as an Either signaling which cell decoder succeeded. Allows for parsing an unrelated type in case of failure.

Type parameters:
B

the type the alternative decoder returns

Value parameters:
cd

the alternative decoder

Returns:

a decoder combining both decoders

def either[B](cd: CellDecoder[B]): CellDecoder[Either[T, B]]
Implicitly added by rawOrResultDecoder

Similar to or, but return the result as an Either signaling which cell decoder succeeded. Allows for parsing an unrelated type in case of failure.

Similar to or, but return the result as an Either signaling which cell decoder succeeded. Allows for parsing an unrelated type in case of failure.

Type parameters:
B

the type the alternative decoder returns

Value parameters:
cd

the alternative decoder

Returns:

a decoder combining both decoders

def either[B](cd: CellDecoder[B]): CellDecoder[Either[T, B]]

Similar to or, but return the result as an Either signaling which cell decoder succeeded. Allows for parsing an unrelated type in case of failure.

Similar to or, but return the result as an Either signaling which cell decoder succeeded. Allows for parsing an unrelated type in case of failure.

Type parameters:
B

the type the alternative decoder returns

Value parameters:
cd

the alternative decoder

Returns:

a decoder combining both decoders

def emap[T2](f: T => DecoderResult[T2]): CellDecoder[T2]
Implicitly added by decoderResultDecoder

Map the parsed value, potentially failing.

Map the parsed value, potentially failing.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def emap[T2](f: T => DecoderResult[T2]): CellDecoder[T2]
Implicitly added by rawOrResultDecoder

Map the parsed value, potentially failing.

Map the parsed value, potentially failing.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def emap[T2](f: T => DecoderResult[T2]): CellDecoder[T2]

Map the parsed value, potentially failing.

Map the parsed value, potentially failing.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def flatMap[T2](f: T => CellDecoder[T2]): CellDecoder[T2]
Implicitly added by decoderResultDecoder

Map the parsed value to a new decoder, which in turn will be applied to the parsed value.

Map the parsed value to a new decoder, which in turn will be applied to the parsed value.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def flatMap[T2](f: T => CellDecoder[T2]): CellDecoder[T2]
Implicitly added by rawOrResultDecoder

Map the parsed value to a new decoder, which in turn will be applied to the parsed value.

Map the parsed value to a new decoder, which in turn will be applied to the parsed value.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def flatMap[T2](f: T => CellDecoder[T2]): CellDecoder[T2]

Map the parsed value to a new decoder, which in turn will be applied to the parsed value.

Map the parsed value to a new decoder, which in turn will be applied to the parsed value.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def map[T2](f: T => T2): CellDecoder[T2]
Implicitly added by decoderResultDecoder

Map the parsed value.

Map the parsed value.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def map[T2](f: T => T2): CellDecoder[T2]
Implicitly added by rawOrResultDecoder

Map the parsed value.

Map the parsed value.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def map[T2](f: T => T2): CellDecoder[T2]

Map the parsed value.

Map the parsed value.

Type parameters:
T2

the result type

Value parameters:
f

the mapping function

Returns:

a cell decoder reading the mapped type

def or[TT >: T](cd: => CellDecoder[TT]): CellDecoder[TT]
Implicitly added by decoderResultDecoder

Fail-over. If this decoder fails, try the supplied other decoder.

Fail-over. If this decoder fails, try the supplied other decoder.

Type parameters:
TT

the return type

Value parameters:
cd

the fail-over decoder

Returns:

a decoder combining this and the other decoder

def or[TT >: T](cd: => CellDecoder[TT]): CellDecoder[TT]
Implicitly added by rawOrResultDecoder

Fail-over. If this decoder fails, try the supplied other decoder.

Fail-over. If this decoder fails, try the supplied other decoder.

Type parameters:
TT

the return type

Value parameters:
cd

the fail-over decoder

Returns:

a decoder combining this and the other decoder

def or[TT >: T](cd: => CellDecoder[TT]): CellDecoder[TT]

Fail-over. If this decoder fails, try the supplied other decoder.

Fail-over. If this decoder fails, try the supplied other decoder.

Type parameters:
TT

the return type

Value parameters:
cd

the fail-over decoder

Returns:

a decoder combining this and the other decoder