scalus.prelude

package scalus.prelude

Members list

Type members

Classlikes

case class AssocMap[A, B](toList: List[(A, B)])

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
AssocMap.type

Validator, parametrized by Data. Keep

Validator, parametrized by Data. Keep

Needed for compability with solutions which use existing uplc scripts and apply Data as parameter on UPLC level.

Attributes

Supertypes
class Object
trait Matchable
class Any
object EqCompanion

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
enum List[+A]

Attributes

Companion
object
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Cons[A]
object List

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
List.type
enum Option[+A]

Attributes

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

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Option.type
object OrdCompanion

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
object Prelude

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Prelude.type
case class Rational(numerator: BigInt, denominator: BigInt)

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Rational.type
enum These[+A, +B]

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any

Deprecated classlikes

enum Maybe[+A]

Attributes

Companion
object
Deprecated
true
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Maybe

Attributes

Companion
enum
Deprecated
true
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Maybe.type

Types

type Eq[-A] = (A, A) => Boolean
type Ord[-A] = (A, A) => Order

Value members

Concrete methods

inline def ???: Nothing

??? can be used for marking methods that remain to be implemented.

??? can be used for marking methods that remain to be implemented.

Attributes

Throws
NotImplementedError

when ??? is invoked.

inline def fail(inline message: String): Nothing
inline def fail(): Nothing
inline def identity[A](value: A): A
inline def log(msg: String): Unit
inline def require(inline requirement: Boolean, inline message: String): Unit

Tests an expression, throwing an IllegalArgumentException if false.

Tests an expression, throwing an IllegalArgumentException if false.

Value parameters

requirement

the expression to test

Attributes

Note

we do not use scala.Predef.require because it's not an inline method and it's not expanded before Scalus compiler plugin phase.

Example
 require(value > 1000, "Not enough")
inline def require(inline requirement: Boolean): Unit

Concrete fields

val Eq: EqCompanion.type
val Ord: OrdCompanion.type

Givens

Givens

inline given given_Eq_BigInt: () => BigInt
inline given given_Eq_Boolean: () => Boolean
inline given given_Eq_ByteString: () => ByteString
inline given given_Eq_Data: () => Data
inline given given_Eq_String: () => String
inline given given_Eq_Unit: () => Unit

Extensions

Extensions

extension [A](self: A)
inline def also[B](inline callback: A => Unit): A
inline def let[B](inline fn: A => B): B
extension (self: BigInt)
def to(other: BigInt): List[BigInt]
def until(other: BigInt): List[BigInt]
extension (x: Boolean)
inline def ?: Boolean

Trace the expression only if it evaluates to false. This is useful to trace an entire evaluation path that led to a final expression being false.

Trace the expression only if it evaluates to false. This is useful to trace an entire evaluation path that led to a final expression being false.

Attributes

Returns

the value of the expression

Example
mustBeAfter.? && mustSpendToken.?

will trace "mustSpendToken ? False" if mustBeAfter is true and mustSpendToken is false.

infix inline def orFail(inline message: String): Unit
extension [A](x: A)
inline def !==(inline y: A)(using inline eq: () => A): Boolean
inline def ===(inline y: A)(using inline eq: () => A): Boolean