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

Data.Mapping

Synopsis

Documentation

class Foldable m => Mapping k m | m -> k where Source #

If Mapping k m, then m v represents a function k -> v.

Mapping requires an instance of Foldable, folding over the values that appear. Given that a value can be associated with a very large collection of keys, the only folds that normally make sense are those over idempotent monoids.

Minimal complete definition

cst, act, isConst, mtraverse, mergeA

Methods

cst :: v -> m v Source #

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

isConst :: Ord v => m v -> Maybe v Source #

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

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

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

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

Instances

Instances details
Mapping Bool OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnBool v Source #

act :: OnBool v -> Bool -> v Source #

isConst :: Ord v => OnBool v -> Maybe v Source #

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

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

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

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

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 #

Ord k => Mapping k (Piecewise k) Source # 
Instance details

Defined in Data.Mapping.Piecewise

Methods

cst :: v -> Piecewise k v Source #

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

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

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

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

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

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

Mapping k (Constant k) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> Constant k v Source #

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

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

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

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

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

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

Mapping k m => Mapping (Maybe k) (OnMaybe k m) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnMaybe k m v Source #

act :: OnMaybe k m v -> Maybe k -> v Source #

isConst :: Ord v => OnMaybe k m v -> Maybe v Source #

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

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

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

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

(Ord a, Ord (m Int), Mapping k m) => Mapping (a -> k) (Decision k m a) Source # 
Instance details

Defined in Data.Mapping.Decision

Methods

cst :: v -> Decision k m a v Source #

act :: Decision k m a v -> (a -> k) -> v Source #

isConst :: Ord v => Decision k m a v -> Maybe v Source #

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

mmap :: Ord v => (u -> v) -> Decision k m a u -> Decision k m a v Source #

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

merge :: Ord w => (u -> v -> w) -> Decision k m a u -> Decision k m a v -> Decision k m a w Source #

