law foldl_map_sym
import bend-mathlib@0.8.1.0/list.bend as Listimport Base
2702# A left fold over a map folds with the mapped function: foldl g z (map f xs) = foldl (fun acc x => g acc (f x)) z xs, reversed to rewrite toward the simple side.
2703law foldl_map_sym:
2704 for ~A: Type
2705 for ~B: Type
2706 for ~C: Type
2707 for ~f: A -> B
2708 for ~g: C -> B -> C
2709 for xs: List<A>
2710 for -z: C
2711 {List.foldl(~&1, ~A, ~C, ~(x => y => g(x, f(y))), xs, z) == List.foldl(~&1, ~B, ~C, ~g, List.map(~A, ~B, ~f, xs), z) : C}
Uses (5)
Used by (0)
No other definition uses this definition.