skip to main content
10.1145/1292520.1292523acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

A language for specifying type contracts in erlang and its interaction with success typings

Published:05 October 2007Publication History

ABSTRACT

We propose a small extension of the Erlang language that allows programmers to specify contracts with type information at the level of individual functions. Such contracts are optional and they document the intended uses of functions. Contracts allow automatic documentation tools such as Edoc to generate better documentation and defect detection tools such as Dialyzer to detect more type clashes. Since the Erlang/OTP system already contains components which perform automatic type inference of success typings, we also describe how contracts interact with success typings and can often provide some key information to the inference process.

References

  1. R. Cartwright and M. Fagan. Soft typing. In Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation, pages 278--292. ACM Press, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. B. Findler, J. Clements, C. Flanagan, M. Flatt, S. Krishnamurthi, P. Steckler, and M. Felleisen. DrScheme: A programming environment for Scheme. Journal of Functional Programming, 12(2):159--182, Mar. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. V. Hermenegildo, G. Puebla, F. Bueno, and P. López-García. Integrated program debugging, verification, and optimization using abstract interpretation (and the Ciao system preprocessor). Sci. Comput. Programming, 58(1-2):115--140, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. T. Lindahl and K. Sagonas. Detecting software defects in telecom applications through lightweight static analysis: A war story. In C. Wei-Ngan, editor, Programming Languages and Systems: Proceedings of the Second Asian Symposium (APLAS'04), volume 3302 of LNCS, pages 91--106. Springer, Nov. 2004.Google ScholarGoogle Scholar
  5. T. Lindahl and K. Sagonas. Typer: a type annotator of erlang code. In Proceedings of the 2005 ACM SIGPLAN Erlang Workshop, pages 17--25, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. Lindahl and K. Sagonas. Practical type inference based on success typings. In Proceedings of the 8th ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, pages 167--178, New York, NY, USA, 2006. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Marlow and P. Wadler. A practical subtyping system for Erlang. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming, pages 136--149. ACM Press, June 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. K. Sagonas. Experience from developing the Dialyzer: A static analysis tool detecting defects in Erlang applications. In ACM SIGPLAN Workshop on the Evaluation of Defect Detection Tools (Bugs'05), June 2005.Google ScholarGoogle Scholar
  9. M. Serrano. Bigloo: A practical Scheme compiler, May 2007. User manual for version 3.0a.Google ScholarGoogle Scholar
  10. Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming, 26(1-3):17--64, Oct./Dec. 1996.Google ScholarGoogle ScholarCross RefCross Ref
  11. G. L. Steele. Common Lisp: The Language. Digital Press, 2nd edition, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A language for specifying type contracts in erlang and its interaction with success typings

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ERLANG '07: Proceedings of the 2007 SIGPLAN workshop on ERLANG Workshop
        October 2007
        106 pages
        ISBN:9781595936752
        DOI:10.1145/1292520

        Copyright © 2007 ACM

        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]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 5 October 2007

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        ERLANG '07 Paper Acceptance Rate11of15submissions,73%Overall Acceptance Rate51of68submissions,75%

        Upcoming Conference

        ICFP '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader