ndmitchell / hoogle

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

Hoogle doesn't find pattern synonyms in Data.Sequence #261

Closed ttuegel closed 5 years ago

ttuegel commented 6 years ago

Hoogle doesn't seem to find the pattern synonyms bundled with Data.Sequence.Seq: https://hoogle.haskell.org/?hoogle=%3A%3C%7C

ndmitchell commented 6 years ago

Looking at the Hoogle output file from Haddock, https://hackage.haskell.org/package/containers-0.6.0.1/docs/containers.txt, it lacks :<| so consequently Hoogle can't ever see it. I reported it upstream at https://github.com/haskell/haddock/issues/946

flip111 commented 5 years ago

Seems to be fixed upstream now. And hoogle gives results. Perhaps close ticket?

ndmitchell commented 5 years ago

@flip111 not sure what you mean - I can't see it fixed upstream and don't see results in Hoogle...

flip111 commented 5 years ago

https://github.com/haskell/haddock/issues/946 lists https://github.com/haskell/haddock/pull/947 as fix i believe

When i click the link https://hoogle.haskell.org/?hoogle=%3A%3C%7C in comment https://github.com/ndmitchell/hoogle/issues/261#issue-365164093 i see 4 search results

type (:<|) f x = A f x
Uses
opaleye Opaleye.Internal.TypeFamilies
data a :<|> b
Uses
servant Servant.API Servant.API.Alternative
Union of two APIs, first takes precedence in case of overlap. Example:

>>> :{
type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
:<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] () -- POST /books
:}

(:<|>) :: a -> b -> (:<|>) a b
Uses
servant Servant.API Servant.API.Alternative, servant-js Servant.JS.Internal
data (:<|>) a b
Uses
servant-js Servant.JS.Internal
Union of two APIs, first takes precedence in case of overlap. Example:

>>> :{
type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
:<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] () -- POST /books
:}
flip111 commented 5 years ago

Ah sorry i see what you mean, Data.Sequence.Seq is not one of the results. However upstream fix is there, no ?

ndmitchell commented 5 years ago

Yeah, I guess it's just waiting for containers to regenerate their docs, perhaps on a new release. I guess however the fundamental issue is fixed, so it is now a containers problem. Thanks for noticing!

expipiplus1 commented 5 years ago

I think that this might still be broken on Hoogle's side.

To reproduce:

Compile a package with these contents:

pattern MyPattern :: () pattern MyPattern = ()


- Observe that the pattern synonym is present in the generated documentation file `hoogle-test.txt`

-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/

@package hoogle-test @version 0.0.0

module MyModule pattern MyPattern :: ()


- Observe that Hoogle can find `MyModule`

$ hoogle MyModule module MyModule


- Observe that Hoogle can not find `MyPattern`

$ hoogle MyPattern No results found

expipiplus1 commented 5 years ago

oh, and a .warn file is generated with this content hoogle-test:9:failed to parse: pattern MyPattern :: ()