From: Michael Orlitzky Date: Sat, 8 May 2010 16:50:49 +0000 (-0400) Subject: Defined a show instance for Octet. X-Git-Tag: 0.0.1~65 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=7d9a55cb4f217bada3c66f585cd1ce35dc564fb1;p=hath.git Defined a show instance for Octet. --- diff --git a/src/Octet.hs b/src/Octet.hs index aaff3d2..bdada65 100644 --- a/src/Octet.hs +++ b/src/Octet.hs @@ -13,7 +13,13 @@ data Octet = None | Octet { b1 :: Bit, b6 :: Bit, b7 :: Bit, b8 :: Bit } - deriving (Eq, Show) + deriving (Eq) + + +instance Show Octet where + show Octet.None = "None" + show oct = show (octet_to_int oct) + -- Convert each bit to its integer value, and multiply by the -- appropriate power of two. Sum them up, and we should get an integer