@@ -6449,6 +6449,11 @@
64496449++ import-to-itype
64506450 |= node=*
64516451 ^- (unit itype)
6452+ (import-to-itype-standard node ~)
6453+::
6454+++ import-to-itype-standard
6455+ |= [node=* standard=(unit ischeme)]
6456+ ^- (unit itype)
64526457 ?@ node ~
64536458 ?+ -.node ~
64546459 %noun ?:(=(node [%noun ~]) `[%noun ~] ~)
@@ -6490,18 +6495,24 @@
64906495 ?: |(=(%map name) =(%mop name) =(%jar name) =(%jug name)) 2
64916496 0
64926497 ?: =(arity 0) ~
6493− =/ args=(unit (list itype)) (import-to-itypes +>.node)
6498+ =/ args=(unit (list itype)) (import-to-itypes-standard +>.node standard)
64946499 ?~ args ~
64956500 ?. =(arity (lent u.args)) ~
64966501 =/ keyed=(unit [types=(list itype) sub=isub]) (itype-collection-keys name u.args ~)
64976502 ?~ keyed ~
6503+ ?: =(%unit name)
6504+ ?. ?=([* ~] types.u.keyed) ~
6505+ ?~ standard `[%collection name types.u.keyed]
6506+ ?. (standard-unit-template u.standard /lib/jibb/prelude/jibb) ~
6507+ =/ nil=itype [%const [%null %n 0 '~']]
6508+ `[%union ~[nil [%cell nil [%face %u i.types.u.keyed]]] `[/lib/jibb/prelude/jibb %unit] `%unit types.u.keyed]
64986509 `[%collection name types.u.keyed]
64996510 %fork
65006511 :: Hoon's ordinary ? mold is the fork of its two %f singletons.
65016512 =/ raw=* +.node
65026513 ?: |(=(raw ~[[%atom %f `0] [%atom %f `1]]) =(raw ~[[%atom %f `1] [%atom %f `0]]))
65036514 `[%flag ~]
6504− =/ cases=(unit (list itype)) (import-to-itypes raw)
6515+ =/ cases=(unit (list itype)) (import-to-itypes-standard raw standard)
65056516 ?~ cases ~
65066517 ?~ u.cases ~
65076518 ?~ t.u.cases ~
@@ -6541,10 +6552,15 @@
65416552++ import-to-itypes
65426553 |= nodes=*
65436554 ^- (unit (list itype))
6555+ (import-to-itypes-standard nodes ~)
6556+::
6557+++ import-to-itypes-standard
6558+ |= [nodes=* standard=(unit ischeme)]
6559+ ^- (unit (list itype))
65446560 ?@ nodes ?:(=(nodes 0) `~ ~)
6545− =/ first (import-to-itype -.nodes)
6561+ =/ first (import-to-itype-standard -.nodes standard)
65466562 ?~ first ~
6547− =/ rest $(nodes +.nodes)
6563+ =/ rest $(nodes +.nodes, standard standard)
65486564 ?~ rest ~
65496565 `[u.first u.rest]
65506566::
@@ -6571,9 +6587,10 @@
65716587 ?. (levy t.cases |=(t=itype =(%disjoint (union-relate first (import-type-pattern t))))) |
65726588 $(cases t.cases)
65736589::
6574−++ find-imported-mold
6575− |= [module=term name=term externals=iexternals surs=(list term)]
6590+++ find-imported-mold-prelude
6591+ |= [module=term name=term externals=iexternals surs=(list term) prelude=ifile]
65766592 ^- (unit itype)
6593+ =/ standard=(unit ischeme) (find-jibb-mold %unit prelude)
65776594 ?. (lien surs |=(n=term =(n module))) ~
65786595 =/ found=iexternals
65796596 (skim externals |=(e=[module=term name=term result=*] &(=(module module.e) =(name name.e))))
@@ -6584,13 +6601,17 @@
65846601 ?. ?=(%& -.result) ~
65856602 =/ node=* +.result
65866603 ?. (imported-faces-valid node) ~
6587− ?@ node (import-to-itype node)
6588− ?: ?=(%ref -.node) (import-to-itype node)
6604+ ?@ node (import-to-itype-standard node standard)
6605+ ?: ?=(%ref -.node) (import-to-itype-standard node standard)
65896606 =/ pattern=(unit irec-pattern) (rec-pattern node module name)
6590− ?~ pattern (import-to-itype node)
6591− ?. has.u.pattern (import-to-itype node)
6607+ ?~ pattern (import-to-itype-standard node standard)
6608+ ?. has.u.pattern (import-to-itype-standard node standard)
65926609 `[%recursive module name `(crip "{(trip name)}.{(trip module)}")]
6593−
6610+::
6611+++ find-imported-mold
6612+ |= [module=term name=term externals=iexternals surs=(list term)]
6613+ ^- (unit itype)
6614+ (find-imported-mold-prelude module name externals surs *ifile)
65946615::
65956616++ collect-sur-imports
65966617 |= imports=(list import)
@@ -6608,9 +6629,10 @@
66086629 [mark.i.imports $(imports t.imports)]
66096630 $(imports t.imports)
66106631::
6611−++ find-imported-mark
6612− |= [name=term externals=imark-externals marks=(list term)]
6632+++ find-imported-mark-prelude
6633+ |= [name=term externals=imark-externals marks=(list term) prelude=ifile]
66136634 ^- (unit itype)
6635+ =/ standard=(unit ischeme) (find-jibb-mold %unit prelude)
66146636 ?. (unique-value-name name marks) ~
66156637 =/ found=imark-externals
66166638 (skim externals |=(e=[mark=term result=*] =(name mark.e)))
@@ -6620,7 +6642,12 @@
66206642 ?@ result ~
66216643 ?. ?=(%& -.result) ~
66226644 ?. (imported-faces-valid +.result) ~
6623− (import-to-itype +.result)
6645+ (import-to-itype-standard +.result standard)
6646+::
6647+++ find-imported-mark
6648+ |= [name=term externals=imark-externals marks=(list term)]
6649+ ^- (unit itype)
6650+ (find-imported-mark-prelude name externals marks *ifile)
66246651::
66256652++ find-jibb-interface
66266653 |= [face=term imports=ijimports]
@@ -7035,12 +7062,12 @@
70357062 ?^ vars.u.found ~
70367063 `[(itype-in-import typ.u.found u.iface i.t.names.sh prelude.state) state]
70377064 =/ found=(unit itype)
7038− (find-imported-mold i.t.names.sh n externals.state surs.state)
7065+ (find-imported-mold-prelude i.t.names.sh n externals.state surs.state ?~(prelude.state *ifile u.prelude.state))
70397066 ?~ found ~
70407067 `[u.found state]
70417068 ?: (lien marks.state |=(x=term =(x n)))
70427069 ?^ (find-simple-mold n molds.state) ~
7043− =/ imported=(unit itype) (find-imported-mark n mark-externals.state marks.state)
7070+ =/ imported=(unit itype) (find-imported-mark-prelude n mark-externals.state marks.state ?~(prelude.state *ifile u.prelude.state))
70447071 ?~ imported ~
70457072 `[u.imported state]
70467073 ?: (lien active.state |=(x=term =(x n))) ~
@@ -10325,11 +10352,6 @@
1032510352 =. entry entry(source src, target dst)
1032610353 `[entry u.rest]
1032710354::
10328−++ add-supported-defs
10329− |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition)]
10330− ^- [env=ienv artifacts=(list iwidth-definition)]
10331− (add-supported-defs-core ds all-defs checked heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts ~)
10332−::
1033310355
1033410356+$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
1033510357+$ iadj (map term (list term))
@@ -10471,12 +10493,11 @@
1047110493 =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
1047210494 `[[[name.d [typ vars]] env] checked artifacts]
1047310495++ add-supported-defs-core
10474− |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
10496+ |= [ds=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile) artifacts=(list iwidth-definition) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
1047510497 ^- [env=ienv artifacts=(list iwidth-definition)]
1047610498 ?~ ds [env artifacts]
1047710499 =/ d=def i.ds
1047810500 ?: ?=(%mold -.d) $(ds t.ds)
10479− ?: (lien (program-recovery-names all-defs) |=(n=term =(n name.d))) $(ds t.ds)
1048010501 ?. (unique-value-name name.d globals) $(ds t.ds)
1048110502 ?^ (ienv-lookup name.d env) $(ds t.ds)
1048210503 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
@@ -10531,7 +10552,7 @@
1053110552 =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
1053210553 |-
1053310554 =/ next=[env=ienv artifacts=(list iwidth-definition)]
10534− (add-supported-defs-core ds ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts index)
10555+ (add-supported-defs-core ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts index)
1053510556 =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
1053610557 =. grec-index.initial index
1053710558 =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
@@ -11615,9 +11636,38 @@
1161511636 ?. ?=(%tvar -.i.args.tail) |
1161611637 =(var name.i.args.tail)
1161711638::
11639+++ prelude-public-label
11640+ |= label=@t
11641+ ^- (unit @t)
11642+ ?: =(label 'ask.internal') `'ask'
11643+ ?: =(label 'qath.internal') `'qath'
11644+ ?: =(label 'raw-poke.internal') `'raw-poke'
11645+ `label
11646+::
11647+++ prelude-label-nested
11648+ |= typ=itype
11649+ ^- itype
11650+ ?- -.typ
11651+ %union
11652+ =/ label=(unit @t) ?~(label.typ ~ (prelude-public-label u.label.typ))
11653+ [%union (turn cases.typ |=(c=itype (prelude-label-nested c))) origin.typ label (turn args.typ |=(c=itype (prelude-label-nested c)))]
11654+ %grec
11655+ =/ label=(unit @t) ?~(label.typ ~ (prelude-public-label u.label.typ))
11656+ typ(label label, args (turn args.typ |=(c=itype (prelude-label-nested c))))
11657+ %jrec
11658+ =/ label=(unit @t) ?~(label.typ ~ (prelude-public-label u.label.typ))
11659+ typ(label label)
11660+ %collection [%collection name.typ (turn args.typ |=(c=itype (prelude-label-nested c)))]
11661+ %face [%face name.typ $(typ body.typ)]
11662+ %fn [%fn $(typ sample.typ) $(typ product.typ)]
11663+ %cell [%cell $(typ hed.typ) $(typ tal.typ)]
11664+ * typ
11665+ ==
11666+::
1161811667++ prelude-label
1161911668 |= [typ=itype name=term vars=(list @ud)]
1162011669 ^- itype
11670+ =. typ (prelude-label-nested typ)
1162111671 ?: ?=(%jrec -.typ) typ(label `name)
1162211672 ?: ?=(%grec -.typ)
1162311673 ?. (identity-union-parameters vars args.typ) typ(label ~)
@@ -12113,22 +12163,22 @@
1211312163+$ iapi-mark-type [name=term typ=itype]
1211412164+$ iapi-path-typed [path=iapi-path full=itype diffs=(list iapi-mark-type)]
1211512165++ api-diff-types
12116− |= [names=(list term) externals=imark-externals declared=(list term)]
12166+ |= [names=(list term) externals=imark-externals declared=(list term) prelude=ifile]
1211712167 ^- (unit (list iapi-mark-type))
1211812168 ?~ names `~
12119− =/ typ=(unit itype) (find-imported-mark i.names externals declared)
12169+ =/ typ=(unit itype) (find-imported-mark-prelude i.names externals declared prelude)
1212012170 ?~ typ ~
1212112171 =/ tail=(unit (list iapi-mark-type)) $(names t.names)
1212212172 ?~ tail ~
1212312173 `[[i.names u.typ] u.tail]
1212412174::
1212512175++ api-path-types
12126− |= [paths=(list iapi-path) externals=imark-externals declared=(list term)]
12176+ |= [paths=(list iapi-path) externals=imark-externals declared=(list term) prelude=ifile]
1212712177 ^- (unit (list iapi-path-typed))
1212812178 ?~ paths `~
12129− =/ full=(unit itype) (find-imported-mark full.i.paths externals declared)
12179+ =/ full=(unit itype) (find-imported-mark-prelude full.i.paths externals declared prelude)
1213012180 ?~ full ~
12131− =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared)
12181+ =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared prelude)
1213212182 ?~ diffs ~
1213312183 =/ tail=(unit (list iapi-path-typed)) $(paths t.paths)
1213412184 ?~ tail ~
@@ -12148,7 +12198,7 @@
1214812198 `~[u.name]
1214912199::
1215012200++ api-path-analysis
12151− |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term)]
12201+ |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term) prelude=ifile]
1215212202 ^- (unit (list iapi-path-typed))
1215312203 ?: (lien defs.mod def-has-hole) ~
1215412204 ?^ (duplicate-defs defs.mod) ~
@@ -12171,7 +12221,7 @@
1217112221 ?~ paths ~
1217212222 =/ derived-pokes=(list term) ?~(pokes ~ ~[%poke])
1217312223 ?. (api-derived-names-valid u.paths derived-pokes mod prelude-values) ~
12174− (api-path-types u.paths externals declared)
12224+ (api-path-types u.paths externals declared prelude)
1217512225::
1217612226:: Source/graph entry for path analysis only. The returned paths retain
1217712227:: reader-derived mark types and import resolution has checked reachable
@@ -12185,12 +12235,13 @@
1218512235 =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
1218612236 ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
1218712237 ?~ prepared [%| 'API path analysis needs the prepared prelude']
12238+ =/ public=ifile iface.u.prepared
1218812239 =/ prelude=(unit ifile) `iface.u.prepared
1218912240 =/ deps=jimports-result
1219012241 (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ prelude)
1219112242 ?: ?=(%| -.deps) [%| p.deps]
1219212243 =/ paths=(unit (list iapi-path-typed))
12193− (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12244+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared public)
1219412245 ?~ paths [%| 'API path declaration needs unsupported analysis']
1219512246 [%& u.paths]
1219612247::
@@ -12215,7 +12266,7 @@
1221512266 (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
1221612267 ?: ?=(%| -.deps) [%| p.deps]
1221712268 =/ paths=(unit (list iapi-path-typed))
12218− (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12269+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared public)
1221912270 ?~ paths [%| 'API path declaration needs unsupported analysis']
1222012271 [%& [file src u.prepared externals marks cache.p.deps u.paths]]
1222112272:: Graph-aware variant preserves the caller active stack and cache.
@@ -12236,7 +12287,7 @@
1223612287 (resolve-jibb-imports imports.p.parsed externals marks modules active values.u.prepared molds.u.prepared cache `public)
1223712288 ?: ?=(%| -.deps) [%| p.deps]
1223812289 =/ paths=(unit (list iapi-path-typed))
12239− (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
12290+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared public)
1224012291 ?~ paths [%| 'API path declaration needs unsupported analysis']
1224112292 [%& [file src u.prepared externals marks cache.p.deps u.paths]]
1224212293::
@@ -12323,7 +12374,7 @@
1232312374 =/ vals=(list term) (global-value-names ordinary)
1232412375 ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
1232512376 =/ declared=(list term) (collect-mark-imports imports.mod)
12326− =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12377+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared iface.prep)
1232712378 ?~ mark-types [%| 'API declared marks need unsupported inference']
1232812379 =/ prelude=(unit ifile) `iface.prep
1232912380 =/ deps=jimports-result
@@ -12357,7 +12408,7 @@
1235712408 =/ vals=(list term) (global-value-names ordinary)
1235812409 ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
1235912410 =/ declared=(list term) (collect-mark-imports imports.mod)
12360− =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12411+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared iface.prep)
1236112412 ?~ mark-types [%| 'API declared marks need unsupported inference']
1236212413 =/ prelude=(unit ifile) `iface.prep
1236312414 =/ deps=jimports-result
@@ -12558,10 +12609,10 @@
1255812609 [%& [support u.parts interface]]
1255912610::
1256012611++ api-mark-exports
12561− |= [marks=(list term) all=(list term) externals=imark-externals]
12612+ |= [marks=(list term) all=(list term) externals=imark-externals prelude=ifile]
1256212613 ^- imold-types
1256312614 ?~ marks ~
12564− =/ t=(unit itype) (find-imported-mark i.marks externals all)
12615+ =/ t=(unit itype) (find-imported-mark-prelude i.marks externals all prelude)
1256512616 ?~ t $(marks t.marks)
1256612617 [[i.marks [u.t ~]] $(marks t.marks)]
1256712618::
@@ -12597,11 +12648,11 @@
1259712648 =/ n=term i.names.sh
1259812649 ?. (unique-value-name n marks) ~
1259912650 ?: |((lien prelude-values |=(x=term =(n x))) (lien prelude-molds |=(x=term =(n x)))) ~
12600− =/ mark=(unit itype) (find-imported-mark n mark-externals marks)
12651+ =/ mark=(unit itype) (find-imported-mark-prelude n mark-externals marks u.prelude)
1260112652 ?~ mark ~
1260212653 =/ sc=(unit ischeme) (derived-poke-command-scheme u.prelude u.mark)
1260312654 ?~ sc ~
12604− `[~[[%poke u.sc]] (api-mark-exports marks marks mark-externals) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
12655+ `[~[[%poke u.sc]] (api-mark-exports marks marks mark-externals u.prelude) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
1260512656::
1260612657:: Source-proven ordinary helpers validate each selected /sur dependency.
1260712658:: Unused or less direct cores remain unsupported by this first interface.
@@ -13186,48 +13237,6 @@
1318613237 ?~ mapper ~
1318713238 `[xs u.mapper]
1318813239::
13189−++ program-recovery-names
13190− |= ds=(list def)
13191− ^- (list term)
13192− =/ main=(unit def) (program-main-def ds)
13193− ?~ main ~
13194− =/ parts=(unit [init=term update=term view=term subs=term])
13195− (program-main-parts u.main)
13196− ?~ parts ~
13197− =/ views=(list def)
13198− (skim ds |=(d=def &(?=(%value -.d) =(view.u.parts name.d))))
13199− ?. ?=([* ~] views) ~
13200− =/ view-def=def i.views
13201− ?> ?=(%value -.view-def)
13202− =/ written=(unit sample) (direct-gate-sample view-def)
13203− ?~ written ~
13204− =/ body=expr
13205− ?- -.val.view-def
13206− %gate body.val.view-def
13207− %gate-wide body.val.view-def
13208− * !!
13209− ==
13210− =/ sites=(unit (list iview-site)) (program-view-sites body ~)
13211− ?~ sites ~
13212− ?. ?=([* ~] u.sites) ~
13213− =/ mapper=term mapper.i.u.sites
13214− =/ components=(list term)
13215− :~ init.u.parts
13216− update.u.parts
13217− view.u.parts
13218− subs.u.parts
13219− ==
13220− ?: (lien components |=(n=term =(n mapper))) ~
13221− =/ mappers=(list def)
13222− (skim ds |=(d=def &(?=(%value -.d) =(mapper name.d))))
13223− ?. ?=([* ~] mappers) ~
13224− :~ init.u.parts
13225− update.u.parts
13226− view.u.parts
13227− subs.u.parts
13228− mapper
13229− ==
13230−::
1323113240++ program-sample-binders
1323213241 |= sam=sample
1323313242 ^- (list term)
@@ -13967,7 +13976,7 @@
1396713976 ?~ error ~
1396813977 ?. ?=(%union -.typ.u.raw) ~
1396913978 =/ poke-case=itype
13970− [%cell [%const [%term %tas %poke '%poke']] [%cell [%face %p typ.u.raw(label `'raw-poke.internal')] [%face %reply [%fn u.error [%var m]]]]]
13979+ [%cell [%const [%term %tas %poke '%poke']] [%cell [%face %p typ.u.raw(label `'raw-poke')] [%face %reply [%fn u.error [%var m]]]]]
1397113980 =/ go-case=itype
1397213981 [%cell [%const [%term %tas %go '%go']] [%face %url [%atom %t]]]
1397313982 =/ wait-case=itype
@@ -14111,7 +14120,7 @@
1411114120 ?~ heads resolution
1411214121 =/ checked=(map term def) (direct-checked-gates ds env.resolution)
1411314122 =/ completed=[env=ienv artifacts=(list iwidth-definition)]
14114− (add-supported-defs-core ~[main] ds checked heads env.resolution molds.initial globals.initial externals.initial surs.initial mark-externals.initial marks.initial jimports.initial reserved-molds.initial at.initial prelude.initial artifacts.resolution grec-index.initial)
14123+ (add-supported-defs-core ~[main] checked heads env.resolution molds.initial globals.initial externals.initial surs.initial mark-externals.initial marks.initial jimports.initial reserved-molds.initial at.initial prelude.initial artifacts.resolution grec-index.initial)
1411514124 [env.completed grouped.resolution artifacts.completed]
1411614125::
1411714126:: A static main may retain a generic element message in its ordinary