X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FDesugar.lhs;h=e5d763c25ed7623747c1834adf63c0fcdcda4fea;hb=98bef4db89b57b01c8f557a027dbeb8ae72407c9;hp=d154e045ab8860634d5bb63378ea54597c35b26e;hpb=92267aa26adb1ab5a6d8004a80fdf6aa06ea4e44;p=ghc-hetmet.git diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs index d154e04..e5d763c 100644 --- a/compiler/deSugar/Desugar.lhs +++ b/compiler/deSugar/Desugar.lhs @@ -34,7 +34,6 @@ import CoreMonad ( endPass, CoreToDo(..) ) import ErrUtils import Outputable import SrcLoc -import FastString import Coverage import Util import MonadUtils @@ -345,9 +344,9 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs)) -- Substitute the dict bindings eagerly, -- and take the body apart into a (f args) form - ; case decomposeRuleLhs lhs' of { - Nothing -> do { warnDs msg; return Nothing } ; - Just (fn_id, args) -> do + ; case decomposeRuleLhs bndrs' lhs' of { + Left msg -> do { warnDs msg; return Nothing } ; + Right (final_bndrs, fn_id, args) -> do { let is_local = isLocalId fn_id -- NB: isLocalId is False of implicit Ids. This is good becuase @@ -356,14 +355,10 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs)) fn_name = idName fn_id final_rhs = simpleOptExpr rhs' -- De-crap it rule = mkRule False {- Not auto -} is_local - name act fn_name bndrs' args final_rhs + name act fn_name final_bndrs args final_rhs ; return (Just rule) } } } - where - msg = hang (ptext (sLit "RULE left-hand side too complicated to desugar; ignored")) - 2 (ppr lhs) \end{code} - Note [Desugaring RULE left hand sides] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For the LHS of a RULE we do *not* want to desugar