Skip to content

Commit

Permalink
deploy: f6b64d5
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerlandson committed May 24, 2024
1 parent 76ad76c commit 15d20b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion coulomb-parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h3 id="examples" class="section"><a class="anchor-link left" href="#examples"><
</span><span class="string-literal">&quot;coulomb.units.info&quot;</span><span> *:
</span><span class="type-name">EmptyTuple</span><span>
]
</span><span class="comment">// dslparser: RuntimeUnitParser = repl.MdocSession$MdocApp$$anon$1@a36b084</span></code></pre>
</span><span class="comment">// dslparser: RuntimeUnitParser = repl.MdocSession$MdocApp$$anon$1@2c9f8ea6</span></code></pre>
<p>Parsing can fail, and so the <code>parse</code> method returns an <a class="api" href="https://scala-lang.org/api/3.x/scala/util/Either.html">Either</a> object.
In the following code, parsing a known unit <code>meter</code> results in a successful <a class="api" href="https://scala-lang.org/api/3.x/scala/util/Right.html">Right</a> value.</p>
<p>This example illustrates that unit names parse into a corresponding fully qualified
Expand Down
8 changes: 4 additions & 4 deletions coulomb-pureconfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ <h3 id="examples" class="section"><a class="anchor-link left" href="#examples"><
bandwidth: {value: 200, unit: &quot;gigabyte / second&quot;}
}
&quot;&quot;&quot;</span><span>)
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@4b3c4ad7
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@14f14b8
</span><span>
</span><span class="comment">// this load will succeed, with automatic unit conversions
</span><span class="keyword">val</span><span> </span><span class="identifier">conf</span><span> = </span><span class="identifier">source</span><span>.</span><span class="identifier">load</span><span>[</span><span class="type-name">Config</span><span>]
Expand All @@ -238,7 +238,7 @@ <h3 id="examples" class="section"><a class="anchor-link left" href="#examples"><
bandwidth: {value: 200, unit: &quot;gigabyte&quot;}
}
&quot;&quot;&quot;</span><span>)
</span><span class="comment">// bad: ConfigObjectSource = pureconfig.ConfigObjectSource@430dd87e
</span><span class="comment">// bad: ConfigObjectSource = pureconfig.ConfigObjectSource@18d5d93b
</span><span>
</span><span class="comment">// this load will fail because bandwidth units are incompatible
</span><span class="keyword">val</span><span> </span><span class="identifier">fail</span><span> = </span><span class="identifier">bad</span><span>.</span><span class="identifier">load</span><span>[</span><span class="type-name">Config</span><span>]
Expand Down Expand Up @@ -281,7 +281,7 @@ <h2 id="integer-values" class="section"><a class="anchor-link left" href="#integ
unit: megabyte
}
&quot;&quot;&quot;</span><span>)
</span><span class="comment">// qsrc: ConfigObjectSource = pureconfig.ConfigObjectSource@3bffbb3f
</span><span class="comment">// qsrc: ConfigObjectSource = pureconfig.ConfigObjectSource@7db348b4
</span><span>
</span><span class="comment">// loading integer value types will succeed when type matches the config
</span><span class="identifier">qsrc</span><span>.</span><span class="identifier">load</span><span>[</span><span class="type-name">Quantity</span><span>[</span><span class="type-name">Int</span><span>, </span><span class="type-name">Mega</span><span> * </span><span class="type-name">Byte</span><span>]]
Expand Down Expand Up @@ -331,7 +331,7 @@ <h2 id="io-policies" class="section"><a class="anchor-link left" href="#io-polic
bandwidth: {value: 200, unit: {lhs: {lhs: giga, op: &quot;*&quot;, rhs: byte}, op: &quot;/&quot;, rhs: second}}
}
&quot;&quot;&quot;</span><span>)
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@43c0f6f5
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@514876ff
</span><span>
</span><span class="comment">// this load will succeed, with automatic unit conversions
</span><span class="keyword">val</span><span> </span><span class="identifier">conf</span><span> = </span><span class="identifier">source</span><span>.</span><span class="identifier">load</span><span>[</span><span class="type-name">Config</span><span>]
Expand Down

0 comments on commit 15d20b0

Please sign in to comment.