packages feed

bytestring-trie-0.2.7: bytestring-trie.cabal

Cabal-Version:  2.2
-- Cabal >=2.2 is required for:
--    <https://cabal.readthedocs.io/en/latest/cabal-package.html#common-stanzas>
-- Since 2.1, the Cabal-Version must be the absolutely first thing
-- in the file, even before comments.  Also, no longer uses ">=".
--    <https://github.com/haskell/cabal/issues/4899>

----------------------------------------------------------------
-- wren gayle romano <wren@cpan.org>                ~ 2022.03.05
----------------------------------------------------------------

Name:           bytestring-trie
Version:        0.2.7
Build-Type:     Simple
Stability:      provisional
Homepage:       https://wrengr.org/software/hackage.html
Bug-Reports:    https://github.com/wrengr/bytestring-trie/issues
Author:         wren gayle romano
Maintainer:     wren@cpan.org
Copyright:      2008–2022 wren gayle romano
-- Cabal-2.2 requires us to say "BSD-3-Clause" not "BSD3"
License:        BSD-3-Clause
License-File:   LICENSE

Category:       Data, Data Structures
Synopsis:       An efficient finite map from bytestrings to values.
Description:    An efficient finite map from bytestrings to values.
    .
    The implementation is based on big-endian patricia trees, like
    "Data.IntMap".  We first trie on the elements of "Data.ByteString"
    and then trie on the big-endian bit representation of those
    elements.  Patricia trees have efficient algorithms for union
    and other merging operations, but they're also quick for lookups
    and insertions.
    .
    If you are only interested in being able to associate strings
    to values, then you may prefer the @hashmap@ package which is
    faster for those only needing a map-like structure.  This package
    is intended for those who need the extra capabilities that a
    trie-like structure can offer (e.g., structure sharing to reduce
    memory costs for highly redundant keys, taking the submap of
    all keys with a given prefix, contextual mapping, extracting
    the minimum and maximum keys, etc.)

Extra-source-files:
    AUTHORS, CHANGELOG, README.md

-- This package should still work as far back as GHC 7.4.1:
--    <https://matrix.hackage.haskell.org/#/package/bytestring-lexing>
-- However, we only list here what we still verify via CI:
--    <https://github.com/wrengr/bytestring-trie/actions?query=workflow%3Aci>
Tested-With:
    GHC ==8.0.2,
    GHC ==8.2.2,
    GHC ==8.4.4,
    GHC ==8.6.5,
    GHC ==8.8.4,
    GHC ==8.10.3,
    GHC ==9.0.1,
    GHC ==9.2.1
-- These are the versions of our dependencies which ship with the
-- above.  Alas, we can't merge this with the above because cabal
-- files only have full-line comments, not end-of-line comments.
-- <https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history>
--     GHC    Cabal  base   bytestring binary    deepseq
--     8.0    1.24   4.9    0.10.8.1   0.8.3.0   1.4.2.0
--     8.2    2.0    4.10   0.10.8.2   0.8.5.1   1.4.3.0
--     8.4    2.2    4.11   ==         ==        ==
--     8.6    2.4    4.12   ==         0.8.6.0   1.4.4.0
--     8.8    3.0    4.13   0.10.9+    0.8.7.0   ==
--     8.10   3.2    4.14   0.10.10+   0.8.8.0   ==
--     9.0    3.4    4.15   0.10.12    ==        1.4.5.0
--     9.2    3.6    4.16   0.11.1     0.8.9.0   1.4.6.0

Source-Repository head
    Type:     git
    Location: https://github.com/wrengr/bytestring-trie.git

----------------------------------------------------------------
-- This stanza requires Cabal>=2.2:
--    <https://cabal.readthedocs.io/en/latest/cabal-package.html#common-stanzas>
-- While Cabal-2.2 only ships with GHC 8.4.1, the dependencies to
-- build it have essentially the same lower bounds as we do.  (They
-- require bytestring>=0.9.2.1 and deepseq>=1.3)  So users of older
-- GHC should still be able to compile it; and if they can't, then
-- they already can't compile this package.
--
-- N.B., the "import:" field must be the first thing in a stanza.
Common library-build-depends
    Default-Language: Haskell2010
    -- The lower bounds are (probably still) more restrictive than
    -- necessary, but once upon a time they were the lowest bounds
    -- we verified (for GHC 7.4.1).  We no longer maintain CI tests
    -- that far back, but they still seem to work according to Hackage:
    -- <https://matrix.hackage.haskell.org/#/package/bytestring-lexing>
    Build-Depends: base       >= 4.5   && < 4.17
                 , bytestring >= 0.9.2 && < 0.12
                 , binary     >= 0.5.1 && < 0.11
                 , deepseq    >= 1.2   && < 1.5

