From 97ec746f83d57b90b9d7bdee178d7c6ffe812e09 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 6 Sep 2022 17:28:43 -0400 Subject: [PATCH] doc: Add a roadmap to the README --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a36e0c0..72dbe8b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ # typomath -Proof of concepts for a PocoMath-adjacent approach to a possible math.ts (TypeScript analogue of mathjs) \ No newline at end of file +Proof of concepts for a PocoMath-adjacent approach to a possible math.ts (TypeScript analogue of mathjs) + +Roadmap: + +1. Install over.ts and get an example of add with number and bigint implementations working with it. +2. Use the builder pattern to get add working with its implmentations defined incrementally before producing the final overload. +3. Use the builder pattern to get a single object with both an add and a negate method, with both defined incrementally, working. +4. Incorporate a subtract method that works generically with both add and negate, with just one generic implementation. +5. Attempt to eliminate redundant specification of implementation signatures. +6. Incorporate multi-argument reducing implementation of add. +7. Actually split into multiple source files to make sure that works. +8. Add a template Complex type with add and subtract. +9. Define a sqrt method that depends on a literal constant non-mutable config object that has to be set before loading sqrt, but with two different imports that use different settings for the config. +10. Add a NumInt type to the existing methods. For reference in the case of positive numbers: https://stackoverflow.com/questions/71670965/how-do-i-assert-a-number-type-is-positive. One can make a similar template for integers, esp. using `${bigint}` in a template literal. But as the comments point out, this doesn't work for computed arguments, only literals. (I think there was a package or repository or other library of lots of such examples, but now I can't find it :-( but anyhow...). So I am not really sure how a type that can't really be precisely represented in TypeScript is going to work out in this approach... Maybe there is a way to automatically combine branded types with type guards. Check out newtype-ts, it has a type library with a bunch of branded types. + +If we get that far, then math.ts is probably feasible.