Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/503272.503294acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Functional logic overloading

Published: 01 January 2002 Publication History

Abstract

Functional logic overloading is a novel approach to user-defined overloading that extends Haskell's concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on the evaluation of functional logic programs. Functional logic programming provides a solid theoretical foundation for type functions and, at the same time, allows for programmable overloading resolution strategies by choosing different evaluation strategies for functional logic programs. Type inference with type functions is an instance of type inference with constrained types, where the underlying constraint system is defined by a functional logic program. We have designed a variant of Haskell which supports our approach to overloading, and implemented a prototype front-end for the language.

References

[1]
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers Principles, Techniques, and Tools. Addison-Wesley, 1986.]]
[2]
Arvind, editor. Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, June 1993. ACM Press, New York.]]
[3]
L. Augustsson. Implementing Haskell overloading. In]]
[4]
L. Augustsson. Cayenne-a language with dependent types. In Hudak {23}.]]
[5]
K. Chen, P. Hudak, and M. Odersky. Parametric type classes. In Proc. 1992 ACM Conference on Lisp and Functional Programming, pages 170-181, San Francisco, California, USA, June 1992.]]
[6]
K. Crary and S. Weirich. Flexible type analysis. In P. Lee, editor, Proc. International Conference on Functional Programming 1999, pages 233-248, Paris, France, Sept. 1999. ACM Press, New York.]]
[7]
K. Crary, S. Weirich, and G. Morrisett. Intensional polymorphism in type-erasure semantics. In Hudak {23}, pages 301-312.]]
[8]
L. Damas and R. Milner. Principal type-schemes for functional programs. In Proc. 9th Annual ACM Symposium on Principles of Programming Languages, pages 207-212. ACM, 1982.]]
[9]
O. Danvy. Functional unparsing. Journal of Functional Programming, 8(6):621-625, Nov. 1998.]]
[10]
D. Duggan, G. V. Cormack, and J. Ophel. Kinded type inference for parametric overloading. Acta Inf., 33(1):21-68, 1996.]]
[11]
J. H. Gallier and W. Snyder. Complete sets of transformations for general E-unification. Theoretical Comput. Sci., 67((2+3)):203-260, 1989.]]
[12]
M. Gasbichler, M. Neubauer, M. Sperber, and P. Thiemann. Functional logic overloading. Technical Report 163, Institut fur Informatik, University of Freiburg, Germany, Nov. 2001. Available from ftp://ftp.informatik.uni-freiburg.de/documents/ reports/report163/report00163.ps.gz.]]
[13]
E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel-LEAF: A logic plus functional language. Journal of Computer and System Sciences, 42(2):139-185, 1991.]]
[14]
K. Glynn, P. Stuckey, and M. Sulzmann. Type classes and constraint handling rules. In First Workshop on Rule-Based Constraint Reasoning and Programming, July 2000.]]
[15]
C. Hall, K. Hammond, S. Peyton Jones, and P. Wadler. Type classes in Haskell. In D. Sannella, editor, Proc. 5th European Symposium on Programming, number 788 in Lecture Notes in Computer Science, pages 241-256, Edinburgh, UK, Apr. 1994. Springer-Verlag.]]
[16]
T. Hallgren. Fun with functional dependencies. In Joint Winter Meeting of the Departments of Science and Computer Engineering, Chalmers University of Technology and Goteborg University, Varberg, Sweden, Jan. 2001. http: //www.cs.chalmers.se/hallgren/Papers/wm01.html.]]
[17]
M. Hanus. On the completeness of residuation. In Proc. of the 1992 Joint International Conference and Symposium on Logic Programming, pages 192-206. MIT Press, 1992.]]
[18]
M. Hanus. The integration of functions into logic programming: From theory to practice. Journal of Logic Programming, 19,20:583-628, 1994.]]
[19]
M. Hanus. A unified computation model for functional and logic programming. In Jones {32}, pages 80-93.]]
[20]
M. Hanus. Curry - an integrated functional logic language. http: //www.informatik.uni-kiel.de/curry/report.html, June 2000. Version 0.7.1.]]
[21]
R. Harper and G. Morrisett. Compiling polymorphism using intensional type analysis. In Proc. 22nd Annual ACM Symposium on Principles of Programming Languages, pages 130-141, San Francisco, CA, Jan. 1995. ACM Press.]]
[22]
R. Hinze. A new approach to generic functional programming. In Reps {44}, pages 119-132.]]
[23]
P. Hudak, editor. International Conference on Functional Programming, Baltimore, USA, Sept. 1998. ACM Press, New York.]]
[24]
J.-M. Hullot. Canonical forms and unification. In R. Kowalski, editor, Proceedings of the Fifth International Conference on Automated Deduction (Les Arcs, France), number 87 in Lecture Notes in Computer Science, pages 318-334, Berlin, July 1980. Springer-Verlag.]]
[25]
P. Jansson and J. Jeuring. PolyP - a polytypic programming language extension. In Jones {32}, pages 470-482.]]
[26]
M. P. Jones. A system of constructor classes: Overloading and implicit higher-order polymorphism. In Arvind {2}, pages 52-61.]]
[27]
M. P. Jones. Qualified Types: Theory and Practice. Cambridge University Press, Cambridge, UK, 1994.]]
[28]
M. P. Jones. Functional programming with overloading and higher-order polymorphism. In Advanced Functional Programming, volume 925 of Lecture Notes in Computer Science, pages 97-136. Springer-Verlag, May 1995.]]
[29]
M. P. Jones. Simplifying and improving qualified types. In S. Peyton Jones, editor, Proc. Functional Programming Languages and Computer Architecture 1995, pages 160-169, La Jolla, CA, June 1995. ACM Press, New York.]]
[30]
M. P. Jones. Typing Haskell in Haskell. In E. Meijer, editor, Proceedings of the 1999 Haskell Workshop, number UU-CS-1999-28 in Technical Reports, 1999. ftp://ftp.cs. uu.nl/pub/RUU/CS/techreps/CS-1999/1999-28.pdf.]]
[31]
M. P. Jones. Type classes with functional dependencies. In G. Smolka, editor, Proc. 9th European Symposium on Programming, number 1782 in Lecture Notes in Computer Science, pages 230-244, Berlin, Germany, Mar. 2000. Springer-Verlag.]]
[32]
N. D. Jones, editor. Proc. 24th Annual ACM Symposium on Principles of Programming Languages, Paris, France, Jan. 1997. ACM Press.]]
[33]
S. Kaes. Parametric overloading in polymorphic programming languages. In H. Ganzinger, editor, Proc. 2nd European Symposium on Programming 1988, number 300 in Lecture Notes in Computer Science, pages 131-144. Springer-Verlag, 1988.]]
[34]
R. Kennaway. The specificity rule for lazy pattern-matching in ambiguous term rewrite systems. In N. D. Jones, editor, Proc. 3rd European Symposium on Programming 1990, number 432 in Lecture Notes in Computer Science, pages 256-270, Copenhagen, Denmark, 1990. Springer-Verlag.]]
[35]
J. R. Lewis, J. Launchbury, E. Meijer, and M. B. Shields. Implicit parameters: Dynamic scoping with static types. In Reps {44}, pages 108-118.]]
[36]
S. Marlow, S. Panne, and N. Winstanley. hsparser: The 100% pure Haskell parser, 1998. http://www.pms.informatik.uni-muenchen.de/ mitarbeiter/panne/haskell_libs/hsparser.html.]]
[37]
C. McBride. Faking it-simulating dependent types in Haskell. http://www.dur.ac.uk/~dcs1ctm/faking.ps, 2001.]]
[38]
M. Neubauer, P. Thiemann, M. Gasbichler, and M. Sperber. A functional notation for functional dependencies. In R. Hinze, editor, Proceedings of the 2001 Haskell Workshop, 2001. to appear.]]
[39]
T. Nipkow and C. Prehofer. Type checking type classes. In Proc. 20th Annual ACM Symposium on Principles of Programming Languages, pages 409-418, Charleston, South Carolina, Jan. 1993. ACM Press.]]
[40]
T. Nipkow and G. Snelting. Type classes and overloading resolution via order-sorted unification. In J. Hughes, editor, Proc. Functional Programming Languages and Computer Architecture 1991, number 523 in Lecture Notes in Computer Science, pages 1-14, Cambridge, MA, 1991. Springer-Verlag.]]
[41]
M. Odersky, M. Sulzmann, and M. Wehr. Type inference with constrained types. Theory and Practice of Object Systems, 5(1):35-55, 1999.]]
[42]
J. Peterson and M. Jones. Implementing type classes. In Proc. of the ACM SIGPLAN '93 Conference on Programming Language Design and Implementation, pages 227-236, Albuquerque, New Mexico, June 1993.]]
[43]
S. Peyton Jones, M. Jones, and E. Meijer. Type classes: An exploration of the design space. In J. Launchbury, editor, Proc. of the Haskell Workshop, Amsterdam, The Netherlands, June 1997. Yale University Research Report YALEU/DCS/RR-1075.]]
[44]
T. Reps, editor. Proc. 27th Annual ACM Symposium on Principles of Programming Languages, Boston, MA, USA, Jan. 2000. ACM Press.]]
[45]
M. Shields and E. Meijer. Type-indexed rows. In H. R. Nielson, editor, Proc. 28th Annual ACM Symposium on Principles of Programming Languages, pages 261-275, London, Jan. 2001. ACM Press.]]
[46]
M. Shields and S. Peyton Jones. Object-oriented style overloading for Haskell. In BABEL '01. First Workshop on Multi-Language Infrastructure and Interoperability, Florence, Italy, Sept. 2001.]]
[47]
P. A. Subrahmanyam and J.-H. You. FUNLOG: A computational model integrating logic programming and functional programming. In D. DeGroot and G. Lindstrom, editors, Logic Programming: Functions, Relations and Equations. Prentice Hall, Englewood Cliffs, NJ, 1986.]]
[48]
P. Thiemann and M. Sperber. Program generation with class. In M. Jarke, K. Pasedach, and K. Pohl, editors, Proceedings Informatik'97, Reihe Informatik aktuell, pages 582-592, Aachen, Sept. 1997. Springer-Verlag.]]
[49]
P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad-hoc. In Proc. 16th Annual ACM Symposium on Principles of Programming Languages, pages 60-76, Austin, Texas, Jan. 1989. ACM Press.]]
[50]
S. Weirich. Encoding intensional type analysis. In D. Sands, editor, Proc. 10th European Symposium on Programming, Lecture Notes in Computer Science, Genova, Italy, Apr. 2001. Springer-Verlag.]]
[51]
H. Xi and F. Pfenning. Dependent types in practical programming. In A. Aiken, editor, Proc. 26th Annual ACM Symposium on Principles of Programming Languages, pages 214-227, San Antonio, Texas, USA, Jan. 1999. ACM Press.]]

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '02: Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2002
351 pages
ISBN:1581134509
DOI:10.1145/503272
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 2002

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

