Skip to content

Commit

Permalink
Merge pull request #133 from soronpo/caching
Browse files Browse the repository at this point in the history
Introduce Caching + some other changes
  • Loading branch information
Oron Port authored Apr 9, 2020
2 parents a2f58c5 + 3ef31f1 commit c2a8761
Show file tree
Hide file tree
Showing 20 changed files with 497 additions and 568 deletions.
966 changes: 482 additions & 484 deletions src/main/scala/singleton/ops/impl/GeneralMacros.scala

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/main/scala/singleton/ops/impl/Op.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ trait Op extends HasOut {
type OutDouble <: Double with Singleton
type OutString <: String with Singleton
type OutBoolean <: Boolean with Singleton
type OutSymbol <: Symbol
val value: Out
val isLiteral : Boolean
val valueWide: OutWide
Expand Down Expand Up @@ -95,11 +94,3 @@ object OpBoolean {
implicit def impl[O <: Op](implicit o: O) : Aux[O, o.OutBoolean] = new OpBoolean[O] {type Out = o.OutBoolean; val value = o.value.asInstanceOf[o.OutBoolean]}
implicit def conv[O <: Op](op : OpBoolean[O]) : Boolean = op.value
}

@scala.annotation.implicitNotFound(msg = "Unable to prove type argument is a Symbol.")
trait OpSymbol[O <: Op] extends OpCast[Symbol, O]
object OpSymbol {
type Aux[O <: Op, Ret_Out <: Symbol] = OpSymbol[O] {type Out = Ret_Out}
implicit def impl[O <: Op](implicit o: O) : Aux[O, o.OutSymbol] = new OpSymbol[O] {type Out = o.OutSymbol; val value = o.value.asInstanceOf[o.OutSymbol]}
implicit def conv[O <: Op](op : OpSymbol[O]) : Symbol = op.value
}
2 changes: 0 additions & 2 deletions src/main/scala/singleton/ops/impl/OpId.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ object OpId {
sealed trait ToFloat extends OpId
sealed trait ToDouble extends OpId
sealed trait ToString extends OpId
sealed trait ToSymbol extends OpId
sealed trait IsNat extends OpId
sealed trait IsChar extends OpId
sealed trait IsInt extends OpId
Expand All @@ -30,7 +29,6 @@ object OpId {
sealed trait IsDouble extends OpId
sealed trait IsString extends OpId
sealed trait IsBoolean extends OpId
sealed trait IsSymbol extends OpId
sealed trait IsNonLiteral extends OpId
sealed trait GetType extends OpId
sealed trait Reverse extends OpId
Expand Down
10 changes: 3 additions & 7 deletions src/main/scala/singleton/ops/impl/OpMacros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ object OpMacro {
OutFloat0 <: Float with Singleton,
OutDouble0 <: Double with Singleton,
OutString0 <: String with Singleton,
OutBoolean0 <: Boolean with Singleton,
OutSymbol0 <: Symbol
OutBoolean0 <: Boolean with Singleton
] = OpMacro[N, S1, S2, S3] {
type OutWide = OutWide0
type Out = Out0
Expand All @@ -35,7 +34,6 @@ object OpMacro {
type OutDouble = OutDouble0
type OutString = OutString0
type OutBoolean = OutBoolean0
type OutSymbol = OutSymbol0
}

implicit def call[
Expand All @@ -52,8 +50,7 @@ object OpMacro {
OutFloat <: Float with Singleton,
OutDouble <: Double with Singleton,
OutString <: String with Singleton,
OutBoolean <: Boolean with Singleton,
OutSymbol <: Symbol
OutBoolean <: Boolean with Singleton
]: Aux[
N,
S1,
Expand All @@ -68,8 +65,7 @@ object OpMacro {
OutFloat,
OutDouble,
OutString,
OutBoolean,
OutSymbol
OutBoolean
] = macro Macro.impl[N, S1, S2, S3]

final class Macro(val c: whitebox.Context) extends GeneralMacros {
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/singleton/ops/impl/util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ object std {
type Double = scala.Double
type String = java.lang.String
type Boolean = scala.Boolean
type Symbol = scala.Symbol
}
5 changes: 0 additions & 5 deletions src/main/scala/singleton/ops/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package object ops {
type XDouble = Double with Singleton
type XString = String with Singleton
type XBoolean = Boolean with Singleton
type XSymbol = Symbol with Singleton
/////////////////////////////////////////////////

/////////////////////////////////////////////////
Expand All @@ -33,7 +32,6 @@ package object ops {
type SafeDouble[P1] = impl.OpDouble[Require[IsDouble[P1]] ==> P1]
type SafeString[P1] = impl.OpString[Require[IsString[P1]] ==> P1]
type SafeBoolean[P1] = impl.OpBoolean[Require[IsBoolean[P1]] ==> P1]
type SafeSymbol[P1] = impl.OpSymbol[ToSymbol[Require[IsSymbol[P1]] ==> P1]]
/////////////////////////////////////////////////

/////////////////////////////////////////////////
Expand All @@ -48,7 +46,6 @@ package object ops {
type OpAuxDouble[O <: Op, Ret_Out <: XDouble] = OpDouble.Aux[O, Ret_Out]
type OpAuxString[O <: Op, Ret_Out <: XString] = OpString.Aux[O, Ret_Out]
type OpAuxBoolean[O <: Op, Ret_Out <: XBoolean] = OpBoolean.Aux[O, Ret_Out]
type OpAuxSymbol[O <: Op, Ret_Out <: Symbol] = OpSymbol.Aux[O, Ret_Out]
/////////////////////////////////////////////////

private val NP = W(0)
Expand Down Expand Up @@ -103,7 +100,6 @@ package object ops {
type ToFloat[P1] = OpMacro[OpId.ToFloat, P1, NP, NP]
type ToDouble[P1] = OpMacro[OpId.ToDouble, P1, NP, NP]
type ToString[P1] = OpMacro[OpId.ToString, P1, NP, NP]
type ToSymbol[P1] = OpMacro[OpId.ToSymbol, P1, NP, NP]
type IsNat[P1] = OpMacro[OpId.IsNat, P1, NP, NP]
type IsChar[P1] = OpMacro[OpId.IsChar, P1, NP, NP]
type IsInt[P1] = OpMacro[OpId.IsInt, P1, NP, NP]
Expand All @@ -112,7 +108,6 @@ package object ops {
type IsDouble[P1] = OpMacro[OpId.IsDouble, P1, NP, NP]
type IsString[P1] = OpMacro[OpId.IsString, P1, NP, NP]
type IsBoolean[P1] = OpMacro[OpId.IsBoolean, P1, NP, NP]
type IsSymbol[P1] = OpMacro[OpId.IsSymbol, P1, NP, NP]
type IsNonLiteral[P1] = OpMacro[OpId.IsNonLiteral, P1, NP, NP]
type Reverse[P1] = OpMacro[OpId.Reverse, P1, NP, NP]
type Negate[P1] = OpMacro[OpId.Negate, P1, NP, NP]
Expand Down
5 changes: 5 additions & 0 deletions src/main/scala_2.13+/singleton/ops/impl/ListZipper.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package singleton.ops.impl

object ListZipper {
def apply[T](list1 : List[T], list2 : List[T]) = list1 lazyZip list2
}
9 changes: 1 addition & 8 deletions src/main/scala_2.13+/singleton/twoface/impl/TwoFaceAny.scala
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ object TwoFaceAny {
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Char]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Char]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Char]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Char.Shell1[Id, T, std.Char]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -253,7 +252,6 @@ object TwoFaceAny {
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Int]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Int]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Int]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Int.Shell1[Id, T, std.Int]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -349,7 +347,6 @@ object TwoFaceAny {
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Long]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Long]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Long]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Long.Shell1[Id, T, std.Long]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -446,7 +443,6 @@ object TwoFaceAny {
def toLong(implicit tfs : Long.Shell1[ToLong, T, std.Float]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Float]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Float]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Float.Shell1[Id, T, std.Float]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -541,7 +537,6 @@ object TwoFaceAny {
def toLong(implicit tfs : Long.Shell1[ToLong, T, std.Double]) = tfs(this.getValue)
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Double]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Double]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Double.Shell1[Id, T, std.Double]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -577,8 +572,7 @@ object TwoFaceAny {
def toLong(implicit tfs : Long.Shell1[ToLong, T, std.String]) = tfs(this.getValue)
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.String]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.String]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value


def simplify(implicit tfs : String.Shell1[Id, T, std.String]) = tfs(this.getValue)
}
final class _String[T](val value : std.String) extends AnyVal with String[T] {
Expand Down Expand Up @@ -606,7 +600,6 @@ object TwoFaceAny {
def || [R](r : Boolean[R])(implicit tfs : Boolean.Shell2[||, T, std.Boolean, R, std.Boolean]) = tfs(this.getValue, r.getValue)
def unary_!(implicit tfs : Boolean.Shell1[!, T, std.Boolean]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Boolean]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Boolean.Shell1[Id, T, std.Boolean]) = tfs(this.getValue)
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/scala_2.13-/singleton/ops/impl/ListZipper.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package singleton.ops.impl

object ListZipper {
def apply[T](list1 : List[T], list2 : List[T]) = (list1, list2).zipped
}
9 changes: 1 addition & 8 deletions src/main/scala_2.13-/singleton/twoface/impl/TwoFaceAny.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ object TwoFaceAny {
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Char]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Char]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Char]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Char.Shell1[Id, T, std.Char]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -267,7 +266,6 @@ object TwoFaceAny {
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Int]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Int]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Int]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Int.Shell1[Id, T, std.Int]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -363,7 +361,6 @@ object TwoFaceAny {
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Long]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Long]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Long]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Long.Shell1[Id, T, std.Long]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -460,7 +457,6 @@ object TwoFaceAny {
def toLong(implicit tfs : Long.Shell1[ToLong, T, std.Float]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.Float]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Float]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Float.Shell1[Id, T, std.Float]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -555,7 +551,6 @@ object TwoFaceAny {
def toLong(implicit tfs : Long.Shell1[ToLong, T, std.Double]) = tfs(this.getValue)
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.Double]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Double]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Double.Shell1[Id, T, std.Double]) = tfs(this.getValue)
}
Expand Down Expand Up @@ -591,8 +586,7 @@ object TwoFaceAny {
def toLong(implicit tfs : Long.Shell1[ToLong, T, std.String]) = tfs(this.getValue)
def toFloat(implicit tfs : Float.Shell1[ToFloat, T, std.String]) = tfs(this.getValue)
def toDouble(implicit tfs : Double.Shell1[ToDouble, T, std.String]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value


def simplify(implicit tfs : String.Shell1[Id, T, std.String]) = tfs(this.getValue)
}
final class _String[T](val value : std.String) extends AnyVal with String[T] {
Expand Down Expand Up @@ -620,7 +614,6 @@ object TwoFaceAny {
def || [R](r : Boolean[R])(implicit tfs : Boolean.Shell2[||, T, std.Boolean, R, std.Boolean]) = tfs(this.getValue, r.getValue)
def unary_!(implicit tfs : Boolean.Shell1[!, T, std.Boolean]) = tfs(this.getValue)
def toStringTF(implicit tfs : String.Shell1[ToString, T, std.Boolean]) = tfs(this.getValue)
def toSymbol(implicit sym : SafeSymbol[ToSymbol[T]]) : sym.Out = sym.value

def simplify(implicit tfs : Boolean.Shell1[Id, T, std.Boolean]) = tfs(this.getValue)
}
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/ops/IdSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ class IdSpec extends Properties("Id") {
val ret : Boolean = implicitly[SafeBoolean[Id[W.`true`.T]]]
ret == true
}
property("Symbol") = {
val ret : Symbol = implicitly[SafeSymbol[Id[W.`"Something"`.T]]]
ret == Symbol("Something")
}
property("UpperBound") = {
trait Foo[T] {
type Width <: T
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/ops/ToConversionSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,4 @@ class ToConversionSpec extends Properties("ToConversion") {
property("String to String") = verifyOp1Args[ToString,W.`"7"`.T,W.`"7"`.T]
property("Boolean to String") = verifyOp1Args[ToString,True,W.`"true"`.T]

import shapeless.syntax.singleton._
val sym = Symbol("foo").narrow
property("Symbol to String") = verifyOp1Args[ToString,sym.type,W.`"foo"`.T]

}
4 changes: 0 additions & 4 deletions src/test/scala/singleton/twoface/TwoFaceBooleanSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ class TwoFaceBooleanSpec extends Properties("TwoFace.Boolean") {

property("Safe toStringTF") = verifyTFString(TwoFace.Boolean(true).toStringTF, "true")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Boolean(us(false)).toStringTF, us("false"))
property("Safe toSymbol") = {
val sym = TwoFace.Boolean(false).toSymbol
sym == scala.Symbol("false")
}

property("Safe require") = wellTyped {
require(TwoFace.Boolean(true), "something")
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/twoface/TwoFaceCharSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,6 @@ class TwoFaceCharSpec extends Properties("TwoFace.Char") {
property("Unsafe toDouble") = verifyTFDouble(TwoFace.Char(us('\u0001')).toDouble, us(1.0))
property("Safe toStringTF") = verifyTFString(TwoFace.Char('t').toStringTF, "t")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Char(us('t')).toStringTF, us("t"))
property("Safe toSymbol") = {
val sym = TwoFace.Char('t').toSymbol
sym == scala.Symbol("t")
}

property("Implicit Conversions") = wellTyped {
val d : W.`'\u0003'`.T = TwoFace.Char('\u0003')
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/twoface/TwoFaceDoubleSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,6 @@ class TwoFaceDoubleSpec extends Properties("TwoFace.Double") {
property("Unsafe toFloat") = verifyTFFloat(TwoFace.Double(us(1.0)).toFloat, us(1.0f))
property("Safe toStringTF") = verifyTFString(TwoFace.Double(1.0).toStringTF, "1.0")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Double(us(1.5)).toStringTF, us("1.5"))
property("Safe toSymbol") = {
val sym = TwoFace.Double(2.0).toSymbol
sym == scala.Symbol("2.0")
}

property("Safe abs") = verifyTFDouble(abs(TwoFace.Double(-1.0)), 1.0)
property("Unsafe abs") = verifyTFDouble(abs(TwoFace.Double(us(-1.0))), us(1.0))
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/twoface/TwoFaceFloatSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ class TwoFaceFloatSpec extends Properties("TwoFace.Float") {
property("Unsafe toDouble") = verifyTFDouble(TwoFace.Float(us(1.0f)).toDouble, us(1.0))
property("Safe toStringTF") = verifyTFString(TwoFace.Float(1.0f).toStringTF, "1.0")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Float(us(1.5f)).toStringTF, us("1.5"))
property("Safe toSymbol") = {
val sym = TwoFace.Float(2.0f).toSymbol
sym == scala.Symbol("2.0")
}

property("Safe abs") = verifyTFFloat(abs(TwoFace.Float(-1.0f)), 1.0f)
property("Unsafe abs") = verifyTFFloat(abs(TwoFace.Float(us(-1.0f))), us(1.0f))
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/twoface/TwoFaceLongSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ class TwoFaceLongSpec extends Properties("TwoFace.Long") {
property("Unsafe toDouble") = verifyTFDouble(TwoFace.Long(us(1L)).toDouble, us(1.0))
property("Safe toStringTF") = verifyTFString(TwoFace.Long(1L).toStringTF, "1")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Long(us(1L)).toStringTF, us("1"))
property("Safe toSymbol") = {
val sym = TwoFace.Long(2L).toSymbol
sym == scala.Symbol("2")
}

property("Safe abs") = verifyTFLong(abs(TwoFace.Long(-1L)), 1L)
property("Unsafe abs") = verifyTFLong(abs(TwoFace.Long(us(-1L))), us(1L))
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala/singleton/twoface/TwoFaceStringSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ class TwoFaceStringSpec extends Properties("TwoFace.String") {
property("Unsafe toFloat") = verifyTFFloat(TwoFace.String(us("1.0")).toFloat, us(1.0f))
property("Safe toDouble") = verifyTFDouble(TwoFace.String("1.0").toDouble, 1.0)
property("Unsafe toDouble") = verifyTFDouble(TwoFace.String(us("1.0")).toDouble, us(1.0))
property("Safe toSymbol") = {
val sym = TwoFace.String("foo").toSymbol
sym == Symbol("foo")
}

property("Safe length") = verifyTFInt(TwoFace.String("Some").length, 4)
property("Unsafe length") = verifyTFInt(TwoFace.String(us("Some")).length, us(4))
Expand Down
8 changes: 0 additions & 8 deletions src/test/scala_2.13+/singleton/twoface/TwoFaceIntSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,6 @@ class TwoFaceIntSpec extends Properties("TwoFace.Int") {
property("Safe Negate") = verifyTFInt(-TwoFace.Int(-1), 1)
property("Unsafe Negate") = verifyTFInt(-TwoFace.Int(us(1)), us(-1))

property("Safe toNat") = wellTyped {
val nat = TwoFace.Int(3).toNat
verifyOp[nat.N, shapeless.Nat._3]
}
property("Safe toChar") = verifyTFChar(TwoFace.Int(1).toChar, '\u0001')
property("Unsafe toChar") = verifyTFChar(TwoFace.Int(us(1)).toChar, us('\u0001'))
property("Safe toLong") = verifyTFLong(TwoFace.Int(1).toLong, 1L)
Expand All @@ -331,10 +327,6 @@ class TwoFaceIntSpec extends Properties("TwoFace.Int") {
property("Unsafe toDouble") = verifyTFDouble(TwoFace.Int(us(1)).toDouble, us(1.0))
property("Safe toStringTF") = verifyTFString(TwoFace.Int(1).toStringTF, "1")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Int(us(1)).toStringTF, us("1"))
property("Safe toSymbol") = {
val sym = TwoFace.Int(2).toSymbol
sym == scala.Symbol("2")
}

property("Safe abs") = verifyTFInt(abs(TwoFace.Int(-1)), 1)
property("Unsafe abs") = verifyTFInt(abs(TwoFace.Int(us(-1))), us(1))
Expand Down
4 changes: 0 additions & 4 deletions src/test/scala_2.13-/singleton/twoface/TwoFaceIntSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,6 @@ class TwoFaceIntSpec extends Properties("TwoFace.Int") {
property("Unsafe toDouble") = verifyTFDouble(TwoFace.Int(us(1)).toDouble, us(1.0))
property("Safe toStringTF") = verifyTFString(TwoFace.Int(1).toStringTF, "1")
property("Unsafe toStringTF") = verifyTFString(TwoFace.Int(us(1)).toStringTF, us("1"))
property("Safe toSymbol") = {
val sym = TwoFace.Int(2).toSymbol
sym == scala.Symbol("2")
}

property("Safe abs") = verifyTFInt(abs(TwoFace.Int(-1)), 1)
property("Unsafe abs") = verifyTFInt(abs(TwoFace.Int(us(-1))), us(1))
Expand Down

0 comments on commit c2a8761

Please sign in to comment.