
22 May
2005
22 May
'05
8:42 p.m.
Which of these argument orders is more intuitive to you? 1. This one makes more sense when considering the function formed by applying one argument: add :: Diff -> Absolute -> Absolute add d a = a + d subtract :: Diff -> Absolute -> Absolute subtract d a = a - d diff :: Absolute -> Absolute -> Diff diff a b = b - a So "add x", "subtract y" and perhaps "diff z" are intuitively useful functions. And we also have "subtract = add . negate". 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 -- Ashley Yakeley, Seattle WA