Please log in to watch this conference skillscast.
Some high-quality Haskell libraries, including old friends like `text` and new kinds on the block like `generic-lens`, promise that the abstractions provided by these libraries are actually free and will be completely dissolved by the compiler. In the case of `text` the promise is that certain pipelines of text-processing functions will be optimizes (“fused”) to never allocate a full text value; `generic-lens` promises that its generically derived lenses are, after optimization, identical to handwritten ones.
But, in practice, these promises often don’t hold. They held at some point in the past, when the author checked them manually, but later versions regressed.
This problem can be fixed with
inspection-testing, a Haskell library and plugin to the compiler that allows you to explicitly state what you expect from the compilers optimizations, and have the compiler check that it actually happens. This can be used by library authors to test their promises, but also by users to learn more about what the compiler does with their code.
In this talk, you will discover the tale of broken promises in commonly used Haskell libraries, and you will learn how these promises can be checked automatically using inspection-testing.
YOU MAY ALSO LIKE:
- Scala eXchange London 2018 (in London on 13th - 14th December 2018)
- Uncle Bob's Advanced TDD (in London on 11th - 12th April 2019)
- Whole Team Approach to Agile Testing (in London on 13th - 15th May 2019)
- Test Driven Development (TDD) Workshop with Damjan Vujnovic (in London on 18th - 19th July 2019)
A Promise Checked is a Promise Kept: Inspection Testing
Ever since Joachim Breitner got infected with the Haskell fever in 2005, he has been an active part of the community, with many contributions to GHC. Lately, he is driving the GHC proposal process. He obtained a PhD in Karlsruhe, Germany, for the inception and formal verification of the Call Arity program transformation, and has worked as a post-doc with Stephanie Weirich at the University of Pennsylvania to make formal verification of Haskell practical.