From e4fa0854318cde1a317727ab3d29edc0ca772e9d Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 1 Feb 2008 12:27:53 +0000 Subject: [PATCH] FIX BUILD with GHC 6.4.x --- compiler/specialise/Specialise.lhs | 4 ++-- compiler/stranal/WwLib.lhs | 2 +- compiler/utils/MonadUtils.hs | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs index 67dc39c..3aa94cf 100644 --- a/compiler/specialise/Specialise.lhs +++ b/compiler/specialise/Specialise.lhs @@ -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 diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs index ec8f622..5f63a48 100644 --- a/compiler/stranal/WwLib.lhs +++ b/compiler/stranal/WwLib.lhs @@ -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) diff --git a/compiler/utils/MonadUtils.hs b/compiler/utils/MonadUtils.hs index edce995..b1882c3 100644 --- a/compiler/utils/MonadUtils.hs +++ b/compiler/utils/MonadUtils.hs @@ -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 ---------------------------------------------------------------------------------------- -- 1.7.10.4