Documentation for (&&) and (&&) states that they are lazy in their second argument...
[ghc.git] / testsuite / tests / typecheck / should_compile / tc159.hs
1 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
2
3 -- Don't do the cunning new newtype-deriving thing
4 -- when the type constructor is recursive
5
6 module Main where
7
8
9 newtype A = A [A] deriving (Eq)
10
11 -- The derived instance would be:
12 -- instance Eq A where
13 -- (A xs) == (A ys) = xs==ys
14 -- $df :: Eq [A] => Eq A
15 -- $df d = d |> Eq (sym co)
16
17 x :: A
18 x = A [A [], A [A []]]
19
20 main = print (x == x)
21