POPL02

Acceptance Rates

POPL '02 Paper Acceptance Rate 28 of 128 submissions, 22%;
Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

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

Other Metrics

Citations

Cited By

View all
  • (2023)Fluent APIs in Functional LanguagesProceedings of the ACM on Programming Languages10.1145/35860577:OOPSLA1(876-901)Online publication date: 6-Apr-2023
  • (2018)Using Structural Polymorphism in Creating Process-Based Management Information SystemsAutomatic Documentation and Mathematical Linguistics10.3103/S000510551806003152:6(290-296)Online publication date: 1-Nov-2018
  • (2012)The implicit calculusACM SIGPLAN Notices10.1145/2345156.225407047:6(35-44)Online publication date: 11-Jun-2012
  • (2012)The implicit calculusProceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2254064.2254070(35-44)Online publication date: 11-Jun-2012
  • (2008)Type checking with open type functionsProceedings of the 13th ACM SIGPLAN international conference on Functional programming10.1145/1411204.1411215(51-62)Online publication date: 20-Sep-2008
  • (2008)Type checking with open type functionsACM SIGPLAN Notices10.1145/1411203.141121543:9(51-62)Online publication date: 20-Sep-2008
  • (2007)A history of HaskellProceedings of the third ACM SIGPLAN conference on History of programming languages10.1145/1238844.1238856(12-1-12-55)Online publication date: 9-Jun-2007
  • (2007)Scrap your boilerplate with XPath-like combinatorsProceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages10.1145/1190216.1190240(137-142)Online publication date: 17-Jan-2007
  • (2007)Scrap your boilerplate with XPath-like combinatorsACM SIGPLAN Notices10.1145/1190215.119024042:1(137-142)Online publication date: 17-Jan-2007
  • (2005)A theory of overloadingACM Transactions on Programming Languages and Systems10.1145/1108970.110897427:6(1216-1269)Online publication date: 1-Nov-2005
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media