cabal-version:      1.18
name:               data-findcycle
version:            0.1.0.0
synopsis:           Find cycles in periodic functions (and lists)
description:
  Any function @f :: a -> a@ where the type @a@ has finitely many values
  eventually has to be cyclic when iterated from some initial @a@.
  .
  This module provides a number of common algorithms and utilities to identify
  and work with such cycles.
homepage:           https://github.com/rafl/data-findcycle
license:            MIT
license-file:       LICENSE
author:             Florian Ragwitz
maintainer:         florian.ragwitz@gmail.com
copyright:          (c) 2025 Florian Ragwitz
category:           Data
build-type:         Simple
extra-doc-files:    CHANGELOG.md

source-repository head
  type: git
  branch: main
  location: https://github.com/rafl/data-findcycle

library
    exposed-modules:  Data.FindCycle
    build-depends:
        base >= 4.7 && < 4.23,
        containers >= 0.5 && < 0.9,
        hashable >= 1.2 && < 1.6,
        unordered-containers >= 0.2 && < 0.3
    hs-source-dirs:   src
    default-language: Haskell2010
    ghc-options: -Wall

test-suite data-findcycle-test
    default-language: Haskell2010
    type:             exitcode-stdio-1.0
    hs-source-dirs:   test
    main-is:          Main.hs
    build-depends:
        base,
        data-findcycle,
        QuickCheck >= 2.7 && < 2.16,
        primes >= 0.2 && < 0.3,
        tasty >= 0.10 && < 1.6,
        tasty-quickcheck >= 0.8 && < 0.12
    ghc-options: -Wall -threaded -rtsopts

benchmark data-findcycle-bench
    default-language: Haskell2010
    type:             exitcode-stdio-1.0
    hs-source-dirs:   bench
    main-is:          Main.hs
    build-depends:
        base,
        data-findcycle,
        tasty,
        tasty-bench >= 0.4 && < 0.5,
        primes,
        deepseq >= 1.5 && < 1.6
    ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-A64m -fproc-alignment=64