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

Safe Haskell | Safe
Language | Haskell2010

Servant.API.Alternative

Synopsis

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

# Documentation

data a :<|> b infixr 8 #

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) # |
Methods fmap :: (a -> b) -> (a :<|> a) -> a :<|> b # (<$) :: a -> (a :<|> b) -> a :<|> a #
Foldable ((:<|>) a) # |
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) # |
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 b, Bounded a) => Bounded ((:<|>) a b) # |
Methods minBound :: a :<|> b # maxBound :: a :<|> b #
(Eq b, Eq a) => Eq ((:<|>) a b) # |
Methods (==) :: (a :<|> b) -> (a :<|> b) -> Bool # (/=) :: (a :<|> b) -> (a :<|> b) -> Bool #
(Show b, Show a) => Show ((:<|>) a b) # |
Methods showsPrec :: Int -> (a :<|> b) -> ShowS # show :: (a :<|> b) -> String # showList :: [a :<|> b] -> ShowS #
(Semigroup a, Semigroup b) => Semigroup ((:<|>) a b) # |
Methods (<>) :: (a :<|> b) -> (a :<|> b) -> a :<|> b # sconcat :: NonEmpty (a :<|> b) -> a :<|> b # stimes :: Integral b => b -> (a :<|> b) -> a :<|> b #
(Monoid a, Monoid b) => Monoid ((:<|>) a b) # |
Methods mempty :: a :<|> b # mappend :: (a :<|> b) -> (a :<|> b) -> a :<|> b # mconcat :: [a :<|> b] -> a :<|> b #
(Enter typ1 m1 n1 ret1, Enter typ2 m2 n2 ret2, (~) (* -> *) m1 m2, (~) (* -> *) n1 n2, (~) * (Entered m1 n1 ((:<|>) typ1 typ2)) ((:<|>) ret1 ret2), (~) * (Entered n1 m1 ((:<|>) ret1 ret2)) ((:<|>) typ1 typ2)) => Enter ((:<|>) typ1 typ2) m1 n1 ((:<|>) ret1 ret2) # |
Methods enter :: (* :~> m1) n1 -> (typ1 :<|> typ2) -> ret1 :<|> ret2 #