3 ms·
If you just have 1 step then there is no advantage. If you have multiple steps then the advantage is that you never have to unpack "in the middle" and you don'
by valenterry 3y ago
If you just have 1 step then there is no advantage.
If you have multiple steps then the advantage is that you never have to unpack "in the middle" and you don't have to care - and the compiler has your back.
Classical example: show the street number of the user or show <None> if there is no street number. There can be multiple things missing on the way and multiple transformations might happen on the way. E.g. the user might not even have an adress saved alltogether.
In that case, you only have to "check whether those Maybes contain values or not" once at the very end.