Scala: for-comprehension stops at the empty box

def someA = {
println("someA")
Some("A")
}
def someB = {
println("someB")
Some("B")
}
def someC = {
println("someC")
Some("C")
}
def someD = {
println("someD")
Some("D")
}
println(for {
a <- someA
b <- None
_ = println("After none")
c <- someC
d <- someD
} yield a + b +c +d)
someA
None

--

--

--

On a continuing learning journey..

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Modern Rules Of Core Java

Resources that Helped Me Land a Developer Job Without a CS Degree

Top 10 PHP framework

Best PHP Framework

Robot Framework — Getting Started with Selenium Test Automation -1

How clean is your code? Part I

My Cloud Certification Diary: Is Greed the #1 of the 7 deadly sins ?

#SatyenKumar is probably the most certified Cloud professional in Brussels,Europe #AWS #Azure #OCI #CloudCertifiedFamily #IBM

The Flutter SDK Missing UX Pattern, Bottom Sheet

Interacting with Web Pages Using Keyboard Shortcuts

images/keyboardnavigation/example.png

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Learn

Learn

On a continuing learning journey..

More from Medium

Polymorphic functions in Scala

Scala: Partial application

Essential effects

[Scala] Implicit Parameters