blob: a081c4298881f407caeeca79f7b44c8a6271d794 (
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 #-}
-- #2520: a bug in the specialiser when we tried to
-- quantify over an Internal Name
module Types where
data Prod a b = Prod a b
data Nil = Nil
class ProdSel f where
nil :: f Nil
prod :: f x -> f y -> f (Prod x y)
instance ProdSel SqlFields where
nil = SFNil
prod = SFProd
{-# SPECIALIZE reproject :: SqlFields a -> SqlFields a #-}
reproject :: ProdSel f => SqlFields a -> f a
reproject SFNil = nil
reproject (SFProd a b) = prod (reproject a) (reproject b)
data SqlFields a where
SFNil :: SqlFields Nil
SFProd :: SqlFields a -> SqlFields b -> SqlFields (Prod a b)
|