Package net.hydromatic.morel.type
Interface Type
- All Known Subinterfaces:
NamedType,RecordLikeType
- All Known Implementing Classes:
BaseType,DataType,DummyType,FnType,ForallType,ListType,ParameterizedType,PrimitiveType,ProgressiveRecordType,RecordType,TupleType,TypeVar
public interface Type
Type.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(TypeVisitor<R> typeVisitor) copy(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.default booleanisFinite()Whether this type has a small, fixed set of instances.default booleanReturns whether this type is progressive.key()Description of the type, e.gdefault Stringmoniker()Key of the type.op()Type operator.default Typesubstitute(TypeSystem typeSystem, List<? extends Type> types) Returns a copy of this type, specialized by substituting type parameters.
-
Method Details
-
key
Type.Key key()Description of the type, e.g. "int", "int -> int", "NONE | SOME of 'a". -
moniker
Key of the type.Often the same as
key(), but an exception is datatype. For example, datatype "'a option" has moniker and name "option" and description "NONE | SOME of 'a".Use the description if you are looking for a type that is structurally equivalent. Use the moniker to identify it when printing.
-
op
Op op()Type operator. -
copy
Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged. -
accept
-
substitute
Returns a copy of this type, specialized by substituting type parameters. -
isProgressive
default boolean isProgressive()Returns whether this type is progressive.Progressive types are records, but can have additional fields each time you look.
The "file" value is an example.
-
isFinite
default boolean isFinite()Whether this type has a small, fixed set of instances. True forbool, data types on finite types.
-