summaryrefslogtreecommitdiff
path: root/compiler/stranal
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2008-01-29 01:14:38 +0000
committersimonpj@microsoft.com <unknown>2008-01-29 01:14:38 +0000
commit0c72be2588fbbd6410ae9ea5bf9307d593208919 (patch)
tree4deaaf924cef68293f33a0efc21b286f8dfe7be6 /compiler/stranal
parent82c6e1c687481ed54e434a895db4208d48a8e5c5 (diff)
downloadhaskell-0c72be2588fbbd6410ae9ea5bf9307d593208919.tar.gz
Move spiltDmdTy within module (no change in code)
Diffstat (limited to 'compiler/stranal')
-rw-r--r--compiler/stranal/DmdAnal.lhs17
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index a93990781d..eec165a1a0 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -656,15 +656,6 @@ nonAbsentArgs (d : ds) = 1 + nonAbsentArgs ds
%************************************************************************
\begin{code}
-splitDmdTy :: DmdType -> (Demand, DmdType)
--- Split off one function argument
--- We already have a suitable demand on all
--- free vars, so no need to add more!
-splitDmdTy (DmdType fv (dmd:dmds) res_ty) = (dmd, DmdType fv dmds res_ty)
-splitDmdTy ty@(DmdType fv [] res_ty) = (resTypeArgDmd res_ty, ty)
-\end{code}
-
-\begin{code}
unitVarDmd var dmd = DmdType (unitVarEnv var dmd) [] TopRes
addVarDmd top_lvl dmd_ty@(DmdType fv ds res) var dmd
@@ -869,6 +860,13 @@ dmdTransform sigs var dmd
%************************************************************************
\begin{code}
+splitDmdTy :: DmdType -> (Demand, DmdType)
+-- Split off one function argument
+-- We already have a suitable demand on all
+-- free vars, so no need to add more!
+splitDmdTy (DmdType fv (dmd:dmds) res_ty) = (dmd, DmdType fv dmds res_ty)
+splitDmdTy ty@(DmdType fv [] res_ty) = (resTypeArgDmd res_ty, ty)
+
splitCallDmd :: Demand -> (Int, Demand)
splitCallDmd (Call d) = case splitCallDmd d of
(n, r) -> (n+1, r)
@@ -883,7 +881,6 @@ deferType (DmdType fv _ _) = DmdType (deferEnv fv) [] TopRes
-- Notice that we throw away info about both arguments and results
-- For example, f = let ... in \x -> x
-- We don't want to get a stricness type V->T for f.
- -- Peter??
deferEnv :: DmdEnv -> DmdEnv
deferEnv fv = mapVarEnv defer fv