You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@brightredchilli In this case, it's running on an Optional. There's also a flat map on those since I think they conform to CollectionOfOne or some other weird kind of collection protocol.
I believe anything that boxes a value is considered a collection on some level. This one essentially operates on the unwrapped value if one exists.
This is a proposal by the way, I think it warrants discussion.
yes i would definitely prefer the second style to the first - for one, flatMap should be flattening(which it isn't), and map should produce an array, even if it's an array of one(which it isn't). Is anyone using flatMap in this manner right now?
For example
is possibly preferable:
The text was updated successfully, but these errors were encountered: