ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Util.InvertedMap

Synopsis

InvertedMap type

data InvertedMap v k Source #

An inverted Map

INVARIANT the ks are all unique

INVARIANT the NonEmptys are all ascending

Instances

Instances details
(Show v, Show k) ⇒ Show (InvertedMap v k) Source # 
Instance details

Defined in Test.Util.InvertedMap

Methods

showsPrecIntInvertedMap v k → ShowS #

showInvertedMap v k → String #

showList ∷ [InvertedMap v k] → ShowS #

Query

Construction

toMapOrd k ⇒ InvertedMap v k → Map k v Source #

This inverts the given InvertedMap

Inversion is an https://en.wikipedia.org/wiki/Involution_(mathematics), so this returns to Map.

Conversion

fromMapOrd v ⇒ Map k v → InvertedMap v k Source #

This inverts the given Map

Filter

spanAntitone ∷ (v → Bool) → InvertedMap v k → (InvertedMap v k, InvertedMap v k) Source #

Min/Max