2022-07-25 18:56:12 +00:00
|
|
|
export * from './Types/Complex.mjs'
|
|
|
|
export * from '../generic/Types/generic.mjs'
|
2022-07-19 16:52:16 +00:00
|
|
|
|
|
|
|
export const complex = {
|
2022-07-19 18:54:22 +00:00
|
|
|
/* Very permissive for sake of proof-of-concept; would be better to
|
|
|
|
* have a numeric/scalar type, e.g. by implementing subtypes in
|
|
|
|
* typed-function
|
|
|
|
*/
|
2022-07-25 18:56:12 +00:00
|
|
|
'undefined': () => u => u,
|
|
|
|
'undefined,any': () => (u, y) => u,
|
|
|
|
'any,undefined': () => (x, u) => u,
|
|
|
|
'any,any': () => (x, y) => ({re: x, im: y}),
|
2022-07-19 18:54:22 +00:00
|
|
|
/* Take advantage of conversions in typed-function */
|
2022-07-23 16:55:02 +00:00
|
|
|
Complex: () => z => z
|
2022-07-19 16:52:16 +00:00
|
|
|
}
|