module Network.HTTP.Media.RenderHeader
( RenderHeader (..),
)
where
import Data.ByteString (ByteString, intercalate)
class h where
:: h -> ByteString
instance RenderHeader ByteString where
renderHeader :: ByteString -> ByteString
renderHeader = ByteString -> ByteString
forall a. a -> a
id
instance (RenderHeader h) => RenderHeader [h] where
renderHeader :: [h] -> ByteString
renderHeader = ByteString -> [ByteString] -> ByteString
intercalate ByteString
"," ([ByteString] -> ByteString)
-> ([h] -> [ByteString]) -> [h] -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (h -> ByteString) -> [h] -> [ByteString]
forall a b. (a -> b) -> [a] -> [b]
map h -> ByteString
forall h. RenderHeader h => h -> ByteString
renderHeader