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

Ivan Miljenovic ivan.miljenovic at gmail.com
Wed Apr 14 02:11:02 EDT 2010


On 14 April 2010 16:03, Ashley Yakeley <ashley at semantic.org> wrote:
> Why isn't there an instance Eq (a -> b) ?

How do you prove that f = (2*) and g x = x + x are equal?
Mathematically, you can; but the only way you can "prove" it in
Haskell is by comparing the values for the entire domain  (which gets
computationally expensive)...

Or, how about higher order functions like map?

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list