law foldl_reverse

bend-mathlib@0.8.1.0 · list.bend:1947

import bend-mathlib@0.8.1.0/list.bend as List
import Base

1947# A left fold over the reverse is a right fold with the arguments flipped.
1948law foldl_reverse:
1949  for ~a: Quant
1950  for ~A: Kind(a)
1951  for ~B: Type
1952  for ~f: B -> A -> B
1953  for xs: List<a, A>
1954  for -z: B
1955  {List.foldl(~a, ~A, ~B, ~f, List.reverse(a, A, xs), z) == List.foldr(~a, ~A, ~B, ~(x => y => f(y, x)), xs, z) : B}

Uses (5)

Used by (1)