Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data T k a
- insert :: Ord k => k -> a -> Map k a -> T k a
- insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> T k a
- singleton :: k -> a -> T k a
- member :: Ord k => k -> T k a -> Bool
- size :: T k a -> Int
- elems :: T k a -> T [] a
- keys :: T k a -> T [] k
- keysSet :: Ord k => T k a -> T k
- lookup :: Ord k => k -> T k a -> Maybe a
- delete :: Ord k => k -> T k a -> Map k a
- minViewWithKey :: T k a -> ((k, a), Map k a)
- maxViewWithKey :: Ord k => T k a -> ((k, a), Map k a)
- fromList :: Ord k => T [] (k, a) -> T k a
- fromListWith :: Ord k => (a -> a -> a) -> T [] (k, a) -> T k a
- fromAscList :: Ord k => T [] (k, a) -> T k a
- toAscList :: T k a -> T [] (k, a)
- fetch :: Ord k => Map k a -> Maybe (T k a)
- flatten :: Ord k => T k a -> Map k a
- union :: Ord k => T k a -> T k a -> T k a
- unionLeft :: Ord k => Map k a -> T k a -> T k a
- unionRight :: Ord k => T k a -> Map k a -> T k a
- unionWith :: Ord k => (a -> a -> a) -> T k a -> T k a -> T k a
- unionLeftWith :: Ord k => (a -> a -> a) -> Map k a -> T k a -> T k a
- unionRightWith :: Ord k => (a -> a -> a) -> T k a -> Map k a -> T k a
- map :: Ord k => (a -> b) -> T k a -> T k b
- mapWithKey :: Ord k => (k -> a -> b) -> T k a -> T k b
Documentation
Instances
Ord k => Foldable (T k) Source # | |
Defined in Data.NonEmpty.Map fold :: Monoid m => T k m -> m # foldMap :: Monoid m => (a -> m) -> T k a -> m # foldMap' :: Monoid m => (a -> m) -> T k a -> m # foldr :: (a -> b -> b) -> b -> T k a -> b # foldr' :: (a -> b -> b) -> b -> T k a -> b # foldl :: (b -> a -> b) -> b -> T k a -> b # foldl' :: (b -> a -> b) -> b -> T k a -> b # foldr1 :: (a -> a -> a) -> T k a -> a # foldl1 :: (a -> a -> a) -> T k a -> a # elem :: Eq a => a -> T k a -> Bool # maximum :: Ord a => T k a -> a # | |
Ord k => Traversable (T k) Source # | |
Ord k => Functor (T k) Source # | |
(Arbitrary k, Ord k) => Arbitrary (T k) Source # | |
(Arbitrary k, Ord k) => Gen (T k) Source # | |
NFData k => NFData (T k) Source # | |
(Arbitrary k, Ord k, Arbitrary a) => Arbitrary (T k a) Source # | |
(Show k, Show a) => Show (T k a) Source # | |
(NFData k, NFData a) => NFData (T k a) Source # | |
Defined in Data.NonEmpty.Map | |
(Eq k, Eq a) => Eq (T k a) Source # | |
(Ord k, Ord a) => Ord (T k a) Source # | |
insert :: Ord k => k -> a -> Map k a -> T k a Source #
\k a -> forAllMap $ \m -> Map.insert k a m == NonEmptyMap.flatten (NonEmptyMap.insert k a m)
insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> T k a Source #
\k a -> forAllMap $ \m -> Map.insertWith (++) k a m == NonEmptyMap.flatten (NonEmptyMap.insertWith (++) k a m)
delete :: Ord k => k -> T k a -> Map k a Source #
\k -> forAllNonEmptyMap $ \m -> Map.delete k (NonEmptyMap.flatten m) == NonEmptyMap.delete k m
minViewWithKey :: T k a -> ((k, a), Map k a) Source #
fromList :: Ord k => T [] (k, a) -> T k a Source #
Warning: Dangerous because it silently drops colliding key/value pairs. Better use fromListWith.
\xs -> Map.fromList (NonEmpty.flatten xs) == NonEmptyMap.flatten (NonEmptyMap.fromList (xs::NonEmpty.T [] (Int,Char)))
fromListWith :: Ord k => (a -> a -> a) -> T [] (k, a) -> T k a Source #
\xs -> Map.fromListWith (++) (NonEmpty.flatten xs) == NonEmptyMap.flatten (NonEmptyMap.fromListWith (++) (xs::NonEmpty.T [] (Int,String)))
fromAscList :: Ord k => T [] (k, a) -> T k a Source #
forAllNonEmptyMap $ \m -> NonEmptyMap.fromAscList (NonEmptyMap.toAscList m) == m
toAscList :: T k a -> T [] (k, a) Source #
forAllNonEmptyMap $ \m -> NonEmpty.flatten (NonEmptyMap.toAscList m) == Map.toAscList (NonEmptyMap.flatten m)
union :: Ord k => T k a -> T k a -> T k a Source #
Warning: Dangerous because it silently drops colliding key/value pairs. Better use unionWith.
forAllNonEmptyMap $ \xs -> forAllNonEmptyMap $ \ys -> Map.union (NonEmptyMap.flatten xs) (NonEmptyMap.flatten ys) == NonEmptyMap.flatten (NonEmptyMap.union xs ys)
unionLeft :: Ord k => Map k a -> T k a -> T k a Source #
Warning: Dangerous because it silently drops colliding key/value pairs. Better use unionLeftWith.
forAllMap $ \xm -> forAllNonEmptyMap $ \ym -> Map.union xm (NonEmptyMap.flatten ym) == NonEmptyMap.flatten (NonEmptyMap.unionLeft xm ym)
unionRight :: Ord k => T k a -> Map k a -> T k a Source #
Warning: Dangerous because it silently drops colliding key/value pairs. Better use unionRightWith.
forAllNonEmptyMap $ \xm -> forAllMap $ \ym -> Map.union (NonEmptyMap.flatten xm) ym == NonEmptyMap.flatten (NonEmptyMap.unionRight xm ym)
unionWith :: Ord k => (a -> a -> a) -> T k a -> T k a -> T k a Source #
forAllNonEmptyMap $ \xs -> forAllNonEmptyMap $ \ys -> Map.unionWith (++) (NonEmptyMap.flatten xs) (NonEmptyMap.flatten ys) == NonEmptyMap.flatten (NonEmptyMap.unionWith (++) xs ys)
unionLeftWith :: Ord k => (a -> a -> a) -> Map k a -> T k a -> T k a Source #
forAllMap $ \xm -> forAllNonEmptyMap $ \ym -> Map.unionWith (++) xm (NonEmptyMap.flatten ym) == NonEmptyMap.flatten (NonEmptyMap.unionLeftWith (++) xm ym)