mappings-0.2.1.0: Types which represent functions k -> v
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Mapping.MapWithDefault

Synopsis

Documentation

data MapWithDefault k v Source #

Mappings constant except on an enumerated set of values

Constructors

MapWithDefault 

Fields

Instances

Instances details
Ord k => Mapping k (MapWithDefault k) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

Methods

cst :: v -> MapWithDefault k v Source #

act :: MapWithDefault k v -> k -> v Source #

isConst :: Ord v => MapWithDefault k v -> Maybe v Source #

mtraverse :: (Applicative f, Ord v) => (u -> f v) -> MapWithDefault k u -> f (MapWithDefault k v) Source #

mmap :: Ord v => (u -> v) -> MapWithDefault k u -> MapWithDefault k v Source #

mergeA :: (Applicative f, Ord w) => (u -> v -> f w) -> MapWithDefault k u -> MapWithDefault k v -> f (MapWithDefault k w) Source #

merge :: Ord w => (u -> v -> w) -> MapWithDefault k u -> MapWithDefault k v -> MapWithDefault k w Source #

Foldable (MapWithDefault k) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

Methods

fold :: Monoid m => MapWithDefault k m -> m #

foldMap :: Monoid m => (a -> m) -> MapWithDefault k a -> m #

foldMap' :: Monoid m => (a -> m) -> MapWithDefault k a -> m #

foldr :: (a -> b -> b) -> b -> MapWithDefault k a -> b #

foldr' :: (a -> b -> b) -> b -> MapWithDefault k a -> b #

foldl :: (b -> a -> b) -> b -> MapWithDefault k a -> b #

foldl' :: (b -> a -> b) -> b -> MapWithDefault k a -> b #

foldr1 :: (a -> a -> a) -> MapWithDefault k a -> a #

foldl1 :: (a -> a -> a) -> MapWithDefault k a -> a #

toList :: MapWithDefault k a -> [a] #

null :: MapWithDefault k a -> Bool #

length :: MapWithDefault k a -> Int #

elem :: Eq a => a -> MapWithDefault k a -> Bool #

maximum :: Ord a => MapWithDefault k a -> a #

minimum :: Ord a => MapWithDefault k a -> a #

sum :: Num a => MapWithDefault k a -> a #

product :: Num a => MapWithDefault k a -> a #

(Enum k, Eq k) => Neighbourly (MapWithDefault k) Source #

This instance assumes that k is unbounded

It would be possible to do something valid in greater generality (for example, a MaybeBounded class), which might be a good idea.

Instance details

Defined in Data.Mapping.MapWithDefault

Methods

neighbours :: Ord v => MapWithDefault k v -> Set (v, v) Source #

(Ord k, Ord b, Monoid b) => Monoid (MapWithDefault k b) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

(Ord k, Ord b, Semigroup b) => Semigroup (MapWithDefault k b) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

(Ord k, Ord b, Num b) => Num (MapWithDefault k b) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

(Show k, Show v) => Show (MapWithDefault k v) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

(Ord k, Ord b, Boolean b) => Boolean (MapWithDefault k b) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

(Eq v, Eq k) => Eq (MapWithDefault k v) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

(Ord v, Ord k) => Ord (MapWithDefault k v) Source # 
Instance details

Defined in Data.Mapping.MapWithDefault

fromList :: (Ord k, Eq v) => v -> [(k, v)] -> MapWithDefault k v Source #

fromListWithKey :: (Ord k, Eq v) => v -> (k -> u -> v -> v) -> [(k, u)] -> MapWithDefault k v Source #