This is a session where Luke Westby agreed to
pair with me to help refactor an audio toy I've been working on. It's fairly
lengthy, clocking in at around an hour and a half.
In the first half, I introduce the project and we start refactoring. We make
update function pretty nice, extracting a lot of functions, using some
composition, and using
Maybe.map to simplify a host of unnecessarily lengthy
bits of code. We also extract
View modules, making it
far easier to navigate the codebase and cleaning up each piece as we go.
I also tell a story (around 40min in) explaining one of the reasons I always
if. This leads to me suggesting that yet another person
watch Philip Wadler's Propositions as
Types. If you haven't watched it,
At around 46 minutes, we switch gears and start changing the styles to use
elm-mdl, which is amazing.
At around 56 minutes, we implement a Textfield.
Select, or the absence thereof
At 1:01:00, we go looking for a dropdown in elm-mdl only to learn that Material
Design Lite itself lacks such a component. We then use
Menu to implement
something roughly like a dropdown, but ultimately learn that it's not at all
what we want in terms of UX anyway.
Around 1:20:00 we add
Material.Menu.subs so that our menus will go away when we click
outside of them.
I don't know. Programming's awesome. So is
Luke. Also, if you want to help us keep
making stuff like this you could subscribe and
that would be swell :)
I've been building web-based software for businesses for over 18 years. In the last four years I realized that functional programming was in fact amazing, and have been pretty eager since then to help people build software better.