This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: Partition with Either on Traversable

No replies
Joshua.Suereth
Joined: 2008-09-02,
User offline. Last seen 32 weeks 5 days ago.

Perhaps.  However when mapping a bitset into typed partitions, this method has the advantage of preserving the bitset type, if possible.

You are correct that a Traversable[Either[A, B]] may be an easier starting point for this method.  In fact, take a view of a collection and applying the map to an either would probably give you similar execution times , there is still the matter of preserving types...

On Aug 27, 2010 5:36 AM, "Tony Morris" <tonymorris@gmail.com> wrote:

Such a list is better represented List[Either[Int, String]]. I suspect
this would then alter your question.


Josh Suereth wrote:
> What does everyone think about a partionEither method on traversable
> as a w...

> I have a patch <http://gist.github.com/552675> I could commit if we

> think this is a generally useful method on the collections. I
> personally feel this method prov...

--
Tony Morris
http://tmorris.net/


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland