`getCurrentSession().flatMap { optSession -> op...
# arrow
s
getCurrentSession().flatMap { optSession -> optSession.fold({ createSession() }, { session -> just(session) }) }
that should work for sure