Elm Pair Programming - Josh Adams and Luke Westby Pairing on Colluder

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.

Refactoring

In the first half, I introduce the project and we start refactoring. We make the 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 Update, Model, and 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 prefer case to if. This leads to me suggesting that yet another person watch Philip Wadler's Propositions as Types. If you haven't watched it, watch it.

elm-mdl

At around 46 minutes, we switch gears and start changing the styles to use elm-mdl, which is amazing.

Textfields

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.

Conclusion

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 :)