cabal-version:       2.4
name:                type-errors-pretty
version:             0.0.1.0
synopsis:            Combinators for writing pretty type errors easily
description:
    This library provides replacements for the @ErrorMessage@ constructors to
    write the text of custom error messages easily.
homepage:            https://github.com/chshersh/type-errors-pretty
bug-reports:         https://github.com/chshersh/type-errors-pretty/issues
license:             MPL-2.0
license-file:        LICENSE
author:              Dmitrii Kovanikov
maintainer:          Dmitrii Kovanikov <kovanikov@gmail.com>
copyright:           2019 Dmitrii Kovanikov
category:            Types, Type Errors
build-type:          Simple
extra-doc-files:     README.md
                     CHANGELOG.md
tested-with:         GHC == 8.2.2
                     GHC == 8.4.4
                     GHC == 8.6.5
                     GHC == 8.8.1

source-repository head
  type:                git
  location:            https://github.com/chshersh/type-errors-pretty.git

common common-options
  build-depends:       base >= 4.10.1.0 && < 4.14
  ghc-options:         -Wall
                       -Wincomplete-uni-patterns
                       -Wincomplete-record-updates
                       -Wcompat
                       -Widentities
                       -Wredundant-constraints
                       -fhide-source-paths
  if impl(ghc >= 8.8.1)
    ghc-options:       -Wmissing-deriving-strategies
                       -Werror=missing-deriving-strategies

  default-language:    Haskell2010
  default-extensions:  ConstraintKinds
                       DeriveGeneric
                       GeneralizedNewtypeDeriving
                       InstanceSigs
                       KindSignatures
                       LambdaCase
                       OverloadedStrings
                       RecordWildCards
                       ScopedTypeVariables
                       StandaloneDeriving
                       TupleSections
                       TypeApplications
                       ViewPatterns

library
  import:              common-options
  hs-source-dirs:      src
  exposed-modules:     Type.Errors.Pretty

test-suite doctest
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Doctest.hs

  build-depends:       doctest ^>= 0.16
                     , Glob

  ghc-options:         -threaded