packages feed

named-text-1.1.2.0: named-text.cabal

cabal-version:      2.4
name:               named-text
version:            1.1.2.0
synopsis:           A parameterized named text type and associated functionality.
description:
  .
  A plain String or Text is dangerous because it can be arbitrarily combined,
  converted, emitted, and updated without consideration of the validity and
  applicability of the contents and the usage scenario.
  .
  This module provides a Named type wrapper around Text which has two
  additional type parameters: one which indicates what the content of the Text
  represents, and one which indicates the style of the name.
  .
  There are additionally functions and classes which allow conversions and
  transformations between names with different styles and types (or disallow them
  where appropriate).
  .
  The core intent of this library is that the Named is used instead of a raw
  String or Text to provide type-level tracking and safety.

-- bug-reports:
license:            ISC
license-file:       LICENSE
author:             Kevin Quick
maintainer:         kquick@galois.com
copyright:          Galois Inc, 2023
category:           Data
build-type:         Simple
extra-doc-files:    CHANGELOG.md
tested-with:        GHC == 9.4.4, GHC == 9.2.4, GHC == 9.0.2, GHC == 8.10.7, GHC == 8.8.4

source-repository head
  type: git
  location: https://github.com/kquick/named-text


flag with-json
  description: Build optional Data.Text.JSON module with JSON Named style support
  default: True
  manual: False
  -- This flag allows using named-text without the additional dependencies
  -- introduced by aeson when JSON translation is not needed.


common bldspec
  ghc-options:  -Wall
                -Wcompat
                -Wincomplete-uni-patterns
                -Wsimplifiable-class-constraints
                -Wpartial-fields
                -fhide-source-paths
                -O2
                -flate-specialise
                -fspecialise-aggressively

library
    import:           bldspec
    hs-source-dirs:   .
    default-language: Haskell2010
    build-depends:    base >= 4.13 && < 4.18
                    , deepseq
                    , hashable
                    , prettyprinter >= 1.7.0 && < 1.8
                    , sayable >= 1.0 && < 1.2
                    , text
    exposed-modules:  Data.Name
    if flag(with-json)
      build-depends: aeson >= 1.5 && < 2.2
      exposed-modules: Data.Name.JSON


test-suite namedTests
    import:           bldspec
    default-language: Haskell2010
    type:             exitcode-stdio-1.0
    hs-source-dirs:   test
    main-is:          Test.hs
    build-depends:    base
                    , hspec
                    , named-text
                    , parameterized-utils >= 2.1 && < 2.2
                    , prettyprinter
                    , sayable
                    , tasty >= 1.4 && < 1.5
                    , tasty-ant-xml >= 1.1 && < 1.2
                    , tasty-checklist >= 1.0 && < 1.1
                    , tasty-hspec >= 1.2 && < 1.3
                    , text
                    , unordered-containers
    if flag(with-json)
      build-depends: aeson >= 1.5 && < 2.2
                   , bytestring