import { Layout, Txt, makeScene2D } from "@motion-canvas/2d"; import { Direction, beginSlide, createRef, slideTransition, } from "@motion-canvas/core"; import { theme } from "../theme"; const churchNumerals = [ "0 = λ f . λ x . x (no application of f)", "1 = λ f . λ x . f x (one application of f)", "2 = λ f . λ x . f (f x) (two applications of f)", "succ = λ n . λ f . λ x . f ((n f) x)", ]; export default makeScene2D(function* (view) { const numerals = createRef(); view.add( Church Encoding ); yield* slideTransition(Direction.Right); yield* beginSlide("The Lambda Calculus - Church Encoding"); for (const numeral of churchNumerals) { yield* numerals().text(numerals().text() + "\n\n" + numeral, 1); yield* beginSlide("substitution - " + numeral); } });