4
有什么方法可以浏览或搜索重写规则吗?当我使用的标志像-ddump-rule-firings
或-ddump-rule-rewrites
我只想找到引发该规则的名称,它引起了重写,但不是实际的规则本身......寻找重写规则
理想情况下,我想看看有什么重写规则是通过GHCi的范围,但实际上我愿意解决基地存在的重写规则的详尽列表。
有什么方法可以浏览或搜索重写规则吗?当我使用的标志像-ddump-rule-firings
或-ddump-rule-rewrites
我只想找到引发该规则的名称,它引起了重写,但不是实际的规则本身......寻找重写规则
理想情况下,我想看看有什么重写规则是通过GHCi的范围,但实际上我愿意解决基地存在的重写规则的详尽列表。
好吧,仍然希望对此有一个很好的回答,但如果没有,我会继续做pdexter提出的建议,并为规则grep' base
。 Here are the rules in base 4.9.
任何有兴趣在复制此:
http://git.haskell.org/ghc.git
ghc/libraries/base
pcregrep -Mr '\{-# RULES(.|\n)*?#-\}' .
我只想用grep他们。他们以“{ - #RULES”开头。不幸的是,他们不是一流的公民。 – pdexter
@pdexter这正是我希望得不到的答案。 xD – Alec
:D阅读本文[http://www.yesodweb.com/blog/2016/02/first-class-stream-fusion](http://www.yesodweb.com/blog/2016/02/first-class-stream-fusion) – pdexter