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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Servant.API.Alternative

Synopsis

- data a :<|> b = a :<|> b

# 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

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 #
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 #
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 #
(HasLink a, HasLink b) => HasLink (a :<|> b :: Type) Source # |
Instance details Defined in Servant.Links Associated Types type MkLink (a :<|> b) a Source # Methods toLink :: (Link -> a0) -> Proxy (a :<|> b) -> Link -> MkLink (a :<|> b) 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 #
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 #
(Monoid a, Monoid b) => Monoid (a :<|> b) Source # |
Instance details Defined in Servant.API.Alternative Methods mempty :: a :<|> b Source # mappend :: (a :<|> b) -> (a :<|> b) -> a :<|> b Source # mconcat :: [a :<|> b] -> a :<|> b Source #
(Semigroup a, Semigroup b) => Semigroup (a :<|> b) Source # |
Instance details Defined in Servant.API.Alternative Methods (<>) :: (a :<|> b) -> (a :<|> b) -> a :<|> b Source # sconcat :: NonEmpty (a :<|> b) -> a :<|> b Source # stimes :: Integral b0 => b0 -> (a :<|> b) -> a :<|> b Source #
(Bounded a, Bounded b) => Bounded (a :<|> b) Source # |
Instance details Defined in Servant.API.Alternative Methods minBound :: a :<|> b Source # maxBound :: a :<|> b Source #
(Show a, Show b) => Show (a :<|> b) Source # |
Instance details Defined in Servant.API.Alternative Methods showsPrec :: Int -> (a :<|> b) -> ShowS Source # show :: (a :<|> b) -> String Source # showList :: [a :<|> b] -> ShowS Source #
(Eq a, Eq b) => Eq (a :<|> b) Source # |
Instance details Defined in Servant.API.Alternative Methods (==) :: (a :<|> b) -> (a :<|> b) -> Bool Source # (/=) :: (a :<|> b) -> (a :<|> b) -> Bool Source #
type MkLink (a :<|> b :: Type) r Source # |
Instance details Defined in Servant.Links type MkLink (a :<|> b :: Type) r = MkLink a r :<|> MkLink b r