Abstract:
Hylomorphisms in functional programming languages have the disadvantages of describing those recursive functions with parameters. To solve this problem, we use the polynomial functors defined on the category of completed partial orders to propose two different kinds of hylomorphisms with fixed or accumulating parameters, named phylo or ahylo morphisms respectively; and prove that they are both unique under the conditions of fixed or accumulating parameters, which as a result extends the research work of Pardo on recursive functions with parameters, named pfold and afold respectively, to hylomorphisms with parameters. Our work can allow hylomorphisms to directly carry extra parameters as the inputs of calculations or to store those accumulating values produced by programs temporally during the calculations. We also point out and analyze the relations of phylo morphisms and ahylo morphisms with other recursive and corecursive functions, and present their associated calculational laws in a categorical and abstract sense. Most of our work is implemented using the functional programming language Haskell.