Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Map which remembers the fromList
order.
This module is minimal on purpose.
Ordered map
Instances
Functor (OMap k) Source # | |
(Ord k, Arbitrary k) => Arbitrary1 (OMap k) Source # | |
Defined in Data.TreeDiff.OMap liftArbitrary :: Gen a -> Gen (OMap k a) # liftShrink :: (a -> [a]) -> OMap k a -> [OMap k a] # | |
Ord k => Semialign (OMap k) Source # |
|
(Eq k, Eq v) => Eq (OMap k v) Source # |
|
(Show k, Show v) => Show (OMap k v) Source # | Note: The instance uses |
(Ord k, Arbitrary k, Arbitrary v) => Arbitrary (OMap k v) Source # | |
(NFData k, NFData v) => NFData (OMap k v) Source # | |
Defined in Data.TreeDiff.OMap |
Conversions
toAscList :: OMap k v -> [(k, v)] Source #
>>>
toAscList $ fromList [('a', "alpha"), ('b', "beta"), ('g', "gamma")]
[('a',"alpha"),('b',"beta"),('g',"gamma")]
>>>
toAscList $ fromList [('g', "gamma"), ('b', "beta"), ('a', "alpha")]
[('a',"alpha"),('b',"beta"),('g',"gamma")]
toList :: OMap k v -> [(k, v)] Source #
O(n log n). List in creation order.
Doesn't respect Eq
instance.
>>>
toList $ fromList [('a', "alpha"), ('b', "beta"), ('g', "gamma")]
[('a',"alpha"),('b',"beta"),('g',"gamma")]
>>>
toList $ fromList [('g', "gamma"), ('b', "beta"), ('a', "alpha")]
[('g',"gamma"),('b',"beta"),('a',"alpha")]
fromList :: Ord k => [(k, v)] -> OMap k v Source #
>>>
fromList [('g', "gamma"), ('b', "beta"), ('a', "alpha")]
fromList [('g',"gamma"),('b',"beta"),('a',"alpha")]