]> gitweb.michael.orlitzky.com - hath.git/commitdiff
Define a show instance for Bit.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 8 May 2010 16:48:29 +0000 (12:48 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 8 May 2010 16:48:29 +0000 (12:48 -0400)
src/Bit.hs

index 7c1840823b041774774f7d49519ff190f6f52033..d7fb679cfcaf079ebcf349b955d09a5b22da1f30 100644 (file)
@@ -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