kyleg
02/12/2020, 11:21 PMOptionT.fx {
val x: Foo = OptionT(getFoo()).bind()
val y: Bar = OptionT(getBar()).bind()
}.value().fix().unsafeRunAsync {}
errors out at val y = … saying cannot cast Foo to Bar. There’s no compile-time error, getFoo(): IO<Option<Foo>> and getBar(): IO<Option<Bar>>
Furthermore, for the exact same user input on the exact same data set, it only occurs sometimes. getFoo and getBar wrap DB calls that return Foo? and `Bar?`` to make them IO<Option<Foo/Bar>>
Might be my last question for a while! Tomorrow I go pick up a laptop from a client and boss has been joking that I’m going to be putting on 60 hours a week for a while on a project, and I have a baby due in a week. 😄 God willing, work and the baby are both chill.pakoito
02/12/2020, 11:53 PMpakoito
02/12/2020, 11:54 PMpakoito
02/12/2020, 11:54 PMOptionT.fx this herepakoito
02/12/2020, 11:55 PMOptionT(getBar()).bind()pakoito
02/12/2020, 11:55 PMpakoito
02/12/2020, 11:55 PMpakoito
02/12/2020, 11:55 PMkyleg
02/13/2020, 12:02 AMpakoito
02/13/2020, 12:04 AMpakoito
02/13/2020, 12:04 AM