Added support for the minus operator.

This commit is contained in:
Samuel Hammersberg 2023-02-20 14:52:11 +01:00
parent fe4533c7ae
commit a36de2bde1
7 changed files with 48 additions and 12 deletions

View file

@ -24,11 +24,10 @@ fibbonaci x = case x of {
0 => 0,
1 => 1,
-- abusing overflows to represent negatives like a boss
_ => (fibbonaci (x + 9223372036854775807 + 9223372036854775807))
+ (fibbonaci (x + 9223372036854775807 + 9223372036854775807 + 1))
_ => (fibbonaci (x - 2))
+ (fibbonaci (x - 1))
} : Int;
faccer : Int -> Int;
main : Int;
main = fibbonaci 10;