made

package made

Extended mirrors for Scala types, adding annotation metadata, element-level detail, and generated member support on top of standard scala.deriving.Mirror.

Derive a mirror with Made.derived[T]. The resulting mirror subtype depends on T: singletons, transparent wrappers, products (case classes), or sums (sealed traits/enums).

Each mirror carries a MirroredElems tuple of made.MadeElem subtypes describing constructor fields or sum subtypes, and a Metadata type member encoding annotations as an AnnotatedType chain around made.Meta.

Attributes

See also

Members list

Packages

package made.annotation

Annotation system for Made mirrors.

Annotation system for Made mirrors.

Annotations extending made.annotation.MetaAnnotation are refining annotations: they refine the type of the annotated element and are captured in the Metadata type member during Made.derived. Query them at runtime via hasAnnotation[A] and getAnnotation[A] on a Made instance.

Attributes

See also

Type members

Classlikes

object Default

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Default.type
trait Default[O] extends () => O

Type class providing a default "empty" value for optional types.

Type class providing a default "empty" value for optional types.

Used by @optionalParam to supply a default when no explicit default is provided. Instances are defined for Option[A] (returns None) and A | Null (returns null).

Type parameters

O

the type for which a default value is provided

Attributes

See also
Companion
object
Supertypes
trait () => O
class Object
trait Matchable
class Any
sealed trait GeneratedMadeElem extends MadeFieldElem

Element representing a generated val or def.

Element representing a generated val or def.

Extends MadeFieldElem. Lives in Made.GeneratedElems tuple (separate from Made.Elems). A generated element computes a derived value from an instance of the outer type.

Attributes

See also
Companion
object
Supertypes
trait MadeElem
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait Made

Extended mirror for Scala types, providing annotation metadata, element-level detail, and generated member support beyond standard scala.deriving.Mirror.

Extended mirror for Scala types, providing annotation metadata, element-level detail, and generated member support beyond standard scala.deriving.Mirror.

A Made instance describes the structure of a type T at both the type level and runtime. Unlike the standard library Mirror, Made carries per-element metadata (annotations, default values, labels) and supports @generated members that compute derived values.

Attributes

See also
Example
import made.*
case class User(name: String, age: Int)
val mirror: Made.Of[User] = Made.derived[User]
// mirror type members:
//   type Type = User
//   type Label = "User"
//   type Metadata = Meta
//   type Elems = MadeFieldElem { ... } *: MadeFieldElem { ... } *: EmptyTuple
val (nameFld, ageFld) = mirror.mirroredElems
val user = mirror.fromUnsafeArray(Array("Alice", 30))
Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Product
trait Singleton
trait Sum
trait Transparent
object Made

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Made.type
sealed trait MadeElem

Base type for elements within a Made.Elems tuple.

Base type for elements within a Made.Elems tuple.

Each element in the Made.Elems tuple is a subtype of MadeElem, carrying the element's type, label, and annotation metadata. The concrete subtype depends on the mirror kind:

Attributes

See also
Example
import made.*
case class User(name: String, age: Int)
val mirror = Made.derived[User]
val (nameFld, ageFld) = mirror.elems
// nameFld: MadeFieldElem { type Type = String; type Label = "name" }
// ageFld:  MadeFieldElem { type Type = Int;    type Label = "age"  }
Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object MadeElem

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
MadeElem.type
object MadeFieldElem

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait MadeFieldElem extends MadeElem

Element representing a constructor parameter in a product type mirror.

Element representing a constructor parameter in a product type mirror.

Each entry in Made.Product.Elems tuple is a MadeFieldElem, providing the field's type, label, metadata, and default value.

Attributes

See also
Companion
object
Supertypes
trait MadeElem
class Object
trait Matchable
class Any
Known subtypes
object MadeSubElem

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait MadeSubElem extends MadeElem

Element representing a non-singleton subtype in a sum type mirror.

Element representing a non-singleton subtype in a sum type mirror.

Used in Made.Sum.Elems for subtypes that are not singleton types (e.g., case classes with parameters). For singleton subtypes (case objects, parameterless enum cases), see MadeSubSingletonElem.

Attributes

See also
Companion
object
Supertypes
trait MadeElem
class Object
trait Matchable
class Any
Known subtypes
sealed trait MadeSubSingletonElem extends MadeSubElem

Element representing a singleton subtype in a sum type mirror.

Element representing a singleton subtype in a sum type mirror.

Extends MadeSubElem. Used in Made.Sum.Elems for case objects and parameterless enum cases. Provides access to the singleton instance via the value method.

Attributes

See also
Companion
object
Supertypes
trait MadeSubElem
trait MadeElem
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait TransparentWrapping[R, T]

Bidirectional conversion between a transparent wrapper type T and its single wrapped field type R.

Bidirectional conversion between a transparent wrapper type T and its single wrapped field type R.

Used by Made.Transparent to implement wrap and unwrap. Derived at compile time via TransparentWrapping.derived[R, T] for single-field case classes annotated with @transparent.

Type parameters

R

the wrapped field type

T

the transparent wrapper type

Attributes

See also
Companion
object
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def reportOnDuplicates(labels: Seq[(label: String, original: String)])(using quotes: Quotes): Unit

Extensions

Extensions

extension [L <: String](l: { type Label = L; })
inline def label: L

Returns the label of the mirror.

Returns the label of the mirror.

Attributes

extension [Ls <: Tuple](l: { type ElemLabels = Ls; })
inline def elemLabels: Ls

Returns the labels of the mirror's elements.

Returns the labels of the mirror's elements.

Attributes

extension [M <: Meta](self: { type Metadata = M; })
inline def getAnnotation[A <: MetaAnnotation]: Option[A]

Returns Some(annotation) if the mirror's Metadata type member contains an annotation of type A, None otherwise.

Returns Some(annotation) if the mirror's Metadata type member contains an annotation of type A, None otherwise.

The returned annotation instance provides access to annotation parameters (e.g., getAnnotation[JsonName].get.value). Inline - resolved at compile time. A must extend [[made.annotation.MetaAnnotation]`.

Attributes

transparent inline def hasAnnotation[A <: MetaAnnotation]: Boolean

Returns true if the mirror's Metadata type member contains an annotation of type A.

Returns true if the mirror's Metadata type member contains an annotation of type A.

Transparent inline - resolved entirely at compile time, no runtime cost. A must extend made.annotation.MetaAnnotation.

Attributes