在使用Snap开发Web应用程序时,我遇到了模糊类型的问题。
我的代码是
getUserByUsrnamePwd :: Handler HaskellCalendar HaskellCalendar ()
getUserByUsrnamePwd = do
username <- getPostParam "username"
password <- getPostParam "password"
user <- query_ "SELECT * FROM users WHERE username = ? AND password = ?" (username, password)
liftIO $ print (user :: [User])
我收到了错误
Expected type: (Maybe ByteString, Maybe ByteString)
-> Handler HaskellCalendar HaskellCalendar [User]
Actual type: (Maybe ByteString, Maybe ByteString) -> [r0]
我真的不知道为什么,因为根据API它应该是(也许是ByteString,也许是ByteString)而不是(也许是ByteString,可能是ByteString) - &gt; [R0]
亲切的问候