pub enum TyParam {
Show 14 variants Value(ValueObj), Type(Box<Type>), Array(Vec<TyParam>), Tuple(Vec<TyParam>), Set(Set<TyParam>), Dict(Dict<TyParam, TyParam>), Mono(Str), Proj { obj: Box<TyParam>, attr: Str, }, App { name: Str, args: Vec<TyParam>, }, UnaryOp { op: OpKind, val: Box<TyParam>, }, BinOp { op: OpKind, lhs: Box<TyParam>, rhs: Box<TyParam>, }, Erased(Box<Type>), FreeVar(FreeTyParam), Failure,
}
Expand description

型引数 データのみ、その評価結果は別に持つ

  • Literal: 1, “aa”, True, None, … (don’t use container literals, they can only hold literals)
  • Type: Int, Add(?R, ?O), …
  • Mono: I, N, …
  • Attr: math.PI, …
  • Array: [1, 2, N]
  • Tuple: (1, N, True)
  • App: Array(Int), Fib(10), …
  • QuantVar: N: Nat, …
  • FreeVar: ?I: Int, …
  • UnaryOp: -N, ~B, …
  • BinOp: 1 + 1, N * 2, …
  • Erased: _: Type, _: Nat, …

Variants§

§

Value(ValueObj)

§

Type(Box<Type>)

§

Array(Vec<TyParam>)

§

Tuple(Vec<TyParam>)

§

Set(Set<TyParam>)

§

Dict(Dict<TyParam, TyParam>)

§

Mono(Str)

§

Proj

Fields

§obj: Box<TyParam>
§attr: Str
§

App

Fields

§name: Str
§args: Vec<TyParam>
§

UnaryOp

Fields

§val: Box<TyParam>
§

BinOp

Fields

§lhs: Box<TyParam>
§rhs: Box<TyParam>
§

Erased(Box<Type>)

§

FreeVar(FreeTyParam)

§

Failure

Implementations§

NOTE: Always add postfix when entering numbers. For example, value(1) will be of type Int.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
The resulting type after applying the - operator.
Performs the - operation. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.