Closed jonathanlking closed 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.
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.
Thanks for the pointer - I've updated extractChildDeclarationType
(sorry about the multiple commit messages, I didn't realise force pushing did this).
The type displayed for the
Tuple
constructor is incorrect, withTuple :: forall b a. (a -> b) -> Tuple a b
displayed instead offorall b a. a -> b -> Tuple a b
. Additionally a search fora -> 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:
Pair :: forall a. (a -> a) -> Pair a
CofreeF :: forall b f a. (a -> (Unit -> (f b))) -> CofreeF f a b