uchicago-library / attachment-converter

Attachment Converter: tool for batch converting attachments in an email mailbox
GNU General Public License v2.0
8 stars 3 forks source link

Slight adjustment to CONVERT module signature #6

Closed bufordrat closed 2 years ago

bufordrat commented 3 years ago

Change acopy and amap in CONVERT module signature

Update CONVERT so that amap and acopy take two inputs: one for modifying the content-type mime header and one for modifying the data of an attachment. Since strings in OCaml are just sequences of bytes, the inputs to each of these functions should be functions of type string -> string.

New signature (for now, until we change it):

module type CONVERT =
  sig
    type filepath
    type parsetree
    type htransform = string -> string
    type dtransform = string -> string
    val parse : string -> parsetree
    val amap : htransform -> dtransform -> parsetree -> parsetree
    val acopy : htransform -> dtransform -> parsetree -> parsetree
    val to_string : parsetree -> string
    val convert : filepath -> string -> string
    val acopy_email : string -> (string -> string) -> string
  end