ouroboros-consensus-test-0.1.0.0: Tests of the consensus layer
Safe HaskellNone
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

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