Skip to content

Add `Iterable.filterMap` #363

Open
FroMage opened this Issue Nov 26, 2013 · 6 comments

4 participants

@FroMage
Ceylon member
FroMage commented Nov 26, 2013

That does both a filter and a map in a single operation. I guess we're going to have to define a special value for something which we filter out, because if we use Boolean|New filterMap(Old val) we can't map Boolean values.

@gavinking
Ceylon member

It's not really clear to me that this is much better than iterable.map(fun).coalesced.

I guess we're going to have to define a special value for something which we filter out

And we seriously can't use null for that?

@tombentley
Ceylon member

@FroMage do you still this this is worthwhile?

@FroMage
Ceylon member
FroMage commented May 13, 2014

Yes, people expect it to be there

@gavinking
Ceylon member

Yes, people expect it to be there

They do?

Honestly I'm not sure if there is much call for it, since we can just write:

iterable.map(fun).coalesced
@gavinking
Ceylon member

I mean it's really just mapFilteringNulls().

@gavinking gavinking modified the milestone: 1.2, 1.1 Jun 6, 2014
@marvelous

Now that I discovered the iterable.map(fun).coalesced idiom, I have to say that I don't long for a filterMap anymore. Previously, I was using flatMap returning [value] or [].

@CeylonMigrationBot CeylonMigrationBot referenced this issue in ceylon/ceylon Nov 14, 2015
Open

Add `Iterable.filterMap` #5241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.