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

Jonas Almström Duregård jonas.duregard at gmail.com
Wed Apr 14 04:12:25 EDT 2010

```> 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.

f,g :: Bool -> Int
f x = 6
g x = x `seq` 6

/Jonas

2010/4/14 Thomas Davie <tom.davie at gmail.com>:
>
> 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
```