[Haskell-cafe] Re: instance Eq (a -> b)

Thomas Davie tom.davie at gmail.com
Wed Apr 14 04:05:00 EDT 2010


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


More information about the Haskell-Cafe mailing list