summaryrefslogtreecommitdiff
path: root/testsuite/tests/backpack/should_fail/bkpfail54.bkp
blob: 4248390c91a8685facc860f2e3a33cbc979b8389 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47

-- Check that we do something sensible when we implement
-- abstract data with a quantified type.

{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeFamilies #-}

unit p where
  module M where
    import Data.Kind ( Type, Constraint )

    type C :: Type -> Constraint
    class C a where
      type family F a :: Type

unit q where
  dependency p
  signature H where
    data T1
    data T2
    data T3
  module N where
    import M ( C(F) )
    import H ( T1, T2, T3 )

    instance C T1 where
      type F T1 = T2
    instance C T2 where
      type F T2 = T3
    instance C T3 where
      type F T3 = T1

unit r where
  dependency p
  module H where

    class C2 a where {}
    data S = MkS

    type T1 = forall a. a -> a
    type T2 = forall a. C2 a => a
    type T3 = C2 S => S -> S

unit s where
  dependency p
  dependency r
  dependency q[H=r:H]