GHC hackers,

Finally!  I have committed the new representation for coercions!  This is a 
pretty big patch touching a lot of files. If you are working on anything that 
intersects the type checker, it'll affect you.

GHC now implements, rather closely, the system described in our paper 
"Practical aspects of evidence-based compilation in System FC" here
        http://research.microsoft.com/en-us/um/people/simonpj/papers/ext-f/
Treat this paper as the new main statement of the type system implemented in 
GHC.
  
Key changes are these:

* There is a new data type, Coercion (defined in module types/Coercion), 
completely
  distinct from Type.Type.  The Coercion module is the heart of all the changes.

* Equality evidence is handled *completely uniformly* with class evidence 
  and implicit-parameter evidence.  All the beastly special cases for EqPred 
have
  gone away.  In particular, the evidence for an equality is a *value* (not a 
type-level
  thingy), but it is a value that has zero width (like the State# token), and 
hence
  costs nothing to allocate or pass around. See the paper.

* A term can be a coercion, so there is a new constructor in CoreSyn.Expr that 
lifts Coercions
  into Exprs.

All this should make it trivial to implement equality superclasses, but I have 
not quite taken that step yet.

Interface-file formats may have changed, so the safest thing is to recompile 
everything.  There are some minor wibble to haddock, so you'll need to pull 
there too.  No changes to the libraries though.

Many thanks to Brent Yorgey for doing the first pass of all this work, and to 
Stephanie, Steve, and Dimitrios for lots of the design work.

Simon


_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to