0
我已經試過如下:在yesod中,如何發送帶有自定義HTTP狀態碼的defaultLayout?
sendResponseStatus status403 $ (defaultLayout [whamlet|Foo|] :: Handler Html)
這給了我這種類型的錯誤:
<interactive>:1:1: Warning:
Could not deduce (ToTypedContent (Handler Html))
arising from a use of ‘sendResponseStatus’
from the context (MonadHandler m)
bound by the inferred type of it :: MonadHandler m => m a
at <interactive>:1:1
In the expression: sendResponseStatus status403
In the expression:
sendResponseStatus status403
$ (defaultLayout
((asWidgetT . toWidget)
((blaze-markup-0.7.0.3:Text.Blaze.Internal.preEscapedText
. Data.Text.pack)
"Foo")) ::
Handler Html)