From 41a796d2d1465d934edd9cb7305a274bb813b72f Mon Sep 17 00:00:00 2001 From: fang Date: Thu, 10 Mar 2022 01:40:02 +0100 Subject: [PATCH] hoon: hook up $+ for shorthand type rendering Too often when dealing with big types the compiler traces and other such outputs become hard to read. Wrapping a type as $+(shorthand big-type) will now print #shorthand in place of the type. --- pkg/arvo/app/dojo.hoon | 4 +++- pkg/arvo/sys/hoon.hoon | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pkg/arvo/app/dojo.hoon b/pkg/arvo/app/dojo.hoon index 938d9f25a..b127a3ce0 100644 --- a/pkg/arvo/app/dojo.hoon +++ b/pkg/arvo/app/dojo.hoon @@ -679,7 +679,9 @@ [%face ^] a(q $(a q.a)) [%cell ^] a(p $(a p.a), q $(a q.a)) [%fork *] a(p (silt (turn ~(tap in p.a) |=(b=type ^$(a b))))) - [%hint *] !! + [%hint *] ?. ?=(%know -.q.p.a) $(a q.a) + ?@ p.q.p.a [(cat 3 '#' mark.p.q.p.a)]~ + [(rap 3 '#' auth.p.q.p.a (spat type.p.q.p.a) ~)]~ [%core ^] `wain`/core [%hold *] a(p $(a p.a)) == diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index fd6c0fe30..ec4a6fa26 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -7781,7 +7781,7 @@ [%bcgl *] $(mod q.mod) [%bcgr *] $(mod q.mod) [%bckt *] $(mod q.mod) - [%bcls *] $(mod q.mod) + [%bcls *] [%note [%know p.mod] $(mod q.mod)] [%bcmc *] :: borrow sample :: [%tsgl [%$ 6] p.mod] @@ -7832,7 +7832,7 @@ [%bchp *] (decorate (function:clear p.mod q.mod)) [%bcmc *] (decorate (home [%tsgl [%limb %$] p.mod])) [%bcsg *] [%ktls example(mod q.mod) (home p.mod)] - [%bcls *] (decorate example(mod q.mod)) + [%bcls *] (decorate [%note [%know p.mod] example(mod q.mod)]) [%bcts *] (decorate [%ktts p.mod example:clear(mod q.mod)]) [%bcdt *] (decorate (home (interface %gold p.mod q.mod))) [%bcfs *] (decorate (home (interface %iron p.mod q.mod))) @@ -8189,7 +8189,7 @@ relative:clear(mod q.mod) relative:clear(mod p.mod) :: - [%bcls *] relative(mod q.mod) + [%bcls *] [%note [%know p.mod] relative(mod q.mod)] [%bcdt *] (decorate (home (interface %gold p.mod q.mod))) [%bcfs *] (decorate (home (interface %iron p.mod q.mod))) [%bczp *] (decorate (home (interface %lead p.mod q.mod))) @@ -10914,6 +10914,7 @@ [%stop p=@ud] :: [%tree p=term q=wine] :: [%unit p=term q=wine] :: + [%name p=stud q=wine] :: == :: -- |_ sut=type @@ -11004,6 +11005,11 @@ [%unit *] =^ cox gid $(q.ham q.q.ham) :_(gid [%rose [" " (weld (trip p.q.ham) "(") ")"] cox ~]) + :: + [%name *] + :_ gid + ?@ p.q.ham (cat 3 '#' mark.p.q.ham) + (rap 3 '#' auth.p.q.ham (spat type.p.q.ham) ~) == -- :: @@ -11191,6 +11197,9 @@ ?~ wal ~ [~ %rose [[' ' ~] ['[' ~] [']' ~]] [%leaf '~' ~] u.wal ~] + :: + [%name *] + $(q.ham q.q.ham) == :: ++ doge @@ -11295,7 +11304,9 @@ == :: [%hint *] - $(sut q.sut) + =+ yad=$(sut q.sut) + ?. ?=(%know -.q.p.sut) yad + [p.yad [%name p.q.p.sut q.yad]] :: [%face *] =+ yad=$(sut q.sut) @@ -13010,6 +13021,7 @@ ['=' (rune tis %bcts exqg)] ['?' (rune wut %bcwt exqs)] [';' (rune mic %bcmc expa)] + ['+' (rune lus %bcls exqg)] == == :- '%' @@ -13080,6 +13092,7 @@ ['-' (stag %ktcl (rune hep %bchp exqb))] ['=' (stag %ktcl (rune tis %bcts exqg))] ['?' (stag %ktcl (rune wut %bcwt exqs))] + ['+' (stag %ktcl (rune lus %bcls exqg))] ['.' (rune dot %kttr exqa)] [',' (rune com %ktcl exqa)] ==