From 005f49e6919b0ff0d40093c3a13ea0638514cd8f Mon Sep 17 00:00:00 2001
From: Glen Whitney <glen@nobody@nowhere.net>
Date: Wed, 2 Apr 2025 17:46:06 +0000
Subject: [PATCH] Update Item Specifications

---
 Item-Specifications.md | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Item-Specifications.md b/Item-Specifications.md
index 4cf0f73..bcf2d48 100644
--- a/Item-Specifications.md
+++ b/Item-Specifications.md
@@ -61,12 +61,12 @@ export const sqrt = onType(Number, math => {
       return Returns(Number, Math.sqrt)
    }
    const complex = math.complex.resolve(Number, Number)
-   return Returns(Union(Number, Complex(Number)), a => {
+   return Returns(
+      Union(Number, Complex(Number)),
+      a => n < 0 ? complex(0, Math.sqrt(-a)) : Math.sqrt(a)
       if (isNaN(a)) return NaN
-      if (n >= 0) return Math.sqrt(a)
-      return complex(0, Math.sqrt(-a)
-   })
-}]
+   )
+}
 ```
 
 Note here that ideally the accesses to `math.config.predictable` and `math.types.Complex` in this factory mean that the resulting implementation of `sqrt` will depend on the `predictable` property of `math.config`, and so only be invalidated when that property changes, not on any change to `math.config`, just the way that the other possible implementation would only be invalidated if the implementation of `complex` on `Number, Number` were updated, but unaffected if the implementation of `complex` on `BigInt, BigInt` changed. Also note the convenience that for unary signatures, you can supply just a type; you don't have to put it in braces.
@@ -78,7 +78,7 @@ export const tau = onType(
    Number, 6.2831853,
    BigNumber, math => math.bignumber('6.28318530717958647692'),
    [], math => math.resolve('tau', [math.config.constants])
-]
+)
 ```
 A few things to note in this example: now clients of the eventual bundle can use `math.resolve('tau', math.BigNumber)` to get the BigNumber value of tau regardless of the current type in the config.constants setting, the plain `math.tau` should resolve to the correct scalar entity, and the plain `math.tau` should be reset if either config.constants changes or if the setting of math.tau on the type config.constants changes.