servant-0.20.2: A family of combinators for defining webservices APIs
Safe HaskellSafe-Inferred
LanguageHaskell2010

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
Bifoldable (:<|>) Source # 
Instance details

Defined in Servant.API.Alternative

Methods

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

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

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

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

Bifunctor (:<|>) Source # 
Instance details

Defined in Servant.API.Alternative

Methods

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

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

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

Bitraversable (:<|>) Source # 
Instance details

Defined in Servant.API.Alternative

Methods

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

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 #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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

Defined in Servant.API.Alternative

Methods

mempty :: a :<|> b #

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

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

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

Defined in Servant.API.Alternative

Methods

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

sconcat :: NonEmpty (a :<|> b) -> a :<|> b #

stimes :: Integral b0 => b0 -> (a :<|> b) -> a :<|> b #

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

Defined in Servant.API.Alternative

Methods

minBound :: a :<|> b #

maxBound :: a :<|> b #

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

Defined in Servant.API.Alternative

Methods

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

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

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

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

Defined in Servant.API.Alternative

Methods

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

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

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