money-ts
Version:
TypeScript library for type-safe and lossless encoding and manipulation of world currencies and precious metals
16 lines • 756 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var newtype_ts_1 = require("newtype-ts");
var positiveRational = require("./PositiveRational");
exports.wrap = newtype_ts_1.unsafeCoerce;
exports.unwrap = newtype_ts_1.unsafeCoerce;
exports.exchange = function (er) { return function (d) {
return newtype_ts_1.unsafeCoerce(d.mul(exports.unwrap(er)));
}; };
function compose(bc, ab) {
return exports.wrap(positiveRational.mul(exports.unwrap(bc), exports.unwrap(ab)));
}
exports.compose = compose;
exports.getSetoid = function () { return newtype_ts_1.unsafeCoerce(positiveRational.setoid); };
exports.getOrd = function () { return newtype_ts_1.unsafeCoerce(positiveRational.ord); };
//# sourceMappingURL=ExchangeRate.js.map