X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSimplify.lhs;h=95250f8c6d81fb67d5fafaf1e4a08062c9339392;hb=ddf73c04de77994ad138771a7492007d794faf5e;hp=29938ee52c03e65072f7a04ab7b32eb720e569a5;hpb=90dc9026b091be5cca5da4c6cbd3713ecc493361;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs index 29938ee..95250f8 100644 --- a/compiler/typecheck/TcSimplify.lhs +++ b/compiler/typecheck/TcSimplify.lhs @@ -863,7 +863,8 @@ bindIrredsR loc qtvs co_vars reft givens irreds ; let all_tvs = qtvs ++ co_vars -- Abstract over all these ; (implics, bind) <- makeImplicationBind loc all_tvs reft givens' irreds' - -- This call does the real work + -- This call does the real work + -- If irreds' is empty, it does something sensible ; extendLIEs implics ; return bind } @@ -876,6 +877,8 @@ makeImplicationBind :: InstLoc -> [TcTyVar] -> Refinement -- The binding looks like -- (ir1, .., irn) = f qtvs givens -- where f is (evidence for) the new implication constraint +-- f :: forall qtvs. {reft} givens => (ir1, .., irn) +-- qtvs includes coercion variables -- -- This binding must line up the 'rhs' in reduceImplication makeImplicationBind loc all_tvs reft @@ -2257,14 +2260,14 @@ disambiguate extended_defaulting insts -- use [Integer, Double] do { integer_ty <- tcMetaTy integerTyConName ; checkWiredInTyCon doubleTyCon - ; return [integer_ty, doubleTy] } - ; string_ty <- tcMetaTy stringTyConName - ; ovlStr <- doptM Opt_OverloadedStrings - -- XXX This should not be added unconditionally, but the default declaration stuff - -- is too wired to Num for me to understand. /LA - ; let default_str_tys = default_tys ++ if ovlStr then [string_ty] else [] + ; string_ty <- tcMetaTy stringTyConName + ; ovl_str <- doptM Opt_OverloadedStrings + ; if ovl_str -- Add String if -foverloaded-strings + then return [integer_ty,doubleTy,string_ty] + else return [integer_ty,doubleTy] } + ; traceTc (text "disambigutate" <+> vcat [ppr unaries, ppr bad_tvs, ppr defaultable_groups]) - ; mapM_ (disambigGroup default_str_tys) defaultable_groups } + ; mapM_ (disambigGroup default_tys) defaultable_groups } where unaries :: [(Inst,Class, TcTyVar)] -- (C tv) constraints bad_tvs :: TcTyVarSet -- Tyvars mentioned by *other* constraints