Chapter 14Haskell Hands-On
by Paul Callaghan
The preceding chapter was a glimpse into the mindset of an experienced Haskell programmer. Now it’s time to do some programming. Let’s try a kata.
We’re going to use Dave Thomas’s word-chain kata,[7] and through it we’ll explore how functional programmers approach a problem, we’ll learn some Haskell syntax and libraries, and we’ll touch on performance and optimization of Haskell code.
The objective of the kata is to find a series of steps from one word to another, where in each step a single letter is changed such that the resulting string is also a valid word. For example, turning “lead” into “gold” with the path ["lead", "load", "goad", "gold"]. For simplicity, I’ll assume four-letter words ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access