on master help sign in
add foldl
244f1f9drbeefsupreme
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:
721> (roll "abcde" f)
721> (roll "abcde" f)
722'(e*(d*(c*(b*(a*e_r)))))
722'(e*(d*(c*(b*(a*e_r)))))
723```
723```
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+```
725
737
726---
738---
727### `++scag`
739### `++scag`