Skip to content

Commit

Permalink
deploy: 7ce8470
Browse files Browse the repository at this point in the history
  • Loading branch information
johnynek committed Nov 14, 2024
1 parent 443212e commit 1fcd4f5
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ <h1 id="cats-parse" class="title">cats-parse</h1>
<p>A parsing library for the cats ecosystem.</p>
<p>To use in sbt add, the following to your <code>libraryDependencies</code>:</p>
<pre class="keep-together pdf epub"><code class="nohighlight"><span class="comment">// use this snippet for the JVM
</span><span class="identifier">libraryDependencies</span><span> += </span><span class="string-literal">&quot;org.typelevel&quot;</span><span> %% </span><span class="string-literal">&quot;cats-parse&quot;</span><span> % </span><span class="string-literal">&quot;0.3.9&quot;</span><span>
</span><span class="identifier">libraryDependencies</span><span> += </span><span class="string-literal">&quot;org.typelevel&quot;</span><span> %% </span><span class="string-literal">&quot;cats-parse&quot;</span><span> % </span><span class="string-literal">&quot;1.0.0&quot;</span><span>

</span><span class="comment">// use this snippet for JS, or cross-building
</span><span class="identifier">libraryDependencies</span><span> += </span><span class="string-literal">&quot;org.typelevel&quot;</span><span> %%% </span><span class="string-literal">&quot;cats-parse&quot;</span><span> % </span><span class="string-literal">&quot;0.3.9&quot;</span></code></pre>
<p>The <a href="https://javadoc.io/doc/org.typelevel/cats-parse_2.13/0.3.9/cats/parse/index.html">API docs</a> are published.</p>
</span><span class="identifier">libraryDependencies</span><span> += </span><span class="string-literal">&quot;org.typelevel&quot;</span><span> %%% </span><span class="string-literal">&quot;cats-parse&quot;</span><span> % </span><span class="string-literal">&quot;1.0.0&quot;</span></code></pre>
<p>The <a href="https://javadoc.io/doc/org.typelevel/cats-parse_2.13/1.0.0/cats/parse/index.html">API docs</a> are published.</p>
<p>Why another parsing library? See this <a href="https://posco.medium.com/designing-a-parsing-library-in-scala-d5076de52536">blog post detailing the
design</a>. To reiterate,
this library has a few goals:</p>
Expand Down Expand Up @@ -302,7 +302,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10845/0x0000000102e1f040@5a7df408
// fn = cats.parse.Parser$$Lambda$10859/0x0000000102dc8840@10aa1095
// )
</span><span>
</span><span class="comment">// still error since we need the space even if we drop it
Expand Down Expand Up @@ -341,7 +341,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// ranges = NonEmptyList(head = (&#39;A&#39;, &#39;Z&#39;), tail = List((&#39;a&#39;, &#39;z&#39;)))
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// ),
// second = Void(
// parser = CharIn(
Expand All @@ -351,7 +351,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10845/0x0000000102e1f040@5a7df408
// fn = cats.parse.Parser$$Lambda$10859/0x0000000102dc8840@10aa1095
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p5</span><span>: </span><span class="type-name">Parser</span><span>[</span><span class="type-name">Char</span><span>] = </span><span class="identifier">alpha</span><span>.</span><span class="identifier">surroundedBy</span><span>(</span><span class="identifier">sp</span><span>)
</span><span class="comment">// p5: Parser[Char] = Map(
Expand All @@ -378,7 +378,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10846/0x0000000102e1e040@27db8da1
// fn = cats.parse.Parser$$Lambda$10860/0x0000000102dc9040@72dd8751
// )
</span><span>
</span><span class="identifier">p4</span><span>.</span><span class="identifier">parse</span><span>(</span><span class="string-literal">&quot; a &quot;</span><span>)
Expand Down Expand Up @@ -408,7 +408,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// ranges = NonEmptyList(head = (&#39;A&#39;, &#39;Z&#39;), tail = List((&#39;a&#39;, &#39;z&#39;)))
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// ),
// second = Void(
// parser = CharIn(
Expand All @@ -418,7 +418,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10845/0x0000000102e1f040@5a7df408
// fn = cats.parse.Parser$$Lambda$10859/0x0000000102dc8840@10aa1095
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p7</span><span>: </span><span class="type-name">Parser</span><span>[</span><span class="type-name">Char</span><span>] = </span><span class="identifier">alpha</span><span>.</span><span class="identifier">between</span><span>(</span><span class="identifier">sp</span><span>, </span><span class="identifier">digit</span><span>)
</span><span class="comment">// p7: Parser[Char] = Map(
Expand All @@ -445,7 +445,7 @@ <h2 id="combining-parsers" class="section"><a class="anchor-link left" href="#co
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10846/0x0000000102e1e040@27db8da1
// fn = cats.parse.Parser$$Lambda$10860/0x0000000102dc9040@72dd8751
// )
</span><span>
</span><span class="identifier">p6</span><span>.</span><span class="identifier">parse</span><span>(</span><span class="string-literal">&quot; a1&quot;</span><span>)
Expand Down Expand Up @@ -496,7 +496,7 @@ <h2 id="repeating-parsers" class="section"><a class="anchor-link left" href="#re
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator$$anon$12@44a142d8
// acc1 = cats.parse.Accumulator$$anon$12@16a3ffbc
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p2</span><span>: </span><span class="type-name">Parser0</span><span>[</span><span class="type-name">List</span><span>[</span><span class="type-name">Char</span><span>]] = </span><span class="identifier">alpha</span><span>.</span><span class="identifier">rep0</span><span>
</span><span class="comment">// p2: Parser0[List[Char]] = OneOf0(
Expand All @@ -509,7 +509,7 @@ <h2 id="repeating-parsers" class="section"><a class="anchor-link left" href="#re
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$9@6d3d810f
// acc1 = cats.parse.Accumulator0$$anon$9@6c04d000
// ),
// Pure(result = List())
// )
Expand Down Expand Up @@ -551,7 +551,7 @@ <h2 id="repeating-parsers" class="section"><a class="anchor-link left" href="#re
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator$$anon$12@26788c63
// acc1 = cats.parse.Accumulator$$anon$12@beff397
// ),
// fn = &lt;function1&gt;
// )
Expand All @@ -566,7 +566,7 @@ <h2 id="repeating-parsers" class="section"><a class="anchor-link left" href="#re
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p3</span><span>: </span><span class="type-name">Parser</span><span>[</span><span class="type-name">String</span><span>] = </span><span class="identifier">alpha</span><span>.</span><span class="identifier">repAs</span><span>[</span><span class="type-name">String</span><span>]
Expand All @@ -578,7 +578,7 @@ <h2 id="repeating-parsers" class="section"><a class="anchor-link left" href="#re
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$7@4c43bb61
// acc1 = cats.parse.Accumulator0$$anon$7@2b7bd7f9
// )</span></code></pre>
<p>All three parsers will be identical in parsing results, but <code>p2</code> and <code>p3</code> are using built-in methods which will not create intermediate list. <code>rep</code> + <code>map</code> creates intermediate list which is mapped to string in this example.</p>

