hoon: add +roll

This commit is contained in:
Alex Shelkovnykov 2023-09-05 13:16:02 -06:00
parent 304f399595
commit ff2650cf3a

View File

@ -229,6 +229,14 @@
?~ a ~ ?~ a ~
[b $(a (dec a))] [b $(a (dec a))]
:: ::
++ roll :: left fold
~/ %roll
|* [a=(list) b=_=>(~ |=([* *] +<+))]
|- ^+ ,.+<+.b
?~ a
+<+.b
$(a t.a, b b(+<+ (b i.a +<+.b)))
::
++ slag :: suffix ++ slag :: suffix
~/ %slag ~/ %slag
|* [a=@ b=(list)] |* [a=@ b=(list)]