-- TODO: in lieu of using CPP to expose internals to the tests/benchmarks,
-- we should consider using:
--    <https://cabal.readthedocs.io/en/latest/cabal-package.html#sublibs>

Library
    Import:          library-build-depends
    Hs-Source-Dirs:  src
    Exposed-Modules: Data.Trie
                   , Data.Trie.Convenience
                   , Data.Trie.Internal
    Other-Modules:   Data.Trie.Internal.BitTwiddle
                   , Data.Trie.Internal.ByteString
                   , Data.Trie.Internal.Errors

----------------------------------------------------------------
-- See the cabal file for bytestring-lexing for more info about
-- setting up Tasty.
Test-Suite test-all
    Import:         library-build-depends
    Type:           exitcode-stdio-1.0
    Hs-Source-Dirs: dev
    -- NOTE: Test-Suite Main-Is is relative to Hs-Source-Dirs;
    -- unlike Executable Main-Is, which is relative to this cabal
    -- file's directory instead.
    Main-Is:        Test/Main.hs
    Other-Modules:  Shared.BaseCompat
                 ,  Test.Utils
                 ,  Test.Properties
                 -- Test.Validity
                 -- Test.ByteStringInternal
    -- We must include our own library for the tests to use it; but
    -- we must not give a version restriction lest Cabal give warnings.
    -- There's also bug <https://github.com/haskell/cabal/issues/5119>:
    -- if we don't pass -any, then Cabal will fill in ">= 0 && <= $ThisVersion"
    -- which will also give a warning.
    Build-Depends:  bytestring-trie   -any
                 ,  tasty             >= 0.10.1.2 && < 1.5
                 ,  tasty-smallcheck  >= 0.8.0.1  && < 0.9
                 ,  tasty-quickcheck  >= 0.8.3.2  && < 0.11
                 -- N.B., @tasty-hunit@ is just a partial API clone;
                 -- whereas @tasty-hunit-compat@ is a proper integration
                 -- with HUnit itself.  Also, tasty-hunit-compat actually
                 -- depends on tasty-hunit; if you're wanting to minimize
                 -- dependencies.
                 ,  tasty-hunit                      < 0.11
                 ,  QuickCheck        >= 2.10     && < 2.15
                 ,  smallcheck        >= 1.1.1    && < 1.3
                 -- lazysmallcheck    >= 0.6      && < 0.7

----------------------------------------------------------------
-- Can't put the "Type:" field in here; or rather even if we do,
-- it's still required in each of the Benchmark stanzas...
Common bench-common
    Import:         library-build-depends
    if impl(ghc)
      GHC-Options:  -with-rtsopts=-A32m
    -- TODO: this was recommended somewhere for benchmarks, but is
    -- --nonmoving-gc actually good for our use case? (It's
    -- concurrent-mark&sweep for the old generations; instead of
    -- the default stop-the-world generational copying collector)
    --if impl(ghc >= 8.10)
    --  GHC-Options:  -with-rtsopts=--nonmoving-gc
    if impl(ghc)
      GHC-Options:  -Wall -O2 -rtsopts
    Hs-Source-Dirs: dev
    Build-Depends:  bytestring-trie -any
                 -- TODO: try using @gauge@ instead of @criterion@,
                 -- to reduce the transitive dependencies.
                 -- BUG: @gauge@ depends on @basement@ which as of
                 -- version 0.0.12 doesn't support GHC 9.2; so we'll
                 -- have to revisit this later.
                 ,  criterion
                 ,  QuickCheck  >= 2.10  && < 2.15

Benchmark bench-Regression
    Import:         bench-common
    Type:           exitcode-stdio-1.0
    -- NOTE: Benchmark Main-Is behaves like Test-Suite Main-Is
    -- (not like Executable Main-Is).
    Main-Is:        Bench/Regression.hs
    if impl(ghc)
      GHC-Options:  -main-is Bench.Regression.main
    Other-Modules:  Shared.BaseCompat
                 ,  Bench.Foldable

Benchmark bench-Foldable
    Import:         bench-common
    Type:           exitcode-stdio-1.0
    Main-Is:        Bench/Foldable.hs
    if impl(ghc)
      GHC-Options:  -main-is Bench.Foldable.main
    Other-Modules:  Shared.BaseCompat

Benchmark bench-MatchOne
    Import:         bench-common
    Type:           exitcode-stdio-1.0
    Main-Is:        Bench/MatchOne.hs

Benchmark bench-UnionWith
    Import:         bench-common
    Type:           exitcode-stdio-1.0
    Main-Is:        Bench/UnionWith.hs

----------------------------------------------------------------
----------------------------------------------------------- fin.