blob: 8aa43637ba39137f483fdbb5be268711d8cd5775 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
{-# LANGUAGE UndecidableInstances #-}
-- This tests the recursive-dictionary stuff.
module Main where
data Fix f = In (f (Fix f))
instance Show (f (Fix f)) => Show (Fix f) where
show (In x) = "In " ++ show x -- No parens, but never mind
instance Eq (f (Fix f)) => Eq (Fix f) where
(In x) == (In y) = x==y
data L x = Nil | Cons Int x deriving( Show, Eq )
main = do { print (In Nil);
print (In Nil == In Nil) }
|