Many1 no longer works with Parsec 3.x

After upgrading to Parsec 3.1 from 2.x, code using many1, for example word = many1 letter, does not work with

No instance for (Stream s m Char) arising from a use of `letter'

I found a mailing list stating that adding {-#LANGUAGE NoMonomorphismRestriction #-}to the beginning of the source file will solve the problem, but it is not.

+3
source share
1 answer

Remember to add a space before LANGUAGE.

Instead of disabling monomorphism restriction, you can also write explicit type annotation.

+9
source

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


All Articles