
14 Apr
2010
14 Apr
'10
4:05 a.m.
On 14 Apr 2010, at 09:01, Jonas Almström Duregård wrote:
But if one did start considering bottom to be a value, one would have to distinguish different ones. For instance, (error "ABC") vs. (error "PQR"). Obviously this is not finite.
Nor is it computable, since it must distinguish terminating programs from nonterminating ones (i.e. the halting problem).
On a side note, since "instance (Finite a, Finite b) => Finite (a -> b)" should be possible, one can even compare some higher order functions with this approach ;).
f,g :: Bool -> Int f x = 6 g x = 6 We can in Haskell compute that these two functions are equal, without solving the halting problem. Bob