Builtin modifiers for token amounts #193

Open
opened 2019-12-09 21:13:18 +09:00 by zxq9 · 1 comment
zxq9 commented 2019-12-09 21:13:18 +09:00 (Migrated from gitlab.com)

Created by: UlfNorell

From the Sophia discussion at the Sofia workshop.

*Created by: UlfNorell* *From the Sophia discussion at the Sofia workshop.*
zxq9 commented 2019-12-09 21:16:23 +09:00 (Migrated from gitlab.com)

Created by: UlfNorell

This sounds like a very simple library to me:

namespace Amount =
  function ae(n : int) = 1_000_000_000_000_000_000 * n
  ...

Possibly you want a separate type to get some added safety

namespace Amount =
  record aetto = {value : int}
  function ae(n : int) : aetto = {value = 1_000_000_000_000_000_000 * n}
  ...
*Created by: UlfNorell* This sounds like a very simple library to me: ``` namespace Amount = function ae(n : int) = 1_000_000_000_000_000_000 * n ... ``` Possibly you want a separate type to get some added safety ``` namespace Amount = record aetto = {value : int} function ae(n : int) : aetto = {value = 1_000_000_000_000_000_000 * n} ... ```
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#193
No description provided.