X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FMaskbits.hs;h=39a15b33908842a50aa85fe63e7fad0427175731;hb=6b71fc1e444cc95acdef91ad814e4f97b01ec52e;hp=51701f562276ece9cc216a0d9cb649624ff7fe1c;hpb=45ac9baca360d0f0dabe4576fb44c1634a50dbf7;p=hath.git diff --git a/src/Maskbits.hs b/src/Maskbits.hs index 51701f5..39a15b3 100644 --- a/src/Maskbits.hs +++ b/src/Maskbits.hs @@ -1,9 +1,8 @@ module Maskbits( - Maskbits(..), - ) + Maskbits(..) ) where -import Test.QuickCheck (Arbitrary(..), elements) +import Test.Tasty.QuickCheck ( Arbitrary(arbitrary), elements ) -- | A type representing the number of bits in a CIDR netmask. @@ -118,12 +117,12 @@ instance Arbitrary Maskbits where 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')]