purebred-mua / hs-notmuch

Modern Haskell binding to the Notmuch mail indexer
11 stars 2 forks source link

Message types should not be String? #1

Closed romanofski closed 7 years ago

romanofski commented 7 years ago

When I retrieve the values of a message header, the type is String, but I guess what we want is either Text or ByteString?

frasertweedale commented 7 years ago

Yes, probably Text. There are heaps of places where we need to change from String to either Text or ByteString so we'll broaden the scope of this ticket to dealing with that codebase-wide.

frasertweedale commented 7 years ago

Partway there (using B.ByteString): 082f844. More functions to convert.

ByteString was chosen because I do not want to incur the cost (and possible failure) of UTF-8 decoding in the notmuch binding. purebred and other programs can incur the cost and complexity of the conversion if/where they need to.

Some results and inputs have to be converted to String, in particular messageFilename :: Message -> IO FilePath where type FilePath = String.

romanofski commented 7 years ago

Good stuff!!

frasertweedale commented 7 years ago

All the desired conversions are complete except for the Query conversion which is in scope of issue #5. Closing this now.