cabal-version:      3.0
name:               nothunks
version:            0.3.0.0
synopsis:           Examine values for unexpected thunks
description:        Long lived application data typically should not contain
                    any thunks. This library can be used to examine values for
                    unexpected thunks, which can then be used in assertions.
                    This can be invaluable in avoiding memory leaks, or tracking
                    down existing ones.
license:            Apache-2.0
license-files:      LICENSE
                    NOTICE
bug-reports:        https://github.com/input-output-hk/nothunks
author:             IOG
maintainer:         Marcin Szamotulski <coot@coot.me>
copyright:          2018-2024 Input Output Global Inc (IOG)
category:           Development
extra-doc-files:    README.md CHANGELOG.md
tested-with:        GHC == {8.10, 9.0, 9.2, 9.4, 9.6, 9.8, 9.10}

source-repository head
  type:     git
  location: https://github.com/input-output-hk/nothunks

flag bytestring
  description: Provide instances for bytestring
  default: True
  manual: True

flag text
  description: Provide instances for text
  default: True
  manual: True

flag vector
  description: Provide instances for vector
  default: True
  manual: True

library
    exposed-modules:  NoThunks.Class

    build-depends:    base       >= 4.12 && < 5
                    , containers >= 0.5  && < 0.8
                    , stm        >= 2.5  && < 2.6
                    , time       >= 1.5  && < 1.13

                      -- Whatever is bundled with ghc
                    , ghc-heap

    if impl(ghc >= 9.2)
      build-depends:  wherefrom-compat ^>= 0.1.1

    if flag(bytestring)
      build-depends:  bytestring >= 0.10 && < 0.13
    if flag(text)
      build-depends:  text       >= 1.2  && < 1.3 || >= 2 && < 2.2
    if flag(vector)
      build-depends:  vector     >= 0.12 && < 0.14

    hs-source-dirs:   src
    default-language: Haskell2010
    ghc-options:      -Wall

test-suite nothunks-test
    type:             exitcode-stdio-1.0
    main-is:          Main.hs
    other-modules:    Test.NoThunks.Class

    build-depends:    base

                      -- Self dependency
                    , nothunks

                      -- Dependencies shared with the lib
                    , containers
                    , stm

                      -- Whatever is bundled with ghc
                    , ghc-prim

                      -- Additional dependencies
                    , hedgehog       >= 1.1 && < 1.5
                    , random         >= 1.1 && < 1.3
                    , tasty          >= 1.3 && < 1.6
                    , tasty-hedgehog >= 1.1 && < 1.5

    hs-source-dirs:   test
    default-language: Haskell2010
    ghc-options:      -Wall