packages feed

cfg-0.0.2.0: cfg.cabal

cabal-version: 3.0
name:          cfg
version:       0.0.2.0
synopsis:
  Type directed application configuration parsing and accessors

description:
  `cfg` is a library that provides Generic machinery for generating configuration accessors, 
  and parsers from Haskell types. This package is intended to be used to build out additional 
  "sources" for configuration access, the environment source is provided in this package as a default.

category:      Configuration
bug-reports:   https://github.com/JonathanLorimer/cfg/issues
homepage:      https://github.com/JonathanLorimer/cfg#readme
license:       MIT
license-file:  LICENSE
copyright:     (c) 2023 Jonathan Lorimer
author:        Jonathan Lorimer
maintainer:    Jonathan Lorimer <jonathanlorimer@pm.me>
build-type:    Simple

source-repository head
  type:     git
  location: https://github.com/JonathanLorimer/cfg

common common-opts
  default-extensions:
    AllowAmbiguousTypes
    BlockArguments
    ConstraintKinds
    DataKinds
    DeriveAnyClass
    DeriveFunctor
    DeriveGeneric
    DerivingStrategies
    DerivingVia
    EmptyCase
    FlexibleContexts
    FlexibleInstances
    GADTs
    GeneralizedNewtypeDeriving
    ImportQualifiedPost
    InstanceSigs
    KindSignatures
    LambdaCase
    MultiParamTypeClasses
    MultiWayIf
    NamedFieldPuns
    NumericUnderscores
    OverloadedStrings
    PolyKinds
    RecordWildCards
    ScopedTypeVariables
    StandaloneDeriving
    TupleSections
    TypeApplications
    TypeFamilies
    TypeOperators
    UndecidableInstances

  build-depends:
    , base           >=4.18.0 && <4.19
    , containers     >=0.6.7  && <0.7
    , free           >=5.1.10 && <5.2
    , mtl            >=2.3.1  && <2.4
    , pretty-simple  >=4.1.2  && <4.2
    , text           >=2.0.2  && <2.1

  default-language:   Haskell2010

library
  import:          common-opts
  build-depends:
    , bytestring  >=0.11.4 && <0.12
    , errors      >=2.3.0  && <2.4
    , megaparsec  >=9.2.2  && <9.3
    , vector      >=0.12.3 && <0.13

  -- cabal-fmt: expand src
  exposed-modules:
    Cfg
    Cfg.Deriving
    Cfg.Deriving.Assert
    Cfg.Deriving.Config
    Cfg.Deriving.KeyModifier
    Cfg.Deriving.Value
    Cfg.Env
    Cfg.Env.Keys
    Cfg.Options
    Cfg.Parser
    Cfg.Parser.Config
    Cfg.Parser.Value
    Cfg.Source
    Cfg.Source.Config
    Cfg.Source.Default
    KeyTree

  hs-source-dirs:  src
  ghc-options:     -Wall -fdefer-typed-holes

test-suite cfg-tests
  import:         common-opts
  type:           exitcode-stdio-1.0
  hs-source-dirs: test
  ghc-options:
    -Wall -threaded -rtsopts -with-rtsopts=-N -fdefer-typed-holes

  main-is:        Main.hs

  -- cabal-fmt: expand test -Main
  other-modules:
    Cfg.Deriving.KeyModifierSpec
    Cfg.Env.KeysSpec
    Cfg.EnvSpec
    Cfg.ParserSpec
    Cfg.SourceSpec
    Spec

  build-depends:
    , cfg
    , hedgehog            >=1.2   && <1.3
    , hspec               >=2.9.7 && <2.10
    , hspec-core          >=2.9.7 && <2.10
    , hspec-discover      >=2.9.7 && <2.10
    , hspec-expectations  >=0.8.2 && <0.9
    , hspec-hedgehog      >=0.0.1 && <0.1

test-suite documentation
  import:         common-opts
  type:           exitcode-stdio-1.0
  hs-source-dirs: doctest
  ghc-options:    -Wall -threaded -rtsopts -with-rtsopts=-N
  main-is:        Main.hs
  build-depends:
    , cfg
    , doctest  >=0.21.1 && <0.22