Many1 不再适用于 Parsec 3.x
从 2.x 更新到 Parsec 3.1 后,使用 Many1 的代码(例如 word = Many1 letter
)失败,
No instance for (Stream s m Char) arising from a use of `letter'
我发现一个邮件列表帖子声称添加 {-#LANGUAGE NoMonomorphismRestriction #-}< /code> 到源文件的顶部可以解决问题,但事实并非如此。
After updating to Parsec 3.1 from 2.x, code using many1, such as word = many1 letter
fails with
No instance for (Stream s m Char) arising from a use of `letter'
I found a mailing list post claiming that adding {-#LANGUAGE NoMonomorphismRestriction #-}
to the top of the source file would solve the problem, but it did not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要忘记在
LANGUAGE
之前添加空格。您还可以编写显式类型注释,而不是关闭单态限制。
Don't forget to add a space before
LANGUAGE
.Instead of turning off the monomorphism restriction, you can also write an explicit type annotation.