name:                threads-supervisor
version:             1.2.0.1
synopsis:            Simple, IO-based library for Erlang-style thread supervision
description:         Simple, IO-based library for Erlang-style thread supervision
license:             MIT
license-file:        LICENSE
author:              Alfredo Di Napoli
maintainer:          alfredo.dinapoli@gmail.com
copyright:           Alfredo Di Napoli
category:            Concurrency
build-type:          Simple
cabal-version:       >=1.10

source-repository head
  type: git
  location: https://github.com/adinapoli/threads-supervisor

flag prof
  default: False

library
  exposed-modules:
    Control.Concurrent.Supervisor
    Control.Concurrent.Supervisor.Bounded
    Control.Concurrent.Supervisor.Types
    Control.Concurrent.Supervisor.Tutorial
  build-depends:
    base                 >= 4.6 && < 6,
    clock                >= 0.6,
    unordered-containers >= 0.2.0.0 && < 0.5.0.0,
    retry                >= 0.7 && < 0.10,
    transformers         >= 0.4 && < 0.6,
    stm                  >= 2.5,
    time                 >= 1.2
  hs-source-dirs: src
  if flag(prof)
    ghc-options: -fprof-auto -auto-all -caf-all
  default-language:    Haskell2010
  ghc-options:
    -Wall
    -funbox-strict-fields

executable threads-supervisor-example
  build-depends:
    base                 >= 4.6 && < 6,
    threads-supervisor   -any,
    unordered-containers >= 0.2.0.0 && < 0.5.0.0,
    stm                  >= 2.4,
    time                 >= 1.2
  hs-source-dirs:
    examples
  main-is:
    Main.hs
  default-language:    Haskell2010
  if flag(prof)
    ghc-options:
                -Wall
                -fprof-auto
                -rtsopts
                -auto-all
                -caf-all
                -threaded
                "-with-rtsopts=-N -K1K"
  else
    ghc-options:
        -Wall
        -threaded
        "-with-rtsopts=-N"
        -funbox-strict-fields

test-suite threads-supervisor-tests
  type:
    exitcode-stdio-1.0
  main-is:
    Main.hs
  other-modules:
    Tests
    Tests.Bounded
  hs-source-dirs:
    test
  default-language:
    Haskell2010
  if flag(prof)
    ghc-options:
      -fprof-auto
      -rtsopts
      -auto-all
      -caf-all
      -threaded
      "-with-rtsopts=-N -K1K"
  else
    ghc-options:
        -threaded
        "-with-rtsopts=-N"
  build-depends:
      threads-supervisor -any
    , base
    , bytestring
    , retry
    , QuickCheck
    , tasty >= 0.9.0.1
    , tasty-quickcheck
    , tasty-hunit
    , time
    , stm
    , transformers