PGF library: expose only PGF and PGF.Internal instead of all modules

PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler & shell,
including the nonstardard version of Data.Binary.
This commit is contained in:
hallgren
2014-06-12 14:43:18 +00:00
parent 352ecb7eb8
commit d6252d1c16
34 changed files with 80 additions and 71 deletions

View File

@@ -3,10 +3,10 @@ module PGF.Utilities where
import Data.Set(empty,member,insert)
-- | Like 'nub', but O(n log n) instead of O(n^2), since it uses a set to lookup previous things.
-- | Like 'Data.List.nub', but O(n log n) instead of O(n^2), since it uses a set to lookup previous things.
-- The result list is stable (the elements are returned in the order they occur), and lazy.
-- Requires that the list elements can be compared by Ord.
-- Code ruthlessly taken from http://hpaste.org/54411
-- Code ruthlessly taken from <http://hpaste.org/54411>
nub' :: Ord a => [a] -> [a]
nub' = loop empty
where loop _ [] = []