Skip to content

Instantly share code, notes, and snippets.

@apsheronets
Created June 15, 2023 22:50
Show Gist options
  • Save apsheronets/20e8a3f1ad68850cc58087d5ba907030 to your computer and use it in GitHub Desktop.
Save apsheronets/20e8a3f1ad68850cc58087d5ba907030 to your computer and use it in GitHub Desktop.
module Lwt_thread = struct
type 'a t = 'a Lwt.t
let return = Lwt.return
let (>>=) = Lwt.(>>=)
let fail = Lwt.fail
let catch = Lwt.catch
type in_channel = Lwt_io.input_channel
type out_channel = Lwt_io.output_channel
let open_connection sockaddr = Lwt_io.open_connection sockaddr
let output_char = Lwt_io.write_char
let output_binary_int = Lwt_io.BE.write_int
let output_string = Lwt_io.write
let flush = Lwt_io.flush
let input_char = Lwt_io.read_char
let input_binary_int = Lwt_io.BE.read_int
let really_input = Lwt_io.read_into_exactly
let close_in = Lwt_io.close
end
module PG = PGOCaml_generic.Make (Lwt_thread)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment