packages feed

quickcheck-classes-0.6.4.0: quickcheck-classes.cabal

name: quickcheck-classes
version: 0.6.4.0
synopsis: QuickCheck common typeclasses
description:
  This library provides QuickCheck properties to ensure
  that typeclass instances adhere to the set of laws that
  they are supposed to. There are other libraries that do
  similar things, such as `genvalidity-hspec` and `checkers`.
  This library differs from other solutions by not introducing
  any new typeclasses that the user needs to learn.
  .
  /Note:/ on GHC < 8.5, this library uses the higher-kinded typeclasses
  ('Data.Functor.Classes.Show1', 'Data.Functor.Classes.Eq1', 'Data.Functor.Classes.Ord1', etc.),
  but on GHC >= 8.5, it uses `-XQuantifiedConstraints` to express these
  constraints more cleanly.
homepage: https://github.com/andrewthad/quickcheck-classes#readme
license: BSD3
license-file: LICENSE
author: Andrew Martin, chessai
maintainer: andrew.thaddeus@gmail.com
copyright: 2018 Andrew Martin
category: Testing
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
extra-source-files: changelog.md

flag aeson
  description:
    You can disable the use of the `aeson` package using `-f-aeson`.
    .
    This may be useful for accelerating builds in sandboxes for expert users.
  default: True
  manual: True

flag semigroupoids
  description:
    You can disable the use of the `semigroupoids` package using `-f-semigroupoids`.
    .
    This may be useful for accelerating builds in sandboxes for expert users.
  default: True
  manual: True

flag semirings
  description:
    You can disable the use of the `semirings` package using `-f-semirings`.
    .
    This may be useful for accelerating builds in sandboxes for expert users.
  default: True
  manual: True

flag vector
  description:
    You can disable the use of the `vector` package using `-f-vector`.
    .
    This may be useful for accelerating builds in sandboxes for expert users.
  default: True
  manual: True

flag unary-laws
  description:
    Include infrastructure for testing class laws of unary type constructors.
    It is required that this flag match the value that the `unary-laws` flag
    was given when building `quickcheck-classes-base`.
  default: True
  manual: True

flag binary-laws
  description:
    Include infrastructure for testing class laws of binary type constructors.
    It is required that this flag match the value that the `unary-laws` flag
    was given when building `quickcheck-classes-base`. Disabling `unary-laws`
    while keeping `binary-laws` enabled is an unsupported configuration.
  default: True
  manual: True

library
  default-language: Haskell2010
  hs-source-dirs: src
  exposed-modules:
    Test.QuickCheck.Classes
    Test.QuickCheck.Classes.IsList
  other-modules:
    Test.QuickCheck.Classes.Alt
    Test.QuickCheck.Classes.Apply
    Test.QuickCheck.Classes.Euclidean
    Test.QuickCheck.Classes.Json
    Test.QuickCheck.Classes.MVector
    Test.QuickCheck.Classes.Plus
    Test.QuickCheck.Classes.Prim
    Test.QuickCheck.Classes.Semigroupoid
    Test.QuickCheck.Classes.Semiring
    Test.QuickCheck.Classes.Ring
  build-depends:
      base >= 4.5 && < 5
    , base-orphans >= 0.1
    , bifunctors
    , contravariant
    , QuickCheck >= 2.7
    , transformers >= 0.3 && < 0.6
    , primitive >= 0.6.4 && < 0.8
    , primitive-addr >= 0.1.0.2 && < 0.2
    , containers >= 0.4.2.1
    , semigroups >= 0.17
    , tagged
    , fail
    , quickcheck-classes-base >=0.6 && <0.7
  if impl(ghc > 7.4) && impl(ghc < 7.6)
    build-depends: ghc-prim
  if impl(ghc > 8.5)
    cpp-options: -DHAVE_QUANTIFIED_CONSTRAINTS
  if flag(unary-laws)
    build-depends:
        transformers >= 0.4.0
      , QuickCheck >= 2.10.0
    cpp-options: -DHAVE_UNARY_LAWS
  if flag(binary-laws)
    build-depends:
        transformers >= 0.5.0
      , QuickCheck >= 2.10.0
    cpp-options: -DHAVE_BINARY_LAWS
  if flag(aeson)
    build-depends: aeson >= 0.9
    cpp-options: -DHAVE_AESON
  if flag(semigroupoids)
    build-depends: semigroupoids
    cpp-options: -DHAVE_SEMIGROUPOIDS
  if flag(semirings)
    build-depends: semirings >= 0.4.2
    cpp-options: -DHAVE_SEMIRINGS
  if flag(vector)
    build-depends: vector >= 0.12
    cpp-options: -DHAVE_VECTOR

-- The basic test suite is compatible with all the versions of GHC that
-- this library supports. It is useful for confirming whether the laws tests
-- behave correct. Additionally, it helps catch CPP mistakes.
test-suite basic
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Spec.hs
  other-modules:
    Spec.ShowRead
  build-depends:
      base
    , base-orphans >= 0.5
    , quickcheck-classes
    , QuickCheck
    , containers
    , primitive
    , vector
    , transformers
    , tagged
  if impl(ghc > 8.5)
    cpp-options: -DHAVE_QUANTIFIED_CONSTRAINTS
  if flag(unary-laws)
    cpp-options: -DHAVE_UNARY_LAWS
  if flag(binary-laws)
    cpp-options: -DHAVE_BINARY_LAWS
  if flag(aeson)
    build-depends: aeson
    cpp-options: -DHAVE_AESON
  if flag(semigroupoids)
    build-depends: semigroupoids
    cpp-options: -DHAVE_SEMIGROUPOIDS
  if flag(vector)
    build-depends: vector >= 0.12
    cpp-options: -DHAVE_VECTOR
  default-language: Haskell2010

-- The advanced test suite only builds with the newest version
-- of GHC. It is intended to be a sort of regression test for GHC and for
-- base. It check instances for a number of types in base. It also checks
-- a bunch of derived instances for data types of varying sizes. And it
-- does some tests on UnboxedSums.
test-suite advanced
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Advanced.hs
  ghc-options: -O2
  build-depends:
      QuickCheck
    , base >= 4.12
    , base-orphans >= 0.5
    , containers
    , primitive
    , quickcheck-classes
    , tagged
    , tasty
    , tasty-quickcheck
    , transformers
    , vector
  if impl(ghc < 8.6)
    buildable: False
  default-language: Haskell2010

source-repository head
  type: git
  location: https://github.com/andrewthad/quickcheck-classes