Hacker News new | ask | show | jobs
by mrkeen 531 days ago
Thinking in terms of monoids can be quite helpful even if you're not in pure functions land.

For instance, if you're putting together an on-disk full-text search index, immutability techniques become very relevant (since you can't insert into the middle of files like you can do with in-memory hashmaps). Just make small indexes and a (binary, associative) index-merge operation. Now you have an online&updatable search engine which doesn't need to wait for full reindexes over the data to include new documents.