servant-0.9.1.1: A family of combinators for defining webservices APIs

Safe HaskellSafe
LanguageHaskell2010

Servant.API.Alternative

Synopsis

Documentation

data a :<|> b infixr 8 Source #

Union of two APIs, first takes precedence in case of overlap.

Example:

>>> :{
type MyApi = "books" :> Get '[JSON] [Book] -- GET /books
       :<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] () -- POST /books
:}

Constructors

a :<|> b infixr 8 

Instances

Functor ((:<|>) a) Source # 

Methods

fmap :: (a -> b) -> (a :<|> a) -> a :<|> b #

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

Foldable ((:<|>) a) Source # 

Methods

fold :: Monoid m => (a :<|> m) -> m #

foldMap :: Monoid m => (a -> m) -> (a :<|> a) -> m #

foldr :: (a -> b -> b) -> b -> (a :<|> a) -> b #

foldr' :: (a -> b -> b) -> b -> (a :<|> a) -> b #

foldl :: (b -> a -> b) -> b -> (a :<|> a) -> b #

foldl' :: (b -> a -> b) -> b -> (a :<|> a) -> b #

foldr1 :: (a -> a -> a) -> (a :<|> a) -> a #

foldl1 :: (a -> a -> a) -> (a :<|> a) -> a #

toList :: (a :<|> a) -> [a] #

null :: (a :<|> a) -> Bool #

length :: (a :<|> a) -> Int #

elem :: Eq a => a -> (a :<|> a) -> Bool #

maximum :: Ord a => (a :<|> a) -> a #

minimum :: Ord a => (a :<|> a) -> a #

sum :: Num a => (a :<|> a) -> a #

product :: Num a => (a :<|> a) -> a #

Traversable ((:<|>) a) Source # 

Methods

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

sequenceA :: Applicative f => (a :<|> f a) -> f (a :<|> a) #

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

sequence :: Monad m => (a :<|> m a) -> m (a :<|> a) #

(Bounded a, Bounded b) => Bounded ((:<|>) a b) Source # 

Methods

minBound :: a :<|> b #

maxBound :: a :<|> b #

(Eq a, Eq b) => Eq ((:<|>) a b) Source # 

Methods

(==) :: (a :<|> b) -> (a :<|> b) -> Bool #

(/=) :: (a :<|> b) -> (a :<|> b) -> Bool #

(Show a, Show b) => Show ((:<|>) a b) Source # 

Methods

showsPrec :: Int -> (a :<|> b) -> ShowS #

show :: (a :<|> b) -> String #

showList :: [a :<|> b] -> ShowS #

(Monoid a, Monoid b) => Monoid ((:<|>) a b) Source # 

Methods

mempty :: a :<|> b #

mappend :: (a :<|> b) -> (a :<|> b) -> a :<|> b #

mconcat :: [a :<|> b] -> a :<|> b #

(Enter typ1 arg1 ret1, Enter typ2 arg2 ret2, (~) * arg1 arg2) => Enter ((:<|>) typ1 typ2) arg1 ((:<|>) ret1 ret2) Source # 

Methods

enter :: arg1 -> (typ1 :<|> typ2) -> ret1 :<|> ret2 Source #