skip to main content
article

Suggesting valid hole fits for typed-holes (experience report)

Published:17 September 2018Publication History
Skip Abstract Section

Abstract

Type systems allow programmers to communicate a partial specification of their program to the compiler using types, which can then be used to check that the implementation matches the specification. But can the types be used to aid programmers during development? In this experience report I describe the design and implementation of my lightweight and practical extension to the typed-holes of GHC that improves user experience by adding a list of valid hole fits and refinement hole fits to the error message of typed-holes. By leveraging the type checker, these fits are selected from identifiers in scope such that if the hole is substituted with a valid hole fit, the resulting expression is guaranteed to type check.

References

  1. Agda Contributors. 2017. Agda Documentation 2.5.3. https://agda.readthedocs.io/en/v2.5.3/Google ScholarGoogle Scholar
  2. Lennart Augustsson. 2014. The Djinn package. https://hackage.haskell.org/package/djinnGoogle ScholarGoogle Scholar
  3. Edwin Brady. 2017. Type-Driven Development with Idris. Manning Publications Company.Google ScholarGoogle Scholar
  4. GHC Contributors. 2017. GHC 8.2.1 users guide. https://downloads.haskell.org/~ghc/8.2.1/docs/html/users_guide/index.htmlGoogle ScholarGoogle Scholar
  5. GitHub. 2017. The Open Source Survey. http://opensourcesurvey.org/2017/Google ScholarGoogle Scholar
  6. Tihomir Gvero, Viktor Kuncak, Ivan Kuraj, and Ruzica Piskac. 2013. Complete completion using types and weights. In PLDI '13, Proc. the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 27-38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Haskell Wiki Contributors. 2014. Typed holes in GHC. https://wiki.haskell.org/index.php?title=GHC/Typed_holes&oldid=58717Google ScholarGoogle Scholar
  8. Christoph Hegemann. 2016. Implementing type directed search for PureScript. (2016). BSc. Thesis, University of Applied Sciences, Cologne.Google ScholarGoogle Scholar
  9. Graham Hutton. 2016. Programming in Haskell. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Edward Kmett. 2018. The lens library. https://hackage.haskell.org/package/lensGoogle ScholarGoogle Scholar
  11. David Mandelin, Lin Xu, Rastislav Bodík, and Doug Kimelman. 2005. Jungloid mining: helping to navigate the API jungle. In PLDI '05, Proc. the 26th ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 48-61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Neil Mitchell. 2008. Hoogle overview. The Monad. Reader 12 (2008), 27-35.Google ScholarGoogle Scholar
  13. Ulf Norell. 2008. Dependently typed programming in Agda. In International School on Advanced Functional Programming. Springer, 230-266. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program synthesis from polymorphic refinement types. In PLDI '16, Proc. the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 522-538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Niki Vazou, Eric L Seidel, Ranjit Jhala, Dimitrios Vytiniotis, and Simon Peyton-Jones. 2014. Refinement types for Haskell. In ICFP '14, Proc. the 19th ACM SIGPLAN International Conference on Functional Programming. ACM, 269-282. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Suggesting valid hole fits for typed-holes (experience report)

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 53, Issue 7
        Haskell '18
        July 2018
        185 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3299711
        Issue’s Table of Contents
        • cover image ACM Conferences
          Haskell 2018: Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell
          September 2018
          185 pages
          ISBN:9781450358354
          DOI:10.1145/3242744

        Copyright © 2018 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 17 September 2018

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!