on master help sign in
Simplify SupportedTypes instances
commit02c4adfd1805268dd229f1c812441dcf0a927257 authorThomas Sutton <me@thomas-sutton.id.au> dateFri 20 Feb 2015, 08:05 (12 years ago) parent8087fae
1 file changed+3−9
src/Servant/Docs.hs+3−9
src/Servant/Docs.hs+3−9
@@ -477,16 +477,10 @@ class SupportedTypes (list :: [*]) where
477477instance SupportedTypes '[] where
478478 supportedTypes Proxy = []
479479
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
485−
480+instance (Accept ctype, SupportedTypes rest) => SupportedTypes (ctype ': rest)
481+ where
486482 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)
490484
491485-- | The class that helps us automatically get documentation
492486-- for GET parameters.