FIX BUILD with GHC 6.4.x
authorSimon Marlow <simonmar@microsoft.com>
Fri, 1 Feb 2008 12:27:53 +0000 (12:27 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Fri, 1 Feb 2008 12:27:53 +0000 (12:27 +0000)
compiler/specialise/Specialise.lhs
compiler/stranal/WwLib.lhs
compiler/utils/MonadUtils.hs

index 67dc39c..3aa94cf 100644 (file)
@@ -672,7 +672,7 @@ specExpr subst (Case scrut case_bndr ty alts) = do
 
     spec_alt (con, args, rhs) = do
           (rhs', uds) <- specExpr subst_rhs rhs
-          let (uds', rhs'') = do dumpUDs args uds rhs'
+          let (uds', rhs'') = dumpUDs args uds rhs'
           return ((con, args', rhs''), uds')
         where
           (subst_rhs, args') = substBndrs subst_alt args
@@ -1220,7 +1220,7 @@ cloneBindSM :: Subst -> CoreBind -> SpecM (Subst, Subst, CoreBind)
 -- Return the substitution to use for RHSs, and the one to use for the body
 cloneBindSM subst (NonRec bndr rhs) = do
     us <- getUniqueSupplyM
-    let (subst', bndr') = do cloneIdBndr subst us bndr
+    let (subst', bndr') = cloneIdBndr subst us bndr
     return (subst, subst', NonRec bndr' rhs)
 
 cloneBindSM subst (Rec pairs) = do
index ec8f622..5f63a48 100644 (file)
@@ -122,7 +122,7 @@ mkWwBodies :: Type                          -- Type of original function
 mkWwBodies fun_ty demands res_info one_shots = do
     (wrap_args,   wrap_fn_args, work_fn_args, res_ty) <- mkWWargs fun_ty demands one_shots'
     (work_args,   wrap_fn_str,  work_fn_str) <- mkWWstr wrap_args
-    let (work_lam_args, work_call_args) = do mkWorkerArgs work_args res_ty
+    let (work_lam_args, work_call_args) = mkWorkerArgs work_args res_ty
         -- Don't do CPR if the worker doesn't have any value arguments
         -- Then the worker is just a constant, so we don't want to unbox it.
     (wrap_fn_cpr, work_fn_cpr,  _cpr_res_ty)
index edce995..b1882c3 100644 (file)
@@ -21,7 +21,11 @@ module MonadUtils
 -- Detection of available libraries
 ----------------------------------------------------------------------------------------
 
+#if __GLASGOW_HASKELL__ >= 606
 #define HAVE_APPLICATIVE 1
+#else
+#define HAVE_APPLICATIVE 0
+#endif
 -- we don't depend on MTL for now
 #define HAVE_MTL 0
 
@@ -54,6 +58,10 @@ class Functor f => Applicative f where
 infixl 4 <$>
 infixl 4 <*>
 
+instance Applicative IO where
+       pure = return
+       (<*>) = ap
+
 #endif
 
 ----------------------------------------------------------------------------------------