I wrote this code and it compiles fine
for {
list : List[Int] <- Future(List(1, 2, 3))
} yield list.size
res7: Future[Int] = Future(Success(3))
But if I convert this code to
for {
list : List[Int] <- IO(List(1, 2, 3))
} yield list.size
I get a compile time error
value withFilter is not a member of cats.effect.IO[List[Int]]
If I remove the type then it compiles fine
for {
list <- IO(List(1, 2, 3)) // returns IO[List[Int]]
} yield list.size
res8: IO[Int] = Map(Delay(<function0>), <function1>, 0)
Why can't I specify the type with IO?
I have partial unification enabled so it can't be that :)