-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stripTypeVars after fullyDefinedType
- Loading branch information
1 parent
9ec5e3d
commit 9a9c40d
Showing
2 changed files
with
22 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import scala.deriving.* | ||
|
||
trait Functor[F[_]] | ||
|
||
object Functor: | ||
given [C]: Functor[[T] =>> C]() | ||
given Functor[[T] =>> Tuple1[T]]() | ||
given t2 [T]: Functor[[U] =>> (T, U)]() | ||
given t3 [T, U]: Functor[[V] =>> (T, U, V)]() | ||
|
||
def derived[F[_]](using m: Mirror { type MirroredType[X] = F[X] ; type MirroredElemTypes[_] }, r: Functor[m.MirroredElemTypes]): Functor[F] = new Functor[F] {} | ||
|
||
case class Mono(i: Int) derives Functor | ||
case class Poly[A](a: A) derives Functor | ||
//case class Poly11[F[_]](fi: F[Int]) derives Functor | ||
case class Poly2[A, B](a: A, b: B) derives Functor | ||
case class Poly3[A, B, C](a: A, b: B, c: C) derives Functor | ||
|
||
@main def Test = () |