api-tools-0.8.0.1: DSL for generating API boilerplate and docs

Safe HaskellNone
LanguageHaskell2010

Data.API.Utils

Contents

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

(Eq b, Eq a) => Eq (MergeResult a b) Source # 

Methods

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

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

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

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.