UNPKG

@harmoniclabs/plu-ts-onchain

Version:

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

22 lines (21 loc) 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._pmap = void 0; var type_system_1 = require("../../../../type_system/index.js"); var minimal_1 = require("../../../builtins/pprepend/minimal.js"); var phoist_1 = require("../../../phoist.js"); var plam_1 = require("../../../plam.js"); var minimal_common_1 = require("../../data/conversion/minimal_common.js"); var minimal_2 = require("../const/minimal.js"); var minimal_3 = require("../pfoldr/minimal.js"); function _pmap(fromT, toT) { return (0, phoist_1.phoist)((0, plam_1.plam)((0, type_system_1.lam)(fromT, toT), (0, type_system_1.lam)((0, type_system_1.list)(fromT), (0, type_system_1.list)(toT)))(function (f) { return (0, minimal_common_1._papp)((0, minimal_common_1._papp)((0, phoist_1.phoist)((0, plam_1.plam)((0, type_system_1.lam)(fromT, toT), (0, type_system_1.fn)([(0, type_system_1.list)(toT), (0, type_system_1.list)(fromT)], (0, type_system_1.list)(toT)))(function (mapFunc) { return (0, minimal_common_1._papp)((0, minimal_3._pfoldr)(fromT, (0, type_system_1.list)(toT)), (0, plam_1.plam)(fromT, (0, type_system_1.lam)((0, type_system_1.list)(toT), (0, type_system_1.list)(toT)))(function (elem) { return (0, minimal_common_1._papp)((0, minimal_1._pprepend)(toT), (0, minimal_common_1._papp)(mapFunc, elem)); })); })), f), (0, minimal_2._pnil)(toT)); // .$( _list ) }, "pmap")); } exports._pmap = _pmap;