summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/Overlap12.hs
blob: 6fe1bd981c7a57ff7d009faacdd998dc952d17c8 (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
{-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-}

module Overlap12 where

type family And (a :: Bool) (b :: Bool) :: Bool where
  And False x = False
  And True x = x
  And x False = False
  And x True = x
  And x x = x

data Proxy p = P

a :: Proxy (And False x)
a = (P :: Proxy False)

b :: Proxy x -> Proxy (And True x)
b x = x

c :: Proxy (And x False)
c = (P :: Proxy False)

d :: Proxy x -> Proxy (And x True)
d x = x

e :: Proxy x -> Proxy (And x x)
e x = x