+ -- We play a bit fast and loose by treating the dictionary
+ -- superclasses as ordinary arguments. That means that in
+ -- the case of
+ -- class C a => D a
+ -- we don't get a newtype with no arguments!
+ args = sc_sel_names ++ op_names
+ op_tys = [ty | (_,_,ty) <- sig_stuff]
+ op_names = [op | (op,_,_) <- sig_stuff]
+ arg_tys = map mkPredTy dict_theta ++ op_tys
+ rec_tycon = classTyCon rec_clas
+
+ ; dict_con <- buildDataCon datacon_name
+ False -- Not declared infix
+ (map (const HsNoBang) args)
+ [{- No fields -}]
+ tvs [{- no existentials -}]
+ [{- No GADT equalities -}]
+ eq_theta
+ arg_tys
+ (mkTyConApp rec_tycon (mkTyVarTys tvs))
+ rec_tycon
+