基本的な挿入のように見えるものでエラーが発生します。関連するコードは
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"
thisとthisによると、何かが欠けていない限り、うまくいくはずです。
ヒントはありますか?