From 388f3a86c8146861c91d34a0fdddc871c457679f 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@1a5e560f
+// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@7318aa5
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 502d1808..cf5add3a 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@6d1f0db1
+// stateDecoder: CellDecoder[State] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@193e33ad
// 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@50a11c23
+// stateEncoder: CellEncoder[State] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@3b8019ba
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@643d7470
+// unknownDecoder: CellDecoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$unaryProductDecoder$3@e763f53
implicit val advancedDecoder = deriveCellDecoder[Advanced]
-// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@3017a041
+// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@1b716244
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@38355a30
+// unknownEncoder: CellEncoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$unaryProductEncoder$3@29b63d93
implicit val advancedEncoder = deriveCellEncoder[Advanced]
-// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@3fa54439
+// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@7f5479b3
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@7b228e2
+// MyRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@6ba042d0
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 2989ff6f..f982c27a 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@30e0afcf
+// myRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@271eb63d
implicit val myRowEncoder: CsvRowEncoder[MyRow, String] = deriveCsvRowEncoder
-// myRowEncoder: CsvRowEncoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowEncoder$$anonfun$productWriter$2@17f9963d
+// myRowEncoder: CsvRowEncoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowEncoder$$anonfun$productWriter$2@4f5e825c
// 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$13234/0x00000008027dd040@4e3b4355
+// parseableMyHeaders: ParseableHeader[MyHeaders] = fs2.data.csv.ParseableHeader$$$Lambda$13265/0x00000008027efc40@56664915
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@41f0356
+// wrapperCellEncoder: CellEncoder[Wrapper] = repl.MdocSession$MdocApp$$anonfun$9@6ba0ec2a
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@4b98a863
+// wrapperCellEncoder2: CellEncoder[Wrapper] = fs2.data.csv.CellEncoder$$anonfun$contramap$2@5546b60a
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* aim*Am%dO*_r?;}RgM
z15H8`Px81TwtKxkP52)cqhYaCfHM$3KDFH&uF?+jO14R|Tl8uM&{W$NnEL0Y>v|3B)rp|_m5`fzpc{eSPa
zGnX#RT&3sC_;Gd3W9x#BcmFTPyXrc-Uft!ox&|(B-jEKujs1Vq?f7P{b>C1P?M&Of
z&;PyKzS9u&Tsxs*TwT+Ia?g3&z19EPbKejb?z^UTd`*V?acbmq|F1e3*N`4PrnYHx
z5HC}(-Fy6Zz4ZS~_l2xZWD2!on#X49YsWUap}lRp*Zp0m a0(%RxBNZBilQMeB2t+Yt~@7r9U(4m>w^+2{(63&OF@
z(NcZ|yZM@05Mn@HN^_g;Z__LIQSaT}A!&Y#c
z3Fcl34W>|uycY8AB|l^v>dHHyp>7OMZ6(j-)VeXF$Bvs&GqygM`boI&*n;^N{@#Y&
z&4crQrN|f=r&&mT!Zz3CORbqgu%Wki8+wAx)G={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