From a7de16c34b7ccffc5ae0ac4fd004dfc155b4f546 Mon Sep 17 00:00:00 2001 From: "peter.ljunglof" Date: Wed, 29 Aug 2012 21:45:10 +0000 Subject: Added an O(n log n) version of nub The new nub is called nub', and it replaces the old sortNub which was not lazy and did not retain the order between the elements. --- src/compiler/GF/Speech/RegExp.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compiler/GF/Speech') diff --git a/src/compiler/GF/Speech/RegExp.hs b/src/compiler/GF/Speech/RegExp.hs index 2592b3d57..bf9f89cb3 100644 --- a/src/compiler/GF/Speech/RegExp.hs +++ b/src/compiler/GF/Speech/RegExp.hs @@ -53,7 +53,7 @@ isEpsilon (REConcat []) = True isEpsilon _ = False unionRE :: Ord a => [RE a] -> RE a -unionRE = unionOrId . sortNub . concatMap toList +unionRE = unionOrId . nub' . concatMap toList where toList (REUnion xs) = xs toList x = [x] -- cgit v1.2.3