On 08/12/06, Dan Weston <[EMAIL PROTECTED]> wrote:
The following observations are not new, insightful, or gracious, but I
Wouldn't the following be more useful/general?
class Subtraction a b | a -> b where
(-) :: a -> a -> b
If you split them up like this, things like quadRoots take an
unwieldly type signature:
quadRoots a b c | a /= 0 = (x1 / (2*a), x2 / (2*a))
where x1 = -b - sqrt det
x2 = -b + sqrt det
det = b ^ 2 - 4*a*c
As these use many of the operations. However, this might become
manageable with class aliases [1].
[1]: http://repetae.net/john/recent/out/classalias.html
--
-David House, [EMAIL PROTECTED]
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell