[m-rev.] trivial diff: update design docs

Mark Brown mark at cs.mu.OZ.AU
Sun Apr 24 11:47:24 AEST 2005


Estimated hours taken: 0.2
Branches: main

compiler/notes/compiler_design.html:
	Update the design document after the recent changes to add functional
	dependencies and split up typecheck.m.

compiler/check_typeclass.m:
	Fix a typo.

Index: compiler/check_typeclass.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/check_typeclass.m,v
retrieving revision 1.72
diff -u -r1.72 check_typeclass.m
--- compiler/check_typeclass.m	23 Apr 2005 06:29:46 -0000	1.72
+++ compiler/check_typeclass.m	24 Apr 2005 01:43:55 -0000
@@ -41,7 +41,7 @@
 %
 % Third, typeclass constraints on predicate and function declarations are
 % checked for ambiguity, taking into consideration the information
-% provided by functional depencies.
+% provided by functional dependencies.
 %
 % Fourth, all visible instances are checked for range-restrictedness and
 % mutual consistency, with respect to any functional dependencies.  This
Index: compiler/notes/compiler_design.html
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/notes/compiler_design.html,v
retrieving revision 1.101
diff -u -r1.101 compiler_design.html
--- compiler/notes/compiler_design.html	19 Apr 2005 02:47:16 -0000	1.101
+++ compiler/notes/compiler_design.html	24 Apr 2005 01:40:21 -0000
@@ -483,8 +483,9 @@
 <dt> checking typeclass instances (check_typeclass.m)
 	<dd>
 	check_typeclass.m both checks that instance declarations satisfy all 
-	the appropriate superclass constraints and
-	performs a source-to-source transformation on the
+	the appropriate superclass constraints
+	(including functional dependencies)
+	and performs a source-to-source transformation on the
 	methods from the instance declarations.
 	The transformed code is checked for type, mode, uniqueness, purity
 	and determinism correctness by the later passes, which has the effect
@@ -495,11 +496,18 @@
 	pred_ids and proc_ids are assigned to the methods for each instance. 
 
 	<p>
-	In addition,
-	while checking that the superclasses of a class are satisfied
+	While checking that the superclasses of a class are satisfied
 	by the instance declaration, a set of constraint_proofs are built up 
 	for the superclass constraints. These are used by polymorphism.m when
 	generating the base_typeclass_info for the instance.
+
+	<p>
+	This module also checks that there are no ambiguous pred/func
+	declarations (that is, it checks that all type variables in constraints
+	are determined by type variables in arguments),
+	checks that there are no cycles in the typeclass hierarchy,
+	and checks that each abstract instance has a corresponding
+	typeclass instance.
 	<p>
 
 <dt> type checking
@@ -513,7 +521,10 @@
 	  for function calls or calls to overloaded predicates; that can't
 	  be done in a single pass of typechecking, and so it is done
 	  later on (in post_typecheck.m, for both preds and function calls)
-	  Typeclass constraints are checked here, and
+	<li> typecheck_info.m defines the main data structures used by
+	  typechecking.
+	<li> typecheck_errors.m handles outputting of type errors.
+	<li> typeclasses.m checks typeclass constraints, and
 	  any redundant constraints that are eliminated are recorded (as
 	  constraint_proofs) in the pred_info for future reference.
 	<li> type_util.m contains utility predicates dealing with types
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list