Skip to content

Commit

Permalink
Merge branch 'master' into upsert-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mentegy authored Apr 6, 2018
2 parents 11a9cf2 + 024aae8 commit 5fc1557
Show file tree
Hide file tree
Showing 36 changed files with 698 additions and 65 deletions.
22 changes: 8 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ branches:
- website
before_script:
- ./build/pull_docker_images.sh
- travis_retry docker-compose run setup
script:
- docker-compose run sbt bash -c "./build/build.sh"
- travis_retry docker-compose run setup
- travis_wait 120 docker-compose run sbt bash -c "./build/build.sh"
after_success:
- ./build/push_docker_images.sh
- pip install --user codecov && codecov
Expand All @@ -28,18 +28,12 @@ env:
- secure: cq/0b2mHyfkpNtoecmJBhsq37vySkzeaH0TN06jAtW9/zGkm5yaIJkPUCdlJmW0on/xgXLCTvrx17nuRXQJmNpO32KfUOPfn7VIKS054Y8s86z61dKarWthTruNEosIdnmp88lV+V9lsjmAlYZv23u0yMDx4U34FYumPrH14eb27gGd/Xc7+LZpMYf3okxGPRtdxZ5KRO05v9dHcR3IthITixL26M6Z2VUb79fXkMiQ5Z17zh8sh1elS6AnE8SkcLYAefHhdJP18vFx3dmMlYY7m+qwfUmZ3YCZjUUYxA1Z+dnH5/mRNww4Se47TZFmoyHycq+P29znH+P7fSN5TnzTd6B5yPzIjFFTogv7BlPOgpq67J7vKeEyJ7mTYa5br84wnIIw1RJOltzhn2DO3YhXGysPzw8icz1RTlOASW86kUBAGiCzHW9iQGk2wll0ARohHSplahN8Qyb5vtUnF9Qep7fS6DTUHqAFCXiS1g7PEmvTD0ns5j+GNXLUy56LMrotpyV+zO5p8822Vu6315dbDkj7+znh+XTXG5we0AZIEAHK/F3BXy3URWmMdnrowPvlMMB20LLGvxOyaZMQsqBxYypHeKXqDMy9+M16LMJdUQRFCQFFunyGedHLJFyucs3ao6L0sxUdirXKFeoXnuB1QhLHQOphwhENuz1OLWmk=
- secure: YWJ9ho4mwXjy4GrnbjehDlP5wFA6P8KLZMb+jOCEFNI9wKSiKzUUeIqGNog6Q9KCHE+RMEFz/kqE+7jNhhOgGGv0mRF0RVfHL0SkamhD0NMxiC1vITk3+oqMi/v1sK/V88WbfM4+1sAcFqV7yoptyWw/Db7U/MdLcRZaVe2zMz6s4P811CZjpT2Y/EkwxWcxejTCxptAvAkIfrgIyI28xW9hgA9oWvQJjD42ShKd445AC9qNq8E2cY8ukFIMik/FNHYWQMmdUTYOqX68O6fn2lPcIayPNCl0UuY6L9DB0KS0ZxrItX6/0JQU/CR8iFHWxshACvxLAMLUofPl/0QVkoSVaCGrKCX8WpjQ4K2FV/xiXa6xPXSFcI4RRsGkpXe3S6BHdWdH7whEsLDhvIJN3WQREWYqujXNi2imCO08+N0/GuDxfIcCzkrsEZYk5d1h8HQTk6Ml9ahhbL5EbrgEO6z8C/cLoSwebeYPeO7Wlw8y1f0pT8yIMH0cAI0PrdUzhQOgSgMUZGgntCynHyJymwtlHV7y829qsxvf3M0IpjCwK3VAdQLQKt2evFOT2hIbubpzvR6u26zeflpiMr/U8/uZnu3XYCPFLwkAZEDLb1LNfDiXOZY+cG+aX0R/m3hPDv5G5iH0OCTCwJ/usGSRMxdhwgQqltXrhGLUkvKcy8w=
matrix:
- SCALA_VERSION=2.11
- SCALA_VERSION=2.12
- SCALA_VERSION=2.11.11
- SCALA_VERSION=2.12.4
jobs:
include:
- stage: release 2.12
env:
- SCALA_VERSION=2.12.4
script:
- docker-compose run sbt bash -c "./build/release.sh"

