@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
23 lines (22 loc) • 977 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.peqList = void 0;
var types_1 = require("../../../type_system/types.js");
var list_1 = require("../../builtins/list/index.js");
var phoist_1 = require("../../phoist.js");
var punsafeConvertType_1 = require("../../punsafeConvertType/index.js");
var pBool_1 = require("../bool/pBool.js");
var pstdEq_1 = require("../stdEq/pstdEq.js");
var pcompareList_1 = require("./pcompareList/index.js");
/**
* @since v0.5.0
* @param {TermType} t type of the elements of the list
*/
function peqList(t) {
return (0, phoist_1.phoist)((0, pcompareList_1.pcompareList)(t, t)
.$((0, punsafeConvertType_1.punsafeConvertType)(list_1.pisEmpty, (0, types_1.lam)((0, types_1.list)(t), types_1.bool)))
// if rest second is matched then restFst is not empty
.$(function (_restFst) { return (0, pBool_1.pBool)(false); })
.$((0, pstdEq_1.pstdEq)(t)));
}
exports.peqList = peqList;