packages feed

streamly-flatparse-0.1.0.0: streamly-flatparse.cabal

cabal-version:   3.12
name:            streamly-flatparse
version:         0.1.0.0
synopsis:        Run flatparse parsers on Streamly streams of byte arrays
description:
  flatparse parsers are fast, but need their whole input in one piece.
  This library runs them on a stream of byte arrays, as they come from a
  socket or a file: it gathers the arrays until the parser succeeds, or
  until a delimiter, within a size, and gives back the stream that follows
  what was parsed.

homepage:        https://github.com/GuillaumedeVolpiano/streamly-flatparse
license:         BSD-3-Clause
license-file:    LICENSE
author:          Xavier Dectot
maintainer:      Xavier Dectot <xavier@wheredoibegin.fr>
category:        Parsing, Streamly
build-type:      Simple
tested-with:     GHC ==9.8.4 || ==9.10.3 || ==9.12.4
extra-doc-files:
  CHANGELOG.md
  README.md

source-repository head
  type:     git
  location: https://github.com/GuillaumedeVolpiano/streamly-flatparse.git

common shared
  default-language:   GHC2021
  default-extensions:
    DataKinds
    DerivingStrategies
    DisambiguateRecordFields
    DuplicateRecordFields
    ExplicitNamespaces
    GADTs
    LambdaCase
    MonoLocalBinds
    NoFieldSelectors
    OverloadedRecordDot
    OverloadedStrings
    RoleAnnotations

  ghc-options:
    -Wall -Wcompat -Wredundant-constraints -Wmissing-deriving-strategies
    -Wunused-packages

library
  import:          shared
  hs-source-dirs:  src
  exposed-modules: Streamly.External.FlatParse
  build-depends:
    , base                 >=4.19 && <4.22
    , bytestring           ^>=0.12
    , flatparse            ^>=0.5
    , streamly-bytestring  ^>=0.2.3
    , streamly-core        ^>=0.3.3

test-suite streamly-flatparse-test
  import:         shared
  type:           exitcode-stdio-1.0
  hs-source-dirs: test
  main-is:        Main.hs
  ghc-options:    -threaded
  build-depends:
    , base
    , bytestring
    , flatparse
    , streamly-bytestring
    , streamly-core
    , streamly-flatparse
    , tasty                ^>=1.5
    , tasty-hunit          ^>=0.10
    , tasty-quickcheck     ^>=0.11

-- What gathering the arrays costs, over flatparse alone. Run it by hand,
-- with cabal bench.
benchmark streamly-flatparse-bench
  import:         shared
  type:           exitcode-stdio-1.0
  hs-source-dirs: bench
  main-is:        Main.hs
  ghc-options:    -threaded
  build-depends:
    , base
    , bytestring
    , flatparse
    , streamly-bytestring
    , streamly-core
    , streamly-flatparse
    , tasty-bench          >=0.4 && <0.6