Class ListType

java.lang.Object
net.hydromatic.morel.type.BaseType
net.hydromatic.morel.type.ListType
All Implemented Interfaces:
Type

public class ListType extends BaseType
The type of a list value.
  • Field Details

    • elementType

      public final Type elementType
  • Constructor Details

    • ListType

      ListType(Type elementType)
  • Method Details

    • key

      public Type.Key key()
      Description copied from interface: Type
      Description of the type, e.g. "int", "int -> int", " NONE | SOME of 'a".
    • arg

      public Type arg(int i)
      Description copied from interface: Type
      Returns the ith type parameter. Throws for types except ListType and DataType.
    • isCollection

      public boolean isCollection()
      Description copied from interface: Type
      Whether this is a collection type (list or bag).

      If a type is a collection type, arg(0) returns the element type.

    • accept

      public <R> R accept(TypeVisitor<R> typeVisitor)
    • copy

      public ListType copy(TypeSystem typeSystem, UnaryOperator<Type> transform)
      Description copied from interface: Type
      Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
    • specializes

      public boolean specializes(Type type)
      Description copied from interface: Type
      Whether this type is the same as, or a specialization of, a given type.

      For example, bool specializes bool and 'a but does not specialize int or ('a, 'b).