servant-0.19.1: A family of combinators for defining webservices APIs
Safe Haskell Safe-Inferred
Language Haskell2010

Servant.API.Alternative

Synopsis

Documentation

data a :<|> b infixr 3 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 3

Instances

Instances details
Bifunctor (:<|>) Source #
Instance details

Defined in Servant.API.Alternative

Methods

bimap :: (a -> b) -> (c -> d) -> (a :<|> c) -> b :<|> d Source #

first :: (a -> b) -> (a :<|> c) -> b :<|> c Source #

second :: (b -> c) -> (a :<|> b) -> a :<|> c Source #

Bitraversable (:<|>) Source #
Instance details

Defined in Servant.API.Alternative

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> (a :<|> b) -> f (c :<|> d) Source #

Bifoldable (:<|>) Source #
Instance details

Defined in Servant.API.Alternative

Methods

bifold :: Monoid m => (m :<|> m) -> m Source #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> (a :<|> b) -> m Source #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> (a :<|> b) -> c Source #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> (a :<|> b) -> c Source #

Biapplicative (:<|>) Source #
Instance details

Defined in Servant.API.Alternative

Methods

bipure :: a -> b -> a :<|> b Source #

(<<*>>) :: ((a -> b) :<|> (c -> d)) -> (a :<|> c) -> b :<|> d Source #

biliftA2 :: (a -> b -> c) -> (d -> e -> f) -> (a :<|> d) -> (b :<|> e) -> c :<|> f Source #

(*>>) :: (a :<|> b) -> (c :<|> d) -> c :<|> d Source #

(<<*) :: (a :<|> b) -> (c :<|> d) -> a :<|> b Source #

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

Defined in Servant.API.Alternative

Methods

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

( HasLink a, HasLink b) => HasLink (a :<|> b :: Type ) Source #
Instance details

Defined in Servant.Links

Associated Types

type MkLink (a :<|> b) a Source #

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

Defined in Servant.API.Alternative

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

Defined in Servant.API.Alternative

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

Defined in Servant.API.Alternative

( Semigroup a, Semigroup b) => Semigroup (a :<|> b) Source #
Instance details

Defined in Servant.API.Alternative

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

Defined in Servant.API.Alternative

type MkLink (a :<|> b :: Type ) r Source #
Instance details

Defined in Servant.Links