purescript / pursuit

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

Incorrect types displayed for constructors with 2 or more arguments #373

Closed jonathanlking closed 6 years ago

jonathanlking commented 6 years ago

The type displayed for the Tuple constructor is incorrect, with Tuple :: forall b a. (a -> b) -> Tuple a b displayed instead of forall b a. a -> b -> Tuple a b. Additionally a search for a -> b -> Tuple a b doesn’t give any (useful) results, but (a -> b) -> Tuple a b does.

As noted by @hdgarrood (on the purescript-begginers slack channel) there appears to be an issue with data constructors with 2 or more arguments - other examples are:

jonathanlking commented 6 years ago

I had a quick look and typeToText in searchIndex.hs appears responsible for generating the (incorrect) type. This in turn uses renderType from Language.PureScript.Docs in the Purescript repo, which is where I suspect the problem may actually lie.

hdgarrood commented 6 years ago

I’m fairly sure that renderType is correct, because the types of things do show up correctly in the actual docs - it’s just search results which are wrong here, I think. My suspicion is that the problem is in extractChildDeclarationType in SearchIndex.hs.

jonathanlking commented 6 years ago

Thanks for the pointer - I've updated extractChildDeclarationType (sorry about the multiple commit messages, I didn't realise force pushing did this).