Sebastian Walz 860d31cee1
Tohu vaBohu
2023-04-21 00:22:52 +02:00

36 lines
903 B
Nix

{ common, core, ... }:
let
inherit(common) Total;
inherit(core) debug list number path set string time type;
Account#: { ... } -> Account
= let
__functor
= { credit, debit, ... } @ self:
{ ... } @ transaction:
self
// {
};
__toString
= { uid, ... }:
"<${uid}>";
in
type "Account"
{
from
= uid:
{ ... } @ meta:
Account.instanciate
(
meta
// {
inherit uid __functor __toString;
credit = Total false;
debit = Total true;
}
);
};
in
{ inherit Account; }