Closed k-bx closed 1 year ago
I agree that this case should always suceed. Other solutions require every callsite to handle empty sequences in some way, which just isn't useful.
We use hedis at imvu.com and we've baked this behaviour into a layer that we have just above Hedis.
I agree this is required. I was bitten by this too just now:
> runRedis conn (del [])
Left (Error "ERR wrong number of arguments for 'del' command")
I favor switching to NonEmpty
, by the way.
In most APIs, it's an error to send an empty list as an argument. For example:
This will give you an error. Need to think to either switch to
NonEmpty
type or to skip empty lists somehow. Skipping is problematic since current API is exposing too much to a user, it returns a type corresponding to a redis-response, while I think it would be more logical to only return a success response, throwing exception (or skipping error) in other case.