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

roconnor at theorem.ca roconnor at theorem.ca
Thu Apr 15 02:21:44 EDT 2010


On Thu, 15 Apr 2010, Maciej Piechotka wrote:

> Are
>
> f 0 = 1
> f n = f (n - 1) + f (n - 2)
>
> and
>
> g 0 = 1
> g n | n > 0 = g (n - 1) + g (n - 2)
>     | n < 0 = g (n + 2) - g (n + 1)
>
> The same (morally) function?
>
> Are:
>
> f x = 2*x
>
> and
>
> f x = undefined
>
> The same function

Try using the (x == y) ==> (f x = g y) test yourself.

-- 
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''


More information about the Haskell-Cafe mailing list