summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc252.hs
blob: 215e1ff8cc015b7cffc9f0b4b77479971c483238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE TypeFamilies #-}
module ShouldCompile where

import Data.Kind (Type)

class Cls a where
    type Fam a :: Type
    type Fam a = Maybe a

instance Cls Int where
    -- Overriding default
    type Fam Int = Bool

nott :: (Fam a ~ Bool) => a -> Fam a -> Fam a
nott _proxy False = True
nott _proxy True  = False

foo :: Bool -> Bool
foo = nott (undefined :: Int)