~fgaz/bimap-many

0b2ba2462eb6c9d4b9120f0042794a5f9a363c6e — Francesco Gazzetta 1 year, 6 months ago 4743892
Document the main types
3 files changed, 7 insertions(+), 2 deletions(-)

M bimap-many.cabal
M src/Data/BimapMany.hs
M src/Data/BimapMany/Extended.hs
M bimap-many.cabal => bimap-many.cabal +2 -2
@@ 5,14 5,14 @@ synopsis:           Bidirectional many-to-many mapping between two key types
description:
    A data structure representing a bidirectional mapping between two key types.
    Each key in the bimap is associated with at least one of the opposite type.
    Finally, each pair of keys is associated with a value type.
    In the extended version, each pair of keys is associated with a value type.

    @bimap-many@ is a many-to-many map. For a one-to-one map,
    see [@bimap@](https://hackage.haskell.org/package/bimap)

    Documentation links on Hackage may not appear due to backpack, so here's
    a link to the indefinite module's docs, which may be there instead:
    "Data.BimapMany".
    "Data.BimapMany" "Data.BimapMany.Extended".
homepage:           https://sr.ht/~fgaz/bimap-many
bug-reports:        https://todo.sr.ht/~fgaz/bimap-many
license:            BSD-3-Clause

M src/Data/BimapMany.hs => src/Data/BimapMany.hs +2 -0
@@ 62,6 62,8 @@ import Data.Maybe (fromMaybe)
-- * BimapMany type
-------------------

-- | Bidirectional map between key @a@ and key @b@.
-- Each key in the bimap is associated with at least one of the opposite type.
data BimapMany a b = BimapMany
  !(MS.Map a (Set b)) -- l
  !(MS.Map b (Set a)) -- r

M src/Data/BimapMany/Extended.hs => src/Data/BimapMany/Extended.hs +3 -0
@@ 95,6 95,9 @@ import Data.Maybe (fromMaybe)
-- When operating on l and r, the Map value is another set structure, not a
-- BimapMany value (c), so operations should be strict.

-- | Bidirectional map between key @a@ and key @b@.
-- Each key in the bimap is associated with at least one of the opposite type.
-- Each pair of keys is associated with a value of type @c@.
data BimapMany a b c = BimapMany
  !(MS.Map a (Set b)) -- l
  !(MS.Map b (Set a)) -- r