Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about ordNubBy's type #112

Open
kozross opened this issue Jan 25, 2016 · 4 comments
Open

Confused about ordNubBy's type #112

kozross opened this issue Jan 25, 2016 · 4 comments

Comments

@kozross
Copy link

kozross commented Jan 25, 2016

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.

@gregwebs
Copy link
Collaborator

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.

@kozross
Copy link
Author

kozross commented Jan 25, 2016

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?

@gregwebs
Copy link
Collaborator

Yes

@kozross
Copy link
Author

kozross commented Jan 25, 2016

Alrighty, I'll give it a try.

kozross added a commit to kozross/classy-prelude that referenced this issue Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants