api-tools-0.9.0.0: DSL for generating API boilerplate and docs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.API.Utils

Synopsis

Documentation

(?!) :: Maybe a -> e -> Either e a Source #

The "oh noes!" operator.

(?!?) :: Either e a -> (e -> e') -> Either e' a Source #

Utils for merging and diffing maps

data MergeResult a b Source #

Constructors

OnlyInLeft a 
InBoth a b 
OnlyInRight b 

Instances

Instances details
(Eq a, Eq b) => Eq (MergeResult a b) Source # 
Instance details

Defined in Data.API.Utils

Methods

(==) :: MergeResult a b -> MergeResult a b -> Bool #

(/=) :: MergeResult a b -> MergeResult a b -> Bool #

(Show a, Show b) => Show (MergeResult a b) Source # 
Instance details

Defined in Data.API.Utils

Methods

showsPrec :: Int -> MergeResult a b -> ShowS #

show :: MergeResult a b -> String #

showList :: [MergeResult a b] -> ShowS #

mergeMaps :: Ord k => Map k a -> Map k b -> Map k (MergeResult a b) Source #

diffMaps :: (Eq a, Ord k) => Map k a -> Map k a -> Map k (MergeResult a a) Source #

matchMaps :: Ord k => Map k a -> Map k b -> Either (k, Either a b) (Map k (a, b)) Source #

Attempts to match the keys of the maps to produce a map from keys to pairs.