Metamorphic Programming : Structured Recursion for Abstract Data Types
We extend the structured recursive programming discipline, which favors the use of fold operations in place of general recursion, to abstract data types. The key idea is to represent an ADT by two parts, a constructor and a destructor, which are essentially functions to/from a common representation. Then a fold can work on an ADT by applying parameter functions to values that are delivered by the ADT's own destructor. Fold operations that use as a parameter the constructor of another ADT, called ADT transformers, play an important role and offer a concise programming style. We present some laws for ADT folds and transformers and show their use in program optimization and verification.
Nutzung und Vervielfältigung:
Alle Rechte vorbehalten