I don't think there was a deep reason, but
the current story makes it more like the other 'By' functions.
Anyway, this is one thing that is not going to change!
(Not that you were proposing that it should.)
Simon
| -----Original Message-----
| From: Zhanyong Wan [mailto:[EMAIL PROTECTED]]
| Sent: 30 May 2001 18:42
| To: Simon Peyton-Jones
| Cc: [EMAIL PROTECTED]
| Subject: Re: Haskell 98 Report
|
|
| Hello Simon,
|
| Looking at the definition for deleteBy:
|
| deleteBy :: (x -> a -> Bool) -> x -> [a] -> [a]
| deleteBy eq x [] = []
| deleteBy eq x (y:ys) = if x `eq` y then ys else
| y : deleteBy eq x ys
|
| I can't help wondering why it isn't
|
| deleteBy' :: (a -> Bool) -> [a] -> [a]
| deleteBy' f [] = []
| deleteBy' f (y:ys) = if f y then ys else
| y : deleteBy' f ys
|
| The point is that in the definition of deleteBy, all
| references to eq and x are in the form (eq x), and hence the
| two parameters can be combined. Is there a reason that the
| current design was favored when Prelude was designed? Thanks.
|
| - Zhanyong
|
| --
| # Zhanyong Wan http://pantheon.yale.edu/~zw23/ ____
| # Yale University, Dept of Computer Science /\___\
| # P.O.Box 208285, New Haven, CT 06520-8285 ||___|
|
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell