diff interps/rhotor/Uniqs.hs @ 996:859f9b4339e6

<Gregor> tar xf egobot.tar.xz
author HackBot
date Sun, 09 Dec 2012 19:30:08 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/interps/rhotor/Uniqs.hs	Sun Dec 09 19:30:08 2012 +0000
@@ -0,0 +1,21 @@
+module Uniqs (
+	Uniqs(Root, A, B, C)
+)
+where
+	
+data Uniqs = A Uniqs | B Uniqs | C Uniqs | Root
+
+instance Eq Uniqs where
+	(==) Root Root 		= True
+	(==) (A a) (A b) 	= a == b
+	(==) (B a) (B b) 	= a == b
+	(==) (C a) (C b) 	= a == b
+	(==) _ _			= False
+	(/=) a b			= not (a == b)
+
+instance Show Uniqs where
+	show Root			= "R"
+	show (A b)			= 'A':show b
+	show (B b)			= 'B':show b
+	show (C b)			= 'C':show b
+	
\ No newline at end of file