package markup-lwt

  1. Overview
  2. Docs
Adapter between Markup.ml and Lwt

Install

Dune Dependency

Authors

Maintainers

Sources

0.8.0.tar.gz
sha256=35cd4a7a687eaca860e8e45f5cf12adef54ffb2c15edd936552d90972ec3239b
md5=be0e44a8e8a540f633996e0e26109b4d

doc/markup-lwt.unix/Markup_lwt_unix/index.html

Module Markup_lwt_unix

Stream functions based on Lwt_io.

This module contains additional functions over Markup_lwt.

Markup_lwt_unix is available if Markup.ml is installed when Lwt is installed, i.e.

opam install lwt markup

To link with this module, depend on the findlib package markup.lwt.unix instead of markup or markup.lwt.

Evaluates to a stream that retrieves successive bytes from the given channel. If the channel cannot be read, the next read of the stream results in the thread failing with an exception, as specified in Lwt_io.

val file : string -> (char, Markup.async) Markup.stream * (unit -> unit Lwt.t)

Evaluates to a pair s, close, where reading from stream s retrieves successive bytes from the given file, and completing close () closes the file. If the file cannot be opened, the first read of the stream results in failure with an exception, as specified in Lwt_io. If the file cannot be read, reading the stream results in the reading thread failing with an exception, also as in Lwt_io.

val to_channel : Lwt_io.output Lwt_io.channel -> (char, _) Markup.stream -> unit Lwt.t

Writes bytes from the given stream to the given channel.

val to_file : string -> (char, _) Markup.stream -> unit Lwt.t

Writes bytes from the given stream to the given file.

OCaml

Innovation. Community. Security.