Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / simplCore / should_compile / T2520.hs
1 {-# LANGUAGE GADTs #-}
2
3 -- #2520: a bug in the specialiser when we tried to
4 -- quantify over an Internal Name
5
6 module Types where
7
8 data Prod a b = Prod a b
9
10 data Nil = Nil
11
12 class ProdSel f where
13 nil :: f Nil
14 prod :: f x -> f y -> f (Prod x y)
15
16 instance ProdSel SqlFields where
17 nil = SFNil
18 prod = SFProd
19
20 {-# SPECIALIZE reproject :: SqlFields a -> SqlFields a #-}
21
22 reproject :: ProdSel f => SqlFields a -> f a
23 reproject SFNil = nil
24 reproject (SFProd a b) = prod (reproject a) (reproject b)
25
26 data SqlFields a where
27 SFNil :: SqlFields Nil
28 SFProd :: SqlFields a -> SqlFields b -> SqlFields (Prod a b)