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

36 lines
1.1 KiB
Nix

{ common, core, ... }:
let
inherit(common) Account;
inherit(core) debug list number path set string time type;
Section#: { title: string, ... } | string -> [ { uid, name, ... } | Seection ] -> Section
= type "Section"
{
from
= uid:
title:
body:
Section.instanciate
{
inherit title uid;
body
= list.map
(
this:
if (Account.isInstanceOf this)
|| (Section.isInstanceOf this)
then
this
else
debug.panic [ "Section" title ]
{
text = "Either Section or Account expected, got";
data = this;
}
)
body;
};
};
in
{ inherit Section; }