Skip to main content

Build, Augment and Destroy, Universally

  • Conference paper
Programming Languages and Systems (APLAS 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3302))

Included in the following conference series:

Abstract

We give a semantic footing to the fold/build syntax of programming with inductive types, covering shortcut deforestation, based on a universal property. Specifically, we give a semantics for inductive types based on limits of algebra structure forgetting functors and show that it is equivalent to the usual initial algebra semantics. We also give a similar semantic account of the augment generalization of build and of the unfold/destroy syntax of coinductive types.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Altenkirch, T.: Logical relations and inductive/coinductive types. In: Gottlob, G., Grandjean, E., Seyr, K. (eds.) CSL 1998. LNCS, vol. 1584, pp. 343–354. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  2. Bainbridge, E.S., Freyd, P.J., Scedrov, A., Scott, P.J.: Functorial polymorphism. Theoretical Computer Science 70(1), 35–64 (1991); Corrigendum, ibid. 71(3), 431 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  3. Böhm, C., Berarducci, A.: Automatic synthesis of typed Λ-programs on term algebras. Theoretical Computer Science 39(2–3), 135–154 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  4. Dubuc, E., Street, R.: Dinatural transformations. In: Lane, S.M. (ed.) Reports of the Midwest Category Seminar IV, pp. 126–137. Springer, Heidelberg (1970)

    Chapter  Google Scholar 

  5. Eppendahl, A.: Parametricity and Mulry’s strong dinaturality. Technical Report 768, Dept.of Computer Science, Queen Mary and Westfield College, London (1999)

    Google Scholar 

  6. Eppendahl, A.: Categories and Types for Axiomatic Domain Theory. PhD thesis, Queen Mary, University of London (2003)

    Google Scholar 

  7. Fegaras, L.: Using the parametricity proposition for program fusion. Technical report CSE-96-001, Dept.of Computer Science and Engineering, Oregon Graduate Institute, Portland, OR (1996)

    Google Scholar 

  8. Freyd, P.J.: Structural polymorphism. Theoretical Computer Science 115(1), 107–129 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  9. Ghani, N., Lüth, C., Marchi, F.D.: Coalgebraic monads. In: Moss, L.S. (ed.) Proc. of 5th Wksh. on Coalgebraic Methods in Computer Science, CMCS 2002. Electronic Notes in Theoretical Computer Science, vol. 65(1). Elsevier, Amsterdam (2002)

    Google Scholar 

  10. Gill, A., Launchbury, J., Jones, S.L.P.: A short cut to deforestation. In: Conf. Record of 6th ACM SIGPLAN-SIGARCH Int. Conf. on Functional Programming Languages and Computer Architecture, FPCA 1993, pp. 223–232. ACM Press, New York (1993)

    Google Scholar 

  11. Gill, A.J.: Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Univ. of Glasgow (1996)

    Google Scholar 

  12. Girard, J.-Y., Scedrov, A., Scott, P.J.: Normal forms and cut-free proofs as natural transformations. In: Moschovakis, Y.N. (ed.) Logic from Computer Science, Mathematical Sciences Research Institute Publications, vol. 21, pp. 217–241. Springer, Heidelberg (1991)

    Google Scholar 

  13. Hagino, T.: A typed lambda calculus with categorical type constructors. In: Pitt, D.H., Rydeheard, D.E., Poigné, A. (eds.) Category Theory and Computer Science. LNCS, vol. 283, pp. 140–157. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  14. Hasegawa, R.: Categorical data types in parametric polymorphism. Mathematical Structures in Computer Science 4(1), 71–109 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  15. Johann, P.: A generalization of short-cut fusion and its correctness proof. Higher-Order and Symbolic Computation 15(4), 273–300 (2002)

    Article  MATH  Google Scholar 

  16. Johann, P.: Short-cut fusion is correct. Journal of Functional Programming 13(4), 797–814 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  17. Krstić, S., Launchbury, J., Pavlović, D.: Categories of processes enriched in final coalgebras. In: Honsell, F., Miculan, M. (eds.) ETAPS 2001 and FOSSACS 2001. LNCS, vol. 2030, pp. 303–317. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  18. Launchbury, J., Sheard, T.: Warm fusion: Deriving build-catas from recursive definitions. In: Conf. Record 7th ACM SIGPLAN-SIGARCH Int. Conf. on Functional Programming Languages and Computer Architecture, FPCA 1995, pp. 314–323. ACM Press, New York (1995)

    Google Scholar 

  19. Leivant, D.: Reasoning about functional programs and complexity classes associated with type disciplines. In: Proc. of 24th Annual IEEE Symp. on Foundations of Computer Science, FOCS 1983, pp. 460–469. IEEE CS Press, Los Alamitos (1983)

    Google Scholar 

  20. Mac Lane, S.: Categories for the Working Mathematician, 2nd edn. Graduate Texts in Mathematics, vol. 5. Springer, Heidelberg (1971); (1st edn., 1971)

    Book  MATH  Google Scholar 

  21. Malcolm, G.: Data structures and program transformation. Science of Computer Programming 14(2–3), 255–279 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  22. Meijer, E., Fokkinga, M., Paterson, R.: Functional programming with bananas, lenses, envelopes and barbed wire. In: Hughes, J. (ed.) FPCA 1991. LNCS, vol. 523, pp. 124–144. Springer, Heidelberg (1991)

    Chapter  Google Scholar 

  23. Mulry, P.S.: Strong monads, algebras and fixed points. In: Fourman, M.P., Johnstone, P.T., Pitts, A.M. (eds.) Applications of Categories in Computer Science. London Math. Society Lecture Note Series, vol. 177, pp. 202–216. Cambridge University Press, Cambridge (1992)

    Chapter  Google Scholar 

  24. Paré, R., Román, L.: Dinatural numbers. Journal of Pure and Applied Algebra 128(1), 33–92 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  25. Pavlovic, D.: Logic of build fusion. Technical Report KES.U.00.9, Kestrel Institute (2000)

    Google Scholar 

  26. Reynolds, J.C.: Towards a theory of type structure. In: Robinet, B. (ed.) Proc. of Programming Symp. (Colloque sur la programmation). LNCS, vol. 19, pp. 408–425. Springer, Heidelberg (1974)

    Google Scholar 

  27. Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: Mason, R.E.A. (ed.) Proc. of 9th IFIP World Computer Congress, Information Processing 1983, pp. 513–523. North-Holland, Amsterdam (1983)

    Google Scholar 

  28. Sheard, T., Fegaras, L.: A fold for all seasons. In: Proc. of 6th ACM SIGPLAN/SIGARCH Int. Conf. on Functional Programming Languages and Computer Architecture, FPCA 1993, pp. 233–242. ACM Press, New York (1993)

    Google Scholar 

  29. Svenningsson, J.: Shortcut fusion for accumulating parameters & zip-like functions. In: Proc. of 7th ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 2002, SIGPLAN Notices, vol. 37(9), pp. 124–132. ACM Press, New York (2002)

    Google Scholar 

  30. Takano, A., Meijer, E.: Shortcut deforestation in calculational form. In: Conf. Record 7th ACM SIGPLAN/SIGARCH Int. Conf. on Functional Programming Languages and Computer Architecture, FPCA 1995, pp. 306–313. ACM Press, New York (1995)

    Google Scholar 

  31. Turbak, F., Wells, J.B.: Cycle therapy: A prescription for fold and unfold on regular trees. In: Proc. of 3rd Int. ACM SIGPLAN Conf. on Principles and Practice of Declarative Programming, PPDP 2001, pp. 137–149. ACM Press, New York (2001)

    Google Scholar 

  32. Uustalu, T.: Generalizing substitution. Theoretical Informatics and Applications 37(4), 315–336 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  33. Voigtländer, J.: Concatenate, reverse and map vanish for free. In: Proc. of 7th ACM SIGPLAN Int. Conf. on Functional Programming, ICFP 2002, SIGPLAN Notices, vol. 37(9), pp. 14–25. ACM Press, New York (2002)

    Google Scholar 

  34. Wadler, P.: Theorems for free? In: Proc. of 4th Int. Conf. on Funct. Prog. Languages and Computer Arch. FPCA 1989, pp. 347–359. ACM Press, New York (1989)

    Google Scholar 

  35. Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73(2), 231–248 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  36. Wadler, P.: Recursive types for free! Draft manuscript (1990)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ghani, N., Uustalu, T., Vene, V. (2004). Build, Augment and Destroy, Universally. In: Chin, WN. (eds) Programming Languages and Systems. APLAS 2004. Lecture Notes in Computer Science, vol 3302. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30477-7_22

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-30477-7_22

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-23724-2

  • Online ISBN: 978-3-540-30477-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics