TypeRef

zio.blocks.codegen.ir.TypeRef
See theTypeRef companion class
object TypeRef

Attributes

Companion
class
Source
TypeRef.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TypeRef.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def chunk(typeRef: TypeRef): TypeRef

Wraps a TypeRef in Chunk, representing a high-performance immutable sequence.

Wraps a TypeRef in Chunk, representing a high-performance immutable sequence.

Value parameters

typeRef

The element type

Attributes

Returns

A TypeRef representing Chunk[typeRef]

Example
val chunkOfLongs = TypeRef.chunk(TypeRef.Long)
// Creates: Chunk[Long]
Source
TypeRef.scala
def function(params: List[TypeRef], returnType: TypeRef): TypeRef

Attributes

Source
TypeRef.scala
def intersection(types: TypeRef*): TypeRef

Creates an intersection type reference (Scala 3 A & B).

Creates an intersection type reference (Scala 3 A & B).

Value parameters

types

The types in the intersection

Attributes

Returns

A TypeRef representing the intersection of the given types

Example
val named = TypeRef.intersection(TypeRef("HasName"), TypeRef("HasId"))
// Represents: HasName & HasId
Source
TypeRef.scala
def list(typeRef: TypeRef): TypeRef

Wraps a TypeRef in List, representing a list of elements.

Wraps a TypeRef in List, representing a list of elements.

Value parameters

typeRef

The element type

Attributes

Returns

A TypeRef representing List[typeRef]

Example
val listOfInt = TypeRef.list(TypeRef.Int)
// Creates: List[Int]
Source
TypeRef.scala
def map(key: TypeRef, value: TypeRef): TypeRef

Creates a TypeRef representing a Map with key and value types.

Creates a TypeRef representing a Map with key and value types.

Value parameters

key

The key type

value

The value type

Attributes

Returns

A TypeRef representing Map[key, value]

Example
val mapStringInt = TypeRef.map(TypeRef.String, TypeRef.Int)
// Creates: Map[String, Int]
Source
TypeRef.scala
def of(name: String, args: TypeRef*): TypeRef

Creates a TypeRef with the given name and type arguments.

Creates a TypeRef with the given name and type arguments.

Value parameters

args

Type arguments (variable arguments)

name

The name of the type

Attributes

Returns

A TypeRef with the given name and arguments

Example
val either = TypeRef.of("Either", TypeRef.String, TypeRef.Int)
val list = TypeRef.of("List", TypeRef.String)
Source
TypeRef.scala
def optional(typeRef: TypeRef): TypeRef

Wraps a TypeRef in Option, representing an optional type.

Wraps a TypeRef in Option, representing an optional type.

Value parameters

typeRef

The type to wrap

Attributes

Returns

A TypeRef representing Option[typeRef]

Example
val optString = TypeRef.optional(TypeRef.String)
// Creates: Option[String]
Source
TypeRef.scala
def set(typeRef: TypeRef): TypeRef

Wraps a TypeRef in Set, representing a set of unique elements.

Wraps a TypeRef in Set, representing a set of unique elements.

Value parameters

typeRef

The element type

Attributes

Returns

A TypeRef representing Set[typeRef]

Example
val setOfStrings = TypeRef.set(TypeRef.String)
// Creates: Set[String]
Source
TypeRef.scala
def tuple(types: TypeRef*): TypeRef

Attributes

Source
TypeRef.scala
def union(types: TypeRef*): TypeRef

Creates a union type reference (Scala 3 A | B).

Creates a union type reference (Scala 3 A | B).

Value parameters

types

The types in the union

Attributes

Returns

A TypeRef representing the union of the given types

Example
val strOrInt = TypeRef.union(TypeRef.String, TypeRef.Int)
// Represents: String | Int
Source
TypeRef.scala

Concrete fields

val Any: TypeRef

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala
val Byte: TypeRef

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala
val Float: TypeRef

Attributes

Source
TypeRef.scala
val Int: TypeRef

Attributes

Source
TypeRef.scala
val Long: TypeRef

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala
val Short: TypeRef

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala
val Unit: TypeRef

Attributes

Source
TypeRef.scala

Attributes

Source
TypeRef.scala