package sexplib
Library for serializing OCaml values to and from S-expressions
Install
Dune Dependency
Authors
Maintainers
Sources
sexplib-v0.16.0.tar.gz
sha256=e564d5d1ca157314ba5fd64b4e89fa12c6cba8efee3becf6d09d7d9dda21ac5b
doc/src/sexplib.num/sexplib_num_conv.ml.html
Source file sexplib_num_conv.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
open Sexplib.Sexp open Sexplib.Conv let exn_to_string e = to_string_hum (sexp_of_exn e) let sexp_of_big_int n = Atom (Big_int.string_of_big_int n) let sexp_of_nat n = Atom (Nat.string_of_nat n) let sexp_of_ratio n = Atom (Ratio.string_of_ratio n) let sexp_of_num n = Atom (Num.string_of_num n) let big_int_of_sexp sexp = match sexp with | Atom str -> (try Big_int.big_int_of_string str with | exc -> of_sexp_error ("big_int_of_sexp: " ^ exn_to_string exc) sexp) | List _ -> of_sexp_error "big_int_of_sexp: atom needed" sexp ;; let nat_of_sexp sexp = match sexp with | Atom str -> (try Nat.nat_of_string str with | exc -> of_sexp_error ("nat_of_sexp: " ^ exn_to_string exc) sexp) | List _ -> of_sexp_error "nat_of_sexp: atom needed" sexp ;; let ratio_of_sexp sexp = match sexp with | Atom str -> (try Ratio.ratio_of_string str with | exc -> of_sexp_error ("ratio_of_sexp: " ^ exn_to_string exc) sexp) | List _ -> of_sexp_error "ratio_of_sexp: atom needed" sexp ;; let num_of_sexp sexp = match sexp with | Atom str -> (try Num.num_of_string str with | exc -> of_sexp_error ("num_of_sexp: " ^ exn_to_string exc) sexp) | List _ -> of_sexp_error "num_of_sexp: atom needed" sexp ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>