orc.type.tycon
Class DatatypeTycon
java.lang.Object
orc.type.Type
orc.type.tycon.Tycon
orc.type.tycon.DatatypeTycon
public class DatatypeTycon
- extends Tycon
Type constructor encompassing all type-level information associated with
a datatype. This tycon will be passed as a type parameter to the Datatype
site, which when typechecked will return a tuple of the constructor types.
This may seem slightly obtuse, but it makes the earlier translation steps
easier while still guaranteeing that all type information can be discarded
from an OIL file without affecting its runtime semantics. If datatype
declarations simultaneously had static and dynamic semantics, that would
not be true. So, this is the isolated static component of the datatype
declaration.
- Author:
- dkitchin
Constructor Summary |
DatatypeTycon(java.lang.String name,
java.util.List<Variance> vs,
java.util.List<java.util.List<Type>> cs,
java.lang.Object id)
|
Methods inherited from class orc.type.Type |
addConstraints, allFreeVars, assertSubtype, call, call, closed, demote, equal, findVariance, fromJavaClass, fromJavaMethod, fromJavaMethods, fromJavaType, fromJavaType, isBot, isTop, javaCounterpart, join, makeJavaCtx, makeJavaCtx, meet, promote, resolveSites, shiftFreeVars, substAll, subtype, supertype, unwrapAs |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
DatatypeTycon
public DatatypeTycon(java.lang.String name,
java.util.List<Variance> vs,
java.util.List<java.util.List<Type>> cs,
java.lang.Object id)
variances
public java.util.List<Variance> variances()
- Overrides:
variances
in class Type
getConstructors
public java.util.List<java.util.List<Type>> getConstructors()
throws TypeException
- Throws:
TypeException
subst
public Type subst(Env<Type> ctx)
throws TypeException
- Overrides:
subst
in class Type
- Throws:
TypeException
freeVars
public java.util.Set<java.lang.Integer> freeVars()
- Overrides:
freeVars
in class Type
toString
public java.lang.String toString()
- Overrides:
toString
in class Type
equals
public boolean equals(java.lang.Object that)
- Overrides:
equals
in class Tycon
hashCode
public int hashCode()
- Overrides:
hashCode
in class Tycon
marshal
public Type marshal()
throws UnrepresentableTypeException
- Description copied from class:
Type
- Convert to a syntactic type. May return null
if the type is not representable.
- Overrides:
marshal
in class Type
- Returns:
- The syntactic type corresponding to this type
- Throws:
UnrepresentableTypeException