Something like this in Scala: it doesn&#x27;t have the json read&#x2F;writing but only because I lost interest, not because it&#x27;s intrinsically hard.<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;hythloday&#x2F;6246a352c9e9d0150a4b" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;hythloday&#x2F;6246a352c9e9d0150a4b</a>