Simplify SupportedTypes instances

This commit is contained in:
Thomas Sutton 2015-02-20 08:05:37 +11:00
parent 8087fae18b
commit 02c4adfd18

View File

@ -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.