Skip to content

Commit

Permalink
deploy: 3e723c3
Browse files Browse the repository at this point in the history
  • Loading branch information
satabin committed Apr 26, 2024
1 parent 525be72 commit 29ef955
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 49 deletions.
4 changes: 2 additions & 2 deletions cookbooks/jq/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
<li class="level2 nav-header">cbor-json</li>
<li class="level3 nav-leaf"><a href="../../documentation/cbor-json/">Introduction</a></li>
<li class="level1 nav-header">cookbooks</li>
<li class="level2 nav-leaf"><a href="../jsonlines/">Handling JSON Lines data</a></li>
<li class="level2 active nav-leaf"><a href="#">Reading/transforming/writing JSON data</a></li>
<li class="level2 nav-leaf"><a href="../jsonlines/">Handling JSON Lines data</a></li>
</ul>

<ul class="nav-list">
Expand Down Expand Up @@ -256,7 +256,7 @@ <h3 id="transforming" class="section"><a class="anchor-link left" href="#transfo
<pre class="keep-together pdf epub"><code class="nohighlight"><span class="keyword">import</span><span> </span><span class="identifier">fs2</span><span>.</span><span class="identifier">data</span><span>.</span><span class="identifier">json</span><span>.</span><span class="identifier">jq</span><span>.</span><span class="type-name">Compiler</span><span>

</span><span class="keyword">val</span><span> </span><span class="identifier">queryCompiler</span><span> = </span><span class="type-name">Compiler</span><span>[</span><span class="type-name">IO</span><span>]
</span><span class="comment">// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@8965e66
</span><span class="comment">// queryCompiler: Compiler[IO] = fs2.data.json.jq.internal.ESPJqCompiler@d920a7c
</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">queryPipe</span><span> = </span><span class="identifier">queryCompiler</span><span>.</span><span class="identifier">compile</span><span>(</span><span class="identifier">query</span><span>).</span><span class="identifier">unsafeRunSync</span><span>()
</span><span class="comment">// queryPipe: fs2.package.Pipe[IO, json.Token, json.Token] = &lt;function1&gt;</span></code></pre>
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/jsonlines/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
<li class="level2 nav-header">cbor-json</li>
<li class="level3 nav-leaf"><a href="../../documentation/cbor-json/">Introduction</a></li>
<li class="level1 nav-header">cookbooks</li>
<li class="level2 active nav-leaf"><a href="#">Handling JSON Lines data</a></li>
<li class="level2 nav-leaf"><a href="../jq/">Reading/transforming/writing JSON data</a></li>
<li class="level2 active nav-leaf"><a href="#">Handling JSON Lines data</a></li>
</ul>

<ul class="nav-list">
Expand Down
6 changes: 3 additions & 3 deletions documentation/cbor-json/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
<li class="level2 nav-header">cbor-json</li>
<li class="level3 active nav-leaf"><a href="#">Introduction</a></li>
<li class="level1 nav-header">cookbooks</li>
<li class="level2 nav-leaf"><a href="../../cookbooks/jsonlines/">Handling JSON Lines data</a></li>
<li class="level2 nav-leaf"><a href="../../cookbooks/jq/">Reading/transforming/writing JSON data</a></li>
<li class="level2 nav-leaf"><a href="../../cookbooks/jsonlines/">Handling JSON Lines data</a></li>
</ul>

<ul class="nav-list">
Expand Down Expand Up @@ -264,7 +264,7 @@ <h2 id="json-to-cbor" class="section"><a class="anchor-link left" href="#json-to
// NegativeInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@44cc661d,
// at = scodec.bits.ByteVector$AtArray@4e00ab8d,
// offset = 0L,
// size = 1L
// )
Expand All @@ -273,7 +273,7 @@ <h2 id="json-to-cbor" class="section"><a class="anchor-link left" href="#json-to
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@31687548,
// at = scodec.bits.ByteVector$AtArray@1f11959b,
// offset = 0L,
// size = 2L
// )
Expand Down
32 changes: 16 additions & 16 deletions documentation/cbor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
<li class="level2 nav-header">cbor-json</li>
<li class="level3 nav-leaf"><a href="../cbor-json/">Introduction</a></li>
<li class="level1 nav-header">cookbooks</li>
<li class="level2 nav-leaf"><a href="../../cookbooks/jsonlines/">Handling JSON Lines data</a></li>
<li class="level2 nav-leaf"><a href="../../cookbooks/jq/">Reading/transforming/writing JSON data</a></li>
<li class="level2 nav-leaf"><a href="../../cookbooks/jsonlines/">Handling JSON Lines data</a></li>
</ul>

