nanomath/src/nanomath.js

19 lines
900 B
JavaScript
Raw Normal View History

import * as booleans from './boolean/all.js'
import * as coretypes from './coretypes/all.js'
import * as generics from './generic/all.js'
import * as numbers from './number/all.js'
import * as complex from './complex/all.js'
import {TypeDispatcher} from '#core/TypeDispatcher.js'
// At the moment, since we are not sorting patterns in any way,
// order matters in the construction. Patterns that come later in
// the following list will be tried earlier. (The rationale for that
// ordering is that any time you merge something, it should supersede
// whatever has been merged before.)
// Hence, in building the math instance, we put complex first because
// we want its conversion (which converts _any_ non-complex type to
// complex, potentially making a poor overload choice) to be tried last.
const math = new TypeDispatcher(complex, generics, booleans, coretypes, numbers)
export default math