Class TypeSystem.TemporaryType

  • All Implemented Interfaces:
    NamedType, Type
    Enclosing class:
    TypeSystem

    public static class TypeSystem.TemporaryType
    extends java.lang.Object
    implements NamedType
    Placeholder for a type that is being recursively defined.

    For example, while defining datatype "list" as follows,

    datatype 'a list = NIL | CONS of ('a, 'a list)

    we define a temporary type "list", it is used in CONS, and later we convert it to the real data type "list".

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String name  
      private TypeSystem typeSystem  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TemporaryType​(TypeSystem typeSystem, java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <R> R accept​(TypeVisitor<R> typeVisitor)  
      Type copy​(TypeSystem typeSystem, java.util.function.Function<Type,​Type> transform)
      Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
      void delete()  
      java.lang.String description()
      Description of the type, e.g.
      java.lang.String name()
      Name of the type.
      Op op()
      Type operator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        private final java.lang.String name
    • Constructor Detail

      • TemporaryType

        private TemporaryType​(TypeSystem typeSystem,
                              java.lang.String name)
    • Method Detail

      • description

        public java.lang.String description()
        Description copied from interface: Type
        Description of the type, e.g. "int", "int -> int".
        Specified by:
        description in interface Type
      • op

        public Op op()
        Description copied from interface: Type
        Type operator.
        Specified by:
        op in interface Type
      • name

        public java.lang.String name()
        Description copied from interface: NamedType
        Name of the type.
        Specified by:
        name in interface NamedType
      • copy

        public Type copy​(TypeSystem typeSystem,
                         java.util.function.Function<Type,​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.
        Specified by:
        copy in interface Type
      • delete

        public void delete()