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.
- Agda Contributors. 2017. Agda Documentation 2.5.3. https://agda.readthedocs.io/en/v2.5.3/Google Scholar
- Lennart Augustsson. 2014. The Djinn package. https://hackage.haskell.org/package/djinnGoogle Scholar
- Edwin Brady. 2017. Type-Driven Development with Idris. Manning Publications Company.Google Scholar
- GHC Contributors. 2017. GHC 8.2.1 users guide. https://downloads.haskell.org/~ghc/8.2.1/docs/html/users_guide/index.htmlGoogle Scholar
- GitHub. 2017. The Open Source Survey. http://opensourcesurvey.org/2017/Google Scholar
- 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 Scholar
Digital Library
- Haskell Wiki Contributors. 2014. Typed holes in GHC. https://wiki.haskell.org/index.php?title=GHC/Typed_holes&oldid=58717Google Scholar
- Christoph Hegemann. 2016. Implementing type directed search for PureScript. (2016). BSc. Thesis, University of Applied Sciences, Cologne.Google Scholar
- Graham Hutton. 2016. Programming in Haskell. Cambridge University Press. Google Scholar
Digital Library
- Edward Kmett. 2018. The lens library. https://hackage.haskell.org/package/lensGoogle Scholar
- 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 Scholar
Digital Library
- Neil Mitchell. 2008. Hoogle overview. The Monad. Reader 12 (2008), 27-35.Google Scholar
- Ulf Norell. 2008. Dependently typed programming in Agda. In International School on Advanced Functional Programming. Springer, 230-266. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Suggesting valid hole fits for typed-holes (experience report)
Recommendations
Suggesting valid hole fits for typed-holes (experience report)
Haskell 2018: Proceedings of the 11th ACM SIGPLAN International Symposium on HaskellType 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 ...
Dependently typed Haskell in industry (experience report)
Recent versions of the Haskell compiler GHC have a number of advanced features that allow many idioms from dependently typed programming to be encoded. We describe our experiences using this "dependently typed Haskell" to construct a performance-...
Live Pattern Matching with Typed Holes
Several modern programming systems, including GHC Haskell, Agda, Idris, and Hazel, support typed holes. Assigning static and, to varying degree, dynamic meaning to programs with holes allows program editors and other tools to offer meaningful feedback ...







Comments