Created
March 14, 2019 20:33
-
-
Save qingwei91/98197573d7e24c37bead324b5405fcdb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // simplified | |
| sealed trait Query[A] | |
| case object QueryString extends Query[String] | |
| case object QueryBool extends Query[Boolean] | |
| case class QueryPath[A](path: String, next: Query[A]) extends Query[A] | |
| // sample data | |
| // { | |
| // "oh": { | |
| // "my": "zsh" | |
| // } | |
| // } | |
| // expression to query _.oh.my from JSON above | |
| val expression = QueryPath("oh", QueryPath("my", QueryString)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment