Safe Haskell | None |
---|---|

Language | Haskell98 |

A simple overlay over Data.Map to manage unordered sets with duplicates.

- newtype Bag a = Bag {}
- null :: Bag a -> Bool
- size :: Bag a -> Int
- (!) :: Ord a => Bag a -> a -> [a]
- member :: Ord a => a -> Bag a -> Bool
- notMember :: Ord a => a -> Bag a -> Bool
- count :: Ord a => a -> Bag a -> Int
- empty :: Bag a
- singleton :: a -> Bag a
- union :: Ord a => Bag a -> Bag a -> Bag a
- unions :: Ord a => [Bag a] -> Bag a
- insert :: Ord a => a -> Bag a -> Bag a
- fromList :: Ord a => [a] -> Bag a
- groups :: Bag a -> [[a]]
- toList :: Bag a -> [a]
- keys :: Bag a -> [a]
- elems :: Bag a -> [a]
- toAscList :: Bag a -> [a]
- map :: Ord b => (a -> b) -> Bag a -> Bag b
- traverse' :: forall a b m. (Applicative m, Ord b) => (a -> m b) -> Bag a -> m (Bag b)
- prop_count_empty :: Ord a => a -> Bool
- prop_count_singleton :: Ord a => a -> Bool
- prop_count_insert :: Ord a => a -> Bag a -> Bool
- prop_size_union :: Ord a => Bag a -> Bag a -> Bool
- prop_size_fromList :: Ord a => [a] -> Bool
- prop_fromList_toList :: Ord a => Bag a -> Bool
- prop_toList_fromList :: Ord a => [a] -> Bool
- prop_keys_fromList :: Ord a => [a] -> Bool
- prop_nonempty_groups :: Bag a -> Bool
- prop_map_id :: Ord a => Bag a -> Bool
- prop_map_compose :: (Ord b, Ord c) => (b -> c) -> (a -> b) -> Bag a -> Bool
- prop_traverse_id :: Ord a => Bag a -> Bool
- tests :: IO Bool

# Documentation

A set with duplicates. Faithfully stores elements which are equal with regard to (==).

# Query

# Construction

# Destruction

# Traversal

# Instances

# Properties

prop_count_empty :: Ord a => a -> Bool Source #

prop_count_singleton :: Ord a => a -> Bool Source #

prop_size_fromList :: Ord a => [a] -> Bool Source #

prop_toList_fromList :: Ord a => [a] -> Bool Source #

prop_keys_fromList :: Ord a => [a] -> Bool Source #

prop_nonempty_groups :: Bag a -> Bool Source #

# All tests

All tests as collected by `quickCheckAll`

.

Using `quickCheckAll`

is convenient and superior to the manual
enumeration of tests, since the name of the property is
added automatically.