Building a Naive Spellchecker

Spellchecking is an easy feature to take for granted. Spellchecking has been available for personal computers since the 1980s, and most software we use to write text today has spellchecking available. Surprisingly, spellchecking continues to be both a relevant problem domain, and one that can present some interesting challenges when we need to write efficient code. In the first part of this chapter, we’ll build a general purpose spellchecking library that can be used with any dictionary.

Let’s start by creating a new cabal project. You’ll want to add a few dependencies to your project so you can follow along with this chapter:

  • base
  • containers
  • text
  • vector

We’ll start our project by building a performance naive spellchecking ...

Get Effective Haskell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.