Merge pull request #123 from Soostone/zero-replicacount

Support replica count of 0
This commit is contained in:
Chris Allen 2016-07-08 12:42:34 -05:00 committed by GitHub
commit 26d4e547dd

View File

@ -163,13 +163,13 @@ mkShardCount n
| otherwise = Just (ShardCount n)
-- | 'mkReplicaCount' is a straight-forward smart constructor for 'ReplicaCount'
-- which rejects 'Int' values below 1 and above 1000.
-- which rejects 'Int' values below 0 and above 1000.
--
-- >>> mkReplicaCount 10
-- Just (ReplicaCount 10)
mkReplicaCount :: Int -> Maybe ReplicaCount
mkReplicaCount n
| n < 1 = Nothing
| n < 0 = Nothing
| n > 1000 = Nothing -- ...
| otherwise = Just (ReplicaCount n)