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
supportedTypes Proxy = []
instance (Accept ctype) => SupportedTypes '[ctype] where
supportedTypes Proxy = [ contentType (Proxy :: Proxy ctype) ]
instance (Accept ctype, Accept ctype', SupportedTypes rest)
=> SupportedTypes (ctype ': ctype' ': rest) where
instance (Accept ctype, SupportedTypes rest) => SupportedTypes (ctype ': rest)
where
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
-- for GET parameters.