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
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
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
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
Attributes
- Companion
- trait
- Supertypes
- Self type
-
GeneratedMadeElem.type
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
- Known subtypes
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:
- MadeFieldElem - constructor parameters in product mirrors
- MadeSubElem - non-singleton subtypes in sum mirrors
- MadeSubSingletonElem - singleton subtypes in sum mirrors
- GeneratedMadeElem -
@generatedmembers (inGeneratedElems)
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
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
- Self type
-
MadeFieldElem.type
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
- Known subtypes
-
trait GeneratedMadeElem
Attributes
- Companion
- trait
- Supertypes
- Self type
-
MadeSubElem.type
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
- Known subtypes
-
trait MadeSubSingletonElem
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
Attributes
- Companion
- trait
- Supertypes
- Self type
-
MadeSubSingletonElem.type
Attributes
- Companion
- trait
- Supertypes
- Self type
-
TransparentWrapping.type
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
Extensions
Extensions
Returns the label of the mirror.
Returns the label of the mirror.
Attributes
Returns the labels of the mirror's elements.
Returns the labels of the mirror's elements.
Attributes
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
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.