|
|
@@ -30,12 +30,12 @@
|
|
|
The compound expression <code><span class="numbat-value">3</span> <span class="numbat-unit">months</span> + <span class="numbat-value">2</span> <span class="numbat-unit">years</span></code> is therefore well-typed:
|
|
|
</p>
|
|
|
|
|
|
- <div id="editor1" class="code-editor">3 months + 2 years</div>
|
|
|
+ <div id="editor1" class="code-editor">3 months + 2 years # you can edit these examples!</div>
|
|
|
<pre id="output1" class="numbat-output"></pre>
|
|
|
|
|
|
<p>
|
|
|
On the other hand, <code><span class="numbat-value">3</span> <span class="numbat-unit">months</span> + <span class="numbat-value">2</span> <span class="numbat-unit">lightyears</span></code> is <em>ill</em>-typed, because the right-hand side is of type <code class="numbat-type-identifier">Length</code>.
|
|
|
- You can change ‘years’ to ‘lightyears’ in the example above to see the resulting compiler error.
|
|
|
+ You can change ‘years’ to ‘lightyears’ in the editor above to see the resulting compiler error.
|
|
|
</p>
|
|
|
|
|
|
<p>
|