Writing for both State and StateT