X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FDsExpr.lhs;h=f44a90a29344af32bccac6c21f469ab03cc13889;hb=ce3cab1dc3f3d03d43cf1b8cfc848c1ccaa00a84;hp=1e374ce353ec9560c3e3aa38c7cf90387788f76e;hpb=14ac360a0651770f9297134e55bf5ba796689035;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/DsExpr.lhs b/ghc/compiler/deSugar/DsExpr.lhs index 1e374ce..f44a90a 100644 --- a/ghc/compiler/deSugar/DsExpr.lhs +++ b/ghc/compiler/deSugar/DsExpr.lhs @@ -154,10 +154,10 @@ dsExpr (HsLitOut (HsFrac r) ty) -- others where we know what to do: dsExpr (HsLitOut (HsIntPrim i) _) - = if (i >= toInteger minInt && i <= toInteger maxInt) then - returnDs (Lit (mkMachInt i)) - else - error ("ERROR: Int constant " ++ show i ++ out_of_range_msg) + | i >= toInteger minInt && i <= toInteger maxInt + = returnDs (Lit (mkMachInt (fromInteger i))) + | otherwise + = error ("ERROR: Int constant " ++ show i ++ out_of_range_msg) dsExpr (HsLitOut (HsFloatPrim f) _) = returnDs (Lit (MachFloat f)) @@ -593,10 +593,13 @@ dsDo do_or_lc stmts return_id then_id zero_id result_ty zero_expr = TyApp (HsVar zero_id) [b_ty] main_match = PatMatch pat (SimpleMatch ( HsDoOut do_or_lc stmts return_id then_id zero_id result_ty locn)) + the_matches - = if failureFreePat pat - then [main_match] - else [main_match, PatMatch (WildPat a_ty) (SimpleMatch zero_expr)] + | failureFreePat pat = [main_match] + | otherwise = + [ main_match + , PatMatch (WildPat a_ty) (SimpleMatch zero_expr) + ] in matchWrapper DoBindMatch the_matches match_msg `thenDs` \ (binders, matching_code) ->