summaryrefslogtreecommitdiff
path: root/ghc/compiler/deSugar/DsUtils.lhs
diff options
context:
space:
mode:
authorsof <unknown>2001-10-25 02:13:16 +0000
committersof <unknown>2001-10-25 02:13:16 +0000
commit9e93335020e64a811dbbb223e1727c76933a93ae (patch)
treeaa4607430cb048b7bf00cc9ab00620494b41f0e6 /ghc/compiler/deSugar/DsUtils.lhs
parentdccacbf9dd82d82657f4885a91d3deb57ce22f53 (diff)
downloadhaskell-9e93335020e64a811dbbb223e1727c76933a93ae.tar.gz
[project @ 2001-10-25 02:13:10 by sof]
- Pet peeve removal / code tidyup, replaced various sub-optimal uses of 'length' with something a bit better, i.e., replaced the following patterns * length as `cmpOp` length bs * length as `cmpOp` val -- incl. uses where val == 1 and val == 0 * {take,drop,splitAt} (length as) bs * length [ () | pat <- as ] with uses of misc Util functions. I'd be surprised if there's a noticeable reduction in running times as a result of these changes, but every little bit helps. [ The changes have been tested wrt testsuite/ - I'm seeing a couple of unexpected breakages coming from CorePrep, but I'm currently assuming that these are due to other recent changes. ] - compMan/CompManager.lhs: restored 4.08 compilability + some code cleanup. None of these changes are HEADworthy.
Diffstat (limited to 'ghc/compiler/deSugar/DsUtils.lhs')
-rw-r--r--ghc/compiler/deSugar/DsUtils.lhs3
1 files changed, 2 insertions, 1 deletions
diff --git a/ghc/compiler/deSugar/DsUtils.lhs b/ghc/compiler/deSugar/DsUtils.lhs
index 008cebf6bf..b83b78429f 100644
--- a/ghc/compiler/deSugar/DsUtils.lhs
+++ b/ghc/compiler/deSugar/DsUtils.lhs
@@ -63,6 +63,7 @@ import PrelNames ( unpackCStringName, unpackCStringUtf8Name,
plusIntegerName, timesIntegerName )
import Outputable
import UnicodeUtil ( stringToUtf8 )
+import Util ( isSingleton )
\end{code}
@@ -430,7 +431,7 @@ mkSelectorBinds (VarPat v) val_expr
= returnDs [(v, val_expr)]
mkSelectorBinds pat val_expr
- | length binders == 1 || is_simple_pat pat
+ | isSingleton binders || is_simple_pat pat
= newSysLocalDs (exprType val_expr) `thenDs` \ val_var ->
-- For the error message we don't use mkErrorAppDs to avoid