Funny boy. :-)
On Dec 20, 2008 7:39 AM, "Derek Chen-Becker" <dchen...@gmail.com> wrote:
What about renaming it Glass? Then we could add:
case class HalfFull[T](data : T) extends Glass[T]
type HalfEmpty[T] = HalfFull[T]
;)
Derek
On Sat, Dec 20, 2008 at 8:13 AM, TylerWeir <tyler...@gmail.com> wrote: > > > Once people get Can...
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" <ola...@gmail.com> 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...
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subs...
Because Can is three letters and OptionPlus is 11 and a frequently used construct should be easy on the fingers.
On Dec 20, 2008 11:15 AM, "Oliver Lambert" <ola...@gmail.com> 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 u...
You received this message because you are subscribed to the Google Groups "Lift" group. To post to ...
On 21/12/2008, at 6:50 AM, Charles F. Munat wrote:
> OptionWithFailure
These are pretty much my thoughts on the issue also. I like
OptionWithFailure the best, but of the suggestions for very short
names, Can is a reasonable choice once you see an explanation.
Matt
Yup, when you chose the original name, you did a good job - why second guess yourself now. Can we just leave it the way it is.
With Result:
def doStuff(arg1 : Result[Foo], arg2 : Toto) : Result[Bar]
Result could be good but is not, when used for argument and not for "result"
more I think about it, more I thought ? was not so wrong/joke. In the
Nice language (a old competitor to scala) ? was used to mark value to
be potentially null
var myVar1 : ?String //myVar1 could be null
var myVar2 : String //myVar2 is never null
With ?:
def doStuff(arg1 : ?[Foo], arg2 : Toto) : ?[Bar]
object Can {
...
def has[T](t: T) = Full(t)
}
val gotz = Can has "cheezburger"
... which constitutes my vote for "keep Can" -- it's a comedic noun and
also a semantically relevant verb. :)
-0xe1a
I've never liked "Can" as a name; always thinking that the opposite of one
should be a "Can't". I'm sure it's my own issue to solve, but it's
cognitively dissonant to me.
Any other container name works better for me, although of the ones you listed,
I like "Box".
--
Twitter: http://twitter.com/campbellmichael
To close the season and thread with some humour:
I wanted to send some sort of Christmas (whoops I mean) holiday
greeting to my friends, but it is so difficult in today's world to
know exactly what to say without offending someone. So I met with my
lawyer yesterday, and on his advice I wish to say the following to
you, my dear friends throughout the world:
Please accept with no obligation, implied or implicit, my best wishes
for an environmentally conscious, socially responsible, low stress,
non-addictive, gender neutral celebration of the Summer solstice
holiday, practised with the most enjoyable traditions of religious
persuasion or secular practices of your choice with respect for the
religious/secular persuasions and/or traditions of others, or their
choice not to practice religious or secular traditions at all.
I also wish you a fiscally successful, personally fulfilling and
medically uncomplicated recognition of the onset of the generally
accepted calendar year 2009, but not without due respect for the
calendars of choice of other cultures whose contributions to society
have helped make our country great (not to imply that Australia is
necessarily greater than any other country) and without regard to the
race, creed, colour, age, physical ability, religious faith or sexual
preference of the wishees.
By accepting this greeting, you are accepting these terms:
This greeting is subject to clarification or withdrawal. It is freely
transferable with no alteration to the original greeting. It implies
no promise by the wisher to actually implement any of the wishes for
her/himself or others and is void where prohibited by law, and is
revocable at the sole discretion of the wisher.
This wish is warranted to perform as expected within the usual
application of good tidings for a period of one year or until the
issuance of a subsequent holiday greeting, whichever comes first, and
warranty is limited to replacement of this wish or issuance of a new
wish at the sole discretion of the wisher.
Disclaimer: No trees were harmed in the sending of this message;
however, a significant number of electrons were slightly inconvenienced.
Just brainstorming here... not sure if we're beating a dead horse... but about Option3 to signify it has 3 states? (i.e. Some3, None3, Error3)
It's uglier but could be easier to explain and understand.
One last suggestion... Promise with Fulfilled, Empty, and Broken
(my
other suggestion of Blond, Brunette and Redhead didn't seem to make
it...).
It's ok to love LOLCode, etc.... just don't *LOVE* LOLCode.
--
Twitter: http://twitter.com/campbellmichael
While you're right in a (very) narrowly technical sense you're missing
the point that Lift's Can has functionality that is very closely
related to a combination of Option and Either in a touchy-feely
pragmatic getting-useful-things-actually-done sort of sense.
To prove the point, here,
http://www.milessabin.com/misc/Chain.scala
is something I put together a while ago which can be used in a very
similar way to Can (at least, I expect that's the case ... I haven't
worked with Lift so I can't be sure) but which only exposes Option and
Either in it's public interface. It's also sufficiently Monad like to
get along nicely with for comprehensions.
Given the likelihood of confusion between Can and Option (irrespective
the algebraic niceties) I wish Lift had gone for something more like
that than a rename to Box.
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)1273 720 779
mobile: +44 (0)7813 944 528
skype: milessabin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------fi0tfi0tLTxicj4KPGJyPgo=20gPGJyPiBGb3IgbW9yZSBvcHRpb25zLCB2 isit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------fi0tfi0tLTxicj4KPGJyPgo=go=
Do any conversions exist to treat a Box[_] as an Either[Option[_],Exception] or as an Option[_]? Are there any helper functions that lift could benefit from by having these?
Who cares?
For most people, "is" means "is isomorphic to" when talking about data
types. Furthermore, you are free to invent your own definition, but it
is loaded with nothing more than cognitive bias. If Can is Option -
under a (failed) definition, then Can is also List by precisely the
same flawed method.
Somehow, I'm not sure it is I who is "missing the point".
I had no intention of this. I'm finished. I hope Oliver has understood.
In a pragmatic and therefore, not very useful way, yes Can is like
Option. But now that I have subverted what it means for Can to "be
like" anything I'm going to propose that Can is List - it is either
empty or has a value (right?). Let's all chime in now with our
preferred cognitive biases now that we have lost meaning into the
impractical infection called pragmatism.
A square is like a triangle, but with one extra side. No wait, a
square is a combination of four triangles. Oh actually, a square is
like a triangle, except it is not in any way at all.
Don't fall for it Oliver - it's a misintegration.
--
Tony Morris
http://tmorris.net/
S, K and I ought to be enough for anybody.
We are talking about Can and Option, both of which are algebraic data
types. You might be discussing inheritance somehow (how?) but
nevertheless, so was I when I tried to save the proposition i.e.
implication and inheritance are equivalent for the purposes of the
earlier discussion (forall A. Can[A] -> Option[A]). In any case, this
does not somehow save the false proposition "Can is Option" unless...
Perhaps you mean "an instance of Can is an instance of Option"? I
don't think so. Perhaps then you mean "an instance of Can *could be
written* as if it inherited from Option". Well this may be so, but the
same can be said for every single function that exists. Int could
inherit from Short but we do not say Int is (the data type?) Short. So
what exactly do you mean when you say "Can is Option"? Or worse, "Can
is an enhanced Option"? What is "enhanced" about the addition of a
data constructor? I hope you see why I am protective of Oliver as he
is bombarded with such falsehoods.
Can is no more Option than it is List.
"But" you say "It almost is, it just needs one more data constructor".
Fine then, Unit is Option.
"No, when I say Can is Option I mean to utilise the existing knowledge
of the intended audience who is aware of Option. I really mean Can is
like Option"
Fine, now that this fact is admitted, we are in agreement - the false
statement exists to appease a cognitive aspect, nothing more.
When you say Can is Option, what exactly do you mean? Then when you
have conveyed that meaning I will apply it elsewhere and have your
agreement. If I do not, I will demand that you revise your intended
meaning. We will repeat until you are either logically consistent or
you have retracted the notion. This is inductive reasoning - an
aversion of pragmatism sure - but I am compelled to use it nonetheless.
The recognition of a topological isomorphism between a square and a
triangle requires my metaphor to be subverted somewhat to save it - I
will abandon it instead (there are many examples of misintegration all
around you after all).
If this only fuels a fire and causes further diversion, then I resign.
The recognition of a topological isomorphism between a square and a
triangle requires my metaphor to be subverted somewhat to save it - I
will abandon it instead (there are many examples of misintegration all
around you after all).
If this only fuels a fire and causes further diversion, then I resign.
--