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 7265c2f07d
commit f739841497
34 changed files with 80 additions and 71 deletions

View File

@@ -1,4 +1,13 @@
{-# LANGUAGE ExistentialQuantification, DeriveDataTypeable #-}
-------------------------------------------------
-- |
-- Maintainer : Krasimir Angelov
-- Stability : stable
-- Portability : portable
--
-- This is the Haskell binding to the C run-time system for
-- loading and interpreting grammars compiled in Portable Grammar Format (PGF).
-------------------------------------------------
#include <pgf/pgf.h>
#include <gu/enum.h>
#include <gu/exn.h>

View File

@@ -0,0 +1,18 @@
{-# OPTIONS_HADDOCK hide #-}
-------------------------------------------------
-- |
-- Stability : unstable
--
-------------------------------------------------
module PGF.Internal(module Internal) where
import PGF.Binary as Internal
import PGF.Data as Internal
import PGF.Macros as Internal
import PGF.Optimize as Internal
import PGF.Printer as Internal
import PGF.Utilities as Internal
import Data.Binary as Internal
import Data.Binary.Get as Internal
import Data.Binary.IEEE754 as Internal
import Data.Binary.Put as Internal

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 _ [] = []