Closed nmmull closed 2 years ago
Yeah, the easiest thing would be to put the fake emails into the repo and run the tests from there. You can still run the tests locally, I just temporary disabled them since I don't have access to the email database while I'm out of town.
So here it is. We converted an mbox! This a fairly big change to the code base so I wanted to get a pull request in now, even though there are a couple more things that need to be implemented. I'll try to make those into issued so that they can be handled more modularly. Hope you have some fun looking through the code, I think there's a lot of fun stuff going on here. Note: I also already merge main into this branch so it should be good to go at this point.
Some highlights:
HeaderValue
this cleaned up a lot of the code, and made for some nice functional data-structure updates.mbox.ml
is new, there's some fun stuff with input and output modules there, some fun stuff with functors worth checking out. The actual mbox parsing code is pretty much yoinked from what Keith sent me.try
blocks are now does withmatch
s, so generally cleaner.Error
module inHeaderValue
and propagate it through the little scaffolding we have so that all our functions using those errors just worked without having to do any rewrapping of error constructors, very nice in my opinion. In particular, parsing header value parameters is now safe (no thrown exceptions) without much work!There's a fair amount left to do, but here are a couple of the big items.
acopy
andamap
.