(Mapping k m, Mapping l n) => Mapping (Either k l) (OnEither k l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnEither k l m n v Source #

act :: OnEither k l m n v -> Either k l -> v Source #

isConst :: Ord v => OnEither k l m n v -> Maybe v Source #

mtraverse :: (Applicative f, Ord v) => (u -> f v) -> OnEither k l m n u -> f (OnEither k l m n v) Source #

mmap :: Ord v => (u -> v) -> OnEither k l m n u -> OnEither k l m n v Source #

mergeA :: (Applicative f, Ord w) => (u -> v -> f w) -> OnEither k l m n u -> OnEither k l m n v -> f (OnEither k l m n w) Source #

merge :: Ord w => (u -> v -> w) -> OnEither k l m n u -> OnEither k l m n v -> OnEither k l m n w Source #

(Mapping k m, Mapping l n, forall v. Ord v => Ord (n v)) => Mapping (k, l) (OnPair k l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnPair k l m n v Source #

act :: OnPair k l m n v -> (k, l) -> v Source #

isConst :: Ord v => OnPair k l m n v -> Maybe v Source #

mtraverse :: (Applicative f, Ord v) => (u -> f v) -> OnPair k l m n u -> f (OnPair k l m n v) Source #

mmap :: Ord v => (u -> v) -> OnPair k l m n u -> OnPair k l m n v Source #

mergeA :: (Applicative f, Ord w) => (u -> v -> f w) -> OnPair k l m n u -> OnPair k l m n v -> f (OnPair k l m n w) Source #

merge :: Ord w => (u -> v -> w) -> OnPair k l m n u -> OnPair k l m n v -> OnPair k l m n w Source #

pairMappings :: forall k m u v a. (Mapping k m, Monoid a) => (u -> v -> a) -> m u -> m v -> a Source #

A simultaneous foldMap over two maps

mutualValues :: (Ord u, Ord v, Mapping k m) => m u -> m v -> Set (u, v) Source #

What values can these two take simultaneously?

class Neighbourly m where Source #

A class representing data structures which have a concept of neighbouring values

Methods

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

Instances

Instances details
Neighbourly OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

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

(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 #

Neighbourly (Piecewise k) Source # 
Instance details

Defined in Data.Mapping.Piecewise

Methods

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

Neighbourly (Constant k2) Source # 
Instance details

Defined in Data.Mapping

Methods

neighbours :: Ord v => Constant k2 v -> Set (v, v) Source #

(Mapping k m, Neighbourly m, Ord a, Ord (m Int)) => Neighbourly (Decision k m a) Source # 
Instance details

Defined in Data.Mapping.Decision

Methods

neighbours :: Ord v => Decision k m a v -> Set (v, v) Source #

newtype AlgebraWrapper k m a Source #

A wrapper for representing pointwise algebraic structures on a Mapping

Eventually would like to use this only for "deriving via"

Constructors

AlgebraWrapper 

Fields

Instances

Instances details
(Mapping k m, Ord a, Monoid a) => Monoid (AlgebraWrapper k m a) Source # 
Instance details

Defined in Data.Mapping

Methods

mempty :: AlgebraWrapper k m a #

mappend :: AlgebraWrapper k m a -> AlgebraWrapper k m a -> AlgebraWrapper k m a #

mconcat :: [AlgebraWrapper k m a] -> AlgebraWrapper k m a #

(Mapping k m, Ord a, Semigroup a) => Semigroup (AlgebraWrapper k m a) Source # 
Instance details

Defined in Data.Mapping

Methods

(<>) :: AlgebraWrapper k m a -> AlgebraWrapper k m a -> AlgebraWrapper k m a #

sconcat :: NonEmpty (AlgebraWrapper k m a) -> AlgebraWrapper k m a #

stimes :: Integral b => b -> AlgebraWrapper k m a -> AlgebraWrapper k m a #

(Mapping k m, Ord a, Num a) => Num (AlgebraWrapper k m a) Source # 
Instance details

Defined in Data.Mapping

(Mapping k m, Ord a, Boolean a) => Boolean (AlgebraWrapper k m a) Source # 
Instance details

Defined in Data.Mapping

newtype Constant k v Source #

Constant functions (on any domain)

Constructors

Constant 

Fields

Instances

Instances details
Mapping k (Constant k) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> Constant k v Source #

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

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

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

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

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

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

Foldable (Constant k2) Source # 
Instance details

Defined in Data.Mapping

Methods

fold :: Monoid m => Constant k2 m -> m #

foldMap :: Monoid m => (a -> m) -> Constant k2 a -> m #

foldMap' :: Monoid m => (a -> m) -> Constant k2 a -> m #

foldr :: (a -> b -> b) -> b -> Constant k2 a -> b #

foldr' :: (a -> b -> b) -> b -> Constant k2 a -> b #

foldl :: (b -> a -> b) -> b -> Constant k2 a -> b #

foldl' :: (b -> a -> b) -> b -> Constant k2 a -> b #

foldr1 :: (a -> a -> a) -> Constant k2 a -> a #

foldl1 :: (a -> a -> a) -> Constant k2 a -> a #

toList :: Constant k2 a -> [a] #

null :: Constant k2 a -> Bool #

length :: Constant k2 a -> Int #

elem :: Eq a => a -> Constant k2 a -> Bool #

maximum :: Ord a => Constant k2 a -> a #

minimum :: Ord a => Constant k2 a -> a #

sum :: Num a => Constant k2 a -> a #

product :: Num a => Constant k2 a -> a #

Neighbourly (Constant k2) Source # 
Instance details

Defined in Data.Mapping

Methods

neighbours :: Ord v => Constant k2 v -> Set (v, v) Source #

Monoid v => Monoid (Constant k2 v) Source # 
Instance details

Defined in Data.Mapping

Methods

mempty :: Constant k2 v #

mappend :: Constant k2 v -> Constant k2 v -> Constant k2 v #

mconcat :: [Constant k2 v] -> Constant k2 v #

Semigroup v => Semigroup (Constant k2 v) Source # 
Instance details

Defined in Data.Mapping

Methods

(<>) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

sconcat :: NonEmpty (Constant k2 v) -> Constant k2 v #

stimes :: Integral b => b -> Constant k2 v -> Constant k2 v #

Num v => Num (Constant k2 v) Source # 
Instance details

Defined in Data.Mapping

Methods

(+) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

(-) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

(*) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

negate :: Constant k2 v -> Constant k2 v #

abs :: Constant k2 v -> Constant k2 v #

signum :: Constant k2 v -> Constant k2 v #

fromInteger :: Integer -> Constant k2 v #

Boolean v => Boolean (Constant k2 v) Source # 
Instance details

Defined in Data.Mapping

Methods

true :: Constant k2 v #

false :: Constant k2 v #

not :: Constant k2 v -> Constant k2 v #

(&&) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

(||) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

xor :: Constant k2 v -> Constant k2 v -> Constant k2 v #

(-->) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

(<-->) :: Constant k2 v -> Constant k2 v -> Constant k2 v #

data OnBool a Source #

Binary decisions, as functions defined on Bool

Constructors

OnBool 

Fields

Instances

Instances details
Foldable OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

fold :: Monoid m => OnBool m -> m #

foldMap :: Monoid m => (a -> m) -> OnBool a -> m #

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

foldr :: (a -> b -> b) -> b -> OnBool a -> b #

foldr' :: (a -> b -> b) -> b -> OnBool a -> b #

foldl :: (b -> a -> b) -> b -> OnBool a -> b #

foldl' :: (b -> a -> b) -> b -> OnBool a -> b #

foldr1 :: (a -> a -> a) -> OnBool a -> a #

foldl1 :: (a -> a -> a) -> OnBool a -> a #

toList :: OnBool a -> [a] #

null :: OnBool a -> Bool #

length :: OnBool a -> Int #

elem :: Eq a => a -> OnBool a -> Bool #

maximum :: Ord a => OnBool a -> a #

minimum :: Ord a => OnBool a -> a #

sum :: Num a => OnBool a -> a #

product :: Num a => OnBool a -> a #

Traversable OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

traverse :: Applicative f => (a -> f b) -> OnBool a -> f (OnBool b) #

sequenceA :: Applicative f => OnBool (f a) -> f (OnBool a) #

mapM :: Monad m => (a -> m b) -> OnBool a -> m (OnBool b) #

sequence :: Monad m => OnBool (m a) -> m (OnBool a) #

Functor OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

fmap :: (a -> b) -> OnBool a -> OnBool b #

(<$) :: a -> OnBool b -> OnBool a #

Neighbourly OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

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

FoldableWithIndex Bool OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

ifoldMap :: Monoid m => (Bool -> a -> m) -> OnBool a -> m #

ifoldMap' :: Monoid m => (Bool -> a -> m) -> OnBool a -> m #

ifoldr :: (Bool -> a -> b -> b) -> b -> OnBool a -> b #

ifoldl :: (Bool -> b -> a -> b) -> b -> OnBool a -> b #

ifoldr' :: (Bool -> a -> b -> b) -> b -> OnBool a -> b #

ifoldl' :: (Bool -> b -> a -> b) -> b -> OnBool a -> b #

Mapping Bool OnBool Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnBool v Source #

act :: OnBool v -> Bool -> v Source #

isConst :: Ord v => OnBool v -> Maybe v Source #

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

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

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

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

(Ord a, Monoid a) => Monoid (OnBool a) Source # 
Instance details

Defined in Data.Mapping

Methods

mempty :: OnBool a #

mappend :: OnBool a -> OnBool a -> OnBool a #

mconcat :: [OnBool a] -> OnBool a #

(Ord a, Semigroup a) => Semigroup (OnBool a) Source # 
Instance details

Defined in Data.Mapping

Methods

(<>) :: OnBool a -> OnBool a -> OnBool a #

sconcat :: NonEmpty (OnBool a) -> OnBool a #

stimes :: Integral b => b -> OnBool a -> OnBool a #

(Ord a, Num a) => Num (OnBool a) Source # 
Instance details

Defined in Data.Mapping

Methods

(+) :: OnBool a -> OnBool a -> OnBool a #

(-) :: OnBool a -> OnBool a -> OnBool a #

(*) :: OnBool a -> OnBool a -> OnBool a #

negate :: OnBool a -> OnBool a #

abs :: OnBool a -> OnBool a #

signum :: OnBool a -> OnBool a #

fromInteger :: Integer -> OnBool a #

Show a => Show (OnBool a) Source # 
Instance details

Defined in Data.Mapping

Methods

showsPrec :: Int -> OnBool a -> ShowS #

show :: OnBool a -> String #

showList :: [OnBool a] -> ShowS #

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

Defined in Data.Mapping

Methods

true :: OnBool b #

false :: OnBool b #

not :: OnBool b -> OnBool b #

(&&) :: OnBool b -> OnBool b -> OnBool b #

(||) :: OnBool b -> OnBool b -> OnBool b #

xor :: OnBool b -> OnBool b -> OnBool b #

(-->) :: OnBool b -> OnBool b -> OnBool b #

(<-->) :: OnBool b -> OnBool b -> OnBool b #

Eq a => Eq (OnBool a) Source # 
Instance details

Defined in Data.Mapping

Methods

(==) :: OnBool a -> OnBool a -> Bool #

(/=) :: OnBool a -> OnBool a -> Bool #

Ord a => Ord (OnBool a) Source # 
Instance details

Defined in Data.Mapping

Methods

compare :: OnBool a -> OnBool a -> Ordering #

(<) :: OnBool a -> OnBool a -> Bool #

(<=) :: OnBool a -> OnBool a -> Bool #

(>) :: OnBool a -> OnBool a -> Bool #

(>=) :: OnBool a -> OnBool a -> Bool #

max :: OnBool a -> OnBool a -> OnBool a #

min :: OnBool a -> OnBool a -> OnBool a #

data OnMaybe k m v Source #

Maps on Maybe

Constructors

OnMaybe 

Fields

Instances

Instances details
FoldableWithIndex k m => FoldableWithIndex (Maybe k) (OnMaybe k m) Source # 
Instance details

Defined in Data.Mapping

Methods

ifoldMap :: Monoid m0 => (Maybe k -> a -> m0) -> OnMaybe k m a -> m0 #

ifoldMap' :: Monoid m0 => (Maybe k -> a -> m0) -> OnMaybe k m a -> m0 #

ifoldr :: (Maybe k -> a -> b -> b) -> b -> OnMaybe k m a -> b #

ifoldl :: (Maybe k -> b -> a -> b) -> b -> OnMaybe k m a -> b #

ifoldr' :: (Maybe k -> a -> b -> b) -> b -> OnMaybe k m a -> b #

ifoldl' :: (Maybe k -> b -> a -> b) -> b -> OnMaybe k m a -> b #

Mapping k m => Mapping (Maybe k) (OnMaybe k m) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnMaybe k m v Source #

act :: OnMaybe k m v -> Maybe k -> v Source #

isConst :: Ord v => OnMaybe k m v -> Maybe v Source #

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

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

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

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

Foldable m => Foldable (OnMaybe k2 m) Source # 
Instance details

Defined in Data.Mapping

Methods

fold :: Monoid m0 => OnMaybe k2 m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> OnMaybe k2 m a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> OnMaybe k2 m a -> m0 #

foldr :: (a -> b -> b) -> b -> OnMaybe k2 m a -> b #

foldr' :: (a -> b -> b) -> b -> OnMaybe k2 m a -> b #

foldl :: (b -> a -> b) -> b -> OnMaybe k2 m a -> b #

foldl' :: (b -> a -> b) -> b -> OnMaybe k2 m a -> b #

foldr1 :: (a -> a -> a) -> OnMaybe k2 m a -> a #

foldl1 :: (a -> a -> a) -> OnMaybe k2 m a -> a #

toList :: OnMaybe k2 m a -> [a] #

null :: OnMaybe k2 m a -> Bool #

length :: OnMaybe k2 m a -> Int #

elem :: Eq a => a -> OnMaybe k2 m a -> Bool #

maximum :: Ord a => OnMaybe k2 m a -> a #

minimum :: Ord a => OnMaybe k2 m a -> a #

sum :: Num a => OnMaybe k2 m a -> a #

product :: Num a => OnMaybe k2 m a -> a #

(Mapping k m, Ord a, Monoid a) => Monoid (OnMaybe k m a) Source # 
Instance details

Defined in Data.Mapping

Methods

mempty :: OnMaybe k m a #

mappend :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

mconcat :: [OnMaybe k m a] -> OnMaybe k m a #

(Mapping k m, Ord a, Semigroup a) => Semigroup (OnMaybe k m a) Source # 
Instance details

Defined in Data.Mapping

Methods

(<>) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

sconcat :: NonEmpty (OnMaybe k m a) -> OnMaybe k m a #

stimes :: Integral b => b -> OnMaybe k m a -> OnMaybe k m a #

(Mapping k m, Ord a, Num a) => Num (OnMaybe k m a) Source # 
Instance details

Defined in Data.Mapping

Methods

(+) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

(-) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

(*) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

negate :: OnMaybe k m a -> OnMaybe k m a #

abs :: OnMaybe k m a -> OnMaybe k m a #

signum :: OnMaybe k m a -> OnMaybe k m a #

fromInteger :: Integer -> OnMaybe k m a #

(Mapping k m, Ord a, Boolean a) => Boolean (OnMaybe k m a) Source # 
Instance details

Defined in Data.Mapping

Methods

true :: OnMaybe k m a #

false :: OnMaybe k m a #

not :: OnMaybe k m a -> OnMaybe k m a #

(&&) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

(||) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

xor :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

(-->) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

(<-->) :: OnMaybe k m a -> OnMaybe k m a -> OnMaybe k m a #

data OnEither k l m n v Source #

Maps on Either

Constructors

OnEither 

Fields

Instances

Instances details
(FoldableWithIndex k m, FoldableWithIndex l n) => FoldableWithIndex (Either k l) (OnEither k l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

ifoldMap :: Monoid m0 => (Either k l -> a -> m0) -> OnEither k l m n a -> m0 #

ifoldMap' :: Monoid m0 => (Either k l -> a -> m0) -> OnEither k l m n a -> m0 #

ifoldr :: (Either k l -> a -> b -> b) -> b -> OnEither k l m n a -> b #

ifoldl :: (Either k l -> b -> a -> b) -> b -> OnEither k l m n a -> b #

ifoldr' :: (Either k l -> a -> b -> b) -> b -> OnEither k l m n a -> b #

ifoldl' :: (Either k l -> b -> a -> b) -> b -> OnEither k l m n a -> b #

(Mapping k m, Mapping l n) => Mapping (Either k l) (OnEither k l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnEither k l m n v Source #

act :: OnEither k l m n v -> Either k l -> v Source #

isConst :: Ord v => OnEither k l m n v -> Maybe v Source #

mtraverse :: (Applicative f, Ord v) => (u -> f v) -> OnEither k l m n u -> f (OnEither k l m n v) Source #

mmap :: Ord v => (u -> v) -> OnEither k l m n u -> OnEither k l m n v Source #

mergeA :: (Applicative f, Ord w) => (u -> v -> f w) -> OnEither k l m n u -> OnEither k l m n v -> f (OnEither k l m n w) Source #

merge :: Ord w => (u -> v -> w) -> OnEither k l m n u -> OnEither k l m n v -> OnEither k l m n w Source #

(Foldable m, Foldable n) => Foldable (OnEither k3 l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

fold :: Monoid m0 => OnEither k3 l m n m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> OnEither k3 l m n a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> OnEither k3 l m n a -> m0 #

foldr :: (a -> b -> b) -> b -> OnEither k3 l m n a -> b #

foldr' :: (a -> b -> b) -> b -> OnEither k3 l m n a -> b #

foldl :: (b -> a -> b) -> b -> OnEither k3 l m n a -> b #

foldl' :: (b -> a -> b) -> b -> OnEither k3 l m n a -> b #

foldr1 :: (a -> a -> a) -> OnEither k3 l m n a -> a #

foldl1 :: (a -> a -> a) -> OnEither k3 l m n a -> a #

toList :: OnEither k3 l m n a -> [a] #

null :: OnEither k3 l m n a -> Bool #

length :: OnEither k3 l m n a -> Int #

elem :: Eq a => a -> OnEither k3 l m n a -> Bool #

maximum :: Ord a => OnEither k3 l m n a -> a #

minimum :: Ord a => OnEither k3 l m n a -> a #

sum :: Num a => OnEither k3 l m n a -> a #

product :: Num a => OnEither k3 l m n a -> a #

(Mapping k m, Mapping l n, Ord a, Monoid a) => Monoid (OnEither k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

mempty :: OnEither k l m n a #

mappend :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

mconcat :: [OnEither k l m n a] -> OnEither k l m n a #

(Mapping k m, Mapping l n, Ord a, Semigroup a) => Semigroup (OnEither k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

(<>) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

sconcat :: NonEmpty (OnEither k l m n a) -> OnEither k l m n a #

stimes :: Integral b => b -> OnEither k l m n a -> OnEither k l m n a #

(Mapping k m, Mapping l n, Ord a, Num a) => Num (OnEither k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

(+) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

(-) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

(*) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

negate :: OnEither k l m n a -> OnEither k l m n a #

abs :: OnEither k l m n a -> OnEither k l m n a #

signum :: OnEither k l m n a -> OnEither k l m n a #

fromInteger :: Integer -> OnEither k l m n a #

(Mapping k m, Mapping l n, Ord a, Boolean a) => Boolean (OnEither k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

true :: OnEither k l m n a #

false :: OnEither k l m n a #

not :: OnEither k l m n a -> OnEither k l m n a #

(&&) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

(||) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

xor :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

(-->) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

(<-->) :: OnEither k l m n a -> OnEither k l m n a -> OnEither k l m n a #

(Eq (m v), Eq (n v)) => Eq (OnEither k2 l m n v) Source # 
Instance details

Defined in Data.Mapping

Methods

(==) :: OnEither k2 l m n v -> OnEither k2 l m n v -> Bool #

(/=) :: OnEither k2 l m n v -> OnEither k2 l m n v -> Bool #

(Ord (m v), Ord (n v)) => Ord (OnEither k2 l m n v) Source # 
Instance details

Defined in Data.Mapping

Methods

compare :: OnEither k2 l m n v -> OnEither k2 l m n v -> Ordering #

(<) :: OnEither k2 l m n v -> OnEither k2 l m n v -> Bool #

(<=) :: OnEither k2 l m n v -> OnEither k2 l m n v -> Bool #

(>) :: OnEither k2 l m n v -> OnEither k2 l m n v -> Bool #

(>=) :: OnEither k2 l m n v -> OnEither k2 l m n v -> Bool #

max :: OnEither k2 l m n v -> OnEither k2 l m n v -> OnEither k2 l m n v #

min :: OnEither k2 l m n v -> OnEither k2 l m n v -> OnEither k2 l m n v #

newtype OnPair k l m n v Source #

Maps on pairs

Constructors

OnPair 

Fields

Instances

Instances details
(Mapping k m, Mapping l n, forall v. Ord v => Ord (n v)) => Mapping (k, l) (OnPair k l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

cst :: v -> OnPair k l m n v Source #

act :: OnPair k l m n v -> (k, l) -> v Source #

isConst :: Ord v => OnPair k l m n v -> Maybe v Source #

mtraverse :: (Applicative f, Ord v) => (u -> f v) -> OnPair k l m n u -> f (OnPair k l m n v) Source #

mmap :: Ord v => (u -> v) -> OnPair k l m n u -> OnPair k l m n v Source #

mergeA :: (Applicative f, Ord w) => (u -> v -> f w) -> OnPair k l m n u -> OnPair k l m n v -> f (OnPair k l m n w) Source #

merge :: Ord w => (u -> v -> w) -> OnPair k l m n u -> OnPair k l m n v -> OnPair k l m n w Source #

(Foldable m, Foldable n) => Foldable (OnPair k3 l m n) Source # 
Instance details

Defined in Data.Mapping

Methods

fold :: Monoid m0 => OnPair k3 l m n m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> OnPair k3 l m n a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> OnPair k3 l m n a -> m0 #

foldr :: (a -> b -> b) -> b -> OnPair k3 l m n a -> b #

foldr' :: (a -> b -> b) -> b -> OnPair k3 l m n a -> b #

foldl :: (b -> a -> b) -> b -> OnPair k3 l m n a -> b #

foldl' :: (b -> a -> b) -> b -> OnPair k3 l m n a -> b #

foldr1 :: (a -> a -> a) -> OnPair k3 l m n a -> a #

foldl1 :: (a -> a -> a) -> OnPair k3 l m n a -> a #

toList :: OnPair k3 l m n a -> [a] #

null :: OnPair k3 l m n a -> Bool #

length :: OnPair k3 l m n a -> Int #

elem :: Eq a => a -> OnPair k3 l m n a -> Bool #

maximum :: Ord a => OnPair k3 l m n a -> a #

minimum :: Ord a => OnPair k3 l m n a -> a #

sum :: Num a => OnPair k3 l m n a -> a #

product :: Num a => OnPair k3 l m n a -> a #

(Mapping k m, Mapping l n, Ord a, Monoid a, forall v. Ord v => Ord (n v)) => Monoid (OnPair k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

mempty :: OnPair k l m n a #

mappend :: OnPair k l m n a -> OnPair k l m n a -> OnPair k l m n a #

mconcat :: [OnPair k l m n a] -> OnPair k l m n a #

(Mapping k m, Mapping l n, Ord a, Semigroup a, forall v. Ord v => Ord (n v)) => Semigroup (OnPair k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

(<>) :: OnPair k l m n a -> OnPair k l m n a -> OnPair k l m n a #

sconcat :: NonEmpty (OnPair k l m n a) -> OnPair k l m n a #

stimes :: Integral b => b -> OnPair k l m n a -> OnPair k l m n a #

(Mapping k m, Mapping l n, Ord a, Num a, forall v. Ord v => Ord (n v)) => Num (OnPair k l m n a) Source # 
Instance details

Defined in Data.Mapping

Methods

(+) :: OnPair k l m n a -> OnPair k l m n a -> OnPair k l m n a #

(-) :: OnPair k l m n a -> OnPair k l m n a -> OnPair k l m n a #

(*) :: OnPair k l m n a -> OnPair k l m n a -> OnPair k l m n a #

negate :: OnPair k l m n a -> OnPair k l m n a #

abs :: OnPair k l m n a -> OnPair k l m n a #

signum :: OnPair k l m n a -> OnPair k l m n a #

fromInteger :: Integer -> OnPair k l m n a #

(Mapping k m, Mapping l n, Ord b, Boolean b, forall v. Ord v => Ord (n v)) => Boolean (OnPair k l m n b) Source # 
Instance details

Defined in Data.Mapping

Methods

true :: OnPair k l m n b #

false :: OnPair k l m n b #

not :: OnPair k l m n b -> OnPair k l m n b #

(&&) :: OnPair k l m n b -> OnPair k l m n b -> OnPair k l m n b #

(||) :: OnPair k l m n b -> OnPair k l m n b -> OnPair k l m n b #

xor :: OnPair k l m n b -> OnPair k l m n b -> OnPair k l m n b #

(-->) :: OnPair k l m n b -> OnPair k l m n b -> OnPair k l m n b #

(<-->) :: OnPair k l m n b -> OnPair k l m n b -> OnPair k l m n b #

Eq (m (n v)) => Eq (OnPair k2 l m n v) Source # 
Instance details

Defined in Data.Mapping

Methods

(==) :: OnPair k2 l m n v -> OnPair k2 l m n v -> Bool #

(/=) :: OnPair k2 l m n v -> OnPair k2 l m n v -> Bool #

Ord (m (n v)) => Ord (OnPair k2 l m n v) Source # 
Instance details

Defined in Data.Mapping

Methods

compare :: OnPair k2 l m n v -> OnPair k2 l m n v -> Ordering #

(<) :: OnPair k2 l m n v -> OnPair k2 l m n v -> Bool #

(<=) :: OnPair k2 l m n v -> OnPair k2 l m n v -> Bool #

(>) :: OnPair k2 l m n v -> OnPair k2 l m n v -> Bool #

(>=) :: OnPair k2 l m n v -> OnPair k2 l m n v -> Bool #

max :: OnPair k2 l m n v -> OnPair k2 l m n v -> OnPair k2 l m n v #

min :: OnPair k2 l m n v -> OnPair k2 l m n v -> OnPair k2 l m n v #

isSubset :: Mapping k m => m Bool -> m Bool -> Bool Source #

isDisjoint :: Mapping k m => m Bool -> m Bool -> Bool Source #

newtype OrdWrapper k m v Source #

A wrapper to allow defining PartialOrd instances on mappings whose keys have an Ord instance.

Constructors

OrdWrapper 

Fields

Instances

Instances details
(Mapping k m, Ord v) => PartialOrd (OrdWrapper k m v) Source # 
Instance details

Defined in Data.Mapping

Methods

compare' :: OrdWrapper k m v -> OrdWrapper k m v -> PartialOrdering #

leq :: OrdWrapper k m v -> OrdWrapper k m v -> Bool #

geq :: OrdWrapper k m v -> OrdWrapper k m v -> Bool #

newtype PartialOrdWrapper k m v Source #

Constructors

PartialOrdWrapper 

Fields

Instances

Instances details
(Mapping k m, PartialOrd v) => PartialOrd (PartialOrdWrapper k m v) Source # 
Instance details

Defined in Data.Mapping