put replaces the current state managed by StateT with a supplied value. Its type is put :: Monad m => s -> StateT s m (), so it works over an underlying monad and returns (). section 15.1.2
Use put alongside the other essential StateT operations:
- get retrieves the current state. section 15.1.2
- modify transforms the existing state instead of replacing it outright. section 15.1.2
- StateT can manage application data such as recursion depth and transferred-file counts while running in IO. section 15.1.2
