我从hackage 页面直接查询时遇到类型错误。
查询应该选择GolfCourse
名称等于 的a "Miniota"
。
询问:
getTestR :: Handler Html
getTestR = do
gcs <- runDB $
E.select $
E.from $ \g -> do
E.where_ (g E.^. GolfCourseName ==. E.val "Miniota")
return g
defaultLayout $(widgetFile "test")
错误:
Handler/Home.hs:713:49:
Couldn't match expected type `Text' with actual type `E.Value typ0'
Expected type: E.Value Text
Actual type: E.Value (E.Value typ0)
In the return type of a call of `E.val'
In the second argument of `(==.)', namely `E.val "Miniota"'
我怀疑这个错误与我错误地使用E.val
我现在实际上没有gcs
在 widgetFile 中使用有关。帮助将不胜感激。