law foldr_reverse

bend-mathlib@0.8.1.0 · list.bend:1967

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

1967# A right fold over the reverse is a left fold with the arguments flipped.
1968law foldr_reverse:
1969  for ~a: Quant
1970  for ~A: Kind(a)
1971  for ~B: Type
1972  for ~f: A -> B -> B
1973  for xs: List<a, A>
1974  for -z: B
1975  {List.foldr(~a, ~A, ~B, ~f, List.reverse(a, A, xs), z) == List.foldl(~a, ~A, ~B, ~(x => y => f(y, x)), xs, z) : B}

Uses (5)

Used by (1)