The one runtime exception nearly every Elm developer will encounter sooner or later is this one, dealing with recursive JSON decoders:
Uncaught TypeError: Cannot read property ‘tag’ of…
I figured it would be fun to take a tiny function and explain how it works line by line.
elm-reactor is an underrated tool. Not only does it do on-demand recompilation of Elm source code, but it can serve up other assets, too.
elm-reactor
But did you know you can serve your own HTML with live-compiled Elm code, too? This is useful if you need JS interop…
Coming from JavaScript, where JSON is the most natural thing ever, having to write decoders to work with…
Or perhaps you did. Reminders can’t hurt, though.
Record update syntax { a | b = c } is restricted in various ways: you cannot add or remove fields…
{ a | b = c }
When optimising for performance, there are a few things to watch out for.
The other day, someone on the Elm-lang Slack asked for an (efficient) toHex : Int -> String implementation. Of course, efficiency shouldn’t be the primary concern when doing something…
toHex : Int -> String
One of the core requirements for a self-balancing binary search tree, is that it, well, self-balances…
Let’s start with a some code I plucked from an earlier implementation of an alternative Dict implementation.
Dict
First, let’s get the obvious disclaimers out of the way.
The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and…