<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate">
    <title>gmane.comp.lang.scala.debate</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9529"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9528"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9527"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9526"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9525"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9524"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9523"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9522"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9521"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9520"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9519"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9518"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9517"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9516"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9515"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9514"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9513"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9512"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9511"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9510"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9529">
    <title>RE: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9529</link>
    <description>&lt;pre&gt;
I just don't get the position from the perspective of the types. Validation, fixed in its Failure type is an Applicative functor (which want to keep). It is also a Monad (which you don't). I recall someone saying something about types not lying
Chris

Date: Fri, 18 May 2012 19:25:05 +1000
Subject: Re: [scala-debate] right-biasing Either
From: tmorris&amp;lt; at &amp;gt;tmorris.net
To: tim.pigden&amp;lt; at &amp;gt;optrak.com
CC: oxbow_lakes&amp;lt; at &amp;gt;hotmail.com; scala-debate&amp;lt; at &amp;gt;googlegroups.com

Validation.flatMap should be a type error.


On May 18, 2012 4:49 PM, "Tim Pigden" &amp;lt;tim.pigden&amp;lt; at &amp;gt;optrak.com&amp;gt; wrote:

sorry Tony, what will be "fixed"?
Are you changing the behaviour of Validation significantly?


On 17 May 2012 23:09, Tony Morris &amp;lt;tmorris&amp;lt; at &amp;gt;tmorris.net&amp;gt; wrote:




On May 18, 2012 3:36 AM, "Chris Marshall" &amp;lt;oxbow_lakes&amp;lt; at &amp;gt;hotmail.com&amp;gt; wrote:


This will be fixed. Please assume it doesn't.



       &lt;/pre&gt;</description>
    <dc:creator>Chris Marshall</dc:creator>
    <dc:date>2012-05-18T10:02:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9528">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9528</link>
    <description>&lt;pre&gt;Validation.flatMap should be a type error.
 On May 18, 2012 4:49 PM, "Tim Pigden" &amp;lt;tim.pigden&amp;lt; at &amp;gt;optrak.com&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-18T09:25:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9527">
    <title>RE: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9527</link>
    <description>&lt;pre&gt;
I oppose its removal as well; Validation is quite clearly a Monad.

       &lt;/pre&gt;</description>
    <dc:creator>Chris Marshall</dc:creator>
    <dc:date>2012-05-18T08:59:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9526">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9526</link>
    <description>&lt;pre&gt;On Fri, May 18, 2012 at 10:49 AM, Chris Marshall
&amp;lt;oxbow_lakes&amp;lt; at &amp;gt;hotmail.com&amp;gt; wrote:

I added that method and oppose its removal.

-jason

&lt;/pre&gt;</description>
    <dc:creator>Jason Zaugg</dc:creator>
    <dc:date>2012-05-18T08:56:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9525">
    <title>RE: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9525</link>
    <description>&lt;pre&gt;
I'll assume by "fixed", you mean "deprecated, with a clear migration strategy"

Date: Fri, 18 May 2012 08:09:37 +1000
Subject: RE: [scala-debate] right-biasing Either
From: tmorris&amp;lt; at &amp;gt;tmorris.net
To: oxbow_lakes&amp;lt; at &amp;gt;hotmail.com
CC: scala-debate&amp;lt; at &amp;gt;googlegroups.com



On May 18, 2012 3:36 AM, "Chris Marshall" &amp;lt;oxbow_lakes&amp;lt; at &amp;gt;hotmail.com&amp;gt; wrote:


This will be fixed. Please assume it doesn't.       &lt;/pre&gt;</description>
    <dc:creator>Chris Marshall</dc:creator>
    <dc:date>2012-05-18T08:49:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9524">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9524</link>
    <description>&lt;pre&gt;sorry Tony, what will be "fixed"?
Are you changing the behaviour of Validation significantly?


On 17 May 2012 23:09, Tony Morris &amp;lt;tmorris&amp;lt; at &amp;gt;tmorris.net&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Tim Pigden</dc:creator>
    <dc:date>2012-05-18T06:49:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9523">
    <title>RE: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9523</link>
    <description>&lt;pre&gt;
This will be fixed. Please assume it doesn't.
&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-17T22:09:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9522">
    <title>RE: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9522</link>
    <description>&lt;pre&gt;
