mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-20 02:09:32 -06:00
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:
@@ -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>
|
||||
|
||||
18
src/runtime/haskell/PGF/Internal.hs
Normal file
18
src/runtime/haskell/PGF/Internal.hs
Normal 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
|
||||
@@ -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 _ [] = []
|
||||
|
||||
Reference in New Issue
Block a user