comparison 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
comparison
equal deleted inserted replaced
995:6883f5911eb7 996:859f9b4339e6
1 module Uniqs (
2 Uniqs(Root, A, B, C)
3 )
4 where
5
6 data Uniqs = A Uniqs | B Uniqs | C Uniqs | Root
7
8 instance Eq Uniqs where
9 (==) Root Root = True
10 (==) (A a) (A b) = a == b
11 (==) (B a) (B b) = a == b
12 (==) (C a) (C b) = a == b
13 (==) _ _ = False
14 (/=) a b = not (a == b)
15
16 instance Show Uniqs where
17 show Root = "R"
18 show (A b) = 'A':show b
19 show (B b) = 'B':show b
20 show (C b) = 'C':show b
21