package eio

  1. Overview
  2. Docs
Effect-based direct-style IO API for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

eio-1.4.tbz
sha256=ba11ad486f492130dbb486f2b3bdc4905643f10016806ddf86e9a34e4346aaa5
sha512=57ef2c137ccdc26d8029e636b6a4ee92da7c6b2f35954946bd56ca595d6947a8ec42f6f83f8552f73d6719e6ce2314cae2e2fad1686a387522935e6f90e9a8d9

doc/src/eio.unix/resource.ml.html

Source file resource.ml

1
2
3
4
5
6
7
8
9
type 'a t = ([> `Unix_fd] as 'a) Eio.Resource.t

type ('t, _, _) Eio.Resource.pi += T : ('t, 't -> Fd.t, [> `Unix_fd]) Eio.Resource.pi
let fd (Eio.Resource.T (t, ops)) = Eio.Resource.get ops T t

let fd_opt (Eio.Resource.T (t, ops)) =
  match Eio.Resource.get_opt ops T with
  | Some f -> Some (f t)
  | None -> None