-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade submodule In CI, Java upgrade to 11~17, Scala upgrade to 2.13.12 upgrade submodule & adapt upgrade dependencies improve scalafix add: ExplicitResultTypes { // rewriteStructuralTypesToNamedSubclass = false skipSimpleDefinitions = false onlyImplicits = true } but is broken adapt upgrade submodules StaticTuples renamed to Bone Proto renamed to Backbone adapt to dependency change
- Loading branch information
Showing
68 changed files
with
170 additions
and
269 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Submodule buildSrc
updated
6 files
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,10 @@ | ||
package shapesafe.core | ||
|
||
import shapeless.Poly1 | ||
|
||
import scala.annotation.implicitNotFound | ||
|
||
// TODO: compiler bug? | ||
// https://stackoverflow.com/questions/65944627/in-scala-how-could-a-covariant-type-parameter-be-an-upper-bound-of-an-abstract | ||
import ai.acyclic.prover.commons.function.PreDef | ||
|
||
/** | ||
* Different from dotty's polymorphic function kind, which only supports parametric polymorphic | ||
*/ | ||
trait AdHocPoly1[IUB, OUB] { | ||
|
||
final type _IUB = IUB | ||
final type _OUB = OUB | ||
|
||
trait Case[-I <: IUB] { | ||
|
||
type Out <: OUB | ||
|
||
def apply(v: I): Out | ||
} | ||
|
||
class =>>[ | ||
-I <: IUB, | ||
O <: OUB | ||
](val toOut: I => O) | ||
extends Case[I] { | ||
|
||
final type Out = O | ||
|
||
override def apply(v: I): O = toOut(v) | ||
} | ||
|
||
object Auxs { | ||
|
||
final type =>>[ | ||
I <: IUB, | ||
O <: OUB | ||
] = Case[I] { | ||
type Out = O | ||
} | ||
|
||
final type =>>:<[ | ||
I <: IUB, | ||
O <: OUB | ||
] = Case[I] { | ||
type Out <: O | ||
} | ||
} | ||
|
||
object AuxsWithNotFoundMsg { | ||
|
||
@implicitNotFound( | ||
"${I}\t =/=>> \t??? <: ${OUB}" | ||
) | ||
final type Case[I <: IUB] = AdHocPoly1.this.Case[I] | ||
|
||
@implicitNotFound( | ||
"${I}\t =/=>> \t${O}" | ||
) | ||
final type =>>[ | ||
I <: IUB, | ||
O <: OUB | ||
] = Case[I] { | ||
type Out = O | ||
} | ||
|
||
// only use as an implicit type parameter if Output type doesn't depends on O! | ||
@implicitNotFound( | ||
"${I}\t =/=>> \t??? <: ${O}" | ||
) | ||
final type =>>:<[ | ||
I <: IUB, | ||
O <: OUB | ||
] = Case[I] { | ||
type Out <: O | ||
} | ||
} | ||
|
||
def forAll[I <: IUB] = new ForAll[I]() // same as `at` in Poly1? | ||
|
||
protected class ForAll[I <: IUB]() { | ||
|
||
def =>>[O <: OUB](fn: I => O): I =>> O = new (I =>> O)(fn) | ||
} | ||
|
||
def summon[I <: IUB]( | ||
implicit | ||
_case: Case[I] | ||
): _case.type = _case | ||
|
||
def summonFor[I <: IUB](v: I)( | ||
implicit | ||
_case: Case[I] | ||
): _case.type = _case | ||
|
||
def apply[I <: IUB](v: I)( | ||
implicit | ||
_case: Case[I] | ||
): _case.Out = _case.apply(v) | ||
|
||
object AsShapelessPoly1 extends Poly1 { | ||
|
||
val outer: AdHocPoly1[IUB, OUB] = AdHocPoly1.this | ||
|
||
implicit def delegate[I <: IUB, O <: OUB]( | ||
implicit | ||
from: I =>> O | ||
): Case.Aux[I, O] = at[I].apply { ii => | ||
from.apply(ii) | ||
} | ||
} | ||
} | ||
trait AdHocPoly1 extends PreDef.Poly {} | ||
|
||
object AdHocPoly1 {} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package shapesafe.core.axis | ||
|
||
import shapesafe.core.AdHocPoly1 | ||
import shapeless.HList | ||
|
||
trait RecordUpdater extends AdHocPoly1[(HList, Axis.UB_->>), HList] {} | ||
trait RecordUpdater extends AdHocPoly1 {} |
2 changes: 1 addition & 1 deletion
2
core/src/main/scala/shapesafe/core/debugging/ExpressionType.scala
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.