X-Git-Url: http://gitweb.michael.orlitzky.com/?p=hath.git;a=blobdiff_plain;f=src%2FBit.hs;h=d7fb679cfcaf079ebcf349b955d09a5b22da1f30;hp=7c1840823b041774774f7d49519ff190f6f52033;hb=609ae9195c946f0be8d5105d8a590f9b32941ef7;hpb=76b555ca0ff80d36b481d1b86900bf1683d57081 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