我有呈現一個HTML標籤,像這樣一個簡單的耶索德處理程序:路線插值失敗,並在耶索德處理程序類型錯誤
getHomeR :: Yesod site => HandlerT site IO Html
getHomeR = defaultLayout
[whamlet|$newline never
<h1>Hello!
|]
我想打印的路線,並改變使用@{HomeR}
代碼路線插值語法,就像這樣:
getHomeR :: Yesod site => HandlerT site IO Html
getHomeR = defaultLayout
[whamlet|$newline never
<h1>@{HomeR}
|]
插值在我耶索德處理器路線失敗,此錯誤:
• Couldn't match type ‘site’ with ‘App’
‘site’ is a rigid type variable bound by
the type signature for:
getHomeR :: forall site. Yesod site => HandlerT site IO Html
at Handler/Home.hs:12:13
Expected type: WidgetT
site IO (Route App -> [(Text, Text)] -> Text)
Actual type: WidgetT
site
IO
(Route (HandlerSite (WidgetT site IO)) -> [(Text, Text)] -> Text)