Skip to main content
Home
This release is 1 version behind 0.6.1 — the latest version of @maxdeliso/typed-ski. Jump to latest

Built and signed on GitHub Actions

An implementation of a parser, evaluator, printer, and visualizer for the SKI combinators in TypeScript.

This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
4 days ago (0.6.0)
function ChurchN
ChurchN(value: number | bigint): SKIExpression

Creates a Church-encoded numeral from an integer.

Church numerals represent natural numbers as functions that apply another function a specified number of times. For example, Church numeral 2 applies a function f twice: f(f(x)).

This implementation uses an optimized factorization hierarchy algorithm that prioritizes operations by efficiency:

  • Exponentiation (application) - highest priority
  • Multiplication (composition) - medium priority
  • Successor (addition) - lowest priority

Parameters

value: number | bigint

a non-negative integer

Return Type

an extensionally equivalent Church numeral as an SKI expression

Throws

Error if the input is negative or non-integral

See

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@maxdeliso/typed-ski

Import symbol

import { ChurchN } from "@maxdeliso/typed-ski";
or

Import directly with a jsr specifier

import { ChurchN } from "jsr:@maxdeliso/typed-ski";

Add Package

pnpm i jsr:@maxdeliso/typed-ski
or (using pnpm 10.8 or older)
pnpm dlx jsr add @maxdeliso/typed-ski

Import symbol

import { ChurchN } from "@maxdeliso/typed-ski";

Add Package

yarn add jsr:@maxdeliso/typed-ski
or (using Yarn 4.8 or older)
yarn dlx jsr add @maxdeliso/typed-ski

Import symbol

import { ChurchN } from "@maxdeliso/typed-ski";

Add Package

vlt install jsr:@maxdeliso/typed-ski

Import symbol

import { ChurchN } from "@maxdeliso/typed-ski";

Add Package

npx jsr add @maxdeliso/typed-ski

Import symbol

import { ChurchN } from "@maxdeliso/typed-ski";

Add Package

bunx jsr add @maxdeliso/typed-ski

Import symbol

import { ChurchN } from "@maxdeliso/typed-ski";