Created
March 14, 2019 20:40
-
-
Save qingwei91/aaccec14d07b88bf59a67789d6d4ddca 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
| implicit val queryHFunctor: HFunctor[QueryF] = new HFunctor[QueryF] { | |
| def hmap[I[_], J[_]](nt: I ~> J): QueryF[I, ?] ~> QueryF[J, ?] = { | |
| new (QueryF[I, ?] ~> QueryF[J, ?]) { | |
| def apply[A](a: QueryF[I, A]): QueryF[J, A] = { | |
| a match { | |
| case QueryStringF => QueryStringF | |
| case QueryBoolF => QueryBoolF | |
| case query: QueryPathF[I, A] => QueryPathF(query.path, nt(query.next)) | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment