MIT licensed by Li-yao Xia
Maintained by [email protected]
This version can be pinned in stack with:type-map-0.1.7.0@sha256:0950a70230efb4c52908154d3ca59217ea5987a89e4e115c36963344bfb797ce,2307

Module documentation for 0.1.7.0

Type-indexed maps Hackage Build Status

Maps whose keys are types.

This package includes:

  • a dynamic type map using GHC’s Typeable class, with a Proxy-based API (Data.TypeMap.Dynamic) or a TypeApplications-based API (Data.TypeMap.Dynamic.Alt); Supports arbitrary, user-defined mappings between keys and types of values via defunctionalization.

  • a static type map, whose type is indexed by its list of keys (there are actually multiple implementations with different underlying representations ([], Map, Vector)).

Example using the dynamically-typed interface.

See also this package’s description on Hackage.

Related

Internal module policy

Modules under Data.TypeMap.Internal are not subject to any versioning policy. Breaking changes may apply to them at any time.

If something in those modules seems useful, please report it or create a pull request to export it from an external module.

Changes

0.1.7.0

  • Compatibility with GHC 9. (Thanks to jlwoodwa)
  • Add alter. (Thanks to jlwoodwa)

0.1.6.0

  • Add toList, toListMap. (Thanks to deepfire)

0.1.5.0

  • Add role annotations for all the various type maps. Now the parameters have nominal roles.

    Previously, they had phantom roles, which broke uses of unsafeCoerce.

0.1.4.0

  • Add (<:) to Dynamic. (Thanks to deepfire)

0.1.3.0

  • Add update to Dynamic. (Thanks to deepfire)

0.1.2.0

  • Update Dynamic
    • Export empty
    • Add size, delete, union, difference, intersection

0.1.1.0

  • Compatible with GHC 8.2