orc.type.tycon
Class DatatypeTycon

java.lang.Object
  extended by orc.type.Type
      extended by orc.type.tycon.Tycon
          extended by 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

Field Summary
 
Fields inherited from class orc.type.Type
BOOLEAN, BOT, INTEGER, LET, NUMBER, SIGNAL, STRING, TOP
 
Constructor Summary
DatatypeTycon(java.lang.String name, java.util.List<Variance> vs, java.util.List<java.util.List<Type>> cs, java.lang.Object id)
           
 
Method Summary
 boolean equals(java.lang.Object that)
           
 java.util.Set<java.lang.Integer> freeVars()
           
 java.util.List<java.util.List<Type>> getConstructors()
           
 int hashCode()
           
 Type marshal()
          Convert to a syntactic type.
 Type subst(Env<Type> ctx)
           
 java.lang.String toString()
           
 java.util.List<Variance> variances()
           
 
Methods inherited from class orc.type.tycon.Tycon
asTycon, instance, instance, instance, makeCallableInstance
 
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
 

Constructor Detail

DatatypeTycon

public DatatypeTycon(java.lang.String name,
                     java.util.List<Variance> vs,
                     java.util.List<java.util.List<Type>> cs,
                     java.lang.Object id)
Method Detail

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