diff --git a/cookbooks/jq/index.html b/cookbooks/jq/index.html index ab1059b0..f9743111 100644 --- a/cookbooks/jq/index.html +++ b/cookbooks/jq/index.html @@ -256,7 +256,7 @@

import fs2.data.json.jq.Compiler val queryCompiler = Compiler[IO] -// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@518ae6f +// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@57b7ce0f 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 9372085f..43364e37 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@6a13fa84 +// stateDecoder: CellDecoder[State] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@5556a8cf // 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@6b01cb61 +// stateEncoder: CellEncoder[State] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@438a013d stateEncoder(State.On) // res3: String = "On"

The generic derivation for cell decoders also supports renaming and deriving instances for unary product types (case classes with one field):

@@ -213,9 +213,9 @@

// 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@d74c41b +// unknownDecoder: CellDecoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$unaryProductDecoder$3@2a555c7f implicit val advancedDecoder = deriveCellDecoder[Advanced] -// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@a8adc30 +// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@4829f2d0 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@7fb8c03f +// unknownEncoder: CellEncoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$unaryProductEncoder$3@28d93bca implicit val advancedEncoder = deriveCellEncoder[Advanced] -// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@1a07466a +// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@3b494405 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@5bb62f6 +// MyRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@6d8a7057 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 5c9bc276..f82c1940 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@5bdf6073 +// myRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@fc1640c implicit val myRowEncoder: CsvRowEncoder[MyRow, String] = deriveCsvRowEncoder -// myRowEncoder: CsvRowEncoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowEncoder$$anonfun$productWriter$2@c47a803 +// myRowEncoder: CsvRowEncoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowEncoder$$anonfun$productWriter$2@2a3428fc // 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$14231/0x0000000803867040@7e68d4c +// parseableMyHeaders: ParseableHeader[MyHeaders] = fs2.data.csv.ParseableHeader$$$Lambda$14161/0x0000000802ab4840@4d4a13ff 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@279aa93b
+// wrapperCellEncoder: CellEncoder[Wrapper] = repl.MdocSession$MdocApp$$anonfun$9@49afef5e

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@162c0a7b
+// wrapperCellEncoder2: CellEncoder[Wrapper] = fs2.data.csv.CellEncoder$$anonfun$contramap$2@42d74d5f

RowDecoder & RowEncoder

RowDecoders 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:

diff --git a/documentation/json/jq/index.html b/documentation/json/jq/index.html index a0015a55..92939aee 100644 --- a/documentation/json/jq/index.html +++ b/documentation/json/jq/index.html @@ -325,7 +325,7 @@

val qCompiler = jq.Compiler[SyncIO] -// qCompiler: jq.Compiler[SyncIO] = fs2.data.json.jq.internal.ESPJqCompiler@55b4d915 +// qCompiler: jq.Compiler[SyncIO] = fs2.data.json.jq.internal.ESPJqCompiler@4f9a3aeb val compiled = qCompiler.compile(query).unsafeRunSync() // compiled: Pipe[SyncIO, Token, Token] = <function1> diff --git a/index.html b/index.html index b805c5ea..195497ae 100644 --- a/index.html +++ b/index.html @@ -201,7 +201,7 @@

Adopters

-

Here's a (non-exhaustive) list of companies and projects that use fs2-data. Don't see yours? You can add it in a PR!

+

Here's a (non-exhaustive) list of companies and projects that use fs2-data. Don't see yours? You can add it in a PR!

Projects

    diff --git a/pagefind/fragment/en_206af33.pf_fragment b/pagefind/fragment/en_206af33.pf_fragment new file mode 100644 index 00000000..a724c756 Binary files /dev/null and b/pagefind/fragment/en_206af33.pf_fragment differ diff --git a/pagefind/fragment/en_61137f3.pf_fragment b/pagefind/fragment/en_61137f3.pf_fragment new file mode 100644 index 00000000..b8334523 Binary files /dev/null and b/pagefind/fragment/en_61137f3.pf_fragment differ diff --git a/pagefind/fragment/en_6ca516e.pf_fragment b/pagefind/fragment/en_6ca516e.pf_fragment new file mode 100644 index 00000000..b36a209a Binary files /dev/null and b/pagefind/fragment/en_6ca516e.pf_fragment differ diff --git a/pagefind/fragment/en_71cd3dd.pf_fragment b/pagefind/fragment/en_71cd3dd.pf_fragment new file mode 100644 index 00000000..be76dac1 Binary files /dev/null and b/pagefind/fragment/en_71cd3dd.pf_fragment differ diff --git a/pagefind/fragment/en_7c4e656.pf_fragment b/pagefind/fragment/en_7c4e656.pf_fragment new file mode 100644 index 00000000..3085bc70 Binary files /dev/null and b/pagefind/fragment/en_7c4e656.pf_fragment differ diff --git a/pagefind/fragment/en_f567b42.pf_fragment b/pagefind/fragment/en_f567b42.pf_fragment new file mode 100644 index 00000000..9425ff2f Binary files /dev/null and b/pagefind/fragment/en_f567b42.pf_fragment differ diff --git a/pagefind/index/en_5230863.pf_index b/pagefind/index/en_5230863.pf_index new file mode 100644 index 00000000..56cfe8bd Binary files /dev/null and b/pagefind/index/en_5230863.pf_index differ diff --git a/pagefind/index/en_ceeac28.pf_index b/pagefind/index/en_ceeac28.pf_index new file mode 100644 index 00000000..f4c89f23 Binary files /dev/null and b/pagefind/index/en_ceeac28.pf_index differ diff --git a/pagefind/pagefind-entry.json b/pagefind/pagefind-entry.json index 9d5d134e..60e93073 100644 --- a/pagefind/pagefind-entry.json +++ b/pagefind/pagefind-entry.json @@ -1 +1 @@ -{"version":"1.0.4","languages":{"en":{"hash":"en_75a7ef108c","wasm":"en","page_count":17}}} \ No newline at end of file +{"version":"1.0.4","languages":{"en":{"hash":"en_5d4ceaf478","wasm":"en","page_count":17}}} \ No newline at end of file diff --git a/pagefind/pagefind.en_5d4ceaf478.pf_meta b/pagefind/pagefind.en_5d4ceaf478.pf_meta new file mode 100644 index 00000000..35703237 Binary files /dev/null and b/pagefind/pagefind.en_5d4ceaf478.pf_meta differ