From 6ae44d09faa0ae353c0818705503cad42127d102 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 3 Mar 2024 15:03:41 +0100 Subject: Even more samples wtf --- samples/rosetta/y_combinator.bruijn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 samples/rosetta/y_combinator.bruijn (limited to 'samples/rosetta/y_combinator.bruijn') diff --git a/samples/rosetta/y_combinator.bruijn b/samples/rosetta/y_combinator.bruijn new file mode 100644 index 0000000..95a985b --- /dev/null +++ b/samples/rosetta/y_combinator.bruijn @@ -0,0 +1,15 @@ +:import std/Number . + +# sage bird combinator +y [[1 (0 0)] [1 (0 0)]] + +# factorial using y +factorial y [[=?0 (+1) (0 ⋅ (1 --0))]] + +:test ((factorial (+6)) =? (+720)) ([[1]]) + +# (very slow) fibonacci using y +fibonacci y [[0