informatikr / hedis

A Redis client library for Haskell.
http://hackage.haskell.org/package/hedis
BSD 3-Clause "New" or "Revised" License
329 stars 127 forks source link

Make setOpts more safe #213

Open qnikst opened 1 year ago

qnikst commented 1 year ago

Currently SetOpts structure does not provide structural guarantees for the values passed. Redis specification tells:

SET key value [NX | XX] [GET] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL]

It means that EX, PX, EXAT, PXAT, KEEPTTL options are mutually exclusive, but it's not guaranteed by the type. It would be nice to fix it, as well as all the other similar occurrences.