name:                haskell-list-builder
synopsis:            Fast Sequencing and Building Lists using Unsafe Primitives
description:
  Extra unsafe sequencing of IO actions from [Twan van Laarhoven](https://www.twanvl.nl/blog/haskell/unsafe-sequence)
  packaged up, along with `unfoldIO` and an implementation of Scala's List Buffer. This means we can have tail
  recursive `sequence` and `traverse` specialised for lists of IO actions.
  .
  For algorithms which are more easily written in a mutable way we have `ListBuilder s a`. A `ListBuilder s a`
  is like a wrapper around an `ST s [a]`, but with a constant time append as well as prepend.
version:             0.1.0.0
license:             BSD3
license-file:        LICENSE
author:              Huw Campbell
maintainer:          huw.campbell@gmail.com
cabal-version:       >=1.10
build-type:          Simple
extra-source-files:  CHANGELOG.md
homepage:            https://tangled.org/@huwcampbell.com/haskell-list-builder
bug-reports:         https://tangled.org/@huwcampbell.com/haskell-list-builder/issues

library
  build-depends:     base     >= 3 && < 5
                   , ghc-prim
                   , primitive

  hs-source-dirs:    src
  c-sources:         cbits/set_field.cmm
  default-language:  Haskell2010

  exposed-modules:   Data.ListBuilder
                     Data.Traversable.IO

  other-modules:     Data.ListBuilder.Unsafe
  ghc-options:
    -Wall


test-suite tests
  type:                exitcode-stdio-1.0
  main-is:             test.hs
  hs-source-dirs:      tests
  default-language:    Haskell2010
  ghc-options:
    -Wall -threaded

  build-depends:       base
                     , haskell-list-builder
                     , hedgehog


benchmark bench
  type:                 exitcode-stdio-1.0
  hs-source-dirs:       benchmarks
  main-is:              Main.hs
  default-language:     Haskell2010

  ghc-options:
    -Wall -threaded

  build-depends:        base
                      , haskell-list-builder
                      , criterion
                      , dlist
