如果问题很愚蠢,我对 Haskell 很陌生,所以提前抱歉,但我无法在谷歌中找到解决方案。
假设我有这个使用Scotty Web 框架的程序:
responseUserByName :: ActionM ()
responseUserByName = do name <- param "name"
user <- liftAndCatchIO $ getUserByUserName name
json user
我想添加一个日志,因为它在运行时失败,我不知道为什么。所以我的想法是在 do 块中添加一些打印来检查值。
但由于该do
块必须返回 aActionM
我无法打印并返回一个IO
. 好吧,或者至少我不知道怎么做。
问候