Expand All @@ -599,7 +599,7 @@ <h2 id="parsers-with-empty-output" class="section"><a class="anchor-link left" h
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// ),
// second = OneOf0(
// all = List(
Expand All @@ -614,7 +614,7 @@ <h2 id="parsers-with-empty-output" class="section"><a class="anchor-link left" h
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// )
</span><span>
Expand Down Expand Up @@ -653,7 +653,7 @@ <h2 id="parsers-with-empty-output" class="section"><a class="anchor-link left" h
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// ),
// second = OneOf0(
// all = List(
Expand All @@ -669,7 +669,7 @@ <h2 id="parsers-with-empty-output" class="section"><a class="anchor-link left" h
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// )
</span><span>
Expand Down Expand Up @@ -716,7 +716,7 @@ <h2 id="error-handling" class="section"><a class="anchor-link left" href="#error
// ranges = NonEmptyList(head = (&#39;A&#39;, &#39;Z&#39;), tail = List((&#39;a&#39;, &#39;z&#39;)))
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// )
</span><span>
</span><span class="comment">// epsilon failure
Expand Down Expand Up @@ -766,7 +766,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// ranges = NonEmptyList(head = (&#39;0&#39;, &#39;9&#39;), tail = List())
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// ),
// second = Void(
// parser = CharIn(
Expand All @@ -776,7 +776,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10845/0x0000000102e1f040@5a7df408
// fn = cats.parse.Parser$$Lambda$10859/0x0000000102dc8840@10aa1095
// )
</span><span>
</span><span class="identifier">p</span><span>.</span><span class="identifier">parse</span><span>(</span><span class="string-literal">&quot; 1&quot;</span><span>)
Expand Down Expand Up @@ -815,7 +815,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// ranges = NonEmptyList(head = (&#39;0&#39;, &#39;9&#39;), tail = List())
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// ),
// second = Void(
// parser = CharIn(
Expand All @@ -825,7 +825,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10845/0x0000000102e1f040@5a7df408
// fn = cats.parse.Parser$$Lambda$10859/0x0000000102dc8840@10aa1095
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p2</span><span> = </span><span class="identifier">sp</span><span> *&gt; </span><span class="identifier">digit</span><span>
</span><span class="comment">// p2: cats.parse.Parser[Char] = Map(
Expand All @@ -843,7 +843,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// ranges = NonEmptyList(head = (&#39;0&#39;, &#39;9&#39;), tail = List())
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// )
</span><span>
</span><span class="identifier">p1</span><span>.</span><span class="identifier">backtrack</span><span>.</span><span class="identifier">orElse</span><span>(</span><span class="identifier">p2</span><span>).</span><span class="identifier">parse</span><span>(</span><span class="string-literal">&quot; 1&quot;</span><span>)
Expand Down Expand Up @@ -877,7 +877,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// ranges = NonEmptyList(head = (&#39;0&#39;, &#39;9&#39;), tail = List())
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// ),
// second = Void(
// parser = CharIn(
Expand All @@ -887,7 +887,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// )
// )
// ),
// fn = cats.parse.Parser$$Lambda$10845/0x0000000102e1f040@5a7df408
// fn = cats.parse.Parser$$Lambda$10859/0x0000000102dc8840@10aa1095
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p2</span><span> = </span><span class="identifier">sp</span><span> *&gt; </span><span class="identifier">digit</span><span>
</span><span class="comment">// p2: cats.parse.Parser[Char] = Map(
Expand All @@ -905,7 +905,7 @@ <h3 id="backtrack" class="section"><a class="anchor-link left" href="#backtrack"
// ranges = NonEmptyList(head = (&#39;0&#39;, &#39;9&#39;), tail = List())
// )
// ),
// fn = cats.parse.Parser$$Lambda$10840/0x0000000102e19840@20abc48b
// fn = cats.parse.Parser$$Lambda$10854/0x0000000102dbd840@4a45eda7
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">p3</span><span> = </span><span class="identifier">digit</span><span>
</span><span class="comment">// p3: cats.parse.Parser[Char] = CharIn(
Expand Down Expand Up @@ -948,7 +948,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// )
</span><span>
Expand All @@ -963,7 +963,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// ),
// second = Void(
Expand Down Expand Up @@ -993,7 +993,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// ),
// second = Void(
Expand All @@ -1004,7 +1004,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// )
// )
// ),
// fn = cats.parse.Parser0$$Lambda$10832/0x0000000102e13840@369bb2b9
// fn = cats.parse.Parser0$$Lambda$10846/0x0000000102db7840@240a4a23
// ),
// second = StringP(
// parser = Rep(
Expand All @@ -1020,7 +1020,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// ...
</span><span>