<ul class="nav-list">
Expand Down Expand Up @@ -187,7 +187,7 @@ <h3 id="parsing-1" class="section"><a class="anchor-link left" href="#parsing-1"
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@449dfc9e,
// at = scodec.bits.ByteVector$AtArray@5caa1757,
// offset = 0L,
// size = 1L
// )
Expand All @@ -197,7 +197,7 @@ <h3 id="parsing-1" class="section"><a class="anchor-link left" href="#parsing-1"
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@2c3d8d35,
// at = scodec.bits.ByteVector$AtArray@333da109,
// offset = 0L,
// size = 1L
// )
Expand All @@ -206,7 +206,7 @@ <h3 id="parsing-1" class="section"><a class="anchor-link left" href="#parsing-1"
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@72d1c4c7,
// at = scodec.bits.ByteVector$AtArray@1992e578,
// offset = 0L,
// size = 1L
// )
Expand All @@ -216,7 +216,7 @@ <h3 id="parsing-1" class="section"><a class="anchor-link left" href="#parsing-1"
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@255c1fbd,
// at = scodec.bits.ByteVector$AtArray@f790150,
// offset = 0L,
// size = 1L
// )
Expand All @@ -225,7 +225,7 @@ <h3 id="parsing-1" class="section"><a class="anchor-link left" href="#parsing-1"
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@e0e7e84,
// at = scodec.bits.ByteVector$AtArray@365af47,
// offset = 0L,
// size = 1L
// )
Expand Down Expand Up @@ -340,7 +340,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@4e9a1e55,
// at = scodec.bits.ByteVector$AtArray@5d0e63cb,
// offset = 0L,
// size = 1L
// )
Expand All @@ -350,7 +350,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@32911cbd,
// at = scodec.bits.ByteVector$AtArray@53b9e437,
// offset = 0L,
// size = 1L
// )
Expand All @@ -359,7 +359,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@77755ca5,
// at = scodec.bits.ByteVector$AtArray@148d0c91,
// offset = 0L,
// size = 1L
// )
Expand All @@ -369,7 +369,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@a72e691,
// at = scodec.bits.ByteVector$AtArray@3a3c96d0,
// offset = 0L,
// size = 1L
// )
Expand All @@ -378,7 +378,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@1484393c,
// at = scodec.bits.ByteVector$AtArray@1482ba67,
// offset = 0L,
// size = 1L
// )
Expand All @@ -400,7 +400,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@2ecaabe5,
// at = scodec.bits.ByteVector$AtArray@8066c9c,
// offset = 0L,
// size = 1L
// )
Expand All @@ -410,7 +410,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@73075aed,
// at = scodec.bits.ByteVector$AtArray@74131089,
// offset = 0L,
// size = 1L
// )
Expand All @@ -419,7 +419,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@6edc6c72,
// at = scodec.bits.ByteVector$AtArray@2a4782cd,
// offset = 0L,
// size = 1L
// )
Expand All @@ -429,7 +429,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@5b24f54c,
// at = scodec.bits.ByteVector$AtArray@2b974460,
// offset = 0L,
// size = 1L
// )
Expand All @@ -438,7 +438,7 @@ <h3 id="serializing-2" class="section"><a class="anchor-link left" href="#serial
// PositiveInt(
// bytes = Chunk(
// bytes = View(
// at = scodec.bits.ByteVector$AtArray@204af84e,
// at = scodec.bits.ByteVector$AtArray@104eaf02,
// offset = 0L,
// size = 1L
// )
Expand Down
16 changes: 8 additions & 8 deletions documentation/csv/generic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
<li class="level2 nav-header">cbor-json</li>
<li class="level3 nav-leaf"><a href="../../cbor-json/">Introduction</a></li>
<li class="level1 nav-header">cookbooks</li>
<li class="level2 nav-leaf"><a href="../../../cookbooks/jsonlines/">Handling JSON Lines data</a></li>
<li class="level2 nav-leaf"><a href="../../../cookbooks/jq/">Reading/transforming/writing JSON data</a></li>
<li class="level2 nav-leaf"><a href="../../../cookbooks/jsonlines/">Handling JSON Lines data</a></li>
</ul>

<ul class="nav-list">
Expand Down Expand Up @@ -190,7 +190,7 @@ <h2 id="derivation-of-celldecoder-cellencoder" class="section"><a class="anchor-
}

