Commit Graph

3 Commits

Author SHA1 Message Date
Glen Whitney d83f2a7f23 feat: Instantiate instances of template instantiation need for self-reference
Formerly, when a self-reference like `self(Tuple<number>)` was encountered,
  but the `Tuple<number>` instance of a `Tuple<T>` implementation for this
  operation had not yet been instantiated, the reference would be fulfilled
  with a call to the catchall implementation for `Tuple`. Now the
  necessary instance is instantiated on the spot and referred to instead.

  This change is used to complete return-type specification for all of the
  Tuple functions.
2022-08-30 15:15:23 -04:00
Glen Whitney de42c22ab4 refactor: Convert resolution to two-tier system
Typed-function's sort order/matching algorithm was interfering with
  template resolution. This commit solves the difficulty by moving the
  "catchall" implementations that implement generation of new template
  instances into a separate "fallback" typed-function universe, so that
  Pocomath can control exactly when that is searched.

  Removes a couple of the matching anomalies already noted in the tests.

  Also extends return types to somewhat more functions.
2022-08-29 09:30:07 -04: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