diff options
Diffstat (limited to 'examples/fix.fusp')
-rw-r--r-- | examples/fix.fusp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/fix.fusp b/examples/fix.fusp new file mode 100644 index 0000000..617f909 --- /dev/null +++ b/examples/fix.fusp @@ -0,0 +1,10 @@ +import bool; +import int; + +fix f = fixb f (fixb f); +fixb f x = f (x x); + +main = fix myadd 5 10; + +// Fixpoint peano integer addition +myadd a m n = if (eq n 0) m (add 1 (a m (sub 1 n))); |