Skip to content

[#777][#778] Enhance and rename mutez quasiquote

Description

Problem: We'd like to be able to use numeric underscores and scientific syntax with 'mtzQ'. Also, mtz reads as "millitez" when in reality it represents microtez, additionally, the Q suffix is somewhat inconsistent with our other quotes for literals, like 'mt' and 'ta'.

Solution: Replace 'mtzQ' with 'tz', an XTZ quasiquoter using 'Scientific' parser to parse a scientific notation value; Filter out underscores from input to support numeric underscores; Parse SI suffixes after the number to support specifying different units, e.g. [tz|1|] is 1 XTZ, but [tz|1 u|] or [tz|1 μ|] or [tz|1 micro|] is 1 mutez. See haddocks for more info.

This also adds a re-export of tz from Lorentz.Value, and consequently Lorentz.

Related issue(s)

Resolves #777 (closed), #778 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Nikolay Yakimov

Merge request reports