#974: Add unzipEithers, lefts, rights to Data.Either
----------------------------+-----------------------------------------------
 Reporter:  guest           |          Owner:             
     Type:  proposal        |         Status:  reopened   
 Priority:  normal          |      Milestone:  Not GHC    
Component:  libraries/base  |        Version:  6.6        
 Severity:  normal          |     Resolution:             
 Keywords:                  |     Difficulty:  Easy (1 hr)
 Testcase:                  |   Architecture:  Unknown    
       Os:  Unknown         |  
----------------------------+-----------------------------------------------
Comment (by igloo):

 Sorry Russell, I must have forgotten about the thread by the time I closed
 the bug.

 Having reread the thread, I think we are here:

 We are agreed that we should add
 {{{
 lefts  :: [Either a b] -> [a]
 rights :: [Either a b] -> [b]
 }}}
 and that we should add a function with type
 {{{
 [Either a b] -> ([a],[b])
 }}}
 Possible names include
 {{{
 splitEithers
 unzipEithers
 partitionEithers
 catEithers
 leftRights
 leftsAndRights
 boths
 demuxEithers
 }}}
 While choosing a name, we should bear in mind that we might want to define
 a function with type
 {{{
 (a -> Either b c) -> [a] -> ([b],[c])
 }}}
 at some point in the future.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/974#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to