scalus.sir

package scalus.sir

Members list

Type members

Classlikes

case class AnnotationsDecl(pos: SIRPosition, comment: Option[String], data: Map[String, SIR])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object AnnotationsDecl

Attributes

Companion
class
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
case class Asdf(toData: (Seq[Term]) => Term, select: Int => Term => Term, genMatch: Match => Term)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Binding(name: String, value: SIR)

Attributes

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

Provides optimization functionality for boolean expressions in SIR. Applies standard boolean algebra transformations to reduce the number of nodes and simplify expressions.

Provides optimization functionality for boolean expressions in SIR. Applies standard boolean algebra transformations to reduce the number of nodes and simplify expressions.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class ConstrDecl(name: String, storageType: SIRVarStorage, params: List[TypeBinding], typeParams: List[TypeVar], parentTypeArgs: List[SIRType], annotations: AnnotationsDecl)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class DataDecl(name: String, constructors: List[ConstrDecl], typeParams: List[TypeVar], annotations: AnnotationsDecl)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Module(version: (Int, Int), defs: List[Binding])

Attributes

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

Pretty printers.

Pretty printers.

  • Use pretty to pretty print to a org.typelevel.paiges.Doc.
  • Use prettyXTerm to pretty print to a org.typelevel.paiges.Doc with syntax highlighting for XTerm.

For example:

PrettyPrinter.prettyXTerm(sir).render(80)
// renders a single line if possible
PrettyPrinter.pretty(sir).flatten.render(120)

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class Program(version: (Int, Int, Int), term: SIR)

Attributes

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

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait SIR

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class And
class Apply
class Builtin
class Const
class Constr
class Decl
class Error
class ExternalVar
class IfThenElse
class LamAbs
class Let
class Match
class Not
class Or
class Select
class Var
Show all
object SIR

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
SIR.type
object SIRBuiltins

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object SIRChecker

Attributes

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

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class SIRPosition(file: String, startLine: Int, startColumn: Int, endLine: Int, endColumn: Int)

SIR Position - position in Scala source code.

SIR Position - position in Scala source code.

Value parameters

file

-- fiel of position. Empty file ("") means that position is unknown.

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object SIRToExpr extends ToExprHS[SIR]

Attributes

Supertypes
class ToExprHS[SIR]
trait ToExpr[SIR]
class Object
trait Matchable
class Any
Self type
SIRToExpr.type
sealed trait SIRType

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CaseClass
class Fun
trait Primitive
object Boolean
object ByteString
object Data
object Integer
object String
object Unit
class SumCaseClass
class TypeLambda
object TypeNothing
class TypeProxy
class TypeVar
Show all
object SIRType

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
SIRType.type
object SIRTypeToExpr extends ToExprHS[SIRType]

Attributes

Supertypes
class ToExprHS[SIRType]
trait ToExpr[SIRType]
class Object
trait Matchable
class Any
Self type
object SIRUnify

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
SIRUnify.type
sealed trait SIRVarStorage

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Data
object LocalUPLC
object SIRVarStorage

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
class SimpleSirToUplcLowering(sir: SIR, generateErrorTraces: Boolean)

Lowering from Scalus Intermediate Representation SIR to UPLC Term.

Lowering from Scalus Intermediate Representation SIR to UPLC Term.

Value parameters

generateErrorTraces

whether to generate error traces

sir

the Scalus Intermediate Representation to lower

Attributes

Supertypes
class Object
trait Matchable
class Any
class SimpleSirToUplcV3Lowering(sir: SIR, generateErrorTraces: Boolean)

Lowering from Scalus Intermediate Representation SIR to UPLC Term.

Lowering from Scalus Intermediate Representation SIR to UPLC Term.

Value parameters

generateErrorTraces

whether to generate error traces

sir

the Scalus Intermediate Representation to lower

Attributes

Supertypes
class Object
trait Matchable
class Any
object SirDSL

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
SirDSL.type
class SirToUplc110Lowering(sir: SIR, generateErrorTraces: Boolean)

Lowering from Scalus Intermediate Representation SIR to UPLC Term.

Lowering from Scalus Intermediate Representation SIR to UPLC Term.

We use UPLC version 1.1.0 and generate Sums of Products (SoP) constructors case and constr to represent data types. Also we optimize newtype kind of constructors to be represented as just values.

Value parameters

generateErrorTraces

whether to generate error traces

sir

the Scalus Intermediate Representation to lower

Attributes

Example
case class Wrapper(a: BigInt)
val x = Wrapper(1) // lowers to just (const integer 1)
Supertypes
class Object
trait Matchable
class Any
class ToExprHS[T](hst: HashConsedFlat[T], hste: Quotes ?=> Expr[HashConsedFlat[T]], tt: Quotes ?=> Type[T]) extends ToExpr[T]

Attributes

Supertypes
trait ToExpr[T]
class Object
trait Matchable
class Any
Known subtypes
object SIRToExpr
object SIRTypeToExpr

Called from SIRConverter via reflection.

Called from SIRConverter via reflection.

Attributes

Supertypes
trait Flat[SIR]
class Object
trait Matchable
class Any
Self type

Note, that this hashconsedflat should not be resolved as given. It is used only as parameter to ToExprHS. Given HashConsedFlat[(something other then Module)] is a no-no.

Note, that this hashconsedflat should not be resolved as given. It is used only as parameter to ToExprHS. Given HashConsedFlat[(something other then Module)] is a no-no.

Attributes

Supertypes
trait Flat[SIRType]
class Object
trait Matchable
class Any
Self type
case class TypeBinding(name: String, tp: SIRType)

Attributes

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

Givens