purescript / pursuit

Website for hosting and searching PureScript API documentation
https://pursuit.purescript.org/
Other
170 stars 47 forks source link

Search for NonElementParentNode #407

Open KAction opened 4 years ago

KAction commented 4 years ago

I was trying to figure out how to create object of type NonElementParentNode, since it is referenced in type of selectElementById. The most oblivious search query:

https://pursuit.purescript.org/search?q=NonElementParentNode

showed only the fact that it is foreign data. What I actually wanted is that I can convert HTMLDocument to it link.

Attempt to search by function signature a -> NonElementParentNode (hello, hoogle) showed totally irrelevant results, like abs :: forall a. Ord a => Ring a => a -> a.

klntsky commented 4 years ago

\<shameless plug>

Use starsuit instead. It works differently than pursuit: it allows you to make queries like A -> NonElementParentNode (yes, with capital A). This query can be described as "something concrete -> NonElementParentNode", rather than "literally forall a. -> NonElementParentNode".

Check out the implementation if you want to understand how exactly search results are sorted.

I use both pursuit and starsuit, they both have pros and cons at processing different types queries.

hdgarrood commented 4 years ago

Thanks for the report. I agree that with a query of a -> NonElementParentNode, the candidate HTMLDocument -> NonElementParentNode should score higher than forall a. Ord a => Ring a => a -> a.