Skip to content

Commit

Permalink
base: Explicitly mark Data.Either.{left,right} as INLINABLE
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bgamari committed May 20, 2017
1 parent 53c78be commit 80d5190
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/base/Data/Either.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 80d5190

Please sign in to comment.