diff --git a/docs/users_guide/exts/rewrite_rules.rst b/docs/users_guide/exts/rewrite_rules.rst index 7ac93bb21df9ce92e3692e4f706bd7558c9bf6b0..75ee2474a9843f6464b741272b473caf80c5cc08 100644 --- a/docs/users_guide/exts/rewrite_rules.rst +++ b/docs/users_guide/exts/rewrite_rules.rst @@ -228,6 +228,15 @@ From a semantic point of view: because ``y`` can match against ``0``. +- A rule that has a forall binder with a polymorphic type, is likely to fail to fire. E. g., :: + + {-# RULES forall (x :: forall a. Num a => a -> a). f x = blah #-} + + Here ``x`` has a polymorphic type. This applies to a forall'd binder with a type class constraint, such as:: + + {-# RULES forall @m (x :: KnownNat m => Proxy m). g x = blah #-} + + See `#21093 <https://gitlab.haskell.org/ghc/ghc/-/issues/21093>`_ for discussion. .. _rules-inline: