the description for this gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Language[Wrapper[_]] { | |
type QueryObj | |
case class Raw(q: QueryObj) | |
case class WithFilter(q: QueryObj) | |
case class WithPagination(q: QueryObj) | |
def people(): Wrapper[Raw] | |
// we could change plain Ints into our custom class, but will skip it for brevity | |
def filterByIds(query: Wrapper[Raw], ids: Seq[Int]): Wrapper[WithFilter] | |
def paginate(query: Wrapper[WithFilter], skip: Int, limit: Int): Wrapper[WithPagination] | |
def run(query: Wrapper[WithPagination]): Wrapper[Seq[Person]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment