classy-prelude
classy-prelude copied to clipboard
Confused about ordNubBy's type
According to the Hackage documentation for classy-prelude, ordNubBy has type Ord b => (a -> b) -> (a -> a -> Bool) -> [a] -> [a]. I'm a bit confused as to why it requires two functional arguments. This is especially confusing given other 'by' and 'with' functions only require one additional argument.
Some clarification, both for myself and the documentation, would be appreciated.
I think a -> a -> Bool should be replaced with an Eq constraint. Interested in attempting a pull request? The new function would be called ordNubOn.
I'm not entirely sure what you mean, sorry. Do you mean that the second functional argument is meant to be an 'is equal to' function?
Yes
Alrighty, I'll give it a try.