Skip to content

Commit

Permalink
deploy: 2f36126
Browse files Browse the repository at this point in the history
  • Loading branch information
erikerlandson committed Oct 24, 2023
1 parent 7083eae commit f782298
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@71f26863</span></code></pre>
</span><span class="comment">// dslparser: RuntimeUnitParser = repl.MdocSession$MdocApp$$anon$1@6667b0d0</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@292769f7
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@2bc4b6ab
</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@310f4c5b
</span><span class="comment">// bad: ConfigObjectSource = pureconfig.ConfigObjectSource@40be3f23
</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@ec6fc49
</span><span class="comment">// qsrc: ConfigObjectSource = pureconfig.ConfigObjectSource@4ffcd81a
</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@2cebfd18
</span><span class="comment">// source: ConfigObjectSource = pureconfig.ConfigObjectSource@11c92d78
</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 f782298

Please sign in to comment.