Scalaz's Validation does have flatMap. 
Welcome to Scala version 2.9.2 (Java HotSpot(TM) Server VM, Java 1.6.0_18).Type in expressions to have them evaluated.Type :help for more information.
scala&amp;gt; import scalaz._; import Scalaz._import scalaz._import Scalaz._
scala&amp;gt; "1".success[Exception] flatMap (_.parseInt)res0: scalaz.Validation[Exception,Int] = Success(1)
Or...
scala&amp;gt; for {     | s &amp;lt;- "1".success[Exception]     | i &amp;lt;- s.parseInt     | }     | yield ires1: scalaz.Validation[Exception,Int] = Success(1)
It just doesn't have a "default" implicit monad (viewable by the lack of &amp;gt;&amp;gt;=)
scala&amp;gt; "1".success[Exception] &amp;gt;&amp;gt;= (_.parseInt)&amp;lt;console&amp;gt;:14: error: could not find implicit value for parameter b: scalaz.Bind[[Î±]scalaz.Validation[Exception,Î±]]              "1".success[Exception] &amp;gt;&amp;gt;= (_.parseInt)                                     ^

...unless you import it, of course:
scala&amp;gt; import Validation.Monad._import Validation.Monad._
scala&amp;gt; "1".success[Exception] &amp;gt;&amp;gt;= (_.parseInt)res3: scalaz.Validation[Exception,&lt;/pre&gt;</description>
    <dc:creator>Chris Marshall</dc:creator>
    <dc:date>2012-05-17T17:36:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9521">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9521</link>
    <description>&lt;pre&gt;
It's also very similar to Lift's Box class:

http://www.assembla.com/spaces/liftweb/wiki/Box

So there is at least one precedent of someone needing a "three-state 
Option" badly enough to create it and use it in their framework.

Anyway, I just wanted to mention that it seems be a commonly needed 
pattern, I don't know if it has much bearing on the discussion about 
right-biasing Either (of which I have no opinion one way or another).

&lt;/pre&gt;</description>
    <dc:creator>Ivan Todoroski</dc:creator>
    <dc:date>2012-05-17T15:36:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9520">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9520</link>
    <description>&lt;pre&gt;

Correct--isomorphic, but without the awkwardness of nested containers.



This requires you to load your Lefts with Options, which is a bit of a
pain, but yes, at least filter would work.



I'm not sure they're terribly useful as is, so I'd support that anyway.



The Try[U] apply method transparently catches exceptions so flatMap is
consistent.  Collect is the only odd-man-out that I saw.  (Well, and
filter; if your predicate throws an exception, you're out of luck.)

I agree that catching Throwable instead of Exception is dangerous.  That is
almost never the right thing to do.  I don't suppose we can change that,
though, because I bet Twitter relies upon it somewhere.  I would much
prefer if we could change it to only catch Exception (or to re-throw
ControlThrowable at least--that would be okay, wouldn't it?).

  --Rex
&lt;/pre&gt;</description>
    <dc:creator>Rex Kerr</dc:creator>
    <dc:date>2012-05-17T15:32:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9519">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9519</link>
    <description>&lt;pre&gt;
That looks quite useful. Naming the constructors is probably the hardest part :)

If I understand it correctly, it's isomorphic to Either[Option[A], B],
which is nice in that it allows for a useful filter method.

Perhaps we could take a similar approach for Either:

class Either[A, B] {
  def filter[AA](f: B =&amp;gt; Boolean)(implicit ev: A =:= Option[AA]):
Either[A, B] =
     this match {
        case l &amp;lt; at &amp;gt; Left(_) =&amp;gt; l
        case r &amp;lt; at &amp;gt; Right(b) =&amp;gt; if (f(b)) r else Left(None)
     }

  // scalaz style
  def filter[AA](f: B =&amp;gt; Boolean)(implicit M: Monoid[A]): Either[A, B]
= this match {
     case l &amp;lt; at &amp;gt; Left(_) =&amp;gt; l
     case r &amp;lt; at &amp;gt; Right(b) =&amp;gt; if (f(b)) r else Left(M.zero)
  }
}

I would suggest to deprecate/rename the current filter methods in left
and right projection first.


Try is a different beast altogether, I think its transparent exception
handling is dangerous and currently inconsistent. See my comments here
[1]

-jason

[1] https://github.com/scala/scala/commit/7d206f3c73#src/library/scala/util/Try.scala

&lt;/pre&gt;</description>
    <dc:creator>Jason Zaugg</dc:creator>
    <dc:date>2012-05-17T15:04:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9518">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9518</link>
    <description>&lt;pre&gt;I propose this as an alternative, with more favorable use characteristics
than Try or right-biased Either.  The naming ("Has") is a little quirky
because I was trying to avoid using any existing names.

Either is an awkward fit because of the clumsiness of the isomorphism
between Option[X] and Either[Unit,X]; to get around this, there are three
subclasses: Yes[X], Plea[T], and No.
  Yes[X] - the success type, like Right[X] or Some[X]
  Plea[T] - an excuse for why things didn't work, like Left[T]
  No - it didn't work and you have no idea why, like None

Has is _very strongly right-biased_ (yes-biased).  Although a subset of
methods are defined for Plea, if you want to work in left-biased mode
(plea-biased), use swap.

Code is here: http://pastebin.com/TV1NKy5b

Here's a short example of one way to use it:

  def negativeParse(s: String) = {
    for (d &amp;lt;- Has.catchAll(s.toDouble) if !d.isNaN) yield -d
  }

I'm not suggesting that we turn Either into this, but I think something
like this is the level to which &lt;/pre&gt;</description>
    <dc:creator>Rex Kerr</dc:creator>
    <dc:date>2012-05-16T20:10:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9517">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9517</link>
    <description>&lt;pre&gt;

Perhaps this is where I am confused then. Every example of right-biassed
Either I've seen is framed in terms of success and failure. I have seen
zero examples of it being used in some other way. Perhaps a compelling
example of using a right-biassed Either where left doesn't model failure
and right success would convince me that this is a worthy change.

M




&lt;/pre&gt;</description>
    <dc:creator>Matthew Pocock</dc:creator>
    <dc:date>2012-05-15T21:38:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9516">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9516</link>
    <description>&lt;pre&gt;
I agree another data type is warranted, but with careful consideration,
Yeah, I agree with both your points. Conflation is a poor-man's isomorphism.

&lt;/pre&gt;</description>
    <dc:creator>Matthew Pocock</dc:creator>
    <dc:date>2012-05-15T21:35:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9515">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9515</link>
    <description>&lt;pre&gt;I have not seen in the proposal where Either now becomes biased toward
failure or success. Right-biasing Either does not cause this.

&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-15T21:35:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9514">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9514</link>
    <description>&lt;pre&gt;
I don't expect you to take anything on board on the basis of my strong
belief ;) However, names are important to the average coder though, and
standard libraries are intended to be understandable to and used by the
average coder and the casual user.

Types are not where coding begins and ends. There is a gap to be bridged
between the code and the coder's understanding. Names are part of this
bridge.

&lt;/pre&gt;</description>
    <dc:creator>Matthew Pocock</dc:creator>
    <dc:date>2012-05-15T21:33:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9513">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9513</link>
    <description>&lt;pre&gt;
Scalaz does this with Validation, but it is not a monad and so does not
have flatMap.

I agree another data type is warranted, but with careful consideration,
we could unify them all with some nice library design with implicits --
just sayin'!



&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-15T21:32:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9512">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9512</link>
    <description>&lt;pre&gt;I should imagine the proposal is to throw all that is on RightProjection
onto Either and call it good.

And if I could have my way, there would be a crap-ton more useful
libraries on there too, but I don't think that's the proposal.

&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-15T21:30:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9511">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9511</link>
    <description>&lt;pre&gt;It perhaps should be noted that right-biasing Either and the idea of
using Either for error-handling should not be conflated. Either says
nothing about error-handling -- it is trivial summation and nothing
more. That someone might use it in its specialised form or perhaps even
specialise it one type argument (Try), is beside the point of the need
to right-bias Either. We should not conflate these things in discussion.


On 16/05/12 03:14, Simon Ochsenreither wrote:


&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-15T21:27:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9510">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9510</link>
    <description>&lt;pre&gt;Yes.

Moreover you'd want Option[T] &amp;lt;=&amp;gt; Either[Unit, T] where &amp;lt;=&amp;gt; denotes
bijection. Rather than an implicit, I'd simply prefer library support
for isomorphisms -- much easier to work with then.

In any case, I think that is all beside the point of right-biasing Either.

&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-15T21:24:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.scala.debate/9509">
    <title>Re: right-biasing Either</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.scala.debate/9509</link>
    <description>&lt;pre&gt;I think you mean Either[Unit, T] which is the isomorphism you are
alluding to.

Either[Nothing, T] ~= T

&lt;/pre&gt;</description>
    <dc:creator>Tony Morris</dc:creator>
    <dc:date>2012-05-15T21:22:48</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.scala.debate">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.scala.debate</link>
  </textinput>
</rdf:RDF>

