diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2006-09-20 18:40:35 +0000 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2006-09-20 18:40:35 +0000 |
commit | 27897431cf24d4bde04b15947440c7205f2d703c (patch) | |
tree | a876b6da8b9d5634e1b718dc87c7954873653ac1 /compiler/simplCore/SimplUtils.lhs | |
parent | d5c4754dcb857be7b9f4dbf6482e6050a9cd0991 (diff) | |
download | haskell-27897431cf24d4bde04b15947440c7205f2d703c.tar.gz |
Indexed newtypes
Mon Sep 18 19:24:27 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au>
* Indexed newtypes
Thu Aug 31 22:09:21 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au>
* Indexed newtypes
- This patch makes indexed newtypes work
- Only lightly tested
- We need to distinguish between open and closed newtypes in a number of
places, because looking through newtypes doesn't work easily for open ones.
Diffstat (limited to 'compiler/simplCore/SimplUtils.lhs')
-rw-r--r-- | compiler/simplCore/SimplUtils.lhs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/simplCore/SimplUtils.lhs b/compiler/simplCore/SimplUtils.lhs index ebe4083a0a..32402b206f 100644 --- a/compiler/simplCore/SimplUtils.lhs +++ b/compiler/simplCore/SimplUtils.lhs @@ -51,7 +51,7 @@ import Type ( Type, splitFunTys, dropForAlls, isStrictType, import Coercion ( isEqPredTy ) import Coercion ( Coercion, mkUnsafeCoercion, coercionKind ) -import TyCon ( tyConDataCons_maybe, isNewTyCon ) +import TyCon ( tyConDataCons_maybe, isClosedNewTyCon ) import DataCon ( DataCon, dataConRepArity, dataConExTyVars, dataConInstArgTys, dataConTyCon ) import VarSet @@ -1467,7 +1467,7 @@ mkCase1 scrut case_bndr ty alts -- Identity case identity_alt (con, args, rhs) = de_note rhs `cheapEqExpr` identity_rhs con args identity_rhs (DataAlt con) args - | isNewTyCon (dataConTyCon con) + | isClosedNewTyCon (dataConTyCon con) = wrapNewTypeBody (dataConTyCon con) arg_tys (varToCoreExpr $ head args) | otherwise = mkConApp con (arg_ty_exprs ++ varsToCoreExprs args) |