我正在从黑客页面获得一个类型错误和一个查询。
该查询应该选择一个名称等于GolfCourse的"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有关
我现在并没有在widgetFile中实际使用widgetFile。我将非常感谢你的帮助。
发布于 2013-11-14 05:45:15
我不确定,但你可能需要用:
... E.==. E.val ...因为确切的问题取决于您的导入语句,所以提供一个指向完整的独立文件的链接可能是个好主意。
https://stackoverflow.com/questions/19967820
复制相似问题