module type MIME_TYPE = sig type t exception ParseError of string val from_string : string -> t val to_type : t -> string val to_subtype : t -> string val to_parameter : t -> (string * string) option end module MimeType : MIME_TYPE = struct type t = { mime_type : string; mime_subtype : string; mime_param : (string * string) option; } exception ParseError of string let from_string _ = { mime_type = "text"; mime_subtype = "plain"; mime_param = None } let to_type m = m.mime_type let to_subtype m = m.mime_subtype let to_parameter m = m.mime_param end