blob: 4048c94c5ff51a3b51dbbd083712f5ccc259263c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
{-# LANGUAGE GADTs, GeneralizedNewtypeDeriving #-}
-- See Trac #1251 and the comments
-- Note [Pruning dead case alternatives] in types/Unify.lhs
module Main( main ) where
data T a where MkT :: T Int
class C a where ic :: T a
instance C Int where ic = MkT
newtype A = MkA Int deriving( C )
-- axiom CoA : A ~ Int
-- Hence C Int ~ C A
-- instance C A where
-- ic :: T A
-- ic = MkT
icA = ic :: T A -- There are no (non-bot) values of this type
main = print (icA `seq` "ok")
|