packages feed

large-anon-0.4.0: large-anon.cabal

cabal-version:      2.4
name:               large-anon
version:            0.4.0
synopsis:           Scalable anonymous records
description:        The @large-anon@ package provides support for anonymous
                    records in Haskell, with a focus on compile-time (and
                    run-time) scalability.
bug-reports:        https://github.com/well-typed/large-records/issues
license:            BSD-3-Clause
author:             Edsko de Vries
maintainer:         edsko@well-typed.com
category:           Records
extra-doc-files:    CHANGELOG.md
                    test/Test/Sanity/RebindableSyntax/Tests.hs
tested-with:        GHC ==9.2.8
                    GHC ==9.4.8
                    GHC ==9.6.7
                    GHC ==9.8.4
                    GHC ==9.10.3
                    GHC ==9.12.4
                    GHC ==9.14.1

common lang
  build-depends:    base >= 4.16 && < 4.23
  default-language: GHC2021

  default-extensions:
      DataKinds
      DerivingStrategies
      ExplicitNamespaces
      FunctionalDependencies
      ImportQualifiedPost
      LambdaCase
      PatternSynonyms
      RecordWildCards
      RoleAnnotations
      TypeFamilies
      UndecidableInstances
      UndecidableSuperClasses
      ViewPatterns

  ghc-options:
      -Wall
      -Wno-unticked-promoted-constructors
      -Wprepositive-qualified-module
      -Wredundant-constraints
      -Wunused-packages
      -fno-show-valid-hole-fits

library
  import:         lang
  hs-source-dirs: src

  exposed-modules:
      Data.Record.Anon
      Data.Record.Anon.Advanced
      Data.Record.Anon.Overloading
      Data.Record.Anon.Plugin
      Data.Record.Anon.Plugin.Internal.Runtime
      Data.Record.Anon.Simple

  other-modules:
      -- Module organization:
      --
      -- o The modules in @Core.*@ can only import from other modules in
      --   @Core.*@ and modules in @Util.*@.
      -- o The modules in the rest of @Internal.*@ can import from @Core.*@ and
      --   @Util.*@, as well "Data.Record.Anon.Plugin.Internal.Runtime".
      --
      -- See detailed discussion in the runtime module.
      --

      Data.Record.Anon.Internal.Util.SmallHashMap
      Data.Record.Anon.Internal.Util.StrictArray

      Data.Record.Anon.Internal.Core.Canonical
      Data.Record.Anon.Internal.Core.Diff
      Data.Record.Anon.Internal.Core.FieldName

      Data.Record.Anon.Internal.Reflection
      Data.Record.Anon.Internal.Advanced
      Data.Record.Anon.Internal.Simple

      Data.Record.Anon.Internal.Plugin

      Data.Record.Anon.Internal.Plugin.TC.Constraints.AllFields
      Data.Record.Anon.Internal.Plugin.TC.Constraints.KnownFields
      Data.Record.Anon.Internal.Plugin.TC.Constraints.KnownHash
      Data.Record.Anon.Internal.Plugin.TC.Constraints.RowHasField
      Data.Record.Anon.Internal.Plugin.TC.Constraints.SubRow
      Data.Record.Anon.Internal.Plugin.TC.EquivClasses
      Data.Record.Anon.Internal.Plugin.TC.GhcTcPluginAPI
      Data.Record.Anon.Internal.Plugin.TC.NameResolution
      Data.Record.Anon.Internal.Plugin.TC.Parsing
      Data.Record.Anon.Internal.Plugin.TC.Rewriter
      Data.Record.Anon.Internal.Plugin.TC.Row.KnownField
      Data.Record.Anon.Internal.Plugin.TC.Row.KnownRow
      Data.Record.Anon.Internal.Plugin.TC.Row.ParsedRow
      Data.Record.Anon.Internal.Plugin.TC.Solver

      Data.Record.Anon.Internal.Plugin.Source
      Data.Record.Anon.Internal.Plugin.Source.FreshT
      Data.Record.Anon.Internal.Plugin.Source.GhcShim
      Data.Record.Anon.Internal.Plugin.Source.Names
      Data.Record.Anon.Internal.Plugin.Source.Options

  build-depends:
    , aeson            >= 1.4.4  && < 2.4
    , containers       >= 0.6.5  && < 0.9
    , deepseq          >= 1.4.6  && < 1.6
    , ghc              >= 9.2    && < 9.15
    , ghc-tcplugin-api >= 0.20.2 && < 0.21
    , hashable         >= 1.3    && < 1.6
    , mtl              >= 2.2.2  && < 2.4
    , optics-core      >= 0.3    && < 0.5
    , primitive        >= 0.8    && < 0.10
    , record-hasfield  >= 1.0    && < 1.1
    , sop-core         >= 0.5    && < 0.6
    , syb              >= 0.7    && < 0.8
    , tagged           >= 0.8.6  && < 0.10

      -- large-generics 0.2 starts using 'SmallArray' instead of 'Vector'
    , large-generics   >= 0.2   && < 0.3

  if flag(debug)
    build-depends:
      recover-rtti >= 0.4.1
    cpp-options:
      -DDEBUG

  if flag(enable-core-lint)
    ghc-options:
      -dcore-lint

  other-extensions:
      CPP
      AllowAmbiguousTypes

