The following code:
import Control.Monad.IO.Class
import Happstack.Server
test :: ServerPart String
test = liftIO (putStrLn "Test") >> ok "Test"
main = simpleHTTP nullConf test
is failing to compile with the message:
No instance for (MonadIO (ServerPartT IO))
arising from a use of `liftIO'
Possible fix:
add an instance declaration for (MonadIO (ServerPartT IO))
In the first argument of `(>>)', namely `liftIO (putStrLn "Test")'
In the expression: liftIO (putStrLn "Test") >> ok "Test"
In an equation for `test':
test = liftIO (putStrLn "Test") >> ok "Test"
There appears to be a MonadIO instance here:
but adding a Happstack.Server.Monads
import didn't change anything so I was hoping someone might be able to indicate what I'm doing wrong?