[Haskell-cafe] Re: New to haskell: unresolved overloading question

Christian Maeder maeder at tzi.de
Tue Feb 22 07:41:36 EST 2005


Tomasz Zielonka wrote:
> Why not forget about ApproxEq for () and Bool and simply define a
> function?
> 
>   (~=) :: (Ord a, Num a) => a -> a -> Bool
>   x ~= y = abs (x-y) < 1

Indeed, this works best. The instance for lists is also not too important.

Christian


More information about the Haskell-Cafe mailing list