cardano-data-0.1.0.0: Specialized data for Cardano project
Safe Haskell None
Language Haskell2010

Data.BiMap

Synopsis

Documentation

data BiMap v a b where Source #

Constructors

MkBiMap :: v ~ b => !( Map a b) -> !( Map b ( Set a)) -> BiMap v a b

Instances

Instances details
( Eq k, Eq v) => Eq ( BiMap u k v) Source #
Instance details

Defined in Data.BiMap

( Show k, Show v) => Show ( BiMap u k v) Source #
Instance details

Defined in Data.BiMap

( Ord a, Ord b, ToCBOR a, ToCBOR b) => ToCBOR ( BiMap b a b) Source #
Instance details

Defined in Data.BiMap

( Ord a, Ord b, FromCBOR a, FromCBOR b) => FromCBOR ( BiMap b a b) Source #
Instance details

Defined in Data.BiMap

NFData ( BiMap v a b) Source #
Instance details

Defined in Data.BiMap

Methods

rnf :: BiMap v a b -> () Source #

( NoThunks a, NoThunks b) => NoThunks ( BiMap v a b) Source #
Instance details

Defined in Data.BiMap

( Ord a, Ord b, FromCBOR a, FromCBOR b) => FromSharedCBOR ( BiMap b a b) Source #
Instance details

Defined in Data.Sharing

Associated Types

type Share ( BiMap b a b) Source #

type Share ( BiMap b a b) Source #
Instance details

Defined in Data.Sharing

decodeMapAsBimap :: ( FromCBOR a, FromCBOR b, Ord a, Ord b) => Decoder s ( BiMap b a b) Source #

Decode a serialised CBOR Map as a Bimap

insertWithBiMap :: ( Ord k, Ord v) => (v -> v -> v) -> k -> v -> BiMap v k v -> BiMap v k v Source #

biMapFromList :: ( Ord k, Ord v) => (v -> v -> v) -> [(k, v)] -> BiMap v k v Source #

mapflip :: (v -> v -> v) -> v -> v -> v Source #

biMapFromAscDistinctList :: ( Ord k, Ord v) => [(k, v)] -> BiMap v k v Source #

Warning - invariant that keys are distinct and in ascending order is not checked. Make sure it is not violated, otherwise crazy things will happen.