Expand Down Expand Up @@ -1058,7 +1058,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// ),
// second = Void(
Expand All @@ -1069,7 +1069,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// )
// )
// ),
// fn = cats.parse.Parser0$$Lambda$10832/0x0000000102e13840@369bb2b9
// fn = cats.parse.Parser0$$Lambda$10846/0x0000000102db7840@240a4a23
// ),
// second = StringP(
// parser = Rep(
Expand All @@ -1085,7 +1085,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// ...
</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">p3</span><span> = (</span><span class="identifier">searchWord</span><span> ~ </span><span class="identifier">sp</span><span>.?).</span><span class="identifier">rep</span><span>.</span><span class="identifier">string</span><span>
Expand All @@ -1100,7 +1100,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// ),
// second = OneOf0(
// all = List(
Expand All @@ -1115,7 +1115,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// )
</span><span>
Expand All @@ -1140,7 +1140,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// ),
// second = Void(
Expand Down Expand Up @@ -1170,7 +1170,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// )
// ),
// second = Void(
Expand All @@ -1181,7 +1181,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// )
// )
// ),
// fn = cats.parse.Parser0$$Lambda$10832/0x0000000102e13840@369bb2b9
// fn = cats.parse.Parser0$$Lambda$10846/0x0000000102db7840@240a4a23
// ),
// second = StringP(
// parser = Rep(
Expand All @@ -1197,7 +1197,7 @@ <h3 id="soft" class="section"><a class="anchor-link left" href="#soft"><i class=
// ),
// min = 1,
// maxMinusOne = 2147483647,
// acc1 = cats.parse.Accumulator0$$anon$11@2186bf14
// acc1 = cats.parse.Accumulator0$$anon$11@6dc7c354
// ...
</span><span>
</span><span class="identifier">p4</span><span>.</span><span class="identifier">parse</span><span>(</span><span class="string-literal">&quot;title:The Wind Has Risen&quot;</span><span>)
Expand Down

0 comments on commit 1fcd4f5

Please sign in to comment.