Disco> f : Q -> N
Disco> f(2/4) = 6
Disco> f(1/2)
Error: value did not match any of the branches in a case expression.
In fact f is completely undefined, since the pattern 2/4 will never match anything; rational inputs are always reduced, and the numerator and denominator will be matched literally.
The above is a little strange, and maybe not worth fixing, but I think the below is more troubling:
Disco> f : F -> N
Disco> f(n/4) = n
Disco> f(1/2)
Error: value did not match any of the branches in a case expression.
Currently,
In fact
f
is completely undefined, since the pattern2/4
will never match anything; rational inputs are always reduced, and the numerator and denominator will be matched literally.The above is a little strange, and maybe not worth fixing, but I think the below is more troubling:
I would expect to get
2
as a result.