The rewriting rules get de-sugared. Therefore, a rewrite rule, for example
{-# RULES "myFn/singleton" forall x. myFn [x] = myOtherFn x #-}
will be stored inside
forall x. myFn (x:[]) = myOtherFn x
Then it was applied to the de-sagal form of the program. (All optimization in the GHC takes place in a de-sagal form of the program).
source share