shrub/gen/cat/pretty.hoon

26 lines
609 B
Plaintext
Raw Normal View History

2015-05-28 05:46:58 +03:00
!:
|%
++ pretty-noun
|= pri=* ^- tank
?~ pri
2015-12-21 00:16:39 +03:00
leaf+"~"
2015-05-28 05:46:58 +03:00
?@ pri
2015-12-21 00:16:39 +03:00
leaf+?:(((sane %tas) pri) <`@tas`pri> <pri>)
=< rose+[" " ?:(- "~[" "[") "]"]^+
2015-05-28 05:46:58 +03:00
|- ^- [? (list tank)]
?~ +.pri
[& ^$(pri -.pri) ~]
?@ +.pri
[| ^$(pri -.pri) ^$(pri +.pri) ~]
[+< - +>]:[^$(pri -.pri) $(pri +.pri)]
::
++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b)))))
::
++ pretty-file
2015-12-21 00:16:39 +03:00
=+ wain-to-tang=|=(a=wain (turn a |=(b=cord leaf+(trip b))))
2015-05-28 05:46:58 +03:00
|= fyl=* ^- tang
=+ `(unit wain)`?@(fyl `(lore fyl) ((soft wain) fyl))
?^ - (wain-to-tang u)
[(pretty-noun fyl)]~
--