I'm fairly new to Haskell and have been using Wreq to interact with a JSON API. I'm having an issue trying to edit a JSON response before submitting it back to the API. I think the problem lies with an undefined Bool.
In short, the Wreq response body in ByteString form looks like:
"{\"a\":1, \"b\":null}"
b is actually a boolean but the API response leaves it as null. I'm trying to use Lens functionality to edit it but with no success. The issue is easily reproduced in GHCI:
> import qualified Data.ByteString.Lazy as LB
> bstr = "{\"a\":1, \"b\":null}" :: LB.ByteString
> print $ bstr & key "b" . _Bool .~ True
"{\"a\":1,\"b\":null}"
Nothing is changed. What am I missing here?