From: Michael Orlitzky Date: Sat, 8 May 2010 16:48:29 +0000 (-0400) Subject: Define a show instance for Bit. X-Git-Tag: 0.0.1~66 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=609ae9195c946f0be8d5105d8a590f9b32941ef7;p=hath.git Define a show instance for Bit. --- 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