Package net.hydromatic.morel.type
Class TypeVar
- java.lang.Object
-
- net.hydromatic.morel.type.TypeVar
-
-
Constructor Summary
Constructors Constructor Description TypeVar(int ordinal)Creates a type variable with a given ordinal.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(TypeVisitor<R> typeVisitor)Typecopy(TypeSystem typeSystem, UnaryOperator<Type> transform)Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.booleanequals(Object obj)inthashCode()Type.Keykey()Description of the type, e.g.(package private) static Stringname(int i)Generates a name for a type variable.Opop()Type operator.Typesubstitute(TypeSystem typeSystem, List<? extends Type> types, TypeSystem.Transaction transaction)Returns a copy of this type, specialized by substituting type parameters.StringtoString()Returns a string for debugging.
-
-
-
Method Detail
-
toString
public String toString()
Returns a string for debugging.
-
accept
public <R> R accept(TypeVisitor<R> typeVisitor)
-
name
static String name(int i)
Generates a name for a type variable.0 → 'a, 1 → 'b, 26 → 'z, 27 → 'ba, 28 → 'bb, 675 → 'zz, 676 → 'baa, etc. (Think of it is a base 26 number, with "a" as 0, "z" as 25.)
-
key
public Type.Key key()
Description copied from interface:TypeDescription of the type, e.g. "int", "int -> int", "NONE | SOME of 'a".
-
copy
public Type copy(TypeSystem typeSystem, UnaryOperator<Type> transform)
Description copied from interface:TypeCopies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
-
substitute
public Type substitute(TypeSystem typeSystem, List<? extends Type> types, TypeSystem.Transaction transaction)
Description copied from interface:TypeReturns a copy of this type, specialized by substituting type parameters.- Specified by:
substitutein interfaceType
-
-