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
|
class Accept ctype where
|
||||||
contentType :: Proxy ctype -> M.MediaType
|
contentType :: Proxy ctype -> M.MediaType
|
||||||
|
contentType = NE.head . contentTypes
|
||||||
|
|
||||||
contentTypes :: Proxy ctype -> NE.NonEmpty M.MediaType
|
contentTypes :: Proxy ctype -> NE.NonEmpty M.MediaType
|
||||||
contentTypes = (NE.:| []) . contentType
|
contentTypes = (NE.:| []) . contentType
|
||||||
|
|
||||||
|
{-# MINIMAL contentType | contentTypes #-}
|
||||||
|
|
||||||
-- | @application/json@
|
-- | @application/json@
|
||||||
instance Accept JSON where
|
instance Accept JSON where
|
||||||
contentType _ = "application" M.// "json"
|
contentType _ = "application" M.// "json"
|
||||||
|
|
Loading…
Add table
Reference in a new issue