Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove internal library #210

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Data/Attoparsec/ByteString/Char8.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ import Data.Word (Word)
#endif
import Control.Applicative ((<|>))
import Control.Monad (void, when)
import Data.Attoparsec.ByteString.FastSet (charClass, memberChar)
import Data.Attoparsec.Internal.ByteString.FastSet (charClass, memberChar)
import Data.Attoparsec.ByteString.Internal (Parser)
import Data.Attoparsec.Combinator
import Data.Attoparsec.Number (Number(..))
Expand Down
6 changes: 3 additions & 3 deletions Data/Attoparsec/ByteString/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ import Control.Applicative ((<$>))
#endif
import Control.Applicative ((<|>))
import Control.Monad (when)
import Data.Attoparsec.ByteString.Buffer (Buffer, buffer)
import Data.Attoparsec.ByteString.FastSet (charClass, memberWord8)
import Data.Attoparsec.Internal.ByteString.Buffer (Buffer, buffer)
import Data.Attoparsec.Internal.ByteString.FastSet (charClass, memberWord8)
import Data.Attoparsec.Combinator ((<?>))
import Data.Attoparsec.Internal
import Data.Attoparsec.Internal.Compat
Expand All @@ -87,7 +87,7 @@ import Foreign.ForeignPtr (withForeignPtr)
import Foreign.Ptr (castPtr, minusPtr, plusPtr)
import Foreign.Storable (Storable(peek, sizeOf))
import Prelude hiding (getChar, succ, take, takeWhile)
import qualified Data.Attoparsec.ByteString.Buffer as Buf
import qualified Data.Attoparsec.Internal.ByteString.Buffer as Buf
import qualified Data.Attoparsec.Internal.Types as T
import qualified Data.ByteString as B8
import qualified Data.ByteString.Char8 as B
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-# LANGUAGE BangPatterns #-}
-- |
-- Module : Data.Attoparsec.ByteString.Buffer
-- Module : Data.Attoparsec.Internal.ByteString.Buffer
-- Copyright : Bryan O'Sullivan 2007-2015
-- License : BSD3
--
Expand Down Expand Up @@ -41,7 +41,7 @@
-- once; we lack a linear type system that could enforce this; and
-- there's only so far we should go to accommodate broken uses.

module Data.Attoparsec.ByteString.Buffer
module Data.Attoparsec.Internal.ByteString.Buffer
(
Buffer
, buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

-----------------------------------------------------------------------------
-- |
-- Module : Data.Attoparsec.ByteString.FastSet
-- Module : Data.Attoparsec.Internal.ByteString.FastSet
-- Copyright : Bryan O'Sullivan 2007-2015
-- License : BSD3
--
Expand All @@ -16,7 +16,7 @@
-- a lookup table.
--
-----------------------------------------------------------------------------
module Data.Attoparsec.ByteString.FastSet
module Data.Attoparsec.Internal.ByteString.FastSet
(
-- * Data type
FastSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
UnboxedTuples #-}

-- |
-- Module : Data.Attoparsec.Text.Buffer
-- Module : Data.Attoparsec.Internal.Text.Buffer
-- Copyright : Bryan O'Sullivan 2007-2015
-- License : BSD3
--
Expand All @@ -23,7 +23,7 @@
-- Once we run out of space at the end of a Buffer, we do the usual
-- doubling of the buffer size.

module Data.Attoparsec.Text.Buffer
module Data.Attoparsec.Internal.Text.Buffer
(
Buffer
, buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

------------------------------------------------------------------------------
-- |
-- Module : Data.Attoparsec.FastSet
-- Module : Data.Attoparsec.Internal.Text.FastSet
-- Copyright : Felipe Lessa 2010, Bryan O'Sullivan 2007-2015
-- License : BSD3
--
Expand All @@ -17,7 +17,7 @@
--
--
-----------------------------------------------------------------------------
module Data.Attoparsec.Text.FastSet
module Data.Attoparsec.Internal.Text.FastSet
(
-- * Data type
FastSet
Expand Down
4 changes: 2 additions & 2 deletions Data/Attoparsec/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import Data.Text (Text)
import qualified Data.Text as Text
import Data.Text.Unsafe (Iter(..))
import Prelude hiding (succ)
import qualified Data.Attoparsec.ByteString.Buffer as B
import qualified Data.Attoparsec.Text.Buffer as T
import qualified Data.Attoparsec.Internal.ByteString.Buffer as B
import qualified Data.Attoparsec.Internal.Text.Buffer as T

newtype Pos = Pos { fromPos :: Int }
deriving (Eq, Ord, Show, Num)
Expand Down
6 changes: 3 additions & 3 deletions Data/Attoparsec/Text/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ import Control.Monad (when)
import Data.Attoparsec.Combinator ((<?>))
import Data.Attoparsec.Internal
import Data.Attoparsec.Internal.Types hiding (Parser, Failure, Success)
import qualified Data.Attoparsec.Text.Buffer as Buf
import Data.Attoparsec.Text.Buffer (Buffer, buffer)
import qualified Data.Attoparsec.Internal.Text.Buffer as Buf
import Data.Attoparsec.Internal.Text.Buffer (Buffer, buffer)
import Data.Char (isAsciiUpper, isAsciiLower, toUpper, toLower)
import Data.List (intercalate)
import Data.String (IsString(..))
import Data.Text.Internal (Text(..))
import Prelude hiding (getChar, succ, take, takeWhile)
import qualified Data.Attoparsec.Internal.Types as T
import qualified Data.Attoparsec.Text.FastSet as Set
import qualified Data.Attoparsec.Internal.Text.FastSet as Set
import qualified Data.Text as T
import qualified Data.Text.Lazy as L
import qualified Data.Text.Unsafe as T
Expand Down
30 changes: 7 additions & 23 deletions attoparsec.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,6 @@ Flag developer
Default: False
Manual: True

-- We need to test and benchmark these modules,
-- but do not want to expose them to end users
library attoparsec-internal
hs-source-dirs: internal
build-depends: array,
base >= 4.3 && < 5,
bytestring <0.12,
text >= 1.1.1.3
if !impl(ghc >= 8.0)
build-depends: semigroups >=0.16.1 && <0.21
exposed-modules: Data.Attoparsec.ByteString.Buffer
Data.Attoparsec.ByteString.FastSet
Data.Attoparsec.Internal.Compat
Data.Attoparsec.Internal.Fhthagn
Data.Attoparsec.Text.Buffer
Data.Attoparsec.Text.FastSet
ghc-options: -O2 -Wall
default-language: Haskell2010

library
build-depends: array,
base >= 4.5 && < 5,
Expand All @@ -60,8 +41,7 @@ library
scientific >= 0.3.1 && < 0.4,
transformers >= 0.2 && (< 0.4 || >= 0.4.1.0) && < 0.7,
text >= 1.1.1.3,
ghc-prim <0.9,
attoparsec-internal
ghc-prim <0.9
if impl(ghc < 7.4)
build-depends:
bytestring < 0.10.4.0
Expand All @@ -85,6 +65,12 @@ library
Data.Attoparsec.Text.Lazy
Data.Attoparsec.Types
Data.Attoparsec.Zepto
Data.Attoparsec.Internal.ByteString.Buffer
Data.Attoparsec.Internal.ByteString.FastSet
Data.Attoparsec.Internal.Compat
Data.Attoparsec.Internal.Fhthagn
Data.Attoparsec.Internal.Text.Buffer
Data.Attoparsec.Internal.Text.FastSet
other-modules: Data.Attoparsec.ByteString.Internal
Data.Attoparsec.Text.Internal
ghc-options: -O2 -Wall
Expand Down Expand Up @@ -120,7 +106,6 @@ test-suite attoparsec-tests
build-depends:
array,
attoparsec,
attoparsec-internal,
base,
bytestring,
deepseq >= 1.1,
Expand Down Expand Up @@ -167,7 +152,6 @@ benchmark attoparsec-benchmarks
build-depends:
array,
attoparsec,
attoparsec-internal,
base == 4.*,
bytestring >= 0.10.4.0,
case-insensitive,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Sets.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Sets (benchmarks) where

import Test.Tasty.Bench
import Data.Char (ord)
import qualified Data.Attoparsec.Text.FastSet as FastSet
import qualified Data.Attoparsec.Internal.Text.FastSet as FastSet
import qualified TextFastSet
import qualified Data.HashSet as HashSet
import qualified Data.IntSet as IntSet
Expand Down
6 changes: 3 additions & 3 deletions tests/QC/Buffer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import QC.Common ()
import Test.Tasty (TestTree)
import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.ByteString.Buffer as BB
import qualified Data.Attoparsec.Text.Buffer as BT
import qualified Data.Attoparsec.Internal.ByteString.Buffer as BB
import qualified Data.Attoparsec.Internal.Text.Buffer as BT
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as B
import qualified Data.Text as T
Expand Down Expand Up @@ -47,7 +47,7 @@ b_unbuffer (BP _ts t buf) = t === BB.unbuffer buf
t_unbuffer :: BPT -> Property
t_unbuffer (BP _ts t buf) = t === BT.unbuffer buf

-- This test triggers both branches in Data.Attoparsec.Text.Buffer.append
-- This test triggers both branches in Data.Attoparsec.Internal.Text.Buffer.append
-- and checks that Data.Text.Array.copyI manipulations are correct.
t_unbuffer_three :: Property
t_unbuffer_three = t_unbuffer $ toBP BT.buffer [t, t, t]
Expand Down
2 changes: 1 addition & 1 deletion tests/QC/ByteString.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.ByteString as P
import qualified Data.Attoparsec.ByteString.Char8 as P8
import qualified Data.Attoparsec.ByteString.FastSet as S
import qualified Data.Attoparsec.Internal.ByteString.FastSet as S
import qualified Data.Attoparsec.ByteString.Lazy as PL
import qualified Data.ByteString as B
import qualified Data.ByteString.Char8 as B8
Expand Down
2 changes: 1 addition & 1 deletion tests/QC/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.Text as P
import qualified Data.Attoparsec.Text.Lazy as PL
import qualified Data.Attoparsec.Text.FastSet as S
import qualified Data.Attoparsec.Internal.Text.FastSet as S
import qualified Data.ByteString as BS
import qualified Data.Char as Char
import qualified Data.Text as T
Expand Down
2 changes: 1 addition & 1 deletion tests/QC/Text/FastSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module QC.Text.FastSet where
import Test.Tasty (TestTree)
import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.Text.FastSet as FastSet
import qualified Data.Attoparsec.Internal.Text.FastSet as FastSet

membershipCorrect :: String -> String -> Property
membershipCorrect members others =
Expand Down