package smtml
Install
dune-project
Dependency
Authors
-
JJoão Pereira <joaomhmpereira@tecnico.ulisboa.pt>
-
FFilipe Marques <filipe.s.marques@tecnico.ulisboa.pt>
-
HHichem Rami Ait El Hara <hra@ocamlpro.com>
-
Rredianthus <redopam@pm.me>
-
AArthur Carcano <arthur.carcano@ocamlpro.com>
-
PPierre Chambart <pierre.chambart@ocamlpro.com>
-
JJosé Fragoso Santos <jose.fragoso@tecnico.ulisboa.pt>
Maintainers
Sources
md5=9ef240b636d7059d48bb54e6b8f0a4c4
sha512=2c73a5baa2e4f8a496f575087597510edae58a4416959108e7a4b063fb9a35ae7461227c679868d82cd324865a563bd2a0df6da1fa3a88d416f76be32ea07809
doc/smtml/Smtml/Num/index.html
Module Smtml.NumSource
Typed Values Representation. This module defines types and utilities for representing values with different numeric types, including integers and floating-point numbers. It also provides functions for type checking, comparison, formatting, and conversion.
Value Types
The type t represents values with different numeric types.
compare v1 v2 provides a total ordering over values of type t. It returns a negative integer if v1 is less than v2, zero if they are equal, and a positive integer if v1 is greater than v2.
Pretty Printing
pp_with ~printer allows explicit selection of the printing format.
pp_no_type is a formatter that prints a value of type t without displaying its type.
Serialization
of_string ty s attempts to parse the string s as a value of type ty. Returns Ok v on success, or an error message if parsing fails.
to_json v converts the value v into a JSON representation.