X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FInst.lhs;h=74e5bfa1a7ed0682653c0a9df5ec43271597934a;hb=8f7ac3fe40d3d55743b824deab655d0797a1c55f;hp=fa9dba334488864131b6aeb2934a18cc6d0157b8;hpb=b437dc065099e891083dde8549e06d824461e2d2;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs index fa9dba3..74e5bfa 100644 --- a/ghc/compiler/typecheck/Inst.lhs +++ b/ghc/compiler/typecheck/Inst.lhs @@ -162,21 +162,30 @@ newDicts :: InstOrigin s -> NF_TcM s (LIE s, [TcIdOcc s]) newDicts orig theta = tcGetSrcLoc `thenNF_Tc` \ loc -> + newDictsAtLoc orig loc theta `thenNF_Tc` \ (dicts, ids) -> + returnNF_Tc (listToBag dicts, ids) +{- tcGetUniques (length theta) `thenNF_Tc` \ new_uniqs -> let mk_dict u (clas, ty) = Dict u clas ty orig loc dicts = zipWithEqual "newDicts" mk_dict new_uniqs theta in returnNF_Tc (listToBag dicts, map instToId dicts) - -newDictsAtLoc orig loc theta -- Local function, similar to newDicts, - -- but with slightly different interface - = tcGetUniques (length theta) `thenNF_Tc` \ new_uniqs -> - let - mk_dict u (clas, ty) = Dict u clas ty orig loc - dicts = zipWithEqual "newDictsAtLoc" mk_dict new_uniqs theta - in - returnNF_Tc (dicts, map instToId dicts) +-} + +-- Local function, similar to newDicts, +-- but with slightly different interface +newDictsAtLoc :: InstOrigin s + -> SrcLoc + -> [(Class, TcType s)] + -> NF_TcM s ([Inst s], [TcIdOcc s]) +newDictsAtLoc orig loc theta = + tcGetUniques (length theta) `thenNF_Tc` \ new_uniqs -> + let + mk_dict u (clas, ty) = Dict u clas ty orig loc + dicts = zipWithEqual "newDictsAtLoc" mk_dict new_uniqs theta + in + returnNF_Tc (dicts, map instToId dicts) newMethod :: InstOrigin s -> TcIdOcc s