package safemoney

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parameters

module Qv : Qv_intf.S
module Zv : Zv_intf.S

Signature

exception ScaleTypeMismatch of string
module Scale : sig ... end
type t = {
  1. scale : Scale.t;
    (*

    Scale Setting

    *)
  2. value : Zv.t;
    (*

    Integer Value

    *)
}

Types

type showable = {
  1. scale_ : string;
  2. value_ : string;
}

showable for t

val pp_showable : Ppx_deriving_runtime.Format.formatter -> showable -> Ppx_deriving_runtime.unit
val show_showable : showable -> Ppx_deriving_runtime.string
val showable_to_yojson : showable -> Yojson.Safe.t
val sexp_of_showable : showable -> Sexplib0.Sexp.t
val showable_of_sexp : Sexplib0.Sexp.t -> showable
val make_dv : (Scale.t * Zv.t) -> t

Construction

Construct discrete value

val show_scale : t -> unit

Print the scale setting

val show_val : t -> unit

Print the integer value

val show_t : t -> unit

Print the discrete value

val neg : t -> t

Negate a discrete integer value

val abs : t -> t

Return an absolute discrete integer value

val (+) : t -> t -> t

Add two discrete integer values

val (-) : t -> t -> t

Substract two discrete integer values

val (*) : t:t -> value:Zv.t -> t

Multiply two discrete integer values

val to_showable_json : t -> string

Convert t to showable rep