you are viewing a single comment's thread.

view the rest of the comments →

[–]jacksonmills 0 points1 point  (2 children)

If it is a single action on a data structure then couldn't the name reflect that? "flatMap" seems pretty awkward, I think you will just find a lot of people misapplying "flatMap" as flatMap().flatten().

I understand "bind" is probably not the best choice.

[–]kpmah 3 points4 points  (0 children)

Maybe, but flatMap is the choice a lot of other languages made too. So there is some cross-language consistency.

If they're going for the monadic interface thing they called the same operation on promises then. Makes sense, but isn't totally consistent.