- stage: release 2.11
env:
- SCALA_VERSION=2.11.11
- stage: release
env: SCALA_VERSION
script:
- docker-compose run sbt bash -c "./build/release.sh"
- docker-compose run sbt bash -c "SCALA_VERSION=2.12.4 ./build/release.sh"
- docker-compose run sbt bash -c "SCALA_VERSION=2.11.11 ./build/release.sh"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,7 @@ See the [LICENSE](https://github.com/getquill/quill/blob/master/LICENSE.txt) fil
# Maintainers

- @fwbrasil (creator)
- @deusaquilus
- @gustavoamigo
- @jilen
- @mentegy
Expand All @@ -1998,4 +1999,4 @@ The project was created having Philip Wadler's talk ["A practical theory of lang

* [A Practical Theory of Language-Integrated Query](http://homepages.inf.ed.ac.uk/slindley/papers/practical-theory-of-linq.pdf)
* [Everything old is new again: Quoted Domain Specific Languages](http://homepages.inf.ed.ac.uk/wadler/papers/qdsl/qdsl.pdf)
* [The Flatter, the Better](http://db.inf.uni-tuebingen.de/staticfiles/publications/the-flatter-the-better.pdf)
* [The Flatter, the Better](http://db.inf.uni-tuebingen.de/staticfiles/publications/the-flatter-the-better.pdf)
15 changes: 6 additions & 9 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@ set -e # Any subsequent(*) commands which fail will cause the shell script to ex
chown root ~/.ssh/config
chmod 644 ~/.ssh/config

SBT_CMD="sbt"
SBT_CMD_2_11=" -DscalaVersion=2.11.12 ++2.11.12 clean coverage test tut coverageReport coverageAggregate checkUnformattedFiles"
SBT_CMD_2_12=" -DscalaVersion=2.12.4 ++2.12.4 clean test"
SBT_PUBLISH=" coverageOff publish"
SBT_CMD="sbt -DscalaVersion=$SCALA_VERSION ++$SCALA_VERSION clean"

if [[ $SCALA_VERSION == "2.11" ]]
if [[ $SCALA_VERSION == 2.11* ]]
then
SBT_CMD+=$SBT_CMD_2_11
elif [[ $SCALA_VERSION == "2.12" ]]
SBT_CMD+=" coverage test tut coverageReport coverageAggregate checkUnformattedFiles"
elif [[ $SCALA_VERSION == 2.12* ]]
then
SBT_CMD+=$SBT_CMD_2_12
SBT_CMD+=" test"
else
exit 1
fi

if [[ $TRAVIS_PULL_REQUEST == "false" ]]
then
SBT_CMD+=$SBT_PUBLISH
SBT_CMD+=" coverageOff publish"
openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ./build/secring.gpg.enc -out local.secring.gpg -d
openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ./build/pubring.gpg.enc -out local.pubring.gpg -d
openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ./build/credentials.sbt.enc -out local.credentials.sbt -d
Expand Down
4 changes: 1 addition & 3 deletions build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ set -e # Any subsequent(*) commands which fail will cause the shell script to ex
chown root ~/.ssh/config
chmod 644 ~/.ssh/config


if [[ -n $SCALA_VERSION && $TRAVIS_PULL_REQUEST == "false" &&
$TRAVIS_BRANCH == "master" && $(cat version.sbt) != *"SNAPSHOT"* ]]
if [[ -n $SCALA_VERSION && $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_BRANCH == "master" && $(cat version.sbt) != *"SNAPSHOT"* ]]
then
openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ./build/secring.gpg.enc -out local.secring.gpg -d
openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in ./build/pubring.gpg.enc -out local.pubring.gpg -d
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ services:
image: cassandra:3.11
ports:
- "19042:9042"
- "19160:9160"
environment:
- MAX_HEAP_SIZE=512m
- HEAP_NEWSIZE=256m
- MAX_HEAP_SIZE=256m
- HEAP_NEWSIZE=64m

orientdb:
image: orientdb:latest
ports:
- "12424:2424"
- "12480:2480"
environment:
- ORIENTDB_ROOT_PASSWORD=root

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CassandraAsyncContext[N <: NamingStrategy](
}

def executeQuery[T](cql: String, prepare: Prepare = identityPrepare, extractor: Extractor[T] = identityExtractor)(implicit ec: ExecutionContext): Future[List[T]] =
Future(prepare(super.prepare(cql))).flatMap {
Future(prepare(this.prepare(cql))).flatMap {
case (params, bs) =>
logger.logQuery(cql, params)
session.executeAsync(bs)
Expand All @@ -48,7 +48,7 @@ class CassandraAsyncContext[N <: NamingStrategy](
executeQuery(cql, prepare, extractor).map(handleSingleResult)

def executeAction[T](cql: String, prepare: Prepare = identityPrepare)(implicit ec: ExecutionContext): Future[Unit] = {
Future(prepare(super.prepare(cql))).flatMap {
Future(prepare(this.prepare(cql))).flatMap {
case (params, bs) =>
logger.logQuery(cql, params)
session.executeAsync(bs).map(_ => ())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CassandraSyncContext[N <: NamingStrategy](
}

def executeQuery[T](cql: String, prepare: Prepare = identityPrepare, extractor: Extractor[T] = identityExtractor): List[T] = {
val (params, bs) = prepare(super.prepare(cql))
val (params, bs) = prepare(this.prepare(cql))
logger.logQuery(cql, params)
session.execute(bs)
.all.asScala.toList.map(extractor)
Expand All @@ -44,7 +44,7 @@ class CassandraSyncContext[N <: NamingStrategy](
handleSingleResult(executeQuery(cql, prepare, extractor))

def executeAction[T](cql: String, prepare: Prepare = identityPrepare): Unit = {
val (params, bs) = prepare(super.prepare(cql))
val (params, bs) = prepare(this.prepare(cql))
logger.logQuery(cql, params)
session.execute(bs)
()
Expand Down
17 changes: 10 additions & 7 deletions quill-core/src/main/scala/io/getquill/MirrorIdiom.scala
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ class MirrorIdiom extends Idiom {
}

implicit def optionOperationTokenizer(implicit liftTokenizer: Tokenizer[Lift]): Tokenizer[OptionOperation] = Tokenizer[OptionOperation] {
case OptionMap(ast, alias, body) => stmt"${ast.token}.map((${alias.token}) => ${body.token})"
case OptionForall(ast, alias, body) => stmt"${ast.token}.forall((${alias.token}) => ${body.token})"
case OptionExists(ast, alias, body) => stmt"${ast.token}.exists((${alias.token}) => ${body.token})"
case OptionContains(ast, body) => stmt"${ast.token}.contains(${body.token})"
case OptionIsEmpty(ast) => stmt"${ast.token}.isEmpty"
case OptionNonEmpty(ast) => stmt"${ast.token}.nonEmpty"
case OptionIsDefined(ast) => stmt"${ast.token}.isDefined"
case OptionFlatten(ast) => stmt"${ast.token}.flatten"
case OptionGetOrElse(ast, body) => stmt"${ast.token}.getOrElse(${body.token})"
case OptionFlatMap(ast, alias, body) => stmt"${ast.token}.flatMap((${alias.token}) => ${body.token})"
case OptionMap(ast, alias, body) => stmt"${ast.token}.map((${alias.token}) => ${body.token})"
case OptionForall(ast, alias, body) => stmt"${ast.token}.forall((${alias.token}) => ${body.token})"
case OptionExists(ast, alias, body) => stmt"${ast.token}.exists((${alias.token}) => ${body.token})"
case OptionContains(ast, body) => stmt"${ast.token}.contains(${body.token})"
case OptionIsEmpty(ast) => stmt"${ast.token}.isEmpty"
case OptionNonEmpty(ast) => stmt"${ast.token}.nonEmpty"
case OptionIsDefined(ast) => stmt"${ast.token}.isDefined"
}

implicit def traversableOperationTokenizer(implicit liftTokenizer: Tokenizer[Lift]): Tokenizer[TraversableOperation] = Tokenizer[TraversableOperation] {
Expand Down
3 changes: 3 additions & 0 deletions quill-core/src/main/scala/io/getquill/ast/Ast.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ case class Ident(name: String) extends Ast
case class Property(ast: Ast, name: String) extends Ast

sealed trait OptionOperation extends Ast
case class OptionFlatten(ast: Ast) extends OptionOperation
case class OptionGetOrElse(ast: Ast, body: Ast) extends OptionOperation
case class OptionFlatMap(ast: Ast, alias: Ident, body: Ast) extends OptionOperation
case class OptionMap(ast: Ast, alias: Ident, body: Ast) extends OptionOperation
case class OptionForall(ast: Ast, alias: Ident, body: Ast) extends OptionOperation
case class OptionExists(ast: Ast, alias: Ident, body: Ast) extends OptionOperation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ trait StatefulTransformer[T] {

def apply(o: OptionOperation): (OptionOperation, StatefulTransformer[T]) =
o match {
case OptionFlatten(a) =>
val (at, att) = apply(a)
(OptionFlatten(at), att)
case OptionGetOrElse(a, c) =>
val (at, att) = apply(a)
val (ct, ctt) = att.apply(c)
(OptionGetOrElse(at, ct), ctt)
case OptionFlatMap(a, b, c) =>
val (at, att) = apply(a)
val (ct, ctt) = att.apply(c)
(OptionFlatMap(at, b, ct), ctt)
case OptionMap(a, b, c) =>
val (at, att) = apply(a)
val (ct, ctt) = att.apply(c)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ trait StatelessTransformer {

def apply(o: OptionOperation): OptionOperation =
o match {
case OptionMap(a, b, c) => OptionMap(apply(a), b, apply(c))
case OptionForall(a, b, c) => OptionForall(apply(a), b, apply(c))
case OptionExists(a, b, c) => OptionExists(apply(a), b, apply(c))
case OptionContains(a, b) => OptionContains(apply(a), apply(b))
case OptionIsEmpty(a) => OptionIsEmpty(apply(a))
case OptionNonEmpty(a) => OptionNonEmpty(apply(a))
case OptionIsDefined(a) => OptionIsDefined(apply(a))
case OptionFlatten(a) => OptionFlatten(apply(a))
case OptionGetOrElse(a, b) => OptionGetOrElse(apply(a), apply(b))
case OptionFlatMap(a, b, c) => OptionFlatMap(apply(a), b, apply(c))
case OptionMap(a, b, c) => OptionMap(apply(a), b, apply(c))
case OptionForall(a, b, c) => OptionForall(apply(a), b, apply(c))
case OptionExists(a, b, c) => OptionExists(apply(a), b, apply(c))
case OptionContains(a, b) => OptionContains(apply(a), apply(b))
case OptionIsEmpty(a) => OptionIsEmpty(apply(a))
case OptionNonEmpty(a) => OptionNonEmpty(apply(a))
case OptionIsDefined(a) => OptionIsDefined(apply(a))
}

def apply(o: TraversableOperation): TraversableOperation =
Expand Down
7 changes: 6 additions & 1 deletion quill-core/src/main/scala/io/getquill/dsl/MetaDslMacro.scala
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ class MetaDslMacro(val c: MacroContext) {
nest(tpe, term)
}

if (is[Option[Any]](tpe)) {
if (isNone(tpe)) {
c.fail("Cannot handle untyped `None` objects. Use a cast e.g. `None:Option[String]` or `Option.empty`.")
} else if (is[Option[Any]](tpe)) {
value(tpe.typeArgs.head).copy(optional = true)
} else {
value(tpe)
Expand Down Expand Up @@ -251,6 +253,9 @@ class MetaDslMacro(val c: MacroContext) {
filterExcludes(apply(tpe, term = None, nested = false))
}

private def isNone(tpe: Type) =
tpe.typeSymbol.name.toString == "None"

private def isTuple(tpe: Type) =
tpe.typeSymbol.name.toString.startsWith("Tuple")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ case class BetaReduction(map: collection.Map[Ast, Ast])

override def apply(o: OptionOperation) =
o match {
case other @ OptionFlatMap(a, b, c) =>
OptionFlatMap(apply(a), b, BetaReduction(map - b)(c))
case OptionMap(a, b, c) =>
OptionMap(apply(a), b, BetaReduction(map - b)(c))
case OptionForall(a, b, c) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ import io.getquill.ast._

object FlattenOptionOperation extends StatelessTransformer {

override def apply(ast: Ast) =
private def isNotEmpty(ast: Ast) =
BinaryOperation(ast, EqualityOperator.`!=`, NullValue)

override def apply(ast: Ast): Ast =
ast match {
case OptionFlatten(ast) =>
apply(ast)
case OptionGetOrElse(ast, body) =>
apply(If(isNotEmpty(ast), ast, body))
case OptionFlatMap(ast, alias, body) =>
apply(BetaReduction(body, alias -> ast))
case OptionMap(ast, alias, body) =>
apply(BetaReduction(body, alias -> ast))
case OptionForall(ast, alias, body) =>
Expand Down
1 change: 1 addition & 0 deletions quill-core/src/main/scala/io/getquill/norm/Normalize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ object Normalize extends StatelessTransformer {
case SymbolicReduction(query) => norm(query)
case AdHocReduction(query) => norm(query)
case OrderTerms(query) => norm(query)
case NormalizeAggregationIdent(query) => norm(query)
case other => other
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.getquill.norm

import io.getquill.ast._

object NormalizeAggregationIdent {

def unapply(q: Query) =
q match {

// a => a.b.map(x => x.c).agg =>
// a => a.b.map(a => a.c).agg
case Aggregation(op, Map(p @ Property(i: Ident, _), mi, Property(_: Ident, n))) if i != mi =>
Some(Aggregation(op, Map(p, i, Property(i, n))))

case _ => None
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ case class FreeVariables(state: State)

override def apply(o: OptionOperation): (OptionOperation, StatefulTransformer[State]) =
o match {
case q @ OptionFlatMap(a, b, c) =>
(q, free(a, b, c))
case q @ OptionMap(a, b, c) =>
(q, free(a, b, c))
case q @ OptionForall(a, b, c) =>
Expand Down
17 changes: 10 additions & 7 deletions quill-core/src/main/scala/io/getquill/quotation/Liftables.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ trait Liftables {
}

implicit val optionOperationLiftable: Liftable[OptionOperation] = Liftable[OptionOperation] {
case OptionMap(a, b, c) => q"$pack.OptionMap($a,$b,$c)"
case OptionForall(a, b, c) => q"$pack.OptionForall($a,$b,$c)"
case OptionExists(a, b, c) => q"$pack.OptionExists($a,$b,$c)"
case OptionContains(a, b) => q"$pack.OptionContains($a,$b)"
case OptionIsEmpty(a) => q"$pack.OptionIsEmpty($a)"
case OptionNonEmpty(a) => q"$pack.OptionNonEmpty($a)"
case OptionIsDefined(a) => q"$pack.OptionIsDefined($a)"
case OptionFlatten(a) => q"$pack.OptionFlatten($a)"
case OptionGetOrElse(a, b) => q"$pack.OptionGetOrElse($a,$b)"
case OptionFlatMap(a, b, c) => q"$pack.OptionFlatMap($a,$b,$c)"
case OptionMap(a, b, c) => q"$pack.OptionMap($a,$b,$c)"
case OptionForall(a, b, c) => q"$pack.OptionForall($a,$b,$c)"
case OptionExists(a, b, c) => q"$pack.OptionExists($a,$b,$c)"
case OptionContains(a, b) => q"$pack.OptionContains($a,$b)"
case OptionIsEmpty(a) => q"$pack.OptionIsEmpty($a)"
case OptionNonEmpty(a) => q"$pack.OptionNonEmpty($a)"
case OptionIsDefined(a) => q"$pack.OptionIsDefined($a)"
}

implicit val traversableOperationLiftable: Liftable[TraversableOperation] = Liftable[TraversableOperation] {
Expand Down
10 changes: 10 additions & 0 deletions quill-core/src/main/scala/io/getquill/quotation/Parsing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ trait Parsing {
private def ident(x: TermName): Ident = identClean(Ident(x.decodedName.toString))

val optionOperationParser: Parser[OptionOperation] = Parser[OptionOperation] {
case q"$o.flatten[$t]($implicitBody)" if is[Option[Any]](o) =>
OptionFlatten(astParser(o))
case q"$o.getOrElse[$t]($body)" if is[Option[Any]](o) =>
OptionGetOrElse(astParser(o), astParser(body))
case q"$o.flatMap[$t]({($alias) => $body})" if is[Option[Any]](o) =>
OptionFlatMap(astParser(o), identParser(alias), astParser(body))
case q"$o.map[$t]({($alias) => $body})" if is[Option[Any]](o) =>
OptionMap(astParser(o), identParser(alias), astParser(body))
case q"$o.forall({($alias) => $body})" if is[Option[Any]](o) =>
Expand Down Expand Up @@ -454,6 +460,10 @@ trait Parsing {

val valueParser: Parser[Ast] = Parser[Ast] {
case q"null" => NullValue
case q"scala.None" => NullValue
case q"scala.Option.empty[$t]" => NullValue
case q"scala.Some.apply[$t]($v)" => astParser(v)
case q"scala.Option.apply[$t]($v)" => astParser(v)
case Literal(c.universe.Constant(v)) => Constant(v)
case q"((..$v))" if (v.size > 1) => Tuple(v.map(astParser(_)))
case q"new $ccTerm(..$v)" if (isCaseClass(c.WeakTypeTag(ccTerm.tpe.erasure))) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ trait ReifyLiftings {
case ast: Lift =>
(ast, ReifyLiftings(state + (encode(ast.name) -> reify(ast))))

case p: OptionFlatMap =>
super.apply(p) match {
case (p2 @ OptionFlatMap(_: CaseClassValueLift, _, _), _) => apply(lift(unparse(p2)))
case other => other
}

case p: OptionMap =>
super.apply(p) match {
case (p2 @ OptionMap(_: CaseClassValueLift, _, _), _) => apply(lift(unparse(p2)))
Expand Down
17 changes: 10 additions & 7 deletions quill-core/src/main/scala/io/getquill/quotation/Unliftables.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ trait Unliftables {
}

implicit val optionOperationUnliftable: Unliftable[OptionOperation] = Unliftable[OptionOperation] {
case q"$pack.OptionMap.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionMap(a, b, c)
case q"$pack.OptionForall.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionForall(a, b, c)
case q"$pack.OptionExists.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionExists(a, b, c)
case q"$pack.OptionContains.apply(${ a: Ast }, ${ b: Ast })" => OptionContains(a, b)
case q"$pack.OptionIsEmpty.apply(${ a: Ast })" => OptionIsEmpty(a)
case q"$pack.OptionNonEmpty.apply(${ a: Ast })" => OptionNonEmpty(a)
case q"$pack.OptionIsDefined.apply(${ a: Ast })" => OptionIsDefined(a)
case q"$pack.OptionFlatten.apply(${ a: Ast })" => OptionFlatten(a)
case q"$pack.OptionGetOrElse.apply(${ a: Ast }, ${ b: Ast })" => OptionGetOrElse(a, b)
case q"$pack.OptionFlatMap.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionFlatMap(a, b, c)
case q"$pack.OptionMap.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionMap(a, b, c)
case q"$pack.OptionForall.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionForall(a, b, c)
case q"$pack.OptionExists.apply(${ a: Ast }, ${ b: Ident }, ${ c: Ast })" => OptionExists(a, b, c)
case q"$pack.OptionContains.apply(${ a: Ast }, ${ b: Ast })" => OptionContains(a, b)
case q"$pack.OptionIsEmpty.apply(${ a: Ast })" => OptionIsEmpty(a)
case q"$pack.OptionNonEmpty.apply(${ a: Ast })" => OptionNonEmpty(a)
case q"$pack.OptionIsDefined.apply(${ a: Ast })" => OptionIsDefined(a)
}

implicit val traversableOperationUnliftable: Unliftable[TraversableOperation] = Unliftable[TraversableOperation] {
Expand Down
Loading

0 comments on commit 5fc1557

Please sign in to comment.