I am trying to introduce myself to Riak with Haskell driver and I am stuck with a simple put
operation. I am confused with the signature of the put
function. and there isn't a single example anywhere out there.
So with this signature:
put :: (FromJSON c, ToJSON c, Resolvable c) => Connection -> Bucket
-> Key -> Maybe VClock -> c -> W -> DW -> IO (c, VClock)
I have a couple of questions.
What is a Maybe VClock? Do I have to generate it somehow or is it enough to just specify Nothing there? And why do I get this VClock back in the returned tuple?
Do I have to write FromJSON and ToJSON instances for every simple value I put even if it is a simple string value? Like if I want to put a value "Stitch" with the key "Name", how do I do it?
What is Resolvable
instance? How do I make a Text or String value resolvable?
I understand that I have to define the resolve
function but I don't quite get what it means and how to do it.