Deriving.hs 414 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# OPTIONS -findexed-types -fglasgow-exts #-}

module ShouldCompile where

data family T a

data instance T Int = A | B
		      deriving Eq

foo :: T Int -> Bool
foo x = x == x

data instance T Char = C

instance Eq (T Char) where
  C == C = False


newtype family S a

newtype instance S Int = S Int
		         deriving Eq
23
24
25
26
27

newtype family S2 a b

newtype instance S2 Int b = S2 (IO b)
		          deriving Monad