import Control.Monad.Trans (lift)
import Control.Monad.Trans.Writer (WriterT, runWriterT, tell)
type App a b = WriterT [a] IO b
app :: App String Int
app = do
tell ["A"]
content <- lift $ readFile "./main.hs"
tell ["B"]
return (length content)
main = do
res <- runWriterT app
print res