[commit: ghc] type-nats: Just a note. (fca0545)

Iavor Diatchki <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : type-nats

http://hackage.haskell.org/trac/ghc/changeset/fca0545b4713183f7f7c5a8a23c77b1ff2ea3234

>---------------------------------------------------------------

commit fca0545b4713183f7f7c5a8a23c77b1ff2ea3234
Author: Iavor S. Diatchki <[email protected]>
Date:   Sat Sep 22 11:35:30 2012 -0700

    Just a note.

>---------------------------------------------------------------

 compiler/typecheck/TcTypeNats.hs |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs
index b17b431..e815f55 100644
--- a/compiler/typecheck/TcTypeNats.hs
+++ b/compiler/typecheck/TcTypeNats.hs
@@ -101,6 +101,11 @@ typeNatStage ct
   | isGiven ev =
     case solve ct of
       Just _ -> return Stop              -- trivial fact
+                -- Note: we don't interact givens with wanteds or derived
+                -- because we assume that they are added before them
+                -- Otherwise we'd basically have to kick-out all of the
+                -- wanteds and restart them, to check if they might be solvable
+                -- with the new assumption.
       _      -> checkBad =<< computeNewGivenWork ct
 
   | isWanted ev =
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.