use newDynamic() everywhere instead of { i: ... , t: ... }

This commit is contained in:
Joeri Exelmans 2025-05-08 23:56:58 +02:00
parent 34d06aa82a
commit e1a2139cb4
22 changed files with 141 additions and 124 deletions

View file

@ -16,15 +16,15 @@ const mkType = makeTypeParser({
});
export const ModulePointNominal = [
{i: PointCartesian2D , t: Type},
{i: PointPolar2D , t: Type},
newDynamic(PointCartesian2D )(Type),
newDynamic(PointPolar2D )(Type),
{i: examplePoint , t: PointCartesian2D},
newDynamic(examplePoint )(PointCartesian2D),
{i: cart2polar, t: mkType("PointCartesian2D -> PointPolar2D")},
{i: polar2cart, t: mkType("PointPolar2D -> PointCartesian2D")},
newDynamic(cart2polar)(mkType("PointCartesian2D -> PointPolar2D")),
newDynamic(polar2cart)(mkType("PointPolar2D -> PointCartesian2D")),
{i: translate, t: mkType("Double -> Double -> PointCartesian2D")},
{i: rotate , t: mkType("Double -> PointPolar2D -> PointPolar2D")},
{i: scale , t: mkType("Double -> PointPolar2D -> PointPolar2D")},
newDynamic(translate)(mkType("Double -> Double -> PointCartesian2D")),
newDynamic(rotate )(mkType("Double -> PointPolar2D -> PointPolar2D")),
newDynamic(scale )(mkType("Double -> PointPolar2D -> PointPolar2D")),
];

View file

@ -57,20 +57,20 @@ const mkType = makeTypeParser({
});
const ModuleConversions = [
{ i: NPoint2DCartesian , t: mkType("NPoint2DCartesian") },
{ i: NPoint2DPolar , t: mkType("NPoint2DPolar") },
{ i: cart2polar , t: mkType("NPoint2DCartesian -> NPoint2DPolar") },
{ i: polar2cart , t: mkType("NPoint2DPolar -> NPoint2DCartesian") },
newDynamic(NPoint2DCartesian )(mkType("NPoint2DCartesian") ),
newDynamic(NPoint2DPolar )(mkType("NPoint2DPolar") ),
newDynamic(cart2polar )(mkType("NPoint2DCartesian -> NPoint2DPolar") ),
newDynamic(polar2cart )(mkType("NPoint2DPolar -> NPoint2DCartesian") ),
];
const examplePointCart = newCartesian(1)(2);
const examplePointPolar = newPolar(0)(5);
const ModuleExamples = [
{ i: examplePointCart , t: SPoint2DCartesian },
{ i: examplePointCart , t: NPoint2DCartesian },
{ i: examplePointPolar , t: SPoint2DPolar },
{ i: examplePointPolar , t: NPoint2DPolar },
newDynamic(examplePointCart )(SPoint2DCartesian ),
newDynamic(examplePointCart )(NPoint2DCartesian ),
newDynamic(examplePointPolar )(SPoint2DPolar ),
newDynamic(examplePointPolar )(NPoint2DPolar ),
];
export const ModuleAll = [