Skip to content

Commit

Permalink
Merge pull request #48 from KuceraMartin/minor-updates
Browse files Browse the repository at this point in the history
Minor updates
  • Loading branch information
KuceraMartin authored Sep 11, 2023
2 parents 4908112 + eb5c874 commit b91d5e5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 76 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Installation
------------
With Scala CLI: add the following to your `project.scala` file.
```scala
//> using dep "ch.epfl.tyqu::tyqu:0.0.1"
//> using dep "ch.epfl.tyqu::tyqu:0.1.0"
```

With sbt: add the following to your `build.sbt` file.
```scala
libraryDependencies += "ch.epfl.tyqu" %% "tyqu" % "0.0.1"
libraryDependencies += "ch.epfl.tyqu" %% "tyqu" % "0.1.0"
```

Usage
Expand Down
67 changes: 0 additions & 67 deletions src/demo/Demo.scala

This file was deleted.

10 changes: 4 additions & 6 deletions src/main/Expression.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ import scala.annotation.targetName

import utils.IsTupleOf
import Tuple.Fold
import scala.compiletime.ops.boolean.*


type Numeric = Int | Long | Float | Double
type Primitive = Numeric | String | Char | Boolean

type LogicalAnd[A, B] <: Boolean = (A, B) match
case (true, true) => true
case _ => false

type ForAll[T <: Tuple, Pred[X] <: Boolean] <: Boolean = T match
case EmptyTuple => true
case h *: t => LogicalAnd[Pred[h], ForAll[t, Pred]]
case h *: t => Pred[h] && ForAll[t, Pred]

type CanSelectExpr[T] <: Boolean = T match
case Expression[?, true] => true
Expand Down Expand Up @@ -176,10 +173,11 @@ extension (lhs: Expression[?, ?])
infix def +[T, S <: Boolean](rhs: Expression[T, S]) = lhs.concat(rhs)


extension (lhs: Expression[String, ?])
extension [S <: Boolean] (lhs: Expression[String, S])
def startsWith(rhs: String) = StartsWith(needle = rhs, haystack = lhs)
def endsWith(rhs: String) = EndsWith(needle = rhs, haystack = lhs)
def contains(rhs: String) = Contains(needle = rhs, haystack = lhs)
def length = Function[Int]("LENGTH", lhs)


extension [T <: Numeric | Null, E <: Expression[T, true]] (qb: QueryBuilder[E])
Expand Down
1 change: 0 additions & 1 deletion src/main/ScopeFactory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package tyqu

import scala.quoted.*
import scala.annotation.tailrec
import org.checkerframework.checker.units.qual.m


trait RefinedScope[S <: Scope]:
Expand Down

0 comments on commit b91d5e5

Please sign in to comment.