Re:Scala's Option monad versus null-conditional operator in C#
by dk8996 on Saturday February 20, 2016 @06:35PM
(#11142494)
We work with Scala at our company and this is the style we use. I think that it's something that even a new person to Scala can easy understand.
Re:Scala's Option monad versus null-conditional operator in C#
by Filligree on Saturday February 20, 2016 @07:51PM
(#11142759)
Hell, I've never used Scala at all, and I can read that.
Re:Scala's Option monad versus null-conditional operator in C#
by closetnerd on Sunday February 21, 2016 @12:37PM
(#11145440)
You can tell that "_.author" is a parameterless lambda?
article.author.flatMap(_.address).flatMap(_.city).map(_.toLowerCase).foreach(println)
And in for-comprehension version there is no need to use yield, as we don't need result of println.