on master help sign in
add foldl
commit244f1f995f3d4c9f56665987253636ccd7bde001 authordrbeefsupreme <drbeefsupreme@discordja.net> dateThu 16 Sep 2021, 14:39 (5 years ago) parent8fa1d0b
1 file changed+13−1
content/docs/hoon/reference/stdlib/2b.md+13−1
content/docs/hoon/reference/stdlib/2b.md+13−1
@@ -721,7 +721,19 @@ We can check explicitly what sequence of operations `+roll` performs like this:
721721> (roll "abcde" f)
722722'(e*(d*(c*(b*(a*e_r)))))
723723```
724−
724+This is in contrast to what one might expect:
725+```
726+> =foldl
727+ |* [l=(list) f=$-([* *] *)]
728+ ^- f
729+ ?~ l +<-.f
730+ %= $
731+ +<-.f (f +<-.f i.l)
732+ l t.l
733+ ==
734+> (foldl "abcde" f)
735+'(((((e_l*a)*b)*c)*d)*e)'
736+```
725737
726738---
727739### `++scag`