</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="identifier">stateDecoder</span><span> = </span><span class="identifier">deriveCellDecoder</span><span>[</span><span class="type-name">State</span><span>]
</span><span class="comment">// stateDecoder: CellDecoder[State] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@4a30923c
</span><span class="comment">// stateDecoder: CellDecoder[State] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@4845c3f9
// use stateDecoder to derive decoders for rows...or just test:
</span><span class="identifier">stateDecoder</span><span>(</span><span class="string-literal">&quot;On&quot;</span><span>)
</span><span class="comment">// res1: DecoderResult[State] = Right(value = On)
Expand All @@ -199,7 +199,7 @@ <h2 id="derivation-of-celldecoder-cellencoder" class="section"><a class="anchor-
</span><span>
</span><span class="comment">// same goes for the encoder
</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="identifier">stateEncoder</span><span> = </span><span class="identifier">deriveCellEncoder</span><span>[</span><span class="type-name">State</span><span>]
</span><span class="comment">// stateEncoder: CellEncoder[State] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@34aa1999
</span><span class="comment">// stateEncoder: CellEncoder[State] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@581dce9d
</span><span class="identifier">stateEncoder</span><span>(</span><span class="type-name">State</span><span>.</span><span class="type-name">On</span><span>)
</span><span class="comment">// res3: String = &quot;On&quot;</span></code></pre>
<p>The generic derivation for cell decoders also supports renaming and deriving instances for unary product types (case classes with one field):</p>
Expand All @@ -213,19 +213,19 @@ <h2 id="derivation-of-celldecoder-cellencoder" class="section"><a class="anchor-

</span><span class="comment">// works as we have an implicit CellDecoder[String]
</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="identifier">unknownDecoder</span><span> = </span><span class="identifier">deriveCellDecoder</span><span>[</span><span class="type-name">Advanced</span><span>.</span><span class="type-name">Unknown</span><span>]
</span><span class="comment">// unknownDecoder: CellDecoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$unaryProductDecoder$3@57e56d84
</span><span class="comment">// unknownDecoder: CellDecoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$unaryProductDecoder$3@3341b0b7
</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="identifier">advancedDecoder</span><span> = </span><span class="identifier">deriveCellDecoder</span><span>[</span><span class="type-name">Advanced</span><span>]
</span><span class="comment">// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@2e0aaefa
</span><span class="comment">// advancedDecoder: CellDecoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellDecoder$$anonfun$coproductDecoder$3@70d6410
</span><span>
</span><span class="identifier">advancedDecoder</span><span>(</span><span class="string-literal">&quot;Active&quot;</span><span>)
</span><span class="comment">// res4: DecoderResult[Advanced] = Right(value = On)
</span><span class="identifier">advancedDecoder</span><span>(</span><span class="string-literal">&quot;Off&quot;</span><span>)
</span><span class="comment">// res5: DecoderResult[Advanced] = Right(value = Unknown(name = &quot;Off&quot;))
</span><span>
</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="identifier">unknownEncoder</span><span> = </span><span class="identifier">deriveCellEncoder</span><span>[</span><span class="type-name">Advanced</span><span>.</span><span class="type-name">Unknown</span><span>]
</span><span class="comment">// unknownEncoder: CellEncoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$unaryProductEncoder$3@60657875
</span><span class="comment">// unknownEncoder: CellEncoder[Advanced.Unknown] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$unaryProductEncoder$3@61b12503
</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="identifier">advancedEncoder</span><span> = </span><span class="identifier">deriveCellEncoder</span><span>[</span><span class="type-name">Advanced</span><span>]
</span><span class="comment">// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@4e7d331
</span><span class="comment">// advancedEncoder: CellEncoder[Advanced] = fs2.data.csv.generic.internal.DerivedCellEncoder$$anonfun$coproductEncoder$3@57ee668e
</span><span>
</span><span class="identifier">advancedEncoder</span><span>(</span><span class="type-name">Advanced</span><span>.</span><span class="type-name">On</span><span>)
</span><span class="comment">// res6: String = &quot;Active&quot;
Expand Down Expand Up @@ -269,7 +269,7 @@ <h2 id="derivation-of-csvrowdecoder" class="section"><a class="anchor-link left"
<pre><code class="nohighlight"><span class="keyword">import</span><span> </span><span class="identifier">fs2</span><span>.</span><span class="identifier">data</span><span>.</span><span class="identifier">csv</span><span>.</span><span class="identifier">generic</span><span>.</span><span class="identifier">semiauto</span><span>.</span><span class="identifier">_</span><span>

</span><span class="keyword">implicit</span><span> </span><span class="keyword">val</span><span> </span><span class="type-name">MyRowDecoder</span><span>: </span><span class="type-name">CsvRowDecoder</span><span>[</span><span class="type-name">MyRow</span><span>, </span><span class="type-name">String</span><span>] = </span><span class="identifier">deriveCsvRowDecoder</span><span>[</span><span class="type-name">MyRow</span><span>]
</span><span class="comment">// MyRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@1afc5154
</span><span class="comment">// MyRowDecoder: CsvRowDecoder[MyRow, String] = fs2.data.csv.generic.internal.DerivedCsvRowDecoder$$anon$1@584ca95
</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">decoded</span><span> = </span><span class="identifier">stream</span><span>.</span><span class="identifier">through</span><span>(</span><span class="identifier">decodeUsingHeaders</span><span>[</span><span class="type-name">MyRow</span><span>]())
</span><span class="comment">// decoded: Stream[[x]Fallible[x], MyRow] = Stream(..)
Expand Down
Loading

0 comments on commit 29ef955

Please sign in to comment.