Side effect-free interface on top of a stateful library
- by beta
In an interview with John Hughes where he talks about Erlang and Haskell, he has the following to say about using stateful libraries in Erlang:
If I want to use a stateful library, I usually build a side
effect-free interface on top of it so that I can the use it safely in
the rest of my code.
What does he mean by this? I am trying to think of an example of how this would look, but my imagination and/or knowledge is failing me.