[commit: ghc] master: base: Explicitly mark Data.Either.{left, right} as INLINABLE (80d5190)

git at git.haskell.org git at git.haskell.org
Sat May 20 20:29:41 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/80d5190630a975dfa03d1d84d23cdee4f950d58d/ghc

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

commit 80d5190630a975dfa03d1d84d23cdee4f950d58d
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Sat May 20 12:48:03 2017 -0400

    base: Explicitly mark Data.Either.{left,right} as INLINABLE
    
    Test Plan: read it
    
    Reviewers: dfeuer, austin, hvr, nomeata
    
    Reviewed By: dfeuer, nomeata
    
    Subscribers: nomeata, rwbarton, thomie
    
    GHC Trac Issues: #13689
    
    Differential Revision: https://phabricator.haskell.org/D3576


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

80d5190630a975dfa03d1d84d23cdee4f950d58d
 libraries/base/Data/Either.hs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libraries/base/Data/Either.hs b/libraries/base/Data/Either.hs
index 437d87c..2469e78 100644
--- a/libraries/base/Data/Either.hs
+++ b/libraries/base/Data/Either.hs
@@ -178,6 +178,7 @@ either _ g (Right y)    =  g y
 --
 lefts   :: [Either a b] -> [a]
 lefts x = [a | Left a <- x]
+{-# INLINEABLE lefts #-} -- otherwise doesnt get an unfolding, see #13689
 
 -- | Extracts from a list of 'Either' all the 'Right' elements.
 -- All the 'Right' elements are extracted in order.
@@ -192,6 +193,7 @@ lefts x = [a | Left a <- x]
 --
 rights   :: [Either a b] -> [b]
 rights x = [a | Right a <- x]
+{-# INLINEABLE rights #-} -- otherwise doesnt get an unfolding, see #13689
 
 -- | Partitions a list of 'Either' into two lists.
 -- All the 'Left' elements are extracted, in order, to the first



More information about the ghc-commits mailing list