Skip to content

Add specialized signature of memoize to Resource #3513

Description

@armanbilge

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions