SIRType

scalus.sir.SIRType
See theSIRType companion trait
object SIRType

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
SIRType.type

Members list

Type members

Classlikes

case object BLS12_381_G1_Element extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
case object BLS12_381_G2_Element extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
case object BLS12_381_MlResult extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
case object Boolean extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
Boolean.type
case object ByteString extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
ByteString.type
case class CaclulateApplyTypeException(msg: String, cause: Throwable | Null) extends RuntimeException

Attributes

Supertypes
trait Product
trait Equals
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class CalculateApplyTypeContext(var env: Env, val tvGen: SetBasedTypeVarGenerationContext, var tvSubst: Map[TypeVar, TypeVar], val tvAlreadyUnique: Boolean, val reportUngrounded: Boolean, val debug: Boolean)

Attributes

Supertypes
class Object
trait Matchable
class Any
case class CaseClass(constrDecl: ConstrDecl, typeArgs: List[SIRType], parent: Option[SIRType]) extends SIRType

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
case object Data extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
Data.type
case object FreeUnificator extends SIRType

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
case class Fun(in: SIRType, out: SIRType) extends SIRType

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
case object Integer extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
Integer.type
object List

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
List.type
object Pair

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Pair.type
sealed trait Primitive extends SIRType

Attributes

Supertypes
trait SIRType
class Object
trait Matchable
class Any
Known subtypes
object Boolean
object ByteString
object Data
object Integer
object String
object Unit
Show all
class SetBasedTypeVarGenerationContext(var typeVars: Set[TypeVar], var maxCounter: Long) extends TypeVarGenerationContext

Attributes

Supertypes
class Object
trait Matchable
class Any
case object String extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
String.type
case class SumCaseClass(decl: DataDecl, typeArgs: List[SIRType]) extends SIRType

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
object Tuple2

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Tuple2.type
case class TypeApplyException(msg: String, cause: Throwable | Null) extends RuntimeException

Attributes

Supertypes
trait Product
trait Equals
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class TypeLambda(params: List[TypeVar], body: SIRType) extends SIRType

Type lamnda (always carried).

Type lamnda (always carried).

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
object TypeLambda

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TypeLambda.type
object TypeLambda2

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class TypeNonCaseModule(name: String) extends SIRType

Represents a package or companion object of a case class. Note, that case objects going to case-class.

Represents a package or companion object of a case class. Note, that case objects going to case-class.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
case object TypeNothing extends SIRType

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
class TypeProxy(var _ref: SIRType | Null) extends SIRType

Attributes

Companion
object
Supertypes
trait SIRType
class Object
trait Matchable
class Any
object TypeProxy

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
TypeProxy.type
case class TypeVar(name: String, optId: Option[Long], isBuiltin: Boolean) extends SIRType

Type variable have two forms: when id is not set, that means that for each instantiation of type-lambda, a new set of type-variables with fresh id-s are created. when id is set, that means that computations are situated in the process of instantiation of some type-lambda,

Type variable have two forms: when id is not set, that means that for each instantiation of type-lambda, a new set of type-variables with fresh id-s are created. when id is set, that means that computations are situated in the process of instantiation of some type-lambda,

Value parameters

isBuiltin
  • if true, then this type variable is a type variable of a builtin uplc function, if false, then this is Scala type variable, which can be represented in uplc in a special form. Note, that buildin type variables can come only from Builtin Functions.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SIRType
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case object Unit extends Primitive

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Primitive
trait SIRType
class Object
trait Matchable
class Any
Show all
Self type
Unit.type
object Varargs

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Varargs.type

Value members

Concrete methods

def calculateApplyType(f: SIRType, arg: SIRType, env: Map[TypeVar, SIRType], debug: Boolean): SIRType

Calculate the type of the application of function f to argument arg.

Calculate the type of the application of function f to argument arg.

Attributes

def checkAllProxiesFilled(tp: SIRType): Boolean
def checkAllProxiesFilledTraced(tp: SIRType, traceloops: IdentityHashMap[SIRType, SIRType], log: List[String]): Boolean
def collectPolyOrFun(tp: SIRType): Option[(List[TypeVar], SIRType, SIRType)]
def collectProd(tp: SIRType): Option[(List[TypeVar], ConstrDecl, List[SIRType])]
def fromUplcTypeScheme(uplcTypeSchema: TypeScheme): SIRType
def isGround(tv: TypeVar, tp: SIRType): Boolean
def isPolyFunOrFun(tp: SIRType, trace: IdentityHashMap[SIRType, SIRType]): Boolean

Check if the type is a function or a polymorphic function without unfolding type arguments. (i.e. isPolyFunOrFun(SIRType.Fun(SIRType.Unit, SIRType.Unit)) == true, isPolyFunOrFun(SIRType.TypeVar("A")) == false even if A is a needed function)

Check if the type is a function or a polymorphic function without unfolding type arguments. (i.e. isPolyFunOrFun(SIRType.Fun(SIRType.Unit, SIRType.Unit)) == true, isPolyFunOrFun(SIRType.TypeVar("A")) == false even if A is a needed function)

Value parameters

tp
  • type to check
trace
  • trace for recursive entries

Attributes

def isPolyFunOrFunUnit(tp: SIRType, trace: IdentityHashMap[SIRType, SIRType]): Boolean

Check if the type is a function or a polymorphic function from unit without unfolding type arguments. (i.e. isPolyFunOrFunUnit(SIRType.Fun(SIRType.Unit, SIRType.Unit)) == true, isPolyFunOrFunInut(SIRType.Fun(SIRType.Integer, SIRType.Unit)) == false, isPolyFunOrFunUnt(SIRType.TypeVar("A")) == false even if A is a needed function)

Check if the type is a function or a polymorphic function from unit without unfolding type arguments. (i.e. isPolyFunOrFunUnit(SIRType.Fun(SIRType.Unit, SIRType.Unit)) == true, isPolyFunOrFunInut(SIRType.Fun(SIRType.Integer, SIRType.Unit)) == false, isPolyFunOrFunUnt(SIRType.TypeVar("A")) == false even if A is a needed function)

Value parameters

tp
  • type to check
trace
  • trace for recursive entries

Attributes

def isProd(tp: SIRType): Boolean
def isSum(tp: SIRType): Boolean
def isSynteticNarrowConstrDeclName(name: String): Boolean
def isTypeVarsUsedIn(tvs: List[TypeVar], tp: SIRType): Boolean
def leastUpperBound(left: SIRType, right: SIRType): SIRType
def leastUpperBoundSeq(types: List[SIRType]): SIRType
def parentsEqSeq(input: SIRType, parent: SIRType): List[SIRType]
def parentsNoEqSeq(input: SIRType, parent: SIRType): List[SIRType]
def partitionGround(tvs: List[TypeVar], tp: SIRType): (List[TypeVar], List[TypeVar])
def prodParent(tp: SIRType): Option[SIRType]
def retrieveConstrDecl(tp: SIRType): Either[String, ConstrDecl]
def retrieveDataDecl(tp: SIRType): Either[String, DataDecl]
def substitute(rType: SIRType, env: Map[TypeVar, SIRType], proxyEnv: Map[TypeProxy, TypeProxy]): SIRType
def syntheticNarrowConstrDeclName(childDataDeclName: String): String
def typeApply(tpl: SIRType, args: List[SIRType]): SIRType

Givens