From: simonpj@microsoft.com Date: Wed, 31 Jan 2007 15:07:01 +0000 (+0000) Subject: Slight refactoring for overloaded strings X-Git-Tag: 2007-02-05~24 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=5b91066304b3bd19db3418bf53a94b977202922e Slight refactoring for overloaded strings --- diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs index 29938ee..1278662 100644 --- a/compiler/typecheck/TcSimplify.lhs +++ b/compiler/typecheck/TcSimplify.lhs @@ -2257,14 +2257,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