import Yesod
import Data.Text
data App = App
instance Yesod App
mkYesod "App" [parseRoutes|
/ Home GET
|]
getHome :: String -> Handler Value
getHome = object ["name" .= ("Adam"::Text)]
main = warpDebug 2012 App
抛出错误,
Couldn't match expected type ‘String -> Handler Value’
with actual type ‘Value’
Possible cause: ‘object’ is applied to too many arguments
In the expression: object ["name" .= ("Adam" :: Text)]
In an equation for ‘getHome’:
getHome = object ["name" .= ("Adam" :: Text)]
object
不在前奏范围内。哪个包/模块定义了这个?为什么在上述情况下不取键值对?