Generalising and dualising the third list-homomorphism theorem: Functional pearl

Shin Cheng Mu, Akimasa Morihata

Research output: Contribution to journalArticlepeer-review

Abstract

The third list-homomorphism theorem says that a function is a list homomorphism if it can be described as an instance of both a foldr and a foldl . We prove a dual theorem for unfolds and generalise both theorems to trees: if a function generating a list can be described both as an unfoldr and an unfoldl , the list can be generated from the middle, and a function that processes or builds a tree both upwards and downwards may independently process/build a subtree and its one-hole context. The point-free, relational formalism helps to reveal the beautiful symmetry hidden in the theorem.

Original languageEnglish
Pages (from-to)385-391
Number of pages7
JournalACM SIGPLAN Notices
Volume46
Issue number9
DOIs
Publication statusPublished - 2011 Sep 1

Keywords

  • Program derivation
  • Third list homomorphism theorem

ASJC Scopus subject areas

  • Computer Science(all)

Cite this