diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-04-20 17:06:57 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-04-20 17:06:57 +0100 |
commit | dda1c1b5484247390368e21eeb3ae0880e19d608 (patch) | |
tree | 101abd2859a7d1d0d7116ea6580415fec807d10c | |
parent | 6bf815982df88468035593a07b0be593d1326af2 (diff) | |
download | haskell-dda1c1b5484247390368e21eeb3ae0880e19d608.tar.gz |
Comments only
-rw-r--r-- | compiler/typecheck/TcSMonad.lhs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler/typecheck/TcSMonad.lhs b/compiler/typecheck/TcSMonad.lhs index b3a64e3b14..a540c3ef6f 100644 --- a/compiler/typecheck/TcSMonad.lhs +++ b/compiler/typecheck/TcSMonad.lhs @@ -1433,10 +1433,18 @@ rewriteCtFlavor :: CtFlavor -> TcPredType -- new predicate -> TcCoercion -- new ~ old -> TcS (Maybe CtFlavor) +-- rewriteCtFlavor old_fl new_pred co +-- Main purpose: create a new identity (flavor) for new_pred; +-- unless new_pred is cached already +-- * Returns a new_fl : new_pred, with same wanted/given/derived flag as old_fl +-- * If old_fl was wanted, create a binding for old_fl, in terms of new_fl +-- * If old_fl was given, AND not cached, create a binding for new_fl, in terms of old_fl +-- * Returns Nothing if new_fl is already cached + rewriteCtFlavor = rewriteCtFlavor_cache True --- Returns Nothing only if rewriting has happened and the rewritten constraint is cached --- Returns Just if either (i) we rewrite by reflexivity or --- (ii) we rewrite and original not cached +-- Returns Just new_fl iff either (i) 'co' is reflexivity +-- or (ii) 'co' is not reflexivity, and 'new_pred' not cached +-- In either case, there is nothing new to do with new_fl rewriteCtFlavor_cache :: Bool -> CtFlavor |