Add simplified expression type
Use a pattern-like syntax for describing folds
Rewrite algorithm based on pattern-like approach