diff options
| -rw-r--r-- | doc/undo.md | 4 | ||||
| -rw-r--r-- | docs/doc/undo.html | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/undo.md b/doc/undo.md index 3dded26a..08099e8f 100644 --- a/doc/undo.md +++ b/doc/undo.md @@ -23,7 +23,7 @@ If `π½` can be inverted exactly, then Undo just does that. However, there are ΓΛ Β―3 ΓΛβΌ ΓΛ Β―3 # It's not the same! -Don't worry, this isn't 'nam. Undo doesn't always satisfy `π© β‘ π½βΌ π½ π©`, but it *does* obey `π© β‘ π½ π½βΌ π©`. That is, it gives one possible argument that could have been passed to `π½`, just not necessarily the one that actually was. BQN is conservative in how it uses this freedom, so that it won't for example make up new elements entirely to find an inverse. It's usually used when there's an obvious or standard way to pick which of the possible values should be returned. +Don't worry, this isn't 'nam. Undo doesn't always satisfy `π© β‘ π½βΌ π½ π©`, but it *does* obey `π© β‘ π½ π½βΌ π©`. That is, it gives one possible argument that could have been passed to `π½`, just not necessarily the one that actually was. BQN is conservative in how it uses this freedom, so that it won't for example make up new elements entirely to find an inverse: `1βΈβ` is one function that it could undo but won't. It's usually used when there's an obvious or standard way to pick which of the possible values should be returned. In a BQN with floating-point numbers, computations are approximate, so the inverse is allowed to be approximate as well (any error should still be very small though). @@ -35,7 +35,7 @@ For the full list, see [the specification](../spec/inferred.md#undo). An individ Arithmetic and simple combinators are usually invertible. A compound function that refers to its argument just once, like `6+β½ββ`, can typically be undone, but one that uses the argument in two different ways, such as `β’+β`, probably can't. -A few notable inverses are the [logarithm](arithmetic.md#basic-arithmetic) `ββΌ`, [un-Transpose](transpose.md) `ββΌ`, and [Indices inverse](replicate.md#inverse) `/βΌ`. [Enclose](enclose.md) inverse, `<βΌ`, is an alternative to [First](pick.md#first) that requires its argument to be a unit. +A few notable inverses are the [logarithm](arithmetic.md#basic-arithmetic) `ββΌ`, [un-Transpose](transpose.md) `ββΌ`, and [Indices inverse](replicate.md#inverse) `/βΌ`. [Enclose](enclose.md) inverse, `<βΌ`, is an alternative to [First](pick.md#first) that requires its argument to be a unit array. Structural functions like [Take](take.md) and [shifts](shift.md) that remove elements from `π©` can't be inverted, because given the result there's no way to know what the elements should be. However, there are two special cases that have inverses defined despite losing data: these are `β£βΌ` and `kβΌ` where `k` is a constant (a data type, or `kΛ`). For these, `π©` is required to [match](match.md) the always returned value `π¨` or `k`, and this value is also used for the resultβeven though any result would be valid, as these functions ignore `π©`. diff --git a/docs/doc/undo.html b/docs/doc/undo.html index 5afa4543..64d8ab53 100644 --- a/docs/doc/undo.html +++ b/docs/doc/undo.html @@ -27,7 +27,7 @@ <span class='Function'>Γ</span><span class='Modifier'>ΛβΌ</span> <span class='Function'>Γ</span><span class='Modifier'>Λ</span> <span class='Number'>Β―3</span> <span class='Comment'># It's not the same! </span>3 </pre> -<p>Don't worry, this isn't 'nam. Undo doesn't always satisfy <code><span class='Value'>π©</span> <span class='Function'>β‘</span> <span class='Function'>π½</span><span class='Modifier'>βΌ</span> <span class='Function'>π½</span> <span class='Value'>π©</span></code>, but it <em>does</em> obey <code><span class='Value'>π©</span> <span class='Function'>β‘</span> <span class='Function'>π½</span> <span class='Function'>π½</span><span class='Modifier'>βΌ</span> <span class='Value'>π©</span></code>. That is, it gives one possible argument that could have been passed to <code><span class='Function'>π½</span></code>, just not necessarily the one that actually was. BQN is conservative in how it uses this freedom, so that it won't for example make up new elements entirely to find an inverse. It's usually used when there's an obvious or standard way to pick which of the possible values should be returned.</p> +<p>Don't worry, this isn't 'nam. Undo doesn't always satisfy <code><span class='Value'>π©</span> <span class='Function'>β‘</span> <span class='Function'>π½</span><span class='Modifier'>βΌ</span> <span class='Function'>π½</span> <span class='Value'>π©</span></code>, but it <em>does</em> obey <code><span class='Value'>π©</span> <span class='Function'>β‘</span> <span class='Function'>π½</span> <span class='Function'>π½</span><span class='Modifier'>βΌ</span> <span class='Value'>π©</span></code>. That is, it gives one possible argument that could have been passed to <code><span class='Function'>π½</span></code>, just not necessarily the one that actually was. BQN is conservative in how it uses this freedom, so that it won't for example make up new elements entirely to find an inverse: <code><span class='Number'>1</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span></code> is one function that it could undo but won't. It's usually used when there's an obvious or standard way to pick which of the possible values should be returned.</p> <p>In a BQN with floating-point numbers, computations are approximate, so the inverse is allowed to be approximate as well (any error should still be very small though).</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=NiAtIOKImuKBvOKImjY=">βοΈ</a><pre> <span class='Number'>6</span> <span class='Function'>-</span> <span class='Function'>β</span><span class='Modifier'>βΌ</span><span class='Function'>β</span><span class='Number'>6</span> 8.881784197001252eΒ―16 @@ -35,7 +35,7 @@ <h2 id="whats-supported"><a class="header" href="#whats-supported">What's supported?</a></h2> <p>For the full list, see <a href="../spec/inferred.html#undo">the specification</a>. An individual implementation might support a lot more functionality than is required, so if you're not concerned about portability just try out whatever function you're interested in.</p> <p>Arithmetic and simple combinators are usually invertible. A compound function that refers to its argument just once, like <code><span class='Number'>6</span><span class='Function'>+β½</span><span class='Modifier2'>β</span><span class='Function'>β</span></code>, can typically be undone, but one that uses the argument in two different ways, such as <code><span class='Function'>β’+β</span></code>, probably can't.</p> -<p>A few notable inverses are the <a href="arithmetic.html#basic-arithmetic">logarithm</a> <code><span class='Function'>β</span><span class='Modifier'>βΌ</span></code>, <a href="transpose.html">un-Transpose</a> <code><span class='Function'>β</span><span class='Modifier'>βΌ</span></code>, and <a href="replicate.html#inverse">Indices inverse</a> <code><span class='Function'>/</span><span class='Modifier'>βΌ</span></code>. <a href="enclose.html">Enclose</a> inverse, <code><span class='Function'><</span><span class='Modifier'>βΌ</span></code>, is an alternative to <a href="pick.html#first">First</a> that requires its argument to be a unit.</p> +<p>A few notable inverses are the <a href="arithmetic.html#basic-arithmetic">logarithm</a> <code><span class='Function'>β</span><span class='Modifier'>βΌ</span></code>, <a href="transpose.html">un-Transpose</a> <code><span class='Function'>β</span><span class='Modifier'>βΌ</span></code>, and <a href="replicate.html#inverse">Indices inverse</a> <code><span class='Function'>/</span><span class='Modifier'>βΌ</span></code>. <a href="enclose.html">Enclose</a> inverse, <code><span class='Function'><</span><span class='Modifier'>βΌ</span></code>, is an alternative to <a href="pick.html#first">First</a> that requires its argument to be a unit array.</p> <p>Structural functions like <a href="take.html">Take</a> and <a href="shift.html">shifts</a> that remove elements from <code><span class='Value'>π©</span></code> can't be inverted, because given the result there's no way to know what the elements should be. However, there are two special cases that have inverses defined despite losing data: these are <code><span class='Function'>β£</span><span class='Modifier'>βΌ</span></code> and <code><span class='Value'>k</span><span class='Modifier'>βΌ</span></code> where <code><span class='Value'>k</span></code> is a constant (a data type, or <code><span class='Value'>k</span><span class='Modifier'>Λ</span></code>). For these, <code><span class='Value'>π©</span></code> is required to <a href="match.html">match</a> the always returned value <code><span class='Value'>π¨</span></code> or <code><span class='Value'>k</span></code>, and this value is also used for the resultβeven though any result would be valid, as these functions ignore <code><span class='Value'>π©</span></code>.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=MyDiiqPigbwgNAozIOKKo+KBvCAz">βοΈ</a><pre> <span class='Number'>3</span> <span class='Function'>β£</span><span class='Modifier'>βΌ</span> <span class='Number'>4</span> ERROR |
