ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Ignore parameter order #259

Open wpcarro opened 6 years ago

wpcarro commented 6 years ago

Say I have a query like this:

Int -> String -> Boolean

Is there some way to inform Hoogle that it's okay to return functions like:

foo :: Int -> String -> Boolean
bar :: String -> Int -> Boolean

Or is the recommendation to manually permute parameter order when querying Hoogle. This can get cumbersome for functions with 3+ arity. If this doesn't exist, I could see this being a powerful feature.

ndmitchell commented 6 years ago

Can you give an example of two URL's where it returns different results? It is meant to permute the arguments, although may prefer the order you wrote them in.

wpcarro commented 6 years ago

@ndmitchell I didn't know that Hoogle already permuted the parameter order. Is there a way to mark some of the parameters as optional? The ultimate use case that I'm trying to advocate is something like:

Say I have a bundle of these five arguments and I need a return value. Is there a query that will show me all of the functions that take only those five arguments or a subset of them, in any order, and give me back what I'm looking for?