X-Git-Url: http://gitweb.michael.orlitzky.com/?p=hath.git;a=blobdiff_plain;f=src%2FIPv4Address.hs;h=fca1d0fe006cc33c659f4e883bfda3897f83f4d2;hp=78bceabc703b39202823d6f9882d3c3fb5d523d1;hb=13b975060857b8acd64b7231074dc4a0c0a2915a;hpb=006f90418a578308104b75362f0b595466900eed diff --git a/src/IPv4Address.hs b/src/IPv4Address.hs index 78bceab..fca1d0f 100644 --- a/src/IPv4Address.hs +++ b/src/IPv4Address.hs @@ -194,10 +194,10 @@ instance Enum IPv4Address where shifted_x1 = x `quot` 2^(24 :: Integer) shifted_x2 = x2 `quot` 2^(16 :: Integer) shifted_x3 = x3 `quot` 2^(8 :: Integer) - oct1 = toEnum shifted_x1 - oct2 = toEnum shifted_x2 - oct3 = toEnum shifted_x3 - oct4 = toEnum x4 + oct1 = toEnum shifted_x1 :: Octet + oct2 = toEnum shifted_x2 :: Octet + oct3 = toEnum shifted_x3 :: Octet + oct4 = toEnum x4 :: Octet -- | Convert @addr@ to an 'Int' by converting each octet to an 'Int' -- and shifting the result to the left by 0,8.16, or 24 bits. @@ -358,10 +358,10 @@ mk_testaddr :: Int -> Int -> Int -> Int -> IPv4Address mk_testaddr a b c d = IPv4Address oct1 oct2 oct3 oct4 where - oct1 = toEnum a - oct2 = toEnum b - oct3 = toEnum c - oct4 = toEnum d + oct1 = toEnum a :: Octet + oct2 = toEnum b :: Octet + oct3 = toEnum c :: Octet + oct4 = toEnum d :: Octet test_minBound :: TestTree @@ -422,4 +422,4 @@ test_to_enum = where desc = "192.168.0.0 in base-10 is 3232235520" expected = mk_testaddr 192 168 0 0 - actual = toEnum 3232235520 + actual = toEnum 3232235520 :: IPv4Address