hoogle icon indicating copy to clipboard operation
hoogle copied to clipboard

Hoogling signatures with constraints

Open fredefox opened this issue 8 years ago • 2 comments

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?

fredefox avatar May 19 '17 08:05 fredefox

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.

georgefst avatar Nov 05 '20 10:11 georgefst

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

ndmitchell avatar Nov 05 '20 17:11 ndmitchell