Make MINIMAL contentType | contentTypes
This commit is contained in:
parent
bf66b2b1ff
commit
148bb15635
1 changed files with 3 additions and 0 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue