recip for Ratio

Scott Turner p.turner@computer.org
Mon, 26 Feb 2001 09:53:38 -0500


In the Haskell 98 Library Report, recip is defined for the Ratio type as:
    recip (x:%y)  =  if x < 0 then (-y) :% (-x) else y :% x

Is it intentional that 
    recip (0 % 1)
is not an error?  Everywhere else the denominator is forced to be positive.
 Infinity can be a useful number, if the type is consistent about it.
--
Scott Turner
p.turner@computer.org       http://www.billygoat.org/pkturner