feat: Template operations #41

Merged
glen merged 10 commits from template_operations into main 2022-08-01 10:09:32 +00:00
Owner

Relational functions are added using templates, and existing generic functions are made more strict with them. Also a new built-in typeOf function is added, that automatically updates itself.

Resolves #34.

Relational functions are added using templates, and existing generic functions are made more strict with them. Also a new built-in typeOf function is added, that automatically updates itself. Resolves #34.
glen added 10 commits 2022-08-01 10:09:10 +00:00
883a351aa8 refactor: Add stubs for function templates
The stubs are so far all no-ops so basically at the moment the only
  allowed template parameter 'T' is just a synonym for 'any'. But at least
  this allows us to put the definition of the generic `subtract` into
  the exact form we actually want to support.
d4a4d8f331 refactor: track all the 'prior types' of a type as types are installed
These are exactly the types that might match before the given type, and
  hence which require to have their template instantiations defined when
  an instantiation with the given type is made.
36e7b750ce refactor: Make generics more strict via templates
This commit also adds a built-in `typeOf` function to every PocomathInstance.
  It also adds a notation (prefix '!') for "eager" templeates that
  instantiate themselves for all types immediately upon definition.
glen merged commit fe54bc6004 into main 2022-08-01 10:09:32 +00:00
Sign in to join this conversation.
No description provided.