servant icon indicating copy to clipboard operation
servant copied to clipboard

Upstreaming RawText from servant-http2-client

Open tchoutri opened this issue 1 year ago • 2 comments

@lucasdicioccio Would you be okay with the upstreaming of your RawText into servant? I am specifically thinking about this code:

data RawText

instance Accept RawText where
  contentType _ = "text/plain"

instance MimeRender RawText Text where
  mimeRender _ = fromStrict . Encoding.encodeUtf8

instance MimeUnrender RawText Text where
  mimeUnrender _ = pure . Encoding.decodeUtf8 . toStrict

tchoutri avatar Aug 22 '22 23:08 tchoutri

Yes if you can use it, definitely do that!

Servant's BSD-3 license is okay for me.

lucasdicioccio avatar Aug 29 '22 21:08 lucasdicioccio

Note that to package that in a pretty module you may want to have one module/file per "frequent combinations" of lazy/non-lazy and utf-8/latin-9 (albeit latin-9 hopefully is not really in demand/use much).

lucasdicioccio avatar Aug 29 '22 21:08 lucasdicioccio