From: Ben Lippmeier Date: Fri, 26 Nov 2010 04:29:00 +0000 (+0000) Subject: vectoriser: take class directly from the instance tycon X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=d70f8919d9fde9bf0ec1438cafb617588400e09c;hp=12a9114180eaf776c987026eac87adf5f84918ad vectoriser: take class directly from the instance tycon --- diff --git a/compiler/vectorise/Vectorise/Type/PADict.hs b/compiler/vectorise/Vectorise/Type/PADict.hs index 8b6ad92..a15f671 100644 --- a/compiler/vectorise/Vectorise/Type/PADict.hs +++ b/compiler/vectorise/Vectorise/Type/PADict.hs @@ -53,21 +53,12 @@ buildPADict vect_tc prepr_tc arr_tc repr $ Type inst_ty : map (method_call args) method_ids -- Build the type of the dictionary function. - pa_tc <- builtin paTyCon - let pa_opitems = [(id, NoDefMeth) | id <- method_ids] - let pa_cls = mkClass - (tyConName pa_tc) - tvs -- tyvars of class - [] -- fundeps - [] -- superclass predicates - 0 -- number of equalities - [] -- superclass dict selectors - [] -- associated type families - pa_opitems -- class op items - pa_tc -- dictionary type constructor - - let dfun_ty = mkForAllTys tvs - $ mkFunTys (map varType args) (PredTy $ ClassP pa_cls [inst_ty]) + pa_tc <- builtin paTyCon + let pa_opitems = [(id, NoDefMeth) | id <- method_ids] + let Just pa_cls = tyConClass_maybe pa_tc + + let dfun_ty = mkForAllTys tvs + $ mkFunTys (map varType args) (PredTy $ ClassP pa_cls [inst_ty]) -- Set the unfolding for the inliner. raw_dfun <- newExportedVar dfun_name dfun_ty