Commit Graph

3 Commits

Author SHA1 Message Date
Glen Whitney 0dbb95bbbe feat(polynomialRoot) (#57)
Implements a simply polynomial root finder function
polynomialRoot, intended to be used for benchmarking
against mathjs.

For this purpose, adds numerous other functions (e.g.
cbrt, arg, cis), refactors sqrt (so that you can
definitely get the complex square root when you want
it), and makes numerous enhancements to the core so
that a template can match after conversions.

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #57
2022-12-01 17:47:20 +00:00
Glen Whitney 31add66f4c feat: Return type annotations (#53)
Provides the infrastructure to allow annotating the return types of functions, and does so for essentially every operation in the system (the only known exceptions being add, multiply, etc., on arbitrarily many arguments).

One main infrastructure enhancements are bounded template types, e.g. `T:number` being a template parameter where T can take on the type `number` or any subtype thereof.

A main internal enhancement is that base template types are no longer added to the typed universe; rather, there is a secondary, "meta" typed universe where they live. The primary point/purpose of this change is then the necessary search order for implementations can be much better modeled by typed-function's search order, using the `onMismatch` facility to redirect the search from fully instantiated implementations to the generic catchall implementations for each template (these catchalls live in the meta universe).

Numerous other small improvements and bugfixes were encountered along the way.

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #53
2022-08-30 19:36:44 +00:00
Glen Whitney 845a2354c9 feat: Template types (#45)
Includes a full implementation of a type-homogeneous Tuple type, using the template types
  feature, as a demonstration/check of its operation.

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Reviewed-on: #45
2022-08-05 12:48:57 +00:00