Ticket #12780: pluginbug.hs

File pluginbug.hs, 517 bytes (added by clinton, 2 years ago)
Line 
1{-# LANGUAGE TypeFamilyDependencies #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
3{-# LANGUAGE ConstraintKinds #-}
4{-# OPTIONS_GHC -fplugin MyPlugin #-}
5--{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-}
6
7import GHC.Exts (Constraint)
8
9main :: IO ()
10main = return ()
11
12type family F p = t | t -> p
13
14type IsF p t = (C p, t ~ F p)
15--type family C t :: Constraint
16--type IsF p t = (t ~ F p)
17
18class C p where
19  f :: (IsF p t) => t
20  --f :: (t ~ F p) => t
21  f = undefined
22
23g :: (IsF p t) => t
24--g :: (C p, t ~ F p) => t
25g = f