diff options
author | Ian Lynagh <igloo@earth.li> | 2012-06-06 20:16:48 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-06-06 20:58:28 +0100 |
commit | 2ef5cd26db27543ac8664a3d18f45550d0109a8b (patch) | |
tree | 3ce04c70eeba6549c689aad64a649291bf4d00b1 /compiler/prelude | |
parent | c7c44288b9c6d9ba311f2b7a09e80882eb93cfc9 (diff) | |
download | haskell-2ef5cd26db27543ac8664a3d18f45550d0109a8b.tar.gz |
Put the Integer type, rather than the mkIntegerId, inside LitInteger
This will make it possible to write PrelRules that produce an Integer
result without having Integer arguments.
Diffstat (limited to 'compiler/prelude')
-rw-r--r-- | compiler/prelude/PrelRules.lhs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index 58eefd9e88..9f43f6090c 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -31,7 +31,6 @@ import DataCon ( dataConTag, dataConTyCon, dataConWorkId, fIRST_TAG ) import CoreUtils ( cheapEqExpr, exprIsHNF ) import CoreUnfold ( exprIsConApp_maybe ) import Type -import TypeRep import OccName ( occNameFS ) import PrelNames import Maybes ( orElse ) @@ -789,18 +788,15 @@ match_Integer_divop_both :: (Integer -> Integer -> (Integer, Integer)) -> [Expr CoreBndr] -> Maybe (Expr CoreBndr) match_Integer_divop_both divop _ id_unf [xl,yl] - | Just (LitInteger x i) <- exprIsLiteral_maybe id_unf xl + | Just (LitInteger x t) <- exprIsLiteral_maybe id_unf xl , Just (LitInteger y _) <- exprIsLiteral_maybe id_unf yl , y /= 0 , (r,s) <- x `divop` y - = case idType i of - FunTy _ (FunTy _ integerTy) -> - Just $ mkConApp (tupleCon UnboxedTuple 2) - [Type integerTy, - Type integerTy, - Lit (LitInteger r i), - Lit (LitInteger s i)] - _ -> panic "match_Integer_divop_both: mkIntegerId has the wrong type" + = Just $ mkConApp (tupleCon UnboxedTuple 2) + [Type t, + Type t, + Lit (LitInteger r t), + Lit (LitInteger s t)] match_Integer_divop_both _ _ _ _ = Nothing -- This helper is used for the quotRem and divMod functions |