branching and very basic merging of slots
This commit is contained in:
parent
614e6c0fdb
commit
3978f7f835
32 changed files with 684 additions and 420 deletions
|
|
@ -1,10 +1,11 @@
|
|||
import { Type } from "../primitives/types.js";
|
||||
import { typedFnType } from "../structures/types.js"
|
||||
import { Double } from "../primitives/types.js";
|
||||
import { makeTypeConstructor } from "../type_constructor.js";
|
||||
|
||||
// Create nominal types
|
||||
export const PointCartesian2D = { symbol: Symbol('PointCartesian2D'), params: [] };
|
||||
export const PointPolar2D = { symbol: Symbol('PointPolar2D') , params: [] };
|
||||
export const PointCartesian2D = makeTypeConstructor(Symbol('PointCartesian2D'))(0);
|
||||
export const PointPolar2D = makeTypeConstructor(Symbol('PointPolar2D'))(0);
|
||||
|
||||
export const cart2polar = ({x, y}) => {
|
||||
const r = Math.sqrt(x*x + y*y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue