I'm just starting to pick up momentum with Haskell, and loving the abstractions I run into daily, such as lens
.
I'm to a point where a REST API lens would be useful to work with, but before I spend hours finding it's not possible... is it?
The major problem I see is that I'm not directly accessing a data structure, but outputting a string which is requested (my lens syntax is probably wrong):
λ> over (user "robertplant") . set favoritesong
POST http://...com/api/user/robertplant/favoritesong
{
...
}
----
λ> over (user "robertplant") . view _1
GET http://...com/api/user/robertplant/favoritesong/123
I'm assuming that's at least an Applicative problem, or possibly needs an Monad?
I mean, I could imagine this lens satisfying the lens laws (in some sense... it's still a bit fuzzy to me), but I haven't seen yet that a lens has the hardware for putting out strings/other data structures like this.
Is this a journey worth pursuing?
wreq
? – Sibi