From b13072f067d5c3949cb860d4fcc2ec4f756363f8 Mon Sep 17 00:00:00 2001
From: ybasket The generic derivation for cell decoders also supports renaming and deriving instances for unary product types (case classes with one field):import fs2.data.json.jq.Compiler
val queryCompiler = Compiler[IO]
-// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@2cb97867
+// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@633a17c3
val queryPipe = queryCompiler.compile(query).unsafeRunSync()
// queryPipe: fs2.package.Pipe[IO, json.Token, json.Token] = <function1>
diff --git a/documentation/cbor-json/index.html b/documentation/cbor-json/index.html
index fa3a3551..6e7eb386 100644
--- a/documentation/cbor-json/index.html
+++ b/documentation/cbor-json/index.html
@@ -264,7 +264,7 @@ implicit val stateDecoder = deriveCellDecoder[State]
-// stateDecoder: CellDecoder[State] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@548b15ac
+// stateDecoder: CellDecoder[State] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@7212532c
// use stateDecoder to derive decoders for rows...or just test:
stateDecoder("On")
// res1: DecoderResult[State] = Right(value = On)
@@ -199,7 +199,7 @@
// same goes for the encoder
implicit val stateEncoder = deriveCellEncoder[State]
-// stateEncoder: CellEncoder[State] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@3d833caa
+// stateEncoder: CellEncoder[State] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@1bbc3494
stateEncoder(State.On)
// res3: String = "On"
// works as we have an implicit CellDecoder[String]
implicit val unknownDecoder = deriveCellDecoder[Advanced.Unknown]
-// unknownDecoder: CellDecoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$unaryProductDecoder$3@378ab23b
+// unknownDecoder: CellDecoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$unaryProductDecoder$3@18f30db6
implicit val advancedDecoder = deriveCellDecoder[Advanced]
-// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@4b9e7572
+// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@3584870c
advancedDecoder("Active")
// res4: DecoderResult[Advanced] = Right(value = On)
@@ -223,9 +223,9 @@
// res5: DecoderResult[Advanced] = Right(value = Unknown(name = "Off"))
implicit val unknownEncoder = deriveCellEncoder[Advanced.Unknown]
-// unknownEncoder: CellEncoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$unaryProductEncoder$3@47343fd8
+// unknownEncoder: CellEncoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$unaryProductEncoder$3@55ef39a3
implicit val advancedEncoder = deriveCellEncoder[Advanced]
-// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@63763df8
+// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@2f0daf1e
advancedEncoder(Advanced.On)
// res6: String = "Active"
@@ -269,7 +269,7 @@ import fs2.data.csv.generic.semiauto._
implicit val MyRowDecoder: CsvRowDecoder[MyRow, String] = deriveCsvRowDecoder[MyRow]
-// MyRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@7617ad85
+// MyRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@63688472
val decoded = stream.through(decodeUsingHeaders[MyRow]())
// decoded: Stream[[x]Fallible[x], MyRow] = Stream(..)
diff --git a/documentation/csv/index.html b/documentation/csv/index.html
index 1b536ade..f49afeec 100644
--- a/documentation/csv/index.html
+++ b/documentation/csv/index.html
@@ -200,9 +200,9 @@
val
textStream = Stream.emit(input).covary[Fallible]
// textStream: Stream[Fallible, String] = Stream(..)
implicit val myRowDecoder: CsvRowDecoder[MyRow, String] = deriveCsvRowDecoder
-// myRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@4e66b144
+// myRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@18508b9a
implicit val myRowEncoder: CsvRowEncoder[MyRow, String] = deriveCsvRowEncoder
-// myRowEncoder: CsvRowEncoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowEncoder$$anonfun$productWriter$2@3118b7e8
+// myRowEncoder: CsvRowEncoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowEncoder$$anonfun$productWriter$2@680d2816
// decodeUsingHeaders can take a `Char` indicating the separator to use
// for example `decodeUsingHeaders[MyRow](';') for a semi-colon separated csv
@@ -453,7 +453,7 @@ implicit
val parseableMyHeaders: ParseableHeader[MyHeaders] = ParseableHeader.instance[MyHeaders] { name =>
MyHeaders.withNameInsensitiveOption(name).toRight(new HeaderError(s"Unknown header $name"))
}
-// parseableMyHeaders: ParseableHeader[MyHeaders] = fs2.data.csv.ParseableHeader$$$Lambda$13239/0x00000008036ed840@c3af3ed
+// parseableMyHeaders: ParseableHeader[MyHeaders] = fs2.data.csv.ParseableHeader$$$Lambda$14328/0x0000000803b49440@13074fdb
val withMyHeaders = stream.through(lowlevel.headers[Fallible, MyHeaders])
// withMyHeaders: Stream[[x]Fallible[x], CsvRow[MyHeaders]] = Stream(..)
@@ -559,10 +559,10 @@ For
CellEncoder
, it is even easier to define your own as encoding can't fail, so basically it's just a function A => String
. The easiest ways to roll your own are using Scala's single abstract method sugar:
case class Wrapper(content: String)
implicit val wrapperCellEncoder: CellEncoder[Wrapper] = (w: Wrapper) => w.content
-// wrapperCellEncoder: CellEncoder[Wrapper] = repl.MdocSession$MdocApp$$anonfun$9@77ad8fbf
+// wrapperCellEncoder: CellEncoder[Wrapper] = repl.MdocSession$MdocApp$$anonfun$9@f170a7a
or using contramap
on an existing encoder:
implicit val wrapperCellEncoder2: CellEncoder[Wrapper] = CellEncoder[String].contramap(_.content)
-// wrapperCellEncoder2: CellEncoder[Wrapper] = fs2.data.csv.CellEncoder$$anonfun$contramap$2@37ed155
+// wrapperCellEncoder2: CellEncoder[Wrapper] = fs2.data.csv.CellEncoder$$anonfun$contramap$2@e5bce16
RowDecoder
& RowEncoder
RowDecoder
s can be used to decode an entire CSV row based on field positions. For instance if you want to decode the CSV data into shapeless HList
:
~>V)F1LQdKZFJ$a|(to%5
zR9$Bf6dD*jQEMCAV`ft>tKOr=#{#N_!$>Vs$v+}!sdcGHJ!TY>%98AkUXIXQh}o1;
zgzB?0%a#q^Anq}2Swl$(Ia4}!$YPlyKU8a`qNvn9!kiUYHxZQ?*R*e#Yy~;SH3B~8
zg<%WaNDM^QrC=S4EkzE(rG+kggr$>qv6`|V6hQ2=Qa(zxkj(O=S~rAKL~9~3RTQ{c
z6GRQmUKR67qm(gdW0i{07gi7)we* Vi8eXi9v6z sC*!?*|GOaK
zmEQ>|rOaIbGrAoxrApHITEuPGw1VX`0CIzBKdDU?AoNJ>j6F&7`G#vYWLT`j&^Q)jnzZ>#}QQ24DE
z+fkN_&c?(j6ii}JU?L_{lTXZfL&_+~J7MS&nOxMJQ&92V1yBU*bb
z22d9Fk
@m?b1*LQvAu;aTEIx9yyQP8}=99
z$`^v{Rh$75oU@RXbd1uDUjZ$TFY!2wK~v7tC{0WGc@pCufpk9wmOv1oVG@n_q@*U>
zj}y!!=cNp;Ux|&+4{-FS%$9qENBkSlNW3u~!dqGk#o+XWc}`$58Hj^lS7#DV+2-yF
z6giP1r*eQsvo3fWm`9;)TCh6jQ{;Yrob4%$zn;LBGV>4)ehRol5`Wj>xfHfbhEJ?@
zqFvx=+QUQ9gWSU*L_!C+B|D