forked from GitHub/gf-core
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.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user