So currently memoize on Resource returns a Resource[IO, Resource[IO, A]]. The thing is, that inner resource is not really necessary (the implementation is just a Resource.eval(...)) and it makes the ergonomics a lot worse. The ideal signature would look more like Resource[IO, IO[A]].
Besides memoize, I wonder if we can rescue some of the other method signatures as well, that return extremely hairy nested Resources. It's pretty cool that Resource implements Async with all these bells-and-whistles, but the method signatures aren't always very ergonomic when working directly with concrete Resource.
So currently
memoizeonResourcereturns aResource[IO, Resource[IO, A]]. The thing is, that inner resource is not really necessary (the implementation is just aResource.eval(...)) and it makes the ergonomics a lot worse. The ideal signature would look more likeResource[IO, IO[A]].Besides
memoize, I wonder if we can rescue some of the other method signatures as well, that return extremely hairy nestedResources. It's pretty cool thatResourceimplementsAsyncwith all these bells-and-whistles, but the method signatures aren't always very ergonomic when working directly with concreteResource.