>>12509196easy enough to implement in haskell
[code:lit]
instance (Eq b, Enum a, Bounded a) => Eq (a -> b) where
f == g = all (\x -> f x == g x ) [minBound..maxBound]
[/code:lit]
then for example, (&&) == (||) returns false, (&&) == (&&) returns true, ((\x -> x*2) :: Int -> Int) == (\x -> x*3) returns false
If you're not familiar with haskell, Eq b means that equality must be defined for the output type of the function (b),
Enum a means that the input type (a) must be enumerable, and Bounded a means that that enumeration is finite.
It is possible to relax that last restriction in haskell, although it will take an infinite amount of time to test the equality of functions from an infinite set (although a finite time to test inequality, since evaluation will stop at the first false), although it is valid haskell and will compile
since functions in haskell have no side effects, any two functions with the same output for all the same input can be considered equal.