From 7d9a55cb4f217bada3c66f585cd1ce35dc564fb1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 8 May 2010 12:50:49 -0400 Subject: [PATCH] Defined a show instance for Octet. --- src/Octet.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.43.2