Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1007/11737414_3guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

“Scrap your boilerplate” reloaded

Published: 24 April 2006 Publication History

Abstract

The paper “Scrap your boilerplate” (SYB) introduces a combinator library for generic programming that offers generic traversals and queries. Classically, support for generic programming consists of two essential ingredients: a way to write (type-)overloaded functions, and independently, a way to access the structure of data types. SYB seems to lack the second. As a consequence, it is difficult to compare with other approaches such as PolyP or Generic Haskell. In this paper we reveal the structural view that SYB builds upon. This allows us to define the combinators as generic functions in the classical sense. We explain the SYB approach in this changed setting from ground up, and use the understanding gained to relate it to other generic programming approaches. Furthermore, we show that the SYB view is applicable to a very large class of data types, including generalized algebraic data types.

References

[1]
Lämmel, R., Peyton Jones, S.: Scrap your boilerplate: a practical design pattern for generic programming. In: Types in Language Design and Implementation. (2003)
[2]
Jansson, P., Jeuring, J.: PolyP - a polytypic programming language extension. In: Conference Record 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, ACM Press (1997) 470-482
[3]
Löh, A.: Exploring Generic Haskell. PhD thesis, Utrecht University (2004)
[4]
Löh, A., Jeuring, J., Clarke, D., Hinze, R., Rodriguez, A., de Wit, J.: The Generic Haskell user's guide, version 1.42 (Coral). Technical Report UU-CS-2005-004, Institute of Information and Computing Sciences, Utrecht University (2005)
[5]
Xi, H., Chen, C., Chen, G.: Guarded recursive datatype constructors. In: Proceedings of the ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages (POPL 2003), ACM Press (2003) 224-235
[6]
Peyton Jones, S., Washburn, G., Weirich, S.: Wobbly types: Type inference for generalised algebraic data types. Technical Report MS-CIS-05-26, University of Pennsylvania (2004)
[7]
Peyton Jones, S., ed.: Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press (2003)
[8]
Hinze, R., Löh, A., Oliveira, B.: "Scrap Your Boilerplate" reloaded. Technical report, Universität Bonn (2006) Available from http://www.informatik.uni-bonn.de/~loeh/SYB0.html.
[9]
GHC Team: The Glasgow Haskell Compiler User's Guide. (2005) Available from http://haskell.org/ghc/docs/latest/users guide.ps.gz.
[10]
Wadler, P.: Views: a way for pattern matching to cohabit with data abstraction. In: Principles of Programming Languages, ACM Press (1987) 307-313
[11]
Burton, F.W., Meijer, E., Sansom, P., Thompson, S., Wadler, P.: Views: an extension to Haskell pattern matching. Available from http:// www.haskell.org/development/views.html (1996)
[12]
Holdermans, S., Jeuring, J., Löh, A.: Generic views on data types. Technical Report UU-CS-2005-012, Utrecht University (2005)
[13]
Benke, M., Dybjer, P., Jansson, P.: Universes for generic programs and proofs in dependent type theory. Nordic Journal of Computing 10 (2003) 265-289
[14]
Visser, E.: Language independent traversals for program transformation. In Jeuring, J., ed.: Workshop on Generic Programming (WGP'00), Ponte de Lima, Portugal, Technical Report UU-CS-2000-19, Department of Information and Computing Sciences, Universiteit Utrecht (2000)
[15]
Hinze, R.: Fun with phantom types. In Gibbons, J., de Moor, O., eds.: The Fun of Programming. Palgrave (2003) 245-262
[16]
Oliveira, B., Gibbons, J.: Typecase: A design pattern for type-indexed functions. In: Haskell Workshop. (2005) 98-109
[17]
Li, H., Reinke, C., Thompson, S.: Tool support for refactoring functional programs. In Jeuring, J., ed.: HaskellWorkshop, Association for Computing Machinery (2003) 27-38
[18]
Wadler, P.: Theorems for free! In: Functional Programming and Computer Architecture. (1989)
[19]
Lämmel, R., Peyton Jones, S.: Scrap more boilerplate: reflection, zips, and generalised casts. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP 2004), ACM Press (2004) 244-255
[20]
Lämmel, R., Peyton Jones, S.: Scrap your boilerplate with class: extensible generic functions. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP 2005), ACM Press (2005) 204-215
[21]
Backhouse, R., Jansson, P., Jeuring, J., Meertens, L.: Generic programming: An introduction. In Swierstra, S.D., Henriques, P.R., Oliveira, J.N., eds.: Advanced Functional Programming. Volume 1608 of Lecture Notes in Computer Science., Springer-Verlag (1999) 28-115
[22]
Hinze, R.: Polytypic values possess polykinded types. In Backhouse, R., Oliveira, J.N., eds.: Proceedings of the Fifth International Conference on Mathematics of Program Construction, July 3-5, 2000. Volume 1837 of Lecture Notes in Computer Science., Springer-Verlag (2000) 2-27
[23]
Holdermans, S.: Generic views. Master's thesis, Utrecht University (2005)
[24]
Reig, F.: Generic proofs for combinator-based generic programs. In Loidl, H.W., ed.: Trends in Functional Programming. Volume 5. Intellect (2006)

