CVS: smlnj notes,1.1.2.8,1.1.2.9

David MacQueen <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj.commits
Message-ID <[email protected]>
Update of /cvsroot/smlnj/smlnj
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7681

Modified Files:
      Tag: primop-branch
	notes 
Log Message:
minor edits

Index: notes
===================================================================
RCS file: /cvsroot/smlnj/smlnj/Attic/notes,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** notes	26 Jul 2004 19:48:45 -0000	1.1.2.8
--- notes	27 Apr 2005 22:30:45 -0000	1.1.2.9
***************
*** 1,2 ****
--- 1,8 ----
+ These notes are my attempt to figure out what appears to be a very kludgy
+ treatement of how primops interact with the type checker.  I want to define
+ what the basic problem is, understand what the current code is doing to deal
+ with the problem, and then either eliminate the problem or find a more elegant
+ solution.
+ 
  1. PrimOp dependency in type checker
  
***************
*** 41,55 ****
  compatible.
  
! eqvTnspTy (mnemonic for what?) creates a generic instantiation of the actual
! type (actInst, with generic meta-tyvars actInstTvs), a separate generic
! instantiation (specInst, specInstTvs) of the specty type, which may be less polymorphic
! than actualty, and then unifies actInst and specInst.  This unification may
! cause tyvars in actInstTvs to be instantiated.  Then specInstTvs is transformed
! by TU.tyvarType to produce the second result, boundTvs.
  
! TU.tyvarType turns type expressions that representing meta type
! variables into the tyvars that they contain, stripping off VARtys and 
! following instantiations.  Note that instantiatePoly returns a list of
! type _expressions_ (VARty's) as its second result.
  
      fun eqvTnspTy (specty: ty, actualty: ty) : (ty * tyvar list) = 
--- 47,62 ----
  compatible.
  
! eqvTnspTy (mnemonic for what?) creates a generic instantiation of the
! actual type (actInst, with generic meta-tyvars actInstTvs), a separate
! generic instantiation (specInst, specInstTvs) of the specty type,
! which may be less polymorphic than actualty, and then unifies actInst
! and specInst.  This unification may cause tyvars in actInstTvs to be
! instantiated.  Then specInstTvs is transformed by TU.tyvarType to
! produce the second result, boundTvs.
  
! TU.tyvarType turns type expressions that represent meta type variables
! into the tyvars that they contain, stripping off VARtys and following
! instantiations.  Note that instantiatePoly returns a list of type
! _expressions_ (VARty's) as its second result.
  
      fun eqvTnspTy (specty: ty, actualty: ty) : (ty * tyvar list) = 
***************
*** 63,80 ****
        end
  
! The unification will cause some tyvars in actInstTvs to be instantiated
! to non-type-variable type terms (subterms of specInst), where specty is more
! specific than actualty). Where corresponding subterms are both type variables,
! the specty tyvar (a member of specInstTvs) will be instantiated to the
! corresponding actualty type variable (a member of actInstTvs) because of the
! right-to-left instantiation bias in Unify/unifyTyvars [Elaborator/types/unify.sml].
  
! So the resultant type term actInst may contain (uninstantiated) tyvars in specInstTvs
! as well as some (uninstantiated) tyvars in actInstTvs.  For the latter tyvars,
! the matching tyvar in specInstTvs will have been instantiated to it.  So the
! specInstTvs will contain all the tyvars occuring in actInst, some of which will
! be uninstantiated, while others will be instantiated to tyvars in actInstTvs.
! Applying TU.tyvarType will strip off the instantiations, so that the resulting
! boundtvs will contain a mixture of the tyvars from actInstTvs and specInstTvs.
  
  Example:
--- 70,90 ----
        end
  
! The unification will cause some tyvars in actInstTvs to be
! instantiated to non-type-variable type terms (subterms of specInst),
! where specty is more specific than actualty). Where corresponding
! subterms are both type variables, the specty tyvar (a member of
! specInstTvs) will be instantiated to the corresponding actualty type
! variable (a member of actInstTvs) because of the right-to-left
! instantiation bias in Unify/unifyTyvars [Elaborator/types/unify.sml].
  
! So the resultant type term actInst may contain (uninstantiated) tyvars
! in specInstTvs as well as some (uninstantiated) tyvars in actInstTvs.
! For the latter tyvars, the matching tyvar in specInstTvs will have
! been instantiated to it.  So the specInstTvs will contain all the
! tyvars occuring in actInst, some of which will be uninstantiated,
! while others will be instantiated to tyvars in actInstTvs.  Applying
! TU.tyvarType will strip off the instantiations, so that the resulting
! boundtvs will contain a mixture of the tyvars from actInstTvs and
! specInstTvs.
  
  Example:



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.