我收到一个看起来像基本插入的错误。相关代码是
newConn = runIOE $ connect $ host "127.0.0.1"
run pipe act = access pipe master "MyDB" act
newRecord :: Pipe -> Value -> Value -> IO (Either Failure Value)
newRecord pipe fname lname = run pipe $ insert "people" ["name" := fname, "lastName" := lname]
当我跳进 GHCi 并跑步时
:set -XOverloadedStrings
pipe <- newConn
newRecord pipe "Inai" "mathi"
我得到错误
<interactive>:95:16:
No instance for (Data.String.IsString Database.MongoDB.Value)
arising from the literal `"Inai"'
Possible fix:
add an instance declaration for
(Data.String.IsString Database.MongoDB.Value)
In the second argument of `newRecord', namely `"Inai"'
In the expression: newRecord pipe "Inai" "mathi"
In an equation for `it': it = newRecord pipe "Inai" "mathi"
有什么提示吗?