Quick actions

cmd+k|ctrl+k

Navigation

Languages

WriterT [a] IO b

Snippet info

Language

Haskell

Visibility

public

Author

homam

Created

2016-11-02T13:49:21Z

Updated

2016-11-10T19:37:43Z

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
INFO