Simplify SupportedTypes instances
This commit is contained in:
parent
8087fae18b
commit
02c4adfd18
1 changed files with 3 additions and 9 deletions
|
@ -477,16 +477,10 @@ class SupportedTypes (list :: [*]) where
|
||||||
instance SupportedTypes '[] where
|
instance SupportedTypes '[] where
|
||||||
supportedTypes Proxy = []
|
supportedTypes Proxy = []
|
||||||
|
|
||||||
instance (Accept ctype) => SupportedTypes '[ctype] where
|
instance (Accept ctype, SupportedTypes rest) => SupportedTypes (ctype ': rest)
|
||||||
supportedTypes Proxy = [ contentType (Proxy :: Proxy ctype) ]
|
where
|
||||||
|
|
||||||
instance (Accept ctype, Accept ctype', SupportedTypes rest)
|
|
||||||
=> SupportedTypes (ctype ': ctype' ': rest) where
|
|
||||||
|
|
||||||
supportedTypes Proxy =
|
supportedTypes Proxy =
|
||||||
[ contentType (Proxy :: Proxy ctype)
|
contentType (Proxy :: Proxy ctype) : supportedTypes (Proxy :: Proxy rest)
|
||||||
, contentType (Proxy :: Proxy ctype')
|
|
||||||
] <> supportedTypes (Proxy :: Proxy rest)
|
|
||||||
|
|
||||||
-- | The class that helps us automatically get documentation
|
-- | The class that helps us automatically get documentation
|
||||||
-- for GET parameters.
|
-- for GET parameters.
|
||||||
|
|
Loading…
Add table
Reference in a new issue