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

Hoogling signatures with constraints #213

Open
fredefox opened this issue May 19, 2017 · 2 comments
Open

Hoogling signatures with constraints #213

fredefox opened this issue May 19, 2017 · 2 comments

Comments

@fredefox
Copy link

I think it would be a nice feature if hoogle could show results for signatures with matching types but additional constraints. Say I hoogle

(a -> b) -> f a -> f b

I would like for hoogle to suggest fmap. Also, it would be nice if hoogle was aware of subclass relationships so that the above would also be shown if I hoogle, say

Applicative f => (a -> b) -> f a -> f b

Any thoughts?

@georgefst
Copy link

It seems in some cases this already happens.

Anyway, I think it would be cool to allow syntax like _ => (a -> b) -> f a -> f b. Or even _ f => (a -> b) -> f a -> f b to only allow constraints on f. Although the latter is not valid in GHC.

@ndmitchell
Copy link
Owner

Agreed on all fronts - but it's hard. Someone will need to invest in looking at how it can work in the existing design.

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

3 participants