Permalink
Browse files

Allow Lua false to be converted to Haskell False.

  • Loading branch information...
1 parent 8735b48 commit f495e725f0b645f984eb9692b1dcee53517f807f @informatikr committed Mar 30, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Database/Redis/Types.hs
@@ -76,9 +76,10 @@ instance RedisResult RedisType where
decode r = Left r
instance RedisResult Bool where
- decode (Integer 1) = Right True
- decode (Integer 0) = Right False
- decode r = Left r
+ decode (Integer 1) = Right True
+ decode (Integer 0) = Right False
+ decode (Bulk Nothing) = Right False -- Lua boolean false = nil bulk reply
+ decode r = Left r
instance (RedisResult a) => RedisResult (Maybe a) where
decode (Bulk Nothing) = Right Nothing

0 comments on commit f495e72

Please sign in to comment.