
22 May
2005
22 May
'05
10:21 p.m.
G'day all.
Quoting Ashley Yakeley
Which of these argument orders is more intuitive to you?
This one:
2. This one is more familiar for the English language and for the standard operators:
add :: Absolute -> Diff -> Absolute add a d = a + d subtract :: Absolute -> Diff -> Absolute subtract a d = a - d diff :: Absolute -> Absolute -> Diff diff a b = a - b
But even better would be if you could do both, and not distinguish between subtract and diff: class Add a b c | a b -> c where add :: a -> b -> c class Subtract a b c | a b -> c where subtract :: a -> b -> c ...you get the idea. Cheers, Andrew Bromage