Mirrors
Attributes
- Source
- Mirrors.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Mirrors.type
Members list
Type members
Classlikes
Attributes
- Source
- Mirrors.scala
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
Attributes
- Source
- Mirrors.scala
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
A store for one or more mirrors, with Root type R
.
A store for one or more mirrors, with Root type R
.
Attributes
- Source
- Mirrors.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Types
Proof that T
has a synthetic Mirror in Root[R]
Value members
Concrete methods
generate mirrors for a sealed hierarchy, or a single class. Only optimized for what Mill needs. Does not synthesize mirrors for case classes, or values already extending Mirror.Singleton.
generate mirrors for a sealed hierarchy, or a single class. Only optimized for what Mill needs. Does not synthesize mirrors for case classes, or values already extending Mirror.Singleton.
This means you pay for only what is needed.
Limitations (could be lifted later, but not needed for Mill currently):
- sealed children must be static, i.e. no inner classes or local classes.
- "product" types should not have type parameters.
Note: this is not given, so must be explicitly called, which allows to control caching.
Attributes
- Source
- Mirrors.scala
Attributes
- Source
- Mirrors.scala
Givens
Givens
given a Root[R]
, and a Path[R, T]
, retrieve a Mirror.Of[T]
, and cast it with correct refinements. Note that this must be transparent inline to add path-dependent types, therefore to avoid large bytecode blowup it only generates a single method call.
given a Root[R]
, and a Path[R, T]
, retrieve a Mirror.Of[T]
, and cast it with correct refinements. Note that this must be transparent inline to add path-dependent types, therefore to avoid large bytecode blowup it only generates a single method call.
Attributes
- Source
- Mirrors.scala
Try to synthesize a proof that T
has a synthetic Mirror inside of Root[R]
.
Try to synthesize a proof that T
has a synthetic Mirror inside of Root[R]
.
Attributes
- Source
- Mirrors.scala