Skip to content

Commit

Permalink
deploy: e77a529
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerlandson committed Feb 6, 2024
1 parent 45a55a5 commit 8d7d35e
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@35a5145a</span></code></pre>
</span><span class="comment">// dslparser: RuntimeUnitParser = repl.MdocSession$MdocApp$$anon$1@1db751e3</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@58f7091f
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@235077d5
</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@47996ce9
</span><span class="comment">// bad: ConfigObjectSource = pureconfig.ConfigObjectSource@55a8019e
</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@2a436077
</span><span class="comment">// qsrc: ConfigObjectSource = pureconfig.ConfigObjectSource@2f59e055
</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@126d5afc
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@2f733f58
</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 8d7d35e

Please sign in to comment.