blob: 6ff23e75e49991933378d34e4b788d430a02b5f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
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)
|