purebred-mua / purebred-email

A fast email parsing library implemented in Haskell
https://hackage.haskell.org/package/purebred-email
GNU Affero General Public License v3.0
23 stars 4 forks source link

export Data.MIME.printContentDisposition #60

Closed dylex closed 3 years ago

dylex commented 3 years ago

It would be convenient if this were exported -- there are some use cases where you'd like to render ContentDisposition directly, without going through the HasHeader lens. Thanks!

frasertweedale commented 3 years ago

I don't understand. printContentDisposition has type

printContentDisposition :: ContentDisposition -> B.ByteString

You still need to get the ContentDisposition out of the message, before you can apply this function to it.

frasertweedale commented 3 years ago

OK I think I get it... I found the description confusing but you just want this thing exported ;)

dylex commented 3 years ago

Right, yes, sorry, I have a ContentDisposition already extracted (and possibly mutated) and just want a rendered string for it, so it'd be great to be able to use printContentDisposition directly (for use as an HTTP response header in this case -- building some webmail stuff).

frasertweedale commented 3 years ago

Yep, I'll export it. Will do it this weekend. Not sure when I'll cut a new release though.

dylex commented 3 years ago

No worries, I have a messy workaround for now (mutate message, re-extract header). And great package overall, thanks, just right for what I needed.

frasertweedale commented 3 years ago

@dylex that's great. Would love to know more about what you're using it for :)