packages feed

kleisli-0.0.2: kleisli.cabal

cabal-version:        2.4
name:                 kleisli
version:              0.0.2
synopsis:             Kleisli-like newtypes with different type parameter orderings
description:
  Three newtype wrappers around @p a (f b)@ with different type parameter
  orderings, enabling different type class instances depending on which
  parameter is last:
  .
  * @Kleisli p a f b@ — functor in @b@ (Functor, Applicative, Monad, etc.)
  * @ProKleisli p f a b@ — profunctor in @(a, b)@ (Profunctor, Category, Arrow, etc.)
  * @ContraKleisli p b f a@ — contravariant in @a@ (Contravariant, Divisible, Decidable)
  .
  All three are representationally identical and connected by isomorphisms.
  When @p@ is specialised to @(->)@, extensive instances are derived via
  @Star@, @ReaderT@, @Arrow.Kleisli@, and @Op@.
license:              BSD-3-Clause
license-file:         LICENCE
author:               Tony Morris <tmorris@tmorris.net>
maintainer:           Tony Morris <tmorris@tmorris.net>
category:             Data
build-type:           Simple
extra-doc-files:      changelog.md
                    , README.md
homepage:             https://gitlab.com/tonymorris/kleisli
bug-reports:          https://gitlab.com/tonymorris/kleisli/-/issues
tested-with:          GHC == 9.6.7

flag dev
  description:        Enable development warnings (-Werror, -O2 for benchmarks)
  manual:             True
  default:            False

source-repository     head
  type:               git
  location:           https://gitlab.com/tonymorris/kleisli.git

library
  exposed-modules:
                      Data.Kleisli

  build-depends:        base >= 4.8 && < 6
                      , adjunctions >= 4.3 && < 5
                      , comonad >= 5 && < 6
                      , contravariant >= 1 && < 2
                      , deepseq >= 1.4 && < 2
                      , distributive >= 0.5 && < 1
                      , lens >= 4 && < 6
                      , mtl >= 2.2 && < 3
                      , profunctors >= 5 && < 6
                      , selective >= 0.5 && < 1
                      , semigroupoids >= 5.2 && < 7
                      , transformers >= 0.5 && < 1

  hs-source-dirs:     src

  default-language:   Haskell2010

  ghc-options:        -Wall

  if flag(dev)
    ghc-options:      -Werror

benchmark bench
  type:               exitcode-stdio-1.0
  hs-source-dirs:     benchmarks
  main-is:            Main.hs
  build-depends:      base >= 4.8 && < 6
                    , tasty-bench >= 0.3 && < 1
                    , kleisli
                    , comonad >= 5 && < 6
                    , contravariant >= 1 && < 2
                    , profunctors >= 5 && < 6
                    , semigroupoids >= 5.2 && < 7
                    , transformers >= 0.5 && < 1
  default-language:   Haskell2010
  ghc-options:        -Wall

  if flag(dev)
    ghc-options:      -Werror -O2

test-suite doctest
  type:               exitcode-stdio-1.0
  hs-source-dirs:     test
  main-is:            Main.hs
  build-depends:      base >= 4.8 && < 6
                    , process >= 1 && < 2
  build-tool-depends: doctest:doctest >= 0.22 && < 1
  default-language:   Haskell2010
  ghc-options:        -Wall