summaryrefslogtreecommitdiff
path: root/compiler/stranal
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-08-03 16:14:26 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-08-03 16:14:26 +0100
commit1bcd32b8e0f252d3b830c961184dab9d8b61dba9 (patch)
tree0d6315c9e1a06c4801d89be85c21fa95df97b34e /compiler/stranal
parentc679ce14814a044d6607b31b8e65e9c7ea17af81 (diff)
downloadhaskell-1bcd32b8e0f252d3b830c961184dab9d8b61dba9.tar.gz
Add Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use them
These turn out to be a useful special case of splitTyConApp_maybe. A refactoring only; no change in behaviour
Diffstat (limited to 'compiler/stranal')
-rw-r--r--compiler/stranal/DmdAnal.lhs4
-rw-r--r--compiler/stranal/WwLib.lhs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index afa722fa8a..fab75a0601 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -35,7 +35,7 @@ import TysWiredIn ( unboxedPairDataCon )
import TysPrim ( realWorldStatePrimTy )
import UniqFM ( addToUFM_Directly, lookupUFM_Directly,
minusUFM, filterUFM )
-import Type ( isUnLiftedType, eqType, splitTyConApp_maybe )
+import Type ( isUnLiftedType, eqType, tyConAppTyCon_maybe )
import Coercion ( coercionKind )
import Util ( mapAndUnzip, lengthIs, zipEqual )
import BasicTypes ( Arity, TopLevelFlag(..), isTopLevel, isNeverActive,
@@ -157,7 +157,7 @@ dmdAnal env dmd (Cast e co)
(dmd_ty, e') = dmdAnal env dmd' e
to_co = pSnd (coercionKind co)
dmd'
- | Just (tc, _) <- splitTyConApp_maybe to_co
+ | Just tc <- tyConAppTyCon_maybe to_co
, isRecursiveTyCon tc = evalDmd
| otherwise = dmd
-- This coerce usually arises from a recursive
diff --git a/compiler/stranal/WwLib.lhs b/compiler/stranal/WwLib.lhs
index 1b8b270024..7627ac9b04 100644
--- a/compiler/stranal/WwLib.lhs
+++ b/compiler/stranal/WwLib.lhs
@@ -515,7 +515,7 @@ mk_absent_let :: Id -> Maybe (CoreExpr -> CoreExpr)
mk_absent_let arg
| not (isUnLiftedType arg_ty)
= Just (Let (NonRec arg abs_rhs))
- | Just (tc, _) <- splitTyConApp_maybe arg_ty
+ | Just tc <- tyConAppTyCon_maybe arg_ty
, Just lit <- absentLiteralOf tc
= Just (Let (NonRec arg (Lit lit)))
| arg_ty `eqType` realWorldStatePrimTy