talircd/lib/server/import.ml

22 lines
627 B
OCaml

module Dllist = Lwt_dllist
type sockaddr = Unix.sockaddr
type fd = Lwt_unix.file_descr
let pp_sockaddr ppf = function
| Unix.ADDR_INET (adr, port) -> Fmt.pf ppf "%s:%d" (Unix.string_of_inet_addr adr) port
| Unix.ADDR_UNIX path -> Fmt.string ppf path
type string_ci = Case_insensitive of string [@@unboxed]
let pp_string_ci ppf (Case_insensitive s) = Fmt.string ppf s
let string_ci s = Case_insensitive (String.lowercase_ascii s)
let empty_string_ci = Case_insensitive ""
let defer f =
Lwt.on_success (Lwt.pause ()) f
module Result_syntax = struct
let ( let* ) = Result.bind
let ( let+ ) r f = Result.map f r
end