zio.blocks.codegen.ir
Members list
Type members
Classlikes
Represents a Scala abstract class in the IR.
Represents a Scala abstract class in the IR.
Value parameters
- annotations
-
Annotations on the abstract class (defaults to empty list)
- companion
-
Optional companion object (defaults to None)
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this abstract class extends (defaults to empty list)
- fields
-
The fields (constructor parameters) of the abstract class
- members
-
Members defined within the class body (defaults to empty list)
- name
-
The name of the abstract class
- typeParams
-
Type parameters for generic abstract classes (defaults to empty list)
Attributes
- Example
-
val entity = AbstractClass( "Entity", fields = List(Field("id", TypeRef.Long)) ) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Represents a Scala annotation in the IR.
Represents a Scala annotation in the IR.
Value parameters
- args
-
List of annotation arguments as (name, value) pairs (defaults to empty list)
- name
-
The name of the annotation (e.g., "deprecated", "required")
Attributes
- Example
-
// Annotation without arguments val required = Annotation("required") // Annotation with arguments val deprecated = Annotation("deprecated", List(("message", "\"use v2\""))) - Source
- Annotation.scala
- Supertypes
Represents a Scala case class in the IR.
Represents a Scala case class in the IR.
Value parameters
- annotations
-
Annotations on the case class (defaults to empty list)
- companion
-
Optional companion object (defaults to None)
- derives
-
Type class derivations (defaults to empty list)
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this case class extends (defaults to empty list)
- fields
-
The fields (constructor parameters) of the case class
- name
-
The name of the case class
- typeParams
-
Type parameters for generic case classes (defaults to empty list)
Attributes
- Example
-
val person = CaseClass( "Person", fields = List( Field("name", TypeRef.String), Field("age", TypeRef.Int) ), derives = List("Schema") ) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Represents a companion object in the IR.
Represents a companion object in the IR.
Value parameters
- members
-
The members of the companion object (defaults to empty list)
Attributes
- Source
- TypeDefinition.scala
- Supertypes
Represents a Scala 3 enum in the IR.
Represents a Scala 3 enum in the IR.
Value parameters
- annotations
-
Annotations on the enum (defaults to empty list)
- cases
-
The enum cases
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this enum extends (defaults to empty list)
- name
-
The name of the enum
Attributes
- Example
-
val color = Enum( "Color", cases = List( EnumCase.SimpleCase("Red"), EnumCase.SimpleCase("Green"), EnumCase.SimpleCase("Blue") ) ) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Represents a case within a Scala 3 enum.
Represents a case within a Scala 3 enum.
Attributes
- Companion
- object
- Source
- TypeDefinition.scala
- Supertypes
- Known subtypes
-
class ParameterizedCaseclass SimpleCase
Attributes
- Companion
- trait
- Source
- TypeDefinition.scala
- Supertypes
- Self type
-
EnumCase.type
Represents a field/property in the IR, with type, default value, annotations, and documentation.
Represents a field/property in the IR, with type, default value, annotations, and documentation.
Value parameters
- annotations
-
List of annotations on the field (defaults to empty list)
- defaultValue
-
Optional default value for the field as a string (defaults to None)
- doc
-
Optional documentation/description of the field (defaults to None)
- name
-
The name of the field
- typeRef
-
The type of the field
Attributes
- Example
-
// Simple field val nameField = Field("name", TypeRef.String) // Field with default value val ageField = Field("age", TypeRef.Int, Some("0")) // Field with annotations and documentation val emailField = Field( "email", TypeRef.String, annotations = List(Annotation("required")), doc = Some("User email address") ) // Field with complex type val itemsField = Field("items", TypeRef.list(TypeRef.String)) - Source
- Field.scala
- Supertypes
Attributes
- Companion
- trait
- Source
- Import.scala
- Supertypes
- Self type
-
Import.type
Represents a Scala import statement in the IR.
Represents a Scala import statement in the IR.
Attributes
- Companion
- object
- Source
- Import.scala
- Supertypes
- Known subtypes
Represents a method definition in the IR.
Represents a method definition in the IR.
Value parameters
- annotations
-
List of annotations on the method (defaults to empty list)
- body
-
Optional method body as a string (defaults to None)
- doc
-
Optional documentation for the method (defaults to None)
- isImplicit
-
Whether this method is implicit (Scala 2) or given (Scala 3) (defaults to false)
- isOverride
-
Whether this method overrides a parent method (defaults to false)
- name
-
The method name
- params
-
Parameter lists (supports curried methods, defaults to empty list)
- returnType
-
The return type of the method
- typeParams
-
Type parameters for generic methods (defaults to empty list)
Attributes
- Source
- Method.scala
- Supertypes
Represents a method parameter in the IR.
Represents a method parameter in the IR.
Value parameters
- defaultValue
-
Optional default value as a string (defaults to None)
- isByName
-
Whether this is a by-name parameter (=> T) (defaults to false)
- isVarargs
-
Whether this is a varargs parameter (T*) (defaults to false)
- name
-
The parameter name
- typeRef
-
The parameter type
Attributes
- Source
- Method.scala
- Supertypes
Represents a newtype wrapper in the IR.
Represents a newtype wrapper in the IR.
Value parameters
- annotations
-
Annotations on the newtype (defaults to empty list)
- doc
-
Optional documentation (defaults to None)
- name
-
The name of the newtype
- wrappedType
-
The underlying type being wrapped
Attributes
- Example
-
val userId = Newtype("UserId", wrappedType = TypeRef.Long) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Represents a Scala object definition in the IR.
Represents a Scala object definition in the IR.
Value parameters
- annotations
-
Annotations on the object (defaults to empty list)
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this object extends (defaults to empty list)
- isCaseObject
-
Whether this is a case object (defaults to false)
- members
-
The members of the object (defaults to empty list)
- name
-
The name of the object
Attributes
- Example
-
val utils = ObjectDef( "Utils", members = List( ObjectMember.ValMember("MaxRetries", TypeRef.Int, "3") ) ) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Source
- TypeDefinition.scala
- Supertypes
- Self type
-
ObjectMember.type
Represents a member within an object definition.
Represents a member within an object definition.
Attributes
- Companion
- object
- Source
- TypeDefinition.scala
- Supertypes
- Known subtypes
Represents a Scala 3 opaque type alias in the IR.
Represents a Scala 3 opaque type alias in the IR.
In Scala 3, emitted as opaque type Name = UnderlyingType. In Scala 2, falls back to a plain type alias type Name = UnderlyingType.
Value parameters
- annotations
-
Annotations on the opaque type (defaults to empty list)
- companion
-
Optional companion object (defaults to None)
- doc
-
Optional documentation (defaults to None)
- name
-
The name of the opaque type
- underlyingType
-
The underlying type being aliased
- upperBound
-
Optional upper bound constraint (defaults to None)
Attributes
- Example
-
val userId = OpaqueType("UserId", underlyingType = TypeRef.String) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Represents a Scala package declaration in the IR.
Represents a Scala package declaration in the IR.
Value parameters
- path
-
The fully qualified package path (e.g., "com.example")
Attributes
- Example
-
val pkg = PackageDecl("com.example") // Represents: package com.example - Source
- PackageDecl.scala
- Supertypes
Wraps a list of method parameters with an optional modifier (implicit/using).
Wraps a list of method parameters with an optional modifier (implicit/using).
Value parameters
- modifier
-
The modifier for this parameter list (defaults to Normal)
- params
-
The parameters in this parameter list
Attributes
- Source
- ParamList.scala
- Supertypes
Attributes
- Companion
- trait
- Source
- ParamList.scala
- Supertypes
- Self type
-
ParamListModifier.type
Modifier for a parameter list, indicating whether it is normal, implicit, or using.
Represents a complete Scala source file in the IR.
Represents a complete Scala source file in the IR.
A Scala file consists of a package declaration, optional imports, and type definitions. This is the top-level IR node for code generation.
Value parameters
- imports
-
The import statements (defaults to empty list)
- packageDecl
-
The package declaration for this file
- types
-
The type definitions in this file (defaults to empty list)
Attributes
- Example
-
val file = ScalaFile( PackageDecl("com.example"), imports = List( Import.SingleImport("scala.collection", "List"), Import.WildcardImport("zio") ), types = List( CaseClass("Person", List(Field("name", TypeRef.String))) ) ) - Source
- ScalaFile.scala
- Supertypes
Represents a Scala sealed trait in the IR.
Represents a Scala sealed trait in the IR.
Value parameters
- annotations
-
Annotations on the sealed trait (defaults to empty list)
- cases
-
The cases (subtypes) of the sealed trait (defaults to empty list)
- companion
-
Optional companion object (defaults to None)
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this sealed trait extends (defaults to empty list)
- name
-
The name of the sealed trait
- typeParams
-
Type parameters for generic sealed traits (defaults to empty list)
Attributes
- Example
-
val shape = SealedTrait( "Shape", cases = List( SealedTraitCase.CaseClassCase(CaseClass("Circle", List(Field("radius", TypeRef.Double)))), SealedTraitCase.CaseObjectCase("Unknown") ) ) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Source
- TypeDefinition.scala
- Supertypes
- Self type
-
SealedTraitCase.type
Represents a case within a sealed trait hierarchy.
Represents a case within a sealed trait hierarchy.
Attributes
- Companion
- object
- Source
- TypeDefinition.scala
- Supertypes
- Known subtypes
-
class CaseClassCaseclass CaseObjectCase
Represents a non-sealed Scala trait in the IR.
Represents a non-sealed Scala trait in the IR.
Value parameters
- annotations
-
Annotations on the trait (defaults to empty list)
- companion
-
Optional companion object (defaults to None)
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this trait extends (defaults to empty list)
- members
-
Members defined within the trait body (defaults to empty list)
- name
-
The name of the trait
- typeParams
-
Type parameters for generic traits (defaults to empty list)
Attributes
- Example
-
val hasId = Trait( "HasId", members = List( ObjectMember.DefMember(Method("id", TypeRef.Long)) ) ) - Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Attributes
- Source
- TypeDefinition.scala
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass AnyShow all
Represents a Scala type definition in the IR.
Represents a Scala type definition in the IR.
All compound types (case classes, sealed traits, enums, objects, newtypes) extend this trait, providing a uniform interface for code generation.
Attributes
- Source
- TypeDefinition.scala
- Supertypes
- Known subtypes
-
class AbstractClassclass CaseClassclass Enumclass Newtypeclass ObjectDefclass OpaqueTypeclass SealedTraitclass Traitclass TypeAliasShow all
Represents a type parameter in the IR, with optional variance and bounds.
Represents a type parameter in the IR, with optional variance and bounds.
Value parameters
- name
-
The name of the type parameter (e.g., "A", "B")
- upperBound
-
An optional upper bound type (e.g., Some(TypeRef("Serializable")) for
A : Nothing) - variance
-
The variance of the type parameter (defaults to Invariant)
Attributes
- Example
-
// Simple invariant type param val a = TypeParam("A") // Covariant type param val covariant = TypeParam("A", Variance.Covariant) // With upper bound val bounded = TypeParam("A", upperBound = Some(TypeRef("Serializable"))) - Source
- TypeParam.scala
- Supertypes
Represents a Scala type reference in the IR, supporting generic types.
Represents a Scala type reference in the IR, supporting generic types.
Value parameters
- name
-
The name of the type (e.g., "String", "List", "Option")
- typeArgs
-
Type arguments for generic types (defaults to empty list)
Attributes
- Example
-
// Simple type val stringType = TypeRef("String") // Generic type with arguments val listOfInt = TypeRef("List", List(TypeRef("Int"))) // Using factory methods val optionalString = TypeRef.optional(TypeRef.String) val mapStringInt = TypeRef.map(TypeRef.String, TypeRef.Int) - Companion
- object
- Source
- TypeRef.scala
- Supertypes
Attributes
- Companion
- class
- Source
- TypeRef.scala
- Supertypes
- Self type
-
TypeRef.type
Represents type parameter variance.
Represents type parameter variance.
Attributes
- Companion
- object
- Source
- TypeParam.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- trait
- Source
- TypeParam.scala
- Supertypes
- Self type
-
Variance.type