Let's say you need to compute a function:
f (x,y) = ((x `mod` 3)+(y `mod` 3)) `mod` 2
Then, if f (-1,0) manually expanded once, it turns out:
((-1 `mod` 3)+(0 `mod` 3)) `mod` 2 1
If, however, a built-in function is used, the result:
let f (x,y) = ((x `mod` 3)+(y `mod` 3)) `mod` 2 in f (-1,0) 0
What happens when you save a function that does not produce the expected result?
I assume this is because f uses Integral instead of Int ?
source share