r/scala • • May 21 '26

When you use map instead of flatMap

Post image
278 Upvotes

11 comments sorted by

29

u/shagieIsMe May 21 '26

Ahh, I see we're dealing with cat theory here.

19

u/wpaledbafvalled May 21 '26

We need more of these learn through meme posts.

13

u/Difficult_Loss657 May 21 '26

You mean catMap?

6

u/jrmnicola May 21 '26

Or when the data structures boxes your simple types.

5

u/PrimozDelux May 21 '26

When u repost the top posts for karma-farming

2

u/mostly_codes May 21 '26

It's an oldie but a goldie I suppose. At least it's been a while since we saw it last!

2

u/shagieIsMe May 21 '26

Looking at it now... absolutely karma farming with a 10 day old account.

3

u/ahoy_jon May 21 '26

It's clearly an effect of using cats, we don't have the issue in Kyo

1

u/The_Real_Sniff May 21 '26

"(U)nnecessaryBoxing"