summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-10-06 18:22:28 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-09 04:46:05 -0400
commit31983ab4c65204ad0fd14aac4c00648f5fa6ad6b (patch)
tree6bff70ce40f4d295ce084358ebe4b977e68bb43f /docs
parenta76409c758d8c7bd837dcc6c0b58f8cce656b4f1 (diff)
downloadhaskell-31983ab4c65204ad0fd14aac4c00648f5fa6ad6b.tar.gz
Reject GADT pattern matches in arrow notation
Tickets #20469 and #20470 showed that the current implementation of arrows is not at all up to the task of supporting GADTs: GHC produces ill-scoped Core programs because it doesn't propagate the evidence introduced by a GADT pattern match. For the time being, we reject GADT pattern matches in arrow notation. Hopefully we are able to add proper support for GADTs in arrows in the future.
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/9.2.1-notes.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/users_guide/9.2.1-notes.rst b/docs/users_guide/9.2.1-notes.rst
index a80218098e..6a6dec1ed9 100644
--- a/docs/users_guide/9.2.1-notes.rst
+++ b/docs/users_guide/9.2.1-notes.rst
@@ -135,6 +135,21 @@ Language
will allow the scrutinee to have a multiplicity of ``One``, using its best-effort
inference algorithm.
+* Support for matching on GADT constructors in arrow notation has been removed,
+ as the current implementation of :extension:`Arrows` doesn't handle GADT
+ evidence correctly.
+
+ One possible workaround, for the time being, is to perform GADT matches
+ inside let bindings: ::
+
+ data G a where
+ MkG :: Show a => a -> G a
+
+ foo :: G a -> String
+ foo = proc x -> do
+ let res = case x of { MkG a -> show a }
+ returnA -< res
+
Compiler
~~~~~~~~