Abstract
Until now there has been no support for specifying and enforcing contracts within a lazy functional program. That is a shame, because contracts consist of pre- and post-conditions for functions that go beyond the standard static types. This paper presents the design and implementation of a small, easy-to-use, purely functional contract library for Haskell, which, when a contract is violated, also provides more useful information than the classical blaming of one contract partner. From now on lazy functional languages can profit from the assurances in the development of correct programs that contracts provide.
- M. Blume and D. McAllester. Sound and complete models of contracts. J. Funct. Program., 16 (4-5): 375--414, 2006. Google Scholar
Digital Library
- O. Chitil. A semantics for lazy assertions. In Proceedings of the 20th ACM SIGPLAN workshop on Partial evaluation and program manipulation, PEPM 2011, pages 141--150, January 2011. Google Scholar
Digital Library
- O. Chitil and F. Huch. Monadic, prompt lazy assertions in Haskell. In APLAS 2007, LNCS 4807, pages 38--53, 2007. Google Scholar
Digital Library
- O. Chitil and F. Huch. A pattern logic for prompt lazy assertions in Haskell. In Implementation and Application of Functional Languages: 18th International Workshop, IFL 2006, LNCS 4449, 2007. Google Scholar
Digital Library
- O. Chitil, D. McNeill, and C. Runciman. Lazy assertions. In Implementation of Functional Languages: 15th International Workshop, IFL 2003, LNCS 3145, pages 1--19. Springer, November 2004. Google Scholar
Digital Library
- N. A. Danielsson and P. Jansson. Chasing bottoms, a case study in program verification in the presence of partial and infinite values. In D. Kozen, editor, Proceedings of the 7th International Conference on Mathematics of Program Construction, MPC 2004, LNCS 3125, pages 85--109. Springer-Verlag, July 2004.Google Scholar
- M. Degen, P. Thiemann, and S. Wehr. True lies: Lazy contracts for lazy languages (faithfulness is better than laziness). In 4. Arbeitstagung Programmiersprachen (ATPS'09), Lübeck, Germany, October 2009.Google Scholar
- M. Degen, P. Thiemann, and S. Wehr. The interaction of contracts and laziness. In Proceedings of the ACM SIGPLAN 2012 workshop on Partial evaluation and program manipulation, PEPM '12, pages 97--106, 2012. Google Scholar
Digital Library
- C. Dimoulas, R. B. Findler, C. Flanagan, and M. Felleisen. Correct blame for contracts: no more scapegoating. In Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '11, pages 215--226, 2011. Google Scholar
Digital Library
- R. B. Findler. Comparison with Racket's contract system. Personal communication, 2012.Google Scholar
- R. B. Findler and M. Blume. Contracts as pairs of projections. In International Symposium on Functional and Logic Programming (FLOPS), LNCS 3945, pages 226--241, 2006. Google Scholar
Digital Library
- R. B. Findler and M. Felleisen. Contracts for higher-order functions. In ICFP '02: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming, pages 48--59, 2002. Google Scholar
Digital Library
- R. B. Findler, M. Blume, and M. Felleisen. An investigation of contracts as projections. Technical report, University of Chicago Computer Science Department, 2004. TR-2004-02.Google Scholar
- M. Flatt and PLT. Reference: Racket. Technical Report PLT-TR-2010-1, PLT Inc., 2010. http://docs.racket-lang.org/trl/.Google Scholar
- M. Flatt, R. B. Findler, and PLT. The Racket guide. http://docs.racket-lang.org/guide/index.html, 2012.Google Scholar
- A. Gill. Debugging Haskell by observing intermediate datastructures. Electronic Notes in Theoretical Computer Science, 41 (1), 2001. (Proc. 2000 ACM SIGPLAN Haskell Workshop).Google Scholar
- R. Hinze. Generics for the masses. J. Funct. Program., 16 (4-5): 451--483, July 2006. Google Scholar
Digital Library
- R. Hinze and A. Löh. Generic programming in 3d. Sci. Comput. Program., 74 (8): 590--628, June 2009. Google Scholar
Digital Library
- R. Hinze, J. Jeuring, and A. Löh. Typed contracts for functional programming. In Proceedings of the 8th International Symposium on Functional and Logic Programming, FLOPS 2006, LNCS 3945, pages 208--225, 2006. Google Scholar
Digital Library
- R. Lämmel and S. P. Jones. Scrap your boilerplate: a practical design pattern for generic programming. In Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation, TLDI '03, pages 26--37, 2003. Google Scholar
Digital Library
- R. Lämmel and S. P. Jones. Scrap more boilerplate: reflection, zips, and generalised casts. In Proceedings of the ninth ACM SIGPLAN international conference on Functional programming, ICFP '04, pages 244--255, 2004. Google Scholar
Digital Library
- S. Peyton Jones, A. Reid, T. Hoare, S. Marlow, and F. Henderson. A semantics for imprecise exceptions. In Proceedings of the ACM SIGPLAN '99 Conference on Programming Language Design and Implementation, pages 25--36, 1999. Google Scholar
Digital Library
- T. Sheard and S. P. Jones. Template meta-programming for Haskell. In Proceedings of the 2002 ACM SIGPLAN workshop on Haskell, Haskell '02, pages 1--16, 2002. Google Scholar
Digital Library
Index Terms
Practical typed lazy contracts
Recommendations
Practical typed lazy contracts
ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programmingUntil now there has been no support for specifying and enforcing contracts within a lazy functional program. That is a shame, because contracts consist of pre- and post-conditions for functions that go beyond the standard static types. This paper ...
The interaction of contracts and laziness
PEPM '12: Proceedings of the ACM SIGPLAN 2012 workshop on Partial evaluation and program manipulationContract monitoring for strict higher-order functional languages has an intuitive meaning, an established theoretical basis, and a standard implementation. For lazy functional languages, the situation is less clear-cut. There is no agreed-upon intended ...
Pretty printing with lazy dequeues
There are several purely functional libraries for converting tree structured data into indented text, but they all make use of some backtracking. Over twenty years ago, Oppen published a more efficient imperative implementation of a pretty printer. This ...







Comments