diff options
author | Bodigrim <andrew.lelechenko@gmail.com> | 2022-04-22 19:03:04 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-25 10:20:44 -0400 |
commit | f2c08124b30eb87482dc0ed1d7199aa58950e309 (patch) | |
tree | d7cc1543cd05d0b4c86f6479de2cdf8d39c81b02 /docs | |
parent | e76705cf9548ada18020b14cb049aece8660f749 (diff) | |
download | haskell-f2c08124b30eb87482dc0ed1d7199aa58950e309.tar.gz |
Document behaviour of RULES with KnownNat
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/exts/rewrite_rules.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/users_guide/exts/rewrite_rules.rst b/docs/users_guide/exts/rewrite_rules.rst index 7ac93bb21d..75ee2474a9 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: |