pub enum Type {
Show 62 variants Obj, ObjMut, Int, IntMut, Nat, NatMut, Ratio, RatioMut, Float, FloatMut, Bool, BoolMut, Str, StrMut, NoneType, Code, Module, Frame, Error, Inf, NegInf, Type, Class, Trait, Patch, RangeCommon, FuncCommon, ProcCommon, FuncMethodCommon, ProcMethodCommon, CallableCommon, ArrayCommon, DictCommon, NotImplemented, Ellipsis, Never, Mono(Str), Range(Box<Type>), Iter(Box<Type>), Ref(Box<Type>), RefMut(Box<Type>), Option(Box<Type>), OptionMut(Box<Type>), Subr(SubrType), Callable { param_ts: Vec<Type>, return_t: Box<Type>, }, Array { t: Box<Type>, len: TyParam, }, Dict { k: Box<Type>, v: Box<Type>, }, Tuple(Vec<Type>), Record(Dict<Str, Type>), Refinement(RefinementType), Quantified(QuantifiedType), And(Vec<Type>), Not(Vec<Type>), Or(Vec<Type>), VarArgs(Box<Type>), Poly { name: Str, params: Vec<TyParam>, }, MonoQVar(Str), PolyQVar { name: Str, params: Vec<TyParam>, }, FreeVar(FreeTyVar), MonoProj { lhs: Box<Type>, rhs: Str, }, ASTOmitted, Failure,
}
Expand description

NOTE: 連携型変数があるので、比較にはref_eqを使うこと Commonが付く型は多相だが中の型をなんでも受け入れるバージョン TODO: MonoArray Int, 3 == PolyArray Int, Int, Int Mut型を作ろうとすると、name() -> &strがうまくいかないので 組み込みMut型は全て書き下す

Variants

Obj

ObjMut

Int

IntMut

Nat

NatMut

Ratio

RatioMut

Float

FloatMut

Bool

BoolMut

Str

StrMut

NoneType

Code

Module

Frame

Error

Inf

NegInf

Type

Class

Trait

Patch

RangeCommon

FuncCommon

ProcCommon

FuncMethodCommon

ProcMethodCommon

CallableCommon

ArrayCommon

DictCommon

NotImplemented

Ellipsis

Never

Mono(Str)

Range(Box<Type>)

Iter(Box<Type>)

Ref(Box<Type>)

RefMut(Box<Type>)

Option(Box<Type>)

OptionMut(Box<Type>)

Subr(SubrType)

Callable

Fields

param_ts: Vec<Type>
return_t: Box<Type>

Array

Fields

t: Box<Type>
len: TyParam

Dict

Fields

k: Box<Type>
v: Box<Type>

Tuple(Vec<Type>)

Record(Dict<Str, Type>)

Refinement(RefinementType)

Quantified(QuantifiedType)

And(Vec<Type>)

Not(Vec<Type>)

Or(Vec<Type>)

VarArgs(Box<Type>)

Poly

Fields

name: Str
params: Vec<TyParam>

MonoQVar(Str)

PolyQVar

Fields

name: Str
params: Vec<TyParam>

FreeVar(FreeTyVar)

MonoProj

Fields

lhs: Box<Type>
rhs: Str

ASTOmitted

Failure

Implementations

Top := {=}

Bottom := {}

function type with non-default parameters

{I: Int | I >= 0}
=> Refinement{
    layout: TyParam::MonoQ "I",
    bounds: [TyBound::Instance("I", "Int")],
    preds: [Predicate::GreaterEqual("I", 0)]
}

quantified((T -> T), T: Type) => |T: Type| T -> T

共通部分(A and B)を返す 型同士の包含関係はここでは検査しない(TypeCheckerでする)

Trait Implementations

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

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.