summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/ExplicitForAllFams4b.hs
blob: 6a19a172bf2451fe5e04ac3887c1592e255987f9 (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
29
30
31
32
33
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE TypeFamilies #-}

module ExplicitForAllFams4 where

type family J a
type instance forall a b. J [a]    = Float
type instance forall b.   J _      = Maybe b

data family K a
data instance forall a b. K (a, Bool) = K5 Float
data instance forall b.   K _         = K6 (Maybe b)

data family L a
newtype instance forall a b. L (a, Bool) = L5 { unL5 :: Float   }
newtype instance forall b.   L _         = L6 { unL56:: Maybe b }

class C a where
  type CT a b
  data CD a b

instance C Int where
  type forall a b. CT [a] (a,a)     = Float
  data forall a b. CD [a] (a,a)     = CD5 Float

instance C Bool where
  type forall b.   CT _ _           = Maybe b
  data forall b.   CD _ _           = CD6 (Maybe b)

instance C Double where
  type forall b. CT _ _ = Bool
  data forall b. CD _ _ = CD7