[commit: ghc] master: Fix EmptyCase documentation (14457cf)
git at git.haskell.org
git at git.haskell.org
Mon Aug 7 23:23:27 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/14457cf6a50f708eecece8f286f08687791d51f7/ghc
>---------------------------------------------------------------
commit 14457cf6a50f708eecece8f286f08687791d51f7
Author: Cyd Parser <cydparser at gmail.com>
Date: Sun Aug 6 22:23:23 2017 -0700
Fix EmptyCase documentation
>---------------------------------------------------------------
14457cf6a50f708eecece8f286f08687791d51f7
docs/users_guide/glasgow_exts.rst | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index d50dd40..bc09402 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -1701,8 +1701,8 @@ example, consider these two candidate definitions of ``absurd``:
::
- data a :==: b where
- Refl :: a :==: a
+ data a :~: b where
+ Refl :: a :~: a
absurd :: True :~: False -> a
absurd x = error "absurd" -- (A)
@@ -1710,10 +1710,9 @@ example, consider these two candidate definitions of ``absurd``:
We much prefer (B). Why? Because GHC can figure out that
``(True :~: False)`` is an empty type. So (B) has no partiality and GHC
-should be able to compile with :ghc-flag:`-Wincomplete-patterns`. (Though
-the pattern match checking is not yet clever enough to do that.) On the
-other hand (A) looks dangerous, and GHC doesn't check to make sure that,
-in fact, the function can never get called.
+is able to compile with :ghc-flag:`-Wincomplete-patterns` and
+:ghc-flag:`-Werror`. On the other hand (A) looks dangerous, and GHC doesn't
+check to make sure that, in fact, the function can never get called.
.. _multi-way-if:
More information about the ghc-commits
mailing list