diff --git a/servant/src/Servant/API/ContentTypes.hs b/servant/src/Servant/API/ContentTypes.hs index 69be4813..f719aec5 100644 --- a/servant/src/Servant/API/ContentTypes.hs +++ b/servant/src/Servant/API/ContentTypes.hs @@ -120,10 +120,13 @@ data OctetStream deriving Typeable -- class Accept ctype where contentType :: Proxy ctype -> M.MediaType + contentType = NE.head . contentTypes contentTypes :: Proxy ctype -> NE.NonEmpty M.MediaType contentTypes = (NE.:| []) . contentType + {-# MINIMAL contentType | contentTypes #-} + -- | @application/json@ instance Accept JSON where contentType _ = "application" M.// "json"