Are there unchecked casts in how monad fx operates? I’ve run into an issue where (in summary)
OptionT.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.