[commit: ghc] ghc-8.0: GHC.Generics: Ensure some, many for U1 don't bottom (b89747e)

git at git.haskell.org git at git.haskell.org
Sat Feb 27 21:55:18 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/b89747e33de0e27a8ed45e9e6b4dedbaa40c4ce3/ghc

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

commit b89747e33de0e27a8ed45e9e6b4dedbaa40c4ce3
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Fri Feb 26 23:02:31 2016 +0100

    GHC.Generics: Ensure some, many for U1 don't bottom
    
    Reviewers: austin, hvr, ekmett, RyanGlScott
    
    Reviewed By: RyanGlScott
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1952
    
    GHC Trac Issues: #11650
    
    (cherry picked from commit 890e2bb72b9953ca3e6990911b4cf6e51a0dd0f8)


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

b89747e33de0e27a8ed45e9e6b4dedbaa40c4ce3
 libraries/base/GHC/Generics.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs
index 026584a..c6c8f63 100644
--- a/libraries/base/GHC/Generics.hs
+++ b/libraries/base/GHC/Generics.hs
@@ -745,6 +745,9 @@ instance Applicative U1 where
 instance Alternative U1 where
   empty = U1
   U1 <|> U1 = U1
+  -- The defaults will otherwise bottom; see #11650.
+  some U1 = U1
+  many U1 = U1
 
 instance Monad U1 where
   U1 >>= _ = U1



More information about the ghc-commits mailing list