Index: src/CodeGen/FixNames.h
===================================================================
--- src/CodeGen/FixNames.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/CodeGen/FixNames.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -20,4 +20,5 @@
 
 namespace CodeGen {
+	/// mangles object and function names
 	void fixNames( std::list< Declaration* > translationUnit );
 } // namespace CodeGen
Index: src/CodeGen/Generate.h
===================================================================
--- src/CodeGen/Generate.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/CodeGen/Generate.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -23,4 +23,5 @@
 
 namespace CodeGen {
+	/// Generates code
 	void generate( std::list< Declaration* > translationUnit, std::ostream &os, bool doIntrinsics );
 } // namespace CodeGen
Index: src/ControlStruct/CaseRangeMutator.h
===================================================================
--- src/ControlStruct/CaseRangeMutator.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/ControlStruct/CaseRangeMutator.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -22,4 +22,5 @@
 
 namespace ControlStruct {
+	/// expand case ranges and turn fallthru into a null statement
 	class CaseRangeMutator : public Mutator {
 	  public:
Index: src/ControlStruct/ChooseMutator.h
===================================================================
--- src/ControlStruct/ChooseMutator.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/ControlStruct/ChooseMutator.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -22,4 +22,5 @@
 
 namespace ControlStruct {
+	/// transform choose statements into switch statements
 	class ChooseMutator : public Mutator {
 	  public:
Index: src/ControlStruct/LabelFixer.h
===================================================================
--- src/ControlStruct/LabelFixer.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/ControlStruct/LabelFixer.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -25,4 +25,5 @@
 
 namespace ControlStruct {
+	/// normalizes label definitions and generates multi-level exit labels
 	class LabelFixer : public Visitor {
 		typedef Visitor Parent;
Index: src/ControlStruct/Mutate.h
===================================================================
--- src/ControlStruct/Mutate.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/ControlStruct/Mutate.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -23,4 +23,5 @@
 
 namespace ControlStruct {
+	/// Desugars Cforall control structures
 	void mutate( std::list< Declaration* > translationUnit );
 } // namespace ControlStruct
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/GenPoly/Box.cc	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -204,6 +204,5 @@
 		}
 
-		DeclarationWithType *
-		Pass1::mutate( FunctionDecl *functionDecl ) {
+		DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) {
 			if ( functionDecl->get_statements() ) {
 				TyVarMap oldtyVars = scopeTyVars;
Index: src/GenPoly/Box.h
===================================================================
--- src/GenPoly/Box.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/GenPoly/Box.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -21,4 +21,5 @@
 
 namespace GenPoly {
+	/// boxes polymorphic function calls
 	void box( std::list< Declaration* >& translationUnit );
 } // namespace GenPoly
Index: src/GenPoly/CopyParams.h
===================================================================
--- src/GenPoly/CopyParams.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/GenPoly/CopyParams.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -20,4 +20,5 @@
 
 namespace GenPoly {
+	/// Clones by-value parameters which have been passed by-reference for polymorphism
 	void copyParams( std::list< Declaration* > &translationUnit );
 } // namespace GenPoly
Index: src/GenPoly/Lvalue.h
===================================================================
--- src/GenPoly/Lvalue.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/GenPoly/Lvalue.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -22,4 +22,5 @@
 
 namespace GenPoly {
+	/// replaces return type of `lvalue T` with `T*`, along with appropriate address-of and dereference operators
 	void convertLvalue( std::list< Declaration* >& translationUnit );
 } // namespace GenPoly
Index: src/GenPoly/Specialize.h
===================================================================
--- src/GenPoly/Specialize.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/GenPoly/Specialize.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -22,4 +22,5 @@
 
 namespace GenPoly {
+	/// generates thunks where needed
 	void convertSpecializations( std::list< Declaration* >& translationUnit );
 } // namespace GenPoly
Index: src/InitTweak/RemoveInit.h
===================================================================
--- src/InitTweak/RemoveInit.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/InitTweak/RemoveInit.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -25,4 +25,5 @@
 
 namespace InitTweak {
+	/// Adds assignment statements for polymorphic type initializers
 	void tweak( std::list< Declaration * > translationUnit );
 
Index: src/ResolvExpr/Resolver.h
===================================================================
--- src/ResolvExpr/Resolver.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/ResolvExpr/Resolver.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -21,4 +21,5 @@
 
 namespace ResolvExpr {
+	/// Checks types and binds syntactic constructs to typed representations
 	void resolve( std::list< Declaration * > translationUnit );
 	Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer );
Index: src/SymTab/FixFunction.h
===================================================================
--- src/SymTab/FixFunction.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/SymTab/FixFunction.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -20,4 +20,5 @@
 
 namespace SymTab {
+	/// Replaces function and array types by equivalent pointer types.
 	class FixFunction : public Mutator {
 		typedef Mutator Parent;
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/SymTab/Validate.cc	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -60,4 +60,5 @@
 	class HoistStruct : public Visitor {
 	  public:
+		/// Flattens nested struct types
 		static void hoistStruct( std::list< Declaration * > &translationUnit );
   
@@ -84,4 +85,5 @@
 	};
 
+	/// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers
 	class Pass1 : public Visitor {
 		typedef Visitor Parent;
@@ -89,5 +91,6 @@
 		virtual void visit( FunctionType *func );
 	};
-  
+
+	/// Associates forward declarations of aggregates with their definitions
 	class Pass2 : public Indexer {
 		typedef Indexer Parent;
@@ -110,4 +113,5 @@
 	};
 
+	/// Replaces array and function types in forall lists by appropriate pointer type
 	class Pass3 : public Indexer {
 		typedef Indexer Parent;
@@ -123,4 +127,5 @@
 	class AddStructAssignment : public Visitor {
 	  public:
+		/// Generates assignment operators for aggregate types as required
 		static void addStructAssignment( std::list< Declaration * > &translationUnit );
 
@@ -444,6 +449,6 @@
 	}
 
+	/// Fix up assertions
 	void forallFixer( Type *func ) {
-		// Fix up assertions
 		for ( std::list< TypeDecl * >::iterator type = func->get_forall().begin(); type != func->get_forall().end(); ++type ) {
 			std::list< DeclarationWithType * > toBeDone, nextRound;
@@ -817,4 +822,13 @@
 			Type *ret = def->second.first->get_base()->clone();
 			ret->get_qualifiers() += typeInst->get_qualifiers();
+			// place instance parameters on the typedef'd type
+			if ( ! typeInst->get_parameters().empty() ) {
+				ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret);
+				if ( ! rtt ) {
+					throw SemanticError("cannot apply type parameters to base type of " + typeInst->get_name());
+				}
+				rtt->get_parameters().clear();
+				cloneAll(typeInst->get_parameters(), rtt->get_parameters());
+			}
 			delete typeInst;
 			return ret;
Index: src/SymTab/Validate.h
===================================================================
--- src/SymTab/Validate.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/SymTab/Validate.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -23,4 +23,5 @@
 	class Indexer;
 
+	/// Normalizes struct and function declarations
 	void validate( std::list< Declaration * > &translationUnit, bool doDebug = false );
 	void validateType( Type *type, const Indexer *indexer );
Index: src/SynTree/TypeSubstitution.h
===================================================================
--- src/SynTree/TypeSubstitution.h	(revision 1ab4ce20f0a6002bb1250a1874430c69854abef8)
+++ src/SynTree/TypeSubstitution.h	(revision 724c2b6f8ab60e02cc9a9c5872b23139ff804274)
@@ -157,10 +157,8 @@
 }
 
-// helper function
+/// Instantiate each member of the context given the actual parameters specified, and store the
+/// instantiations for use by the indexer
 template< typename FormalIterator, typename ActualIterator, typename MemberIterator, typename OutputIterator >
 void applySubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actual, MemberIterator memberBegin, MemberIterator memberEnd, OutputIterator out ) {
-	// Instantiate each member of the context given the actual parameters specified, and store the
-	// instantiations for use by the indexer
-
 	TypeSubstitution sub = TypeSubstitution( formalBegin, formalEnd, actual );
 	for ( std::list< Declaration* >::iterator i = memberBegin; i != memberEnd; ++i ) {
