package catala

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

Module RuntimeSource

Types

Sourcetype money
Sourcetype integer
Sourcetype decimal
Sourcetype date
Sourcetype duration

Exceptions

Sourceexception EmptyError
Sourceexception AssertionFailed
Sourceexception ConflictError
Sourceexception UncomparableDurations
Sourceexception ImpossibleDate
Sourceexception NoValueProvided

Constructors and conversions

Money

Sourceval money_of_cents_string : string -> money
Sourceval money_of_units_int : int -> money
Sourceval money_of_cents_integer : integer -> money
Sourceval money_to_float : money -> float
Sourceval money_to_string : money -> string
Sourceval money_to_cents : money -> integer

Decimals

Sourceval decimal_of_string : string -> decimal
Sourceval decimal_to_string : max_prec_digits:int -> decimal -> string
Sourceval decimal_of_integer : integer -> decimal
Sourceval decimal_of_float : float -> decimal
Sourceval decimal_to_float : decimal -> float

Integers

Sourceval integer_of_string : string -> integer
Sourceval integer_to_string : integer -> string
Sourceval integer_to_int : integer -> int
Sourceval integer_of_int : int -> integer
Sourceval integer_log2 : integer -> int
Sourceval integer_exponentiation : integer -> int -> integer

Dates

Sourceval day_of_month_of_date : date -> integer
Sourceval month_number_of_date : date -> integer
Sourceval year_of_date : date -> integer
Sourceval date_to_string : date -> string
Sourceval date_of_numbers : int -> int -> int -> date

Usage: date_of_numbers year month day

Durations

Sourceval duration_of_numbers : int -> int -> int -> duration
Sourceval duration_to_days_months_years : duration -> int * int * int
Sourceval duration_to_string : duration -> string

Defaults

Sourceval handle_default : (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a
Sourceval no_input : unit -> 'a

Operators

Money

Sourceval (*$) : money -> decimal -> money
Sourceval (/$) : money -> money -> decimal
Sourceval (+$) : money -> money -> money
Sourceval (-$) : money -> money -> money
Sourceval (~-$) : money -> money
Sourceval (=$) : money -> money -> bool
Sourceval (<=$) : money -> money -> bool
Sourceval (>=$) : money -> money -> bool
Sourceval (<$) : money -> money -> bool
Sourceval (>$) : money -> money -> bool

Integers

Sourceval (+!) : integer -> integer -> integer
Sourceval (-!) : integer -> integer -> integer
Sourceval (~-!) : integer -> integer
Sourceval (*!) : integer -> integer -> integer
Sourceval (=!) : integer -> integer -> bool
Sourceval (>=!) : integer -> integer -> bool
Sourceval (<=!) : integer -> integer -> bool
Sourceval (>!) : integer -> integer -> bool
Sourceval (<!) : integer -> integer -> bool

Decimals

Sourceval (+&) : decimal -> decimal -> decimal
Sourceval (-&) : decimal -> decimal -> decimal
Sourceval (~-&) : decimal -> decimal
Sourceval (*&) : decimal -> decimal -> decimal
Sourceval (=&) : decimal -> decimal -> bool
Sourceval (>=&) : decimal -> decimal -> bool
Sourceval (<=&) : decimal -> decimal -> bool
Sourceval (>&) : decimal -> decimal -> bool
Sourceval (<&) : decimal -> decimal -> bool

Dates

Sourceval (+@) : date -> duration -> date
Sourceval (-@) : date -> date -> duration
Sourceval (=@) : date -> date -> bool
Sourceval (>=@) : date -> date -> bool
Sourceval (<=@) : date -> date -> bool
Sourceval (>@) : date -> date -> bool
Sourceval (<@) : date -> date -> bool

Durations

Sourceval (~-^) : duration -> duration
Sourceval (=^) : duration -> duration -> bool
Sourceval (>=^) : duration -> duration -> bool
Sourceval (<=^) : duration -> duration -> bool
Sourceval (>^) : duration -> duration -> bool
Sourceval (<^) : duration -> duration -> bool

Arrays

Sourceval array_filter : ('a -> bool) -> 'a array -> 'a array
Sourceval array_length : 'a array -> integer
OCaml

Innovation. Community. Security.