X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Futils%2FUtil.lhs;fp=ghc%2Fcompiler%2Futils%2FUtil.lhs;h=0911dba84137a6c89acb40690a51be95ed35e426;hb=a7ecdf96844404b7bc8273d4ff6d85759278427c;hp=b16f6eb969532d8cae386d530fabc785a593446a;hpb=8a9aba1ff5e66aad02aba0997339ea6ec60d6b1e;p=ghc-hetmet.git diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs index b16f6eb..0911dba 100644 --- 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, - 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