I have seen many examples of ARM (automatic resource management) on the web for Scala. It seems to be a rite-of-passage to write one, though most look pretty much like one a
I see a gradual 4 step evolution for doing ARM in Scala: