Make MINIMAL contentType | contentTypes

This commit is contained in:
Oleg Grenrus 2016-10-11 08:11:48 +03:00
parent bf66b2b1ff
commit 148bb15635

View File

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