package safemoney

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

Module Exchange.MakeSource

Parameters

module Qv : Qv_intf.S

Signature

Sourceexception IntermediaryMismatch of string
Sourcetype t = {
  1. src : string;
    (*

    Source.

    *)
  2. dst : string;
    (*

    Destination.

    *)
  3. value : Qv.t;
    (*

    Exhange Rate.

    *)
}

Types

include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t -> t -> int
Sourcetype showable = {
  1. src_ : string;
  2. dst_ : string;
  3. value_ : string;
}

showable for t

Sourceval showable_to_yojson : showable -> Yojson.Safe.t
Sourceval sexp_of_showable : showable -> Sexplib0.Sexp.t
Sourceval showable_of_sexp : Sexplib0.Sexp.t -> showable
Sourceval make_xchg : src:string -> dst:string -> Qv.t -> t

Construction

Construct exchange rate, e.g. make_xchg "GBP" "AUD" Utils.make_q(19400/1000)

Sourceval show_xchg : t -> unit

Print the exchange rate

Sourceval (**>) : t -> t -> t

Exchange rate composition

Sourceval xchg_recip : t -> t

Apply reciprocal to exchange rate. xchg_recip (xchg_recip xchg) = id

Sourceval to_showable_json : t -> string

Convert t to showable rep

OCaml

Innovation. Community. Security.