module Maskbits(
- Maskbits(..),
- )
+ Maskbits(..) )
where
-import Test.QuickCheck (Arbitrary(..), elements)
+import Test.Tasty.QuickCheck ( Arbitrary(..), elements )
-- | A type representing the number of bits in a CIDR netmask.
instance Read Maskbits where
- readsPrec _ = \s ->
+ readsPrec _ s =
case (reads s :: [(Int, String)]) of
[] -> []
(x,leftover):_ -> go x leftover
where
go :: Int -> String -> [(Maskbits, String)]
- go y s
- | y < minBound || y > maxBound = []
- | otherwise = [(toEnum y, s)]
+ go x' leftover'
+ | x' < minBound || x' > maxBound = []
+ | otherwise = [(toEnum x', leftover')]