@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
25 lines (24 loc) • 820 B
TypeScript
import { PType } from "../../PType/index.js";
import { PLam, TermFn } from "../../PTypes/index.js";
import { Term } from "../../Term/index.js";
/**
* for reference the "Z combinator in js": https://medium.com/swlh/y-and-z-combinators-in-javascript-lambda-calculus-with-real-code-31f25be934ec
*
* ```js
* const Zcombinator = (
* Z => (
* toMakeRecursive => Z( value => toMakeRecursive(toMakeRecursive)(value) )
* )( toMakeRecursive => Z( value => toMakeRecursive(toMakeRecursive)(value)) )
* );
* ```
* of type
* ```js
* Z => toMakeRecursive => value => result
* ```
* and ```toMakeRecursive``` has to be of type
* ```js
* self => value => result
* ```
*/
export declare function precursive<A extends PType, B extends PType>(fnBody: Term<PLam<PLam<A, B>, // self
PLam<A, B>>>): TermFn<[A], B>;