How to Make a Thing in Haskell, Part 8: Zipping

I’ve completed skellect, so it’s time to catch up and post my thoughts on the rest of its implementation. (It’s kinda hard to be disciplined about writing and posting as you go! I hadn’t expected that challenge.) representing state and actually putting the underlying algorithms to use.

(continue reading)

How to Make a Thing in Haskell, Part 7: Scoring and Sorting

I’ve successfully translated Gary Bernhardt’s scoring function into Haskell now! It uses matchLength from my previous post and scores based on the shortest match it can find and the relative lengths of the query and choice string:

(continue reading)

How to Make a Thing in Haskell, Part 6: Maybe

As mentioned previously, I needed and wrote a function to find every suffix of a string that starts with a particular character. Next, I need another function to find the length of the first match of a query in a string. Here’s an initial implementation:

(continue reading)

How to Make a Thing in Haskell, Part 5: Wrangling HLint and Reducing etas

As I discussed in my previous post, it’s time to do some string manipulation. In this post, I’ll talk some tool-wrangling I had to do to get that work done, and a rule for writing idiomatic Haskell that I learned on exercism.

(continue reading)

How to Make a Thing in Haskell, Part 4: Knowing the Score

At the heart of any fuzzy finder is an algorithm that determines what strings match the user’s query. selecta’s is especially suited to interactive fuzzy finding because it also assigns each string a score to approximate the quality of the match, so high-quality matches can be presented at the top of the list for ease of selection. This post describes selecta’s fuzzy matching algorithm so I’ll be prepared to reimplement it in Haskell.

(continue reading)