Snippets

orbitzN 6j5a8: Untitled snippet

Created by orbitzN last modified
exception Closed
exception Empty

module type S = sig
  type ('typ, 'msg) t

  val send : ([ `Writer ], 'msg) t -> 'msg -> unit
  val recv : ([ `Reader ], 'msg) t -> 'msg

  val close : _ t -> unit
end
1
2
3
4
5
6
7
8
type ('typ, 'msg) t = { send : ('msg -> unit)
                      ; recv : (unit -> 'msg)
                      ; close : (unit -> unit)
                      }

let send t m = t.send m
let recv t = t.recv ()
let close t = t.close ()

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.