[Haskell-cafe] Re: instance Eq (a -> b)
Jonas Almström Duregård
jonas.duregard at gmail.com
Wed Apr 14 04:35:09 EDT 2010
>> what about these?
>> f,g :: Bool -> Int
>> f x = 6
>> g x = x `seq` 6
>
> As pointed out on #haskell by roconnor, we apparently don't care, this is a
> shame... We only care that x == y => f x == g y, and x == y can't tell if
> _|_ == _|_.
So the facts that
(1) f == g
(2) f undefined = 6
(3) g undefined = undefined
is not a problem?
/Jonas
2010/4/14 Thomas Davie <tom.davie at gmail.com>:
>
> On 14 Apr 2010, at 09:12, Jonas Almström Duregård wrote:
>
> 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.
>
> what about these?
> f,g :: Bool -> Int
> f x = 6
> g x = x `seq` 6
>
> As pointed out on #haskell by roconnor, we apparently don't care, this is a
> shame... We only care that x == y => f x == g y, and x == y can't tell if
> _|_ == _|_.
> It's a shame that we can't use this to tell if two functions are equally
> lazy (something I would consider part of the semantics of the function).
> Bob
More information about the Haskell-Cafe
mailing list