[GHC] #12402: Add fromLeft and fromRight to Data.Either

GHC ghc-devs at haskell.org
Sat Jul 16 19:19:02 UTC 2016


#12402: Add fromLeft and fromRight to Data.Either
-------------------------------------+-------------------------------------
           Reporter:  mettekou       |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:                 |           Version:  8.0.1
  libraries/base                     |
           Keywords:  Data.Either,   |  Operating System:  Unknown/Multiple
  fromLeft, fromRight                |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This ticket is the result of
 [https://mail.haskell.org/pipermail/libraries/2016-June/027093.html the
 discussion of the proposal on the libraries mailing list] to add the
 following two functions to Data.Either in base:

 {{{#!hs
 fromLeft :: a -> Either a b -> a
 fromRight :: b -> Either a b -> b
 }}}

 The functions extract an {{{Either a b}}} value for the constructors in
 their namesake, providing their first argument as a default value for
 values created using the other constructor.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12402>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list