kluck
07/01/2019, 8:19 AMbind() inside an Option getOrElse, but I get an error: Suspension functions can be called only within coroutine body. What's the correct way to do this?
getCurrentSession(): IO<Option<Session>>
createSession(): IO<Session>
fx {
val currentSession = getCurrentSession().bind()
val session = currentSession.getOrElse { createSession().bind() } // <- This part fails
sessionRepository.startSession(session).bind()
}