Notes - Functional Programming MT22, Fold fusion


Fold fusion theorem

Can you state the fold fusion theorem in full?


If

  • $\text{f}$ is strict
  • $\text{b = f a}$
  • $\text{f (g x y) = h x (f y)}$ Then
\[\text{f $\cdot$ fold g a = fold h b}\]

Can you name the three conditions for the fold fusion theorem

$\text{f . fold g a = fold h b}$

to be applicable?


  • $\text{f}$ is strict
  • $\text{b = f a}$
  • $\text{f (g x y) = h x (f y)}$



Related posts