But if the use of Counter could be considered “pure from the outside” then IO a isn’t needed - ST s a and runST would be enough. Also see:
Counter
IO a
ST s a
runST