sig
  module Encoding :
    sig
      type t = Markup.Encoding.t
      val decode :
        ?report:(Markup.location -> Markup.Error.t -> unit Lwt.t) ->
        Markup.Encoding.t ->
        (char, 'a) Markup.stream -> (int, Markup.async) Markup.stream
    end
  val parse_xml :
    ?report:(Markup.location -> Markup.Error.t -> unit Lwt.t) ->
    ?encoding:Encoding.t ->
    ?namespace:(string -> string option) ->
    ?entity:(string -> string option) ->
    ?context:[< `Document | `Fragment ] ->
    (char, 'a) Markup.stream -> Markup.async Markup.parser
  val write_xml :
    ?report:(Markup.signal * int -> Markup.Error.t -> unit Lwt.t) ->
    ?prefix:(string -> string option) ->
    ([< Markup.signal ], 'a) Markup.stream ->
    (char, Markup.async) Markup.stream
  val parse_html :
    ?report:(Markup.location -> Markup.Error.t -> unit Lwt.t) ->
    ?encoding:Encoding.t ->
    ?context:[< `Document | `Fragment of string ] ->
    (char, 'a) Markup.stream -> Markup.async Markup.parser
  val write_html :
    ?escape_attribute:(string -> string) ->
    ?escape_text:(string -> string) ->
    ([< Markup.signal ], 'a) Markup.stream ->
    (char, Markup.async) Markup.stream
  val fn : (unit -> char option Lwt.t) -> (char, Markup.async) Markup.stream
  val to_string : (char, 'a) Markup.stream -> string Lwt.t
  val to_buffer : (char, 'a) Markup.stream -> Buffer.t Lwt.t
  val stream : (unit -> 'a option Lwt.t) -> ('a, Markup.async) Markup.stream
  val next : ('a, 'b) Markup.stream -> 'a option Lwt.t
  val peek : ('a, 'b) Markup.stream -> 'a option Lwt.t
  val transform :
    ('-> '-> ('c list * 'a option) Lwt.t) ->
    '-> ('b, 'd) Markup.stream -> ('c, Markup.async) Markup.stream
  val fold :
    ('-> '-> 'Lwt.t) -> '-> ('b, 'c) Markup.stream -> 'Lwt.t
  val map :
    ('-> 'Lwt.t) ->
    ('a, 'c) Markup.stream -> ('b, Markup.async) Markup.stream
  val filter :
    ('-> bool Lwt.t) ->
    ('a, 'b) Markup.stream -> ('a, Markup.async) Markup.stream
  val filter_map :
    ('-> 'b option Lwt.t) ->
    ('a, 'c) Markup.stream -> ('b, Markup.async) Markup.stream
  val iter : ('-> unit Lwt.t) -> ('a, 'b) Markup.stream -> unit Lwt.t
  val drain : ('a, 'b) Markup.stream -> unit Lwt.t
  val to_list : ('a, 'b) Markup.stream -> 'a list Lwt.t
  val load : ('a, 'b) Markup.stream -> ('a, Markup.sync) Markup.stream Lwt.t
  val tree :
    ?text:(string list -> 'a) ->
    ?element:(Markup.name -> (Markup.name * string) list -> 'a list -> 'a) ->
    ?comment:(string -> 'a) ->
    ?pi:(string -> string -> 'a) ->
    ?xml:(Markup.xml_declaration -> 'a) ->
    ?doctype:(Markup.doctype -> 'a) ->
    ([< Markup.signal ], 'b) Markup.stream -> 'a option Lwt.t
  val lwt_stream : 'Lwt_stream.t -> ('a, Markup.async) Markup.stream
  val to_lwt_stream : ('a, 'b) Markup.stream -> 'Lwt_stream.t
  val ensure_tail_calls : ?hook:(exn -> unit) Stdlib.ref -> unit -> unit
  val to_cps : (unit -> 'Lwt.t) -> (exn -> unit) -> ('-> unit) -> unit
end