pakoito
12/16/2019, 9:35 AMSagar Suri
12/16/2019, 11:14 AMpakoito
12/16/2019, 12:54 PMpakoito
12/16/2019, 12:54 PMSagar Suri
12/16/2019, 1:20 PMpakoito
12/16/2019, 1:21 PMpakoito
12/16/2019, 1:21 PMpakoito
12/16/2019, 1:21 PMSagar Suri
12/16/2019, 1:24 PMPPWasin
12/16/2019, 2:13 PMPPWasin
12/16/2019, 2:13 PMpakoito
12/16/2019, 2:14 PMPPWasin
12/16/2019, 2:14 PMPhBastiani
12/16/2019, 2:36 PMbind()
extension function you could also mention the use of the !
shortcut 🤔pakoito
12/16/2019, 2:37 PMval a by IO
, so it's better if we start suggesting .bind()
for nowpakoito
12/16/2019, 2:37 PM!
and destructure had collisions when used with boolean or data classesPhBastiani
12/16/2019, 2:45 PMPhBastiani
12/16/2019, 2:48 PMval eitherMonad = Either.monad<String>()
fun stackSafeEitherProgram(n: Int, acc: Int = 1) : Free<EitherPartialOf<String>, Int> =
eitherMonad.fx.stackSafe {
val r = when {
n == 1 -> !Right(acc)
n > 1 -> stackSafeEitherProgram(n-1, acc * n).bind()
else -> !Left("Invalid number!")
}
r
}
pakoito
12/16/2019, 2:49 PMAnton K
12/16/2019, 6:08 PMeffect { renderPage(userPage) }.bind()
instead of effect { renderPage(user) }.bind()
in one of the snippets?pakoito
12/16/2019, 6:14 PMMichael Marth
12/22/2019, 4:30 PMPromise
to mimick lifecycle callbacks:
• There is a typo val endPromise: Promise<ForIo, Unit>
- should be ForIO
as first type param
• Exactly this line does not compile - complaining about failing type inference for A