X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplCore%2FSATMonad.lhs;fp=ghc%2Fcompiler%2FsimplCore%2FSATMonad.lhs;h=0df2551e3f7d0d7ad5d12f136ebadcab6a30216d;hb=9e93335020e64a811dbbb223e1727c76933a93ae;hp=7c3f243758109d95ce7cb404d6642a5ff387866b;hpb=dccacbf9dd82d82657f4885a91d3deb57ce22f53;p=ghc-hetmet.git diff --git a/ghc/compiler/simplCore/SATMonad.lhs b/ghc/compiler/simplCore/SATMonad.lhs index 7c3f243..0df2551 100644 --- a/ghc/compiler/simplCore/SATMonad.lhs +++ b/ghc/compiler/simplCore/SATMonad.lhs @@ -179,7 +179,7 @@ saTransform binder rhs case r of -- [Andre] test: do it only if we have more than one static argument. --Just (tyargs,args) | any isStatic args - Just (tyargs,args) | length (filter isStatic args) > 1 + Just (tyargs,args) | (filter isStatic args) `lengthExceeds` 1 -> newSATName binder (new_ty tyargs args) `thenSAT` \ binder' -> mkNewRhs binder binder' tyargs args rhs `thenSAT` \ new_rhs -> trace ("SAT "++ show (length (filter isStatic args))) ( @@ -240,10 +240,12 @@ saTransform binder rhs -- now, we drop the ones that are -- static, that is, the ones we will not pass to the local function - l = length dict_tys tv_tmpl' = dropStatics tyargs tv_tmpl - dict_tys' = dropStatics (take l args) dict_tys - reg_arg_tys' = dropStatics (drop l args) reg_arg_tys + + (args1, args2) = splitAtList dict_tys args + dict_tys' = dropStatics args1 dict_tys + reg_arg_tys' = dropStatics args2 reg_arg_tys + tau_ty' = glueTyArgs reg_arg_tys' res_type mk_inst_tyenv [] _ = emptyVarEnv