diff options
author | David Feuer <david.feuer@gmail.com> | 2017-03-02 15:01:26 -0500 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2017-03-02 15:01:28 -0500 |
commit | bc332b3159613190a4dc33a067c1ab31039a8434 (patch) | |
tree | d8c61a195aba870b4083441dae4f57730b7b09af /docs/users_guide/8.2.1-notes.rst | |
parent | ae67619853d029ea8049a114f44e59f4ca10b990 (diff) | |
download | haskell-bc332b3159613190a4dc33a067c1ab31039a8434.tar.gz |
Prohibit RULES changing constructors
Previously, `RULES` like
```
{-# RULES
"JustNothing" forall x . Just x = Nothing
#-}
```
were allowed. Simon Peyton Jones say this seems to have been a
mistake, that such rules have never been supported intentionally,
and that he doesn't know if they can break in horrible ways.
Furthermore, Ben Gamari and Reid Barton are considering trying to
detect the presence of "static data" that the simplifier doesn't
need to traverse at all. Such rules do not play well with that.
So for now, we ban them altogether. In most cases, it's possible
to work around the ban using hand-written wrapper functions.
Reviewers: austin, simonpj, bgamari
Reviewed By: simonpj, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3169
Diffstat (limited to 'docs/users_guide/8.2.1-notes.rst')
-rw-r--r-- | docs/users_guide/8.2.1-notes.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/users_guide/8.2.1-notes.rst b/docs/users_guide/8.2.1-notes.rst index 9a222e6003..b3dd2de93e 100644 --- a/docs/users_guide/8.2.1-notes.rst +++ b/docs/users_guide/8.2.1-notes.rst @@ -157,6 +157,16 @@ Compiler - The :ghc-flag:`-XExtendedDefaultRules` extension now defaults multi-parameter typeclasses. See :ghc-ticket:`12923`. +- GHC now ignores ``RULES`` for data constructors (:ghc-ticket:`13290`). + Previously, it accepted:: + + "NotAllowed" forall x. Just x = e + + That rule will no longer take effect, and a warning will be issued. ``RULES`` + may still mention data constructors, but not in the outermost position:: + + "StillWorks" forall x. f (Just x) = e + GHCi ~~~~ |