packages feed

typerep-map-0.7.0.0: typerep-map.cabal

cabal-version:       2.4
name:                typerep-map
version:             0.7.0.0
synopsis:            Efficient implementation of a dependent map with types as keys
description:
    A dependent map from type representations to values of these types.
    .
    Here is an illustration of such a map:
    .
    >     TMap
    > ---------------
    >  Int  -> 5
    >  Bool -> True
    >  Char -> 'x'
    .
    In addition to @TMap@, we provide @TypeRepMap@ parametrized by a
    @vinyl@-style interpretation. This data structure is equivalent to @DMap
    TypeRep@, but with significantly more efficient lookups.

homepage:            https://github.com/kowainik/typerep-map
bug-reports:         https://github.com/kowainik/typerep-map/issues
license:             MPL-2.0
license-file:        LICENSE
author:              Veronika Romashkina, Vladislav Zavialov, Dmitrii Kovanikov
maintainer:          Kowainik <xrom.xkov@gmail.com>
copyright:           2017-2026 Kowainik
category:            Data, Data Structures, Types
build-type:          Simple
extra-doc-files:     README.md
                   , CHANGELOG.md
tested-with:         GHC == 8.8.4
                   , GHC == 8.10.7
                   , GHC == 9.0.2
                   , GHC == 9.2.4
                   , GHC == 9.4.8
                   , GHC == 9.6.7
                   , GHC == 9.8.4
                   , GHC == 9.10.1
                   , GHC == 9.12.2

source-repository head
  type:                git
  location:            https://github.com/kowainik/typerep-map.git

common common-options
  build-depends:       base >= 4.13 && < 4.22

  default-language:    Haskell2010
  default-extensions:  BangPatterns
                       DerivingStrategies
                       OverloadedStrings
                       RecordWildCards
                       ScopedTypeVariables
                       TypeApplications
  ghc-options:         -Wall
                       -Wcompat
                       -Widentities
                       -Wincomplete-uni-patterns
                       -Wincomplete-record-updates
                       -Wredundant-constraints
                       -fhide-source-paths
  if impl(ghc >= 8.4)
    ghc-options:       -Wmissing-export-lists
                       -Wpartial-fields
  if impl(ghc >= 8.8)
    ghc-options:       -Wmissing-deriving-strategies
                       -Werror=missing-deriving-strategies
  if impl(ghc >= 8.10)
    ghc-options:       -Wunused-packages
  if impl(ghc >= 9.0)
    ghc-options:       -Winvalid-haddock
  if impl(ghc >= 9.2)
    ghc-options:       -Wredundant-bang-patterns
                       -Woperator-whitespace
  if impl(ghc >= 9.4  && < 9.10)
    ghc-options:       -Wforall-identifier
  if impl(ghc >= 9.4)
    ghc-options:       -Wredundant-strictness-flags
  if impl(ghc >= 9.8)
    ghc-options:       -Wterm-variable-capture
                       -Winconsistent-flags
  if impl(ghc >= 9.10)
    ghc-options:       -Wincomplete-record-selectors
                       -Wdeprecated-type-abstractions
                       -Wdata-kinds-tc
                       -Wdefaulted-exception-context
  if impl(ghc >= 9.12)
    ghc-options:       -Wview-pattern-signatures

library
  import:              common-options
  hs-source-dirs:      src
  exposed-modules:     Data.TMap
                       Data.TypeRepMap
                       Data.TypeRepMap.Internal

  build-depends:       ghc-prim >= 0.5 && < 0.14
                     , primitive >= 0.7.0 && < 0.10
                     , deepseq >= 1.4 && < 1.7

library typerep-extra-impls
  import:              common-options
  hs-source-dirs:      typerep-extra-impls
  exposed-modules:     Data.TypeRep.CMap
                       Data.TypeRep.OptimalVector
                       Data.TypeRep.Vector

  build-depends:       containers >= 0.6 && < 0.9
                     , vector >= 0.12.0.1 && < 0.14
                     , deepseq >= 1.4 && < 1.7

test-suite typerep-map-test
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test

  main-is:             Test.hs
  other-modules:       Test.TypeRep.CMap
                     , Test.TypeRep.TypeRepMap
                     , Test.TypeRep.TypeRepMapProperty
                     , Test.TypeRep.Vector
                     , Test.TypeRep.VectorOpt

  build-depends:       ghc-typelits-knownnat >= 0.4.2 && < 0.9
                     , hedgehog >= 1.0 && < 1.8
                     , hspec >= 2.7.1 && < 2.12
                     , hspec-hedgehog >= 0.0.1 && < 0.4
                     , typerep-map
                     , typerep-extra-impls

  ghc-options:         -threaded -rtsopts -with-rtsopts=-N

benchmark typerep-map-benchmark
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      benchmark

  main-is:             Main.hs
  other-modules:       CMap
                     , CacheMap
                     , DMap
                     , Spec
                     , Vector
                     , OptimalVector

  build-depends:       criterion >= 1.4.1.0 && < 1.7
                     , dependent-map >= 0.2.4.0 && < 0.5
                     , dependent-sum >= 0.5 && < 0.8
                     , deepseq
                     , ghc-typelits-knownnat >= 0.4.2 && < 0.9
                     , typerep-map
                     , typerep-extra-impls

  ghc-options:         -O2 -threaded -rtsopts -with-rtsopts=-N -freduction-depth=0