test-suite test-large-anon
  import:         lang
  type:           exitcode-stdio-1.0
  hs-source-dirs: test
  main-is:        TestLargeAnon.hs

  other-modules:
      Test.Infra.Discovery
      Test.Infra.DynRecord
      Test.Infra.DynRecord.Advanced
      Test.Infra.DynRecord.Simple
      Test.Infra.Generics
      Test.Infra.MarkStrictness
      Test.Prop.Record.Combinators.Constrained
      Test.Prop.Record.Combinators.Simple
      Test.Prop.Record.Diff
      Test.Prop.Record.Model
      Test.Prop.Record.Model.Generator
      Test.Prop.Record.Model.Orphans
      Test.Sanity.AllFields
      Test.Sanity.Applicative
      Test.Sanity.BlogPost
      Test.Sanity.CheckIsSubRow
      Test.Sanity.Discovery
      Test.Sanity.DuplicateFields
      Test.Sanity.Generics
      Test.Sanity.HasField
      Test.Sanity.Intersection
      Test.Sanity.Merging
      Test.Sanity.Named.Record1
      Test.Sanity.Named.Record2
      Test.Sanity.OverloadedRecordDot
      Test.Sanity.OverloadedRecordUpdate
      Test.Sanity.PolyKinds
      Test.Sanity.RebindableSyntax.Disabled
      Test.Sanity.RebindableSyntax.Enabled
      Test.Sanity.RecordLens
      Test.Sanity.Regression
      Test.Sanity.Simple
      Test.Sanity.SrcPlugin
      Test.Sanity.TypeLevelMetadata

  build-depends:
    , aeson
    , arrows
    , base
    , containers
    , large-anon
    , large-generics
    , mtl
    , QuickCheck
    , sop-core
    , Stream
    , tasty
    , tasty-hunit
    , tasty-quickcheck
    , text
    , validation-selective

  if impl(ghc < 9.10)
    -- Not sure why, but ghc warns about record-hasfield being unused,
    -- despite it actually being required. So for now we just disable this check.
    ghc-options: -Wno-unused-packages
    build-depends:
      , record-dot-preprocessor
        -- dependencies of the blog post example (which uses RDP)
      , aeson-pretty
      , bytestring
      , optics-core
      , parsec
      , record-hasfield
  else
    cpp-options:
      -DNO_RECORD_DOT_PREPROCESSOR

  if flag(enable-core-lint)
    ghc-options:
      -dcore-lint

  other-extensions:
      Arrows
      CPP
      NPlusKPatterns
      OverloadedLabels
      OverloadedLists
      OverloadedRecordDot
      OverloadedRecordUpdate
      OverloadedStrings
      RebindableSyntax

Flag debug
  Description: Enable internal debugging features
  Default: False
  Manual: True

Flag enable-core-lint
  Description: Debugging: Enable GHC's core linter
  Default: False
  Manual: True