
14 Mar
2008
14 Mar
'08
1:32 p.m.
On Fri, Mar 14, 2008 at 6:28 PM, John Meacham
Note also that you are attaching your rule to 'fmap', however, since your rule only applies to the 'Parser' monad (if I am reading it properly) then 'fmap' will have been replaced by the 'fmap' in the Functor Parser instance. So you would probably be better off doing something like
instance Functor Parser where fmap = parserFmap
{-# RULES forall x . parserFmap S.pack ( ...
Didn't think of that. I'll change my code accordingly.
Also, you have to be careful attaching rules to functions you don't define, as you don't know how it will interact with other rules, inline pragmas or whatnot that might already be attached to that function.
Sounds like good advice. Thanks.