Package net.hydromatic.morel.type
Class TypeSystem.TemporaryType
- java.lang.Object
-
- net.hydromatic.morel.type.TypeSystem.TemporaryType
-
- 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.Stringnameprivate TypeSystemtypeSystem
-
Constructor Summary
Constructors Modifier Constructor Description privateTemporaryType(TypeSystem typeSystem, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(TypeVisitor<R> typeVisitor)Typecopy(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.voiddelete()java.lang.Stringdescription()Description of the type, e.g.java.lang.Stringname()Name of the type.Opop()Type operator.
-
-
-
Field Detail
-
typeSystem
private final TypeSystem typeSystem
-
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:TypeDescription of the type, e.g. "int", "int -> int".- Specified by:
descriptionin interfaceType
-
name
public java.lang.String name()
Description copied from interface:NamedTypeName of the type.
-
copy
public Type copy(TypeSystem typeSystem, java.util.function.Function<Type,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.
-
accept
public <R> R accept(TypeVisitor<R> typeVisitor)
-
delete
public void delete()
-
-