Desugaring for comprehensions (AKA for expressions)
Posted: | Categories: Programming, Scala | Tags: for comprehension, for expression
Recently I stumbled upon a piece of Scala code that might leave you puzzled. Before showing you the code I must spend a few words about the compiler options.
Compiler options
Getting into the glory details of each and every compiler option is out of the scope of this post
(see compiler options). Suffice to say
you can use some flags to make the Scala compiler stricter and help you find code deficiencies at compile time.
The flag I always use, among others, is "-Wunused"
. So in build.sbt
I have: