on master help sign in
Simplify SupportedTypes instances
02c4adfThomas Sutton
src/Servant/Docs.hs+3−9
@@ -477,16 +477,10 @@ class SupportedTypes (list :: [*]) where
477instance SupportedTypes '[] where
477instance SupportedTypes '[] where
478 supportedTypes Proxy = []
478 supportedTypes Proxy = []
479
479
480−instance (Accept ctype) => SupportedTypes '[ctype] where
481− supportedTypes Proxy = [ contentType (Proxy :: Proxy ctype) ]
482−
483−instance (Accept ctype, Accept ctype', SupportedTypes rest)
484− => SupportedTypes (ctype ': ctype' ': rest) where
480+instance (Accept ctype, SupportedTypes rest) => SupportedTypes (ctype ': rest)
485−
481+ where
486 supportedTypes Proxy =
482 supportedTypes Proxy =
487− [ contentType (Proxy :: Proxy ctype)
488− , contentType (Proxy :: Proxy ctype')
489− ] <> supportedTypes (Proxy :: Proxy rest)
483+ contentType (Proxy :: Proxy ctype) : supportedTypes (Proxy :: Proxy rest)
490
484
491-- | The class that helps us automatically get documentation
485-- | The class that helps us automatically get documentation
492-- for GET parameters.
486-- for GET parameters.