Class ParameterizedType

  • All Implemented Interfaces:
    NamedType, Type
    Direct Known Subclasses:
    DataType

    public abstract class ParameterizedType
    extends BaseType
    implements NamedType
    Base class for types that accept type parameters.

    These types have not just names but also monikers. For example, the datatype named option has instantiations whose monikers include int option, (string * bool) option, and 'b option.

    • Field Detail

      • name

        public final String name
      • moniker

        public final String moniker
      • parameterTypes

        public final List<Type> parameterTypes
    • Constructor Detail

      • ParameterizedType

        ParameterizedType​(Op op,
                          String name,
                          String moniker,
                          List<? extends Type> parameterTypes)
        Creates a ParameterizedType.
    • Method Detail

      • moniker

        public String moniker()
        Description copied from interface: Type
        Key of the type.

        Often the same as Type.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.

        Specified by:
        moniker in interface Type