Ticket #1695 (closed proposal: duplicate)

Opened 6 years ago

Last modified 4 years ago

library submission: Data.Either.unzipEithers :: [Either a b] -> ([a],[b])

Reported by: JeremyShaw Owned by:
Priority: normal Milestone: Not GHC
Component: libraries/base Version: 6.8
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

This function is like unzip for a list of Eithers instead of tuples.

According to google code search, I am at least the 5th person to implement this function:

 http://www.google.com/codesearch?hl=en&lr=&q=%22%5BEither+a+b%5D+-%3E+%28%5Ba%5D%2C%5Bb%5D%29%22&btnG=Search

I opted for the name unzipEithers because the function is similar to two existing functions: unzip and catMaybes. It seems less similar to partition, because partition does not desconstruct the values, it just divides them into to two groups. I have no particular attachment to the name however.

I modeled the implementation after unzip and partition. Hopefully I made effective use of the irrefutable patterns and laziness, but someone else should verify.

Deadline: October 15

Attachments

unzipEithers.dpatch Download (68.3 KB) - added by JeremyShaw 6 years ago.
implementation of Data.Either.unzipEithers

Change History

Changed 6 years ago by JeremyShaw

implementation of Data.Either.unzipEithers

Changed 6 years ago by JeremyShaw

  • status changed from new to closed
  • resolution set to duplicate

oops, appears this is a dupe of

 http://hackage.haskell.org/trac/ghc/ticket/974

Changed 6 years ago by igloo

  • status changed from closed to reopened
  • resolution duplicate deleted

Reopening as #974 has a wider scope

Changed 6 years ago by igloo

  • description modified (diff)

Changed 6 years ago by guest

Changed 6 years ago by igloo

  • milestone set to Not GHC

Changed 5 years ago by igloo

  • status changed from reopened to closed
  • resolution set to duplicate

This ticket is a duplicate of the only part of #974 that isn't decided, so this ticket is no easier to resolve than all of #974. Thus I'm closing it as a duplicate.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.