package wax-lib

  1. Overview
  2. Docs
Libraries for Wax, a Rust-like syntax for WebAssembly

Install

dune-project
 Dependency

Authors

Maintainers

Sources

wax-0.1.0.tbz
sha256=41b580846af8d41bdf6c3f005f62e38feda3e60fe2e9e4aa440db34ce515a153
sha512=4b3a181fcc7d743194a8647260870fb5190770066a197bcc48104c2b77fd40c643228b795c2bcd6b29a120820e969eb42a37a9bcec98b3f608d13f152d9f6579

doc/wax-lib.utils/Wax_utils/Debug/index.html

Module Wax_utils.DebugSource

Developer-facing debug output, enabled per category with --debug.

Sourcetype category =
  1. | Timing
    (*

    Extend with future debug features.

    *)
Sourceval categories : string list

Known category names, for help text and error messages. Currently ["timing"].

Sourceval parse : string -> (category, string) result

Parse one category name; Error msg names the valid categories.

Sourceval enable : category list -> unit

Record which debug categories are active. Call once at startup.

Sourceval is_enabled : category -> bool

Whether the given category was enabled by enable.

Sourceval timed : string -> (unit -> 'a) -> 'a

timed label f runs f (). When Timing is enabled, it measures the wall-clock duration of f and prints "<label>: <n> ms" to stderr; otherwise it just runs f with no measurement and no output.

Sourceval timed_if : bool -> string -> (unit -> 'a) -> 'a

timed_if cond label f is timed label f when cond holds, and f () untimed otherwise. Used to skip timing a measurement-only sub-pass (e.g. the dry trivia-collection traversal of the printer).