The braces look a bit weird and un-Haskellish here. You can drop the `(` and write `readIORef (counterMap counter)` instead of using the `$`. Alternatively, use `=<<` to put it in `writeIORef` directly.