From: Michael Orlitzky Date: Sat, 8 May 2010 16:58:51 +0000 (-0400) Subject: Define a show instance for Cidr. X-Git-Tag: 0.0.1~63 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b90b397f348edca15cf8181309f25d3be1e641ab;p=hath.git Define a show instance for Cidr. --- diff --git a/src/Cidr.hs b/src/Cidr.hs index 266b7c5..df35138 100644 --- a/src/Cidr.hs +++ b/src/Cidr.hs @@ -13,7 +13,12 @@ import Octet data Cidr = None | Cidr { ipv4address :: IPv4Address, maskbits :: Maskbits } - deriving (Eq, Show) + deriving (Eq) + + +instance Show Cidr where + show Cidr.None = "None" + show cidr = (show (ipv4address cidr)) ++ "/" ++ (show (maskbits cidr)) -- Returns the mask portion of a CIDR address. That is, everything