Why is the Text.Parsec.Token.natural type not the same between Hoogle and what is shown with: t?

I searched Text.Parsec.Token.natural on Hoogle and found the type Text.Parsec.Token.natural is natural :: ParsecT sum Integer .

But this is contrary to what I got with :t in GHCi.

GHCi gives this type:

 Prelude Text.Parsec.Token> :t natural natural :: GenTokenParser sum -> Text.Parsec.Prim.ParsecT sum Integer 

And not only natural ones, i.e. integer, floating, decimal, etc.

+4
source share
1 answer

natural is a named field of the GenTokenParser sum data type. This field is of type ParsecT sum Integer ; scroll down to find it.

The natural function accesses this field from any GenTokenParser sum value, therefore, the type.

+7
source

Source: https://habr.com/ru/post/1482392/


All Articles