From 609ae9195c946f0be8d5105d8a590f9b32941ef7 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 8 May 2010 12:48:29 -0400 Subject: [PATCH] Define a show instance for Bit. --- src/Bit.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Bit.hs b/src/Bit.hs index 7c18408..d7fb679 100644 --- a/src/Bit.hs +++ b/src/Bit.hs @@ -1,8 +1,14 @@ module Bit where data Bit = None | Zero | One - deriving (Eq, Show) + deriving (Eq) +instance Show Bit where + show None = "None" + show Zero = "0" + show One = "1" + + bit_to_int :: Bit -> Int bit_to_int None = -1 bit_to_int Zero = 0 -- 2.43.2