Thank you for this, @Qqwy! (and thanks to @danmarcab for the algae suggestion too, it looks interesting).
Out of interest, how do Elixir people typically encode their tagged tuples in JSON? I’ve thought of two approaches:
As an array:
{:ok, 1} -> [":ok", 1]
Or as some kind of object:
{:ok, 1} -> {"tag": ":ok", "payload": 1}
I’m not sure which is best. It doesn’t really matter from the Elm side, because I have to write a decoder anyway. So if there’s an easy/idiomatic option on the Elixir end, I’ll use that.