liblawless-0.14.0.1: Prelude based on protolude for GHC 8 and beyond.

Map

Synopsis

# Documentation

data Map k a :: * -> * -> * #

A Map from keys k to values a.

Instances

 Ord k => TraverseMin k (Map k) MethodstraverseMin :: (Indexable k p, Applicative f) => p v (f v) -> Map k v -> f (Map k v) # Ord k => TraverseMax k (Map k) MethodstraverseMax :: (Indexable k p, Applicative f) => p v (f v) -> Map k v -> f (Map k v) # Functor (Map k) Methodsfmap :: (a -> b) -> Map k a -> Map k b #(<\$) :: a -> Map k b -> Map k a # Foldable (Map k) Methodsfold :: Monoid m => Map k m -> m #foldMap :: Monoid m => (a -> m) -> Map k a -> m #foldr :: (a -> b -> b) -> b -> Map k a -> b #foldr' :: (a -> b -> b) -> b -> Map k a -> b #foldl :: (b -> a -> b) -> b -> Map k a -> b #foldl' :: (b -> a -> b) -> b -> Map k a -> b #foldr1 :: (a -> a -> a) -> Map k a -> a #foldl1 :: (a -> a -> a) -> Map k a -> a #toList :: Map k a -> [a] #null :: Map k a -> Bool #length :: Map k a -> Int #elem :: Eq a => a -> Map k a -> Bool #maximum :: Ord a => Map k a -> a #minimum :: Ord a => Map k a -> a #sum :: Num a => Map k a -> a #product :: Num a => Map k a -> a # Methodstraverse :: Applicative f => (a -> f b) -> Map k a -> f (Map k b) #sequenceA :: Applicative f => Map k (f a) -> f (Map k a) #mapM :: Monad m => (a -> m b) -> Map k a -> m (Map k b) #sequence :: Monad m => Map k (m a) -> m (Map k a) # Ord k => Bind (Map k) Methods(>>-) :: Map k a -> (a -> Map k b) -> Map k bjoin :: Map k (Map k a) -> Map k a Ord k => Apply (Map k) Methods(<.>) :: Map k (a -> b) -> Map k a -> Map k b(.>) :: Map k a -> Map k b -> Map k b(<.) :: Map k a -> Map k b -> Map k a Ord k => IsList (Map k v) Associated Typestype Item (Map k v) :: * # MethodsfromList :: [Item (Map k v)] -> Map k v #fromListN :: Int -> [Item (Map k v)] -> Map k v #toList :: Map k v -> [Item (Map k v)] # (Eq k, Eq a) => Eq (Map k a) Methods(==) :: Map k a -> Map k a -> Bool #(/=) :: Map k a -> Map k a -> Bool # (Data k, Data a, Ord k) => Data (Map k a) Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Map k a -> c (Map k a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Map k a) #toConstr :: Map k a -> Constr #dataTypeOf :: Map k a -> DataType #dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Map k a)) #dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Map k a)) #gmapT :: (forall b. Data b => b -> b) -> Map k a -> Map k a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Map k a -> r #gmapQ :: (forall d. Data d => d -> u) -> Map k a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Map k a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Map k a -> m (Map k a) # (Ord k, Ord v) => Ord (Map k v) Methodscompare :: Map k v -> Map k v -> Ordering #(<) :: Map k v -> Map k v -> Bool #(<=) :: Map k v -> Map k v -> Bool #(>) :: Map k v -> Map k v -> Bool #(>=) :: Map k v -> Map k v -> Bool #max :: Map k v -> Map k v -> Map k v #min :: Map k v -> Map k v -> Map k v # (Ord k, Read k, Read e) => Read (Map k e) MethodsreadsPrec :: Int -> ReadS (Map k e) #readList :: ReadS [Map k e] #readPrec :: ReadPrec (Map k e) #readListPrec :: ReadPrec [Map k e] # (Show k, Show a) => Show (Map k a) MethodsshowsPrec :: Int -> Map k a -> ShowS #show :: Map k a -> String #showList :: [Map k a] -> ShowS # Ord k => Semigroup (Map k v) Methods(<>) :: Map k v -> Map k v -> Map k v #sconcat :: NonEmpty (Map k v) -> Map k v #stimes :: Integral b => b -> Map k v -> Map k v # Ord k => Monoid (Map k v) Methodsmempty :: Map k v #mappend :: Map k v -> Map k v -> Map k v #mconcat :: [Map k v] -> Map k v # (Binary k, Binary e) => Binary (Map k e) Methodsput :: Map k e -> Put #get :: Get (Map k e) #putList :: [Map k e] -> Put # (NFData k, NFData a) => NFData (Map k a) Methodsrnf :: Map k a -> () # Ord k => Ixed (Map k a) Methodsix :: Index (Map k a) -> Traversal' (Map k a) (IxValue (Map k a)) # Ord k => At (Map k a) Methodsat :: Index (Map k a) -> Lens' (Map k a) (Maybe (IxValue (Map k a))) # Ord k => Wrapped (Map k a) Associated Typestype Unwrapped (Map k a) :: * # Methods_Wrapped' :: Iso' (Map k a) (Unwrapped (Map k a)) # ((~) * t (Map k' a'), Ord k) => Rewrapped (Map k a) t Use wrapping fromList. unwrapping returns a sorted list. type Item (Map k v) type Item (Map k v) = (k, v) type Index (Map k a) type Index (Map k a) = k type IxValue (Map k a) type IxValue (Map k a) = a type Unwrapped (Map k a) type Unwrapped (Map k a) = [(k, a)]

singleton :: k -> a -> Map k a #

O(1). A map with a single element.

singleton 1 'a'        == fromList [(1, 'a')]
size (singleton 1 'a') == 1