(broken) modules are mappings from name to typed value
This commit is contained in:
parent
c27c7d3648
commit
639d70afa5
21 changed files with 125 additions and 132 deletions
|
|
@ -16,15 +16,15 @@ const mkType = makeTypeParser({
|
|||
});
|
||||
|
||||
export const ModulePointNominal = [
|
||||
newDynamic(PointCartesian2D )(Type),
|
||||
newDynamic(PointPolar2D )(Type),
|
||||
["PointCartesian2D" , newDynamic(PointCartesian2D )(Type)],
|
||||
["PointPolar2D" , newDynamic(PointPolar2D )(Type)],
|
||||
|
||||
newDynamic(examplePoint )(PointCartesian2D),
|
||||
["examplePoint" , newDynamic(examplePoint )(PointCartesian2D)],
|
||||
|
||||
newDynamic(cart2polar)(mkType("PointCartesian2D -> PointPolar2D")),
|
||||
newDynamic(polar2cart)(mkType("PointPolar2D -> PointCartesian2D")),
|
||||
["cart2polar", newDynamic(cart2polar)(mkType("PointCartesian2D -> PointPolar2D"))],
|
||||
["polar2cart", newDynamic(polar2cart)(mkType("PointPolar2D -> PointCartesian2D"))],
|
||||
|
||||
newDynamic(translate)(mkType("Double -> Double -> PointCartesian2D")),
|
||||
newDynamic(rotate )(mkType("Double -> PointPolar2D -> PointPolar2D")),
|
||||
newDynamic(scale )(mkType("Double -> PointPolar2D -> PointPolar2D")),
|
||||
["translate", newDynamic(translate)(mkType("Double -> Double -> PointCartesian2D"))],
|
||||
["rotate" , newDynamic(rotate )(mkType("Double -> PointPolar2D -> PointPolar2D"))],
|
||||
["scale" , newDynamic(scale )(mkType("Double -> PointPolar2D -> PointPolar2D"))],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -57,20 +57,20 @@ const mkType = makeTypeParser({
|
|||
});
|
||||
|
||||
const ModuleConversions = [
|
||||
newDynamic(NPoint2DCartesian )(mkType("NPoint2DCartesian") ),
|
||||
newDynamic(NPoint2DPolar )(mkType("NPoint2DPolar") ),
|
||||
newDynamic(cart2polar )(mkType("NPoint2DCartesian -> NPoint2DPolar") ),
|
||||
newDynamic(polar2cart )(mkType("NPoint2DPolar -> NPoint2DCartesian") ),
|
||||
["NPoint2DCartesian" , newDynamic(NPoint2DCartesian )(mkType("NPoint2DCartesian" ))],
|
||||
["NPoint2DPolar" , newDynamic(NPoint2DPolar )(mkType("NPoint2DPolar" ))],
|
||||
["cart2polar" , newDynamic(cart2polar )(mkType("NPoint2DCartesian -> NPoint2DPolar"))],
|
||||
["polar2cart" , newDynamic(polar2cart )(mkType("NPoint2DPolar -> NPoint2DCartesian"))],
|
||||
];
|
||||
|
||||
const examplePointCart = newCartesian(1)(2);
|
||||
const examplePointPolar = newPolar(0)(5);
|
||||
|
||||
const ModuleExamples = [
|
||||
newDynamic(examplePointCart )(SPoint2DCartesian ),
|
||||
newDynamic(examplePointCart )(NPoint2DCartesian ),
|
||||
newDynamic(examplePointPolar )(SPoint2DPolar ),
|
||||
newDynamic(examplePointPolar )(NPoint2DPolar ),
|
||||
["examplePointCart" , newDynamic(examplePointCart )(SPoint2DCartesian )],
|
||||
["examplePointCart" , newDynamic(examplePointCart )(NPoint2DCartesian )],
|
||||
["examplePointPolar" , newDynamic(examplePointPolar )(SPoint2DPolar )],
|
||||
["examplePointPolar" , newDynamic(examplePointPolar )(NPoint2DPolar )],
|
||||
];
|
||||
|
||||
export const ModuleAll = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue