summaryrefslogtreecommitdiff
path: root/src/scenes/reductions.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenes/reductions.tsx')
-rw-r--r--src/scenes/reductions.tsx40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/scenes/reductions.tsx b/src/scenes/reductions.tsx
new file mode 100644
index 0000000..5ee8961
--- /dev/null
+++ b/src/scenes/reductions.tsx
@@ -0,0 +1,40 @@
+import { Layout, Txt, makeScene2D } from "@motion-canvas/2d";
+import {
+ Direction,
+ beginSlide,
+ createRef,
+ slideTransition,
+} from "@motion-canvas/core";
+import { theme } from "../theme";
+
+const reductions = [
+ "1. α - conversion: Renaming of bound variables to avoid name clashes (out of\nscope - assume user knows not to bind variable names already chosen elsewhere).",
+ "2. β - reduction: Application of a function to an argument.",
+ "3. η - reduction: Conversion of a function to a point-free form (out of scope).",
+];
+
+export default makeScene2D(function* (view) {
+ const rules = createRef<Txt>();
+
+ view.add(
+ <Layout layout direction="column" alignItems="center">
+ <Txt fontSize={40} fontFamily={theme.font} fill={theme.text.hex}>
+ The Lambda Calculus - Reductions
+ </Txt>
+ <Txt
+ ref={rules}
+ fontSize={30}
+ fontFamily={theme.font}
+ fill={theme.text.hex}
+ ></Txt>
+ </Layout>
+ );
+
+ yield* slideTransition(Direction.Right);
+ yield* beginSlide("The Lambda Calculus - Reductions");
+
+ for (const rule of reductions) {
+ yield* rules().text(rules().text() + "\n\n" + rule, 1);
+ yield* beginSlide("reduction - " + rule);
+ }
+});