package sexplib

  1. Overview
  2. Docs
Library for serializing OCaml values to and from S-expressions

Install

dune-project
 Dependency

Authors

Maintainers

Sources

sexplib-v0.10.0.tar.gz
sha256=90cb764c44f7b2ab1455b64bef2d8ad9452947946fa90598dda7994b7f434c57
md5=b8f5db21a2b19aadc753c6e626019068

doc/src/sexplib.unix/sexplib_unix_conv.ml.html

Source file sexplib_unix_conv.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(** Exception sexp converters that are Unix-specific. Handles [Unix.Unix_error].

    Write [let () = Sexplib_unix.Sexplib_unix_conv.linkme] in your program to ensure that
    the code in this module is run, i.e. the unix-specific exception converters are added.
    This is already done by [Core], so any application that uses Core need not worry
    about this module at all. *)
open Sexplib.Sexp
open Sexplib.Conv

let () =
  Exn_converter.add ~finalise:false [%extension_constructor Unix.Unix_error]
    (function
      | Unix.Unix_error (err, loc, arg) ->
        let err_str = Unix.error_message err in
        List [Atom "Unix.Unix_error"; Atom err_str; Atom loc; Atom arg]
      | _ -> assert false)

let linkme = ()
OCaml

Innovation. Community. Security.