Cited By

View all
  • (2022)A completely unique account of enumerationProceedings of the ACM on Programming Languages10.1145/35476366:ICFP(411-437)Online publication date: 31-Aug-2022
  • (2022)Computing correctly with inductive relationsProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523707(966-980)Online publication date: 9-Jun-2022
  • (2014)True sums of productsProceedings of the 10th ACM SIGPLAN workshop on Generic programming10.1145/2633628.2633634(83-94)Online publication date: 26-Aug-2014
  • Show More Cited By

Index Terms

  1. “Scrap your boilerplate” reloaded
    Index terms have been assigned to the content through auto-classification.

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image Guide Proceedings
    FLOPS'06: Proceedings of the 8th international conference on Functional and Logic Programming
    April 2006
    293 pages
    ISBN:3540334386

    Publisher

    Springer-Verlag

    Berlin, Heidelberg

    Publication History

    Published: 24 April 2006

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)0
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 26 Sep 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2022)A completely unique account of enumerationProceedings of the ACM on Programming Languages10.1145/35476366:ICFP(411-437)Online publication date: 31-Aug-2022
    • (2022)Computing correctly with inductive relationsProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523707(966-980)Online publication date: 9-Jun-2022
    • (2014)True sums of productsProceedings of the 10th ACM SIGPLAN workshop on Generic programming10.1145/2633628.2633634(83-94)Online publication date: 26-Aug-2014
    • (2014)Type inference for the spine view of dataProceedings of the 10th ACM SIGPLAN workshop on Generic programming10.1145/2633628.2633629(25-34)Online publication date: 26-Aug-2014
    • (2014)Generic Generic ProgrammingProceedings of the 16th International Symposium on Practical Aspects of Declarative Languages - Volume 832410.1007/978-3-319-04132-2_15(216-231)Online publication date: 20-Jan-2014
    • (2013)Programming errors in traversal programs over structured dataScience of Computer Programming10.1016/j.scico.2011.11.00678:10(1770-1808)Online publication date: 1-Oct-2013
    • (2012)Modular tree automataProceedings of the 11th international conference on Mathematics of Program Construction10.1007/978-3-642-31113-0_14(263-299)Online publication date: 25-Jun-2012
    • (2011)Type-safe evolution of spreadsheetsProceedings of the 14th international conference on Fundamental approaches to software engineering: part of the joint European conferences on theory and practice of software10.5555/1987434.1987453(186-201)Online publication date: 26-Mar-2011
    • (2011)Generic programming for indexed datatypesProceedings of the seventh ACM SIGPLAN workshop on Generic programming10.1145/2036918.2036924(37-46)Online publication date: 18-Sep-2011
    • (2010)Scrap your zippersProceedings of the 6th ACM SIGPLAN workshop on Generic programming10.1145/1863495.1863499(13-24)Online publication date: 26-Sep-2010
    • Show More Cited By

    View Options

    View options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media