[project @ 2005-07-19 16:44:50 by simonpj]
[ghc-hetmet.git] / ghc / compiler / utils / Util.lhs
index b16f6eb..0911dba 100644 (file)
@@ -13,7 +13,7 @@ module Util (
        mapAndUnzip, mapAndUnzip3,
        nOfThem, filterOut,
        lengthExceeds, lengthIs, lengthAtLeast, listLengthCmp, atLength,
-       isSingleton, only,
+       isSingleton, only, singleton,
        notNull, snocView,
 
        isIn, isn'tIn,
@@ -299,6 +299,9 @@ listLengthCmp = atLength atLen atEnd
   atLen []     = EQ
   atLen _      = GT
 
+singleton :: a -> [a]
+singleton x = [x]
+
 isSingleton :: [a] -> Bool
 isSingleton [x] = True
 isSingleton  _  = False