Skip to content

Encoding case classes containing streams #207

@soujiro32167

Description

@soujiro32167

I've had a use case like this: I want to return a case class Paginated[A](total: Long, results: List[A]). However, the list can get very big. What I really wanted was case class Paginated[F[_], A](total: Long, results: Stream[F, A]).
How would we encode such a case class using Circe? I have a solution using Shapeless, pretty much the same thing circe does but with streams. Would it be useful here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions