Not an issue with your code, but a slight change leads to a compiler error which I cannot understand or fix. Perhaps you can shed some light on it.
adding types inside the for comprehension fails to compile:
val summed = for {
resultOne: Int <- one
resultTwo: Int <- two
} yield {
resultOne + resultTwo
}
The compiler error is: value filter is not a member of com.example.monadT.OptionTransformer[scala.concurrent.Future,Int] [error] resultOne: Int <- one
while this compiles and runs:
val summed = for {
resultOne <- one
resultTwo <- two
} yield {
resultOne + resultTwo
}
How is filter involved here? How would I fix it and still keep explicit types?
Not an issue with your code, but a slight change leads to a compiler error which I cannot understand or fix. Perhaps you can shed some light on it.
adding types inside the for comprehension fails to compile:
The compiler error is:
value filter is not a member of com.example.monadT.OptionTransformer[scala.concurrent.Future,Int] [error] resultOne: Int <- onewhile this compiles and runs:
How is
filterinvolved here? How would I fix it and still keep explicit types?