Attila Domokos
04/02/2020, 2:44 PMv0.10.5
and my project failed to compile. I was surprised by this, as it was a patch-level bump.
Looking deeper, I found that EitherT
has changed. Do you have some updated examples on how to EitherT
with this new version?
Here is one function that fails to compile:
private fun readConfiguration(): EitherIO<T.Configuration> =
EitherT(IO.fx {
val config = T.Configuration(
System.getenv("CLIENT_ID"),
System.getenv("CLIENT_SECRET"))
Right(config)
}.handleError { Left("No CLIENT_ID or CLIENT_SECRET was found") })
The error is: Required: String, Found: ForIO
. I've been going through the 0.10.5 changelog, looking at EitherT specific commits, but I couldn't find the cure for this error. Any and all help would be appreciated!Jannis
04/02/2020, 2:53 PMEitherT<F, L, A> -> EitherT<L, F, A>
• The MonadError
instance changed from MonadError<EitherTPartialOf<L, F>, E> -> MonadError<EitherTPartialOf<L, F>, L>
Apart from that everything stayed as isAttila Domokos
04/02/2020, 2:55 PMJannis
04/02/2020, 2:57 PMT.Configuration
and EitherTIO
defined?Attila Domokos
04/02/2020, 3:00 PMEitherIO
in my original q, but took it out.
This is `EitherIO`:
typealias EitherIO<A> = EitherT<ForIO, String, A>
And Configuration
is a simple data class:
data class Configuration(val clientId: String, val clientSecret: String)
Jannis
04/02/2020, 3:01 PMtypealias EitherIO<A> = EitherT<ForIO, String, A> -> typealias EitherIO<A> = EitherT<String, ForIO, A>
because the definition changed.Attila Domokos
04/02/2020, 3:09 PM