git.iko.soy/typeable/bloodhound
on master help sign in
Merge pull request #123 from Soostone/zero-replicacount
26d4e54Chris Allen
src/Database/Bloodhound/Client.hs+2−2
@@ -163,13 +163,13 @@ mkShardCount n
163 | otherwise = Just (ShardCount n)
163 | otherwise = Just (ShardCount n)
164
164
165-- | 'mkReplicaCount' is a straight-forward smart constructor for 'ReplicaCount'
165-- | 'mkReplicaCount' is a straight-forward smart constructor for 'ReplicaCount'
166−-- which rejects 'Int' values below 1 and above 1000.
166+-- which rejects 'Int' values below 0 and above 1000.
167--
167--
168-- >>> mkReplicaCount 10
168-- >>> mkReplicaCount 10
169-- Just (ReplicaCount 10)
169-- Just (ReplicaCount 10)
170mkReplicaCount :: Int -> Maybe ReplicaCount
170mkReplicaCount :: Int -> Maybe ReplicaCount
171mkReplicaCount n
171mkReplicaCount n
172− | n < 1 = Nothing
172+ | n < 0 = Nothing
173 | n > 1000 = Nothing -- ...
173 | n > 1000 = Nothing -- ...
174 | otherwise = Just (ReplicaCount n)
174 | otherwise = Just (ReplicaCount n)
175
175