Closed CeylonMigrationBot closed 8 years ago
[@quintesse] Totally agree. I already strongly dislike our collect
and select
synonyms for filter
and map
(I had to look them up again to see what they actually do), instead of the uglier but much more likely to be remembered correctly seqfilter
and seqmap
(or sequenceFilter
and sequenceMap
).
[@gavinking] @FroMage I think you're right. How about bimap()
?
[@gavinking] @quintesse OTOH, I don't think you're right.
[@quintesse] @gavinking I know you don't, but it's one of the things I positively hate in our current language module. It sucks to completely change the name of some very well known functions when the only thing they do basically is filter().sequence
and map().sequence
.
[@FroMage]
bimap
is not good wrt completion, if someone expects map
to be completed and sees map2
he may discover it, but not if it's called bimap
.
I sorta agree with @quintesse on the less than ideal names for collect and select, because they are not easy to discover and mean nothing unless you already know them. I suppose that if there's a good see
annotation on filter
and map
that point to them it may be better, but my preference would be filterSequential
and mapSequential
or some other thing that start with what people are going to look for. I think it is however easier to discover collect
and select
from an Iterable
since you already know what class to look at and its documentation explains the difference. For toplevels such as combine
this isn't true.
[@FroMage] Do we agree on map2
or does this slip to 1.0?
[@gavinking] Slips.
[@gavinking] In fact, I think we should replace today's combine()
with a function that accepts a stream of tuples and a stream of values, and produces a stream of extended tuples. We'll also need a way to get hold of an infinite stream of empty tuples.
So you would be able to write:
combine(xs, combine(ys, empties)).map(unflatten(fun));
Or perhaps instead of combine(ys, empties)
, we could use singletons(ys)
to get a stream of singleton tuples.
[@gavinking] combine()
is now redefined as suggested, in terms of zip()
. Now zip()
itself fills the role that combine()
used to fill.
[@FroMage]
combine
is a special-casemap
for two lists. But it's still map. I think we can't write down the proper signature formap
with N lists, which is why we havemap
+combine
, but we can't be giving each of those a name out of nowhere. I know it sounds like defeat to renamecombine
tomap2
but at least the name will be true and intuitive for everyone who knowsmap
.[Migrated from ceylon/ceylon.language#305] [Closed at 2013-11-05 21:44:56]