[commit: ghc] master: Doctest for Void.absurd (36d1b08)

git at git.haskell.org git at git.haskell.org
Thu Aug 17 20:43:11 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/36d1b08308fdc90e2abaf36cc95ad1a97c0fa8bb/ghc

>---------------------------------------------------------------

commit 36d1b08308fdc90e2abaf36cc95ad1a97c0fa8bb
Author: David Luposchainsky <dluposchainsky at gmail.com>
Date:   Fri Aug 11 10:38:24 2017 +0200

    Doctest for Void.absurd


>---------------------------------------------------------------

36d1b08308fdc90e2abaf36cc95ad1a97c0fa8bb
 libraries/base/Data/Void.hs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libraries/base/Data/Void.hs b/libraries/base/Data/Void.hs
index fd4c0b5..d7fa179 100644
--- a/libraries/base/Data/Void.hs
+++ b/libraries/base/Data/Void.hs
@@ -67,6 +67,14 @@ instance Exception Void
 -- | Since 'Void' values logically don't exist, this witnesses the
 -- logical reasoning tool of \"ex falso quodlibet\".
 --
+-- >>> let x :: Either Void Int; x = Right 5
+-- >>> :{
+-- case x of
+--     Right r -> r
+--     Left l  -> absurd l
+-- :}
+-- 5
+--
 -- @since 4.8.0.0
 absurd :: Void -> a
 absurd a = case a of {}



More information about the ghc-commits mailing list