blob: dbdfdc7f5567b6d7ee61bd0573376eb5fc063607 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- Don't do the cunning new newtype-deriving thing
-- when the type constructor is recursive
module Main where
newtype A = A [A] deriving (Eq)
-- The derived instance would be:
-- instance Eq A where
-- (A xs) == (A ys) = xs==ys
-- $df :: Eq [A] => Eq A
-- $df d = d |> Eq (sym co)
x :: A
x = A [A [], A [A []]]
main = print (x == x)
|