king: fix bug Show Ipv4

This commit is contained in:
pilfer-pandex 2021-02-03 15:26:19 -08:00
parent d625a0e5ed
commit c9c11837b8

View File

@ -172,9 +172,9 @@ newtype Ipv4 = Ipv4 { unIpv4 :: Word32 }
instance Show Ipv4 where
show (Ipv4 i) =
show ((shiftL i 24) .&. 0xff) ++ "." ++
show ((shiftL i 16) .&. 0xff) ++ "." ++
show ((shiftL i 8) .&. 0xff) ++ "." ++
show ((shiftR i 24) .&. 0xff) ++ "." ++
show ((shiftR i 16) .&. 0xff) ++ "." ++
show ((shiftR i 8) .&. 0xff) ++ "." ++
show (i .&. 0xff)
-- @is