Functions & Dragons – Part 6

Refactor time! I did a huge refactor to cut down on the repetitive nature of the code surrounding Save and Skill Proficiencies. This was immensely satisfying and is probably my favorite thing about Elm. I can refactor with confidence even without a single unit test!

All in all I shrank the codebase by 449 lines, or nearly 37%! And while this did cost me a tiny bit of type goodness (the new code uses Dict which introduces Maybe into the equation) the increased conciseness and flexibility (custom skills, anyone?) is a fair trade in my book.

The new module structure with wrapped messages is also a big win. Check out my new update function:

I also started in on the Basic Info module, but didn’t get very far. That’ll be tomorrow’s project. Stay tuned!

Leave a Reply

Your email address will not be published. Required fields are marked *