It's an Option.

It contains a value or it doesn't.  In the case that it does not contain a
value, it may contain out of band information.  This is not any different
from None which contains information.  It contains the information that it
lacks information.

Sure, you can write Option[T] as Either[T, Nothing], but the value of only
having on type is lost.

On Tue, Jan 6, 2009 at 2:59 PM, Tony Morris <[email protected]> wrote:

>
> Right, that's what Oliver said and I was reinforcing it with deductive
> reasoning. It is also not Option. It is something else altogether.
> Nevertheless, an isomorphism can easily be written with Either alone
> (ignoring bottoms). So in some loose sense "it is an Either".
>
> --
> Tony Morris
> http://tmorris.net/
>
> S, K and I ought to be enough for anybody.
>
>
> David Pollak wrote:
> > Tony,
> >
> > Can (now Box) is not an Either.
> >
> > David
> >
> > On Tue, Jan 6, 2009 at 2:37 PM, Tony Morris <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> >
> > Can is not an Option and to call it so in any way is an error of
> > misintegration. Indeed it would be an error to "replace Option with
> > Can" - they are completely different algebras. Either is kinded *
> > -> * -> * so cannot possible be isomorphic and cannot possibly have
> > map, flatMap etc (though it can have a bifunctor map being
> > covariant in both type arguments). However, Either.LeftProjection
> > and Either.RightProjection are kinded * -> * and are both covariant
> > functors and monads, hence map, flatMap etc. are available. e.g.
> > for(x <- either.left) ... is valid, try it.
> >
> > Of mild interest, it is possible to construct an isomorphism to Can
> > using both Either and Option. Indeed, it is possible to construct
> > an isomorphism to Option using Either e.g. forall A. Option[A] ≡
> > Either [Unit, A] so it is possible using Either alone. I'll leave
> > both as reader exercises.
> >
> >
> > On Dec 21 2008, 5:15 am, Oliver Lambert <[email protected]
> > <mailto:[email protected]>> wrote:
> >> Ok so Can is not either an Either or an Option, its a Can. I
> > kind of
> >> wondered when I first used Can, and it was described as an
> > enhanced
> >> Option, why it wasn't called something like Option+ with
> > None, Some
> >> and Failure.
> >>
> >> On 21/12/2008, at 5:47 AM, David Pollak wrote:
> >>
> >>> Can has map, flatMap, filter etc. So it can be used in a for
> >>> comphrension. I don't believe Either has those methods.
> > Further,
> >>> Can has a bunch of helpers to turn Empty into Failure
> >>
> >>> On Dec 20, 2008 10:33 AM, "Oliver Lambert" <[email protected]
> > <mailto:[email protected]>> wrote:
> >>
> >>> Is Can a little less like Option and more like scala.Either,
> > where
> >>> the left side is used to indicate failure? On 21/12/2008, at
> >>> 1:43 AM, David Pollak wrote: > Folks, > >
> > Over the
> >>> year that Lift has had Can[T...
> >
> >
> >
> >
> >
> > -- Lift, the simply functional web framework http://liftweb.net
> > Collaborative Task Management http://much4.us Follow me:
> > http://twitter.com/dpp Git some: http://github.com/dpp
> >
> > >
>
>
>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to