projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2005-07-19 16:44:50 by simonpj]
[ghc-hetmet.git]
/
ghc
/
compiler
/
utils
/
Util.lhs
diff --git
a/ghc/compiler/utils/Util.lhs
b/ghc/compiler/utils/Util.lhs
index
b16f6eb
..
0911dba
100644
(file)
--- a/
ghc/compiler/utils/Util.lhs
+++ b/
ghc/compiler/utils/Util.lhs
@@
-13,7
+13,7
@@
module Util (
mapAndUnzip, mapAndUnzip3,
nOfThem, filterOut,
lengthExceeds, lengthIs, lengthAtLeast, listLengthCmp, atLength,
mapAndUnzip, mapAndUnzip3,
nOfThem, filterOut,
lengthExceeds, lengthIs, lengthAtLeast, listLengthCmp, atLength,
- isSingleton, only,
+ isSingleton, only, singleton,
notNull, snocView,
isIn, isn'tIn,
notNull, snocView,
isIn, isn'tIn,
@@
-299,6
+299,9
@@
listLengthCmp = atLength atLen atEnd
atLen [] = EQ
atLen _ = GT
atLen [] = EQ
atLen _ = GT
+singleton :: a -> [a]
+singleton x = [x]
+
isSingleton :: [a] -> Bool
isSingleton [x] = True
isSingleton _ = False
isSingleton :: [a] -> Bool
isSingleton [x] = True
isSingleton _ = False