So far, abs, add, norm, normsq, and sum are supported. To get them
to work, also implements the following:
* refactor: Use ReturnType function rather than just accessing .returns
* feat: distinguish marking a function as a behavior from its return type
* refactor: Rename `NotAType` to `Unknown` because it must be made closer
to a bona fide type for the sake of inhomogeneous vectors
* feat: make resolving a TypeDispatcher method on a type vector including
`Unknown` into a no-op; that simplifies a number of generic behaviors
* feat: add `haszero` method parallel to `hasnan`
* feat: track the Vector nesting depth of Vector specializations
This PR adds a boolean section, as well as an isNaN predicate on numbers. In a TypeDispatcher, when BooleanT is present, isNaN returns a BooleanT. However, in a numbers-only TypeDispatcher, it returns 1 or 0 instead. Moreover, when booleans are subsequently added to a numbers-only instance, isNaN properly reconfigures itself to return BooleanT.
No predicates that depend on approximate equality testing or a configuration object are implemented in this PR.
This PR also implements type matching and dispatching with implicit conversions, and adds an implicit conversion from BooleanT to NumberT.
Reviewed-on: #17
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>