this post was submitted on 09 Apr 2025
9 points (100.0% liked)

Haskell

532 readers
3 users here now

founded 2 years ago
MODERATORS
 

I stumbled over Bart de Goede’s article on building a full-text search engine in 150 lines of Python, and was reminded of my quest to show how useful Haskell is for solving real-world problems. Python is an eminently practical language, so nobody is surprised this can be done in Python. But Haskell? The Python code spends a lot of time updating mutable dictionaries. Surely we cannot easily port this code over to Haskell.

Let’s find out.

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 2 weeks ago (1 children)

"Since we are talking about aggregating documents into an index, the word semigroup might pop into our heads."

This is why Haskell tutorials have a bad rep. Why not use a common English term like "monoid" instead?

Snark aside, the <> approach to solving the problem piecewise and aggregating the results into a larger instance of the same type is a really convenient approach.

[–] Noughtmare 4 points 2 weeks ago* (last edited 2 weeks ago) (2 children)
[–] [email protected] 3 points 2 weeks ago

Yes! Steele's Fortress-era talks are amazing. Really thought-provoking.

[–] [email protected] 1 points 2 weeks ago

Yes! Steele's Fortress-era talks are amazing. Really thought-provoking.