diff options
Diffstat (limited to 'testsuite/tests/gadt/T3169.hs')
-rw-r--r-- | testsuite/tests/gadt/T3169.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/gadt/T3169.hs b/testsuite/tests/gadt/T3169.hs new file mode 100644 index 0000000000..b52ec2cf87 --- /dev/null +++ b/testsuite/tests/gadt/T3169.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-} +module T3169 where + +import Prelude hiding ( lookup ) + +class Key k where + type Map k :: * -> * + lookup :: k -> Map k elt -> Maybe elt + +instance (Key a, Key b) => Key (a,b) where + type Map (a,b) = MP a b + lookup (a,b) (m :: Map (a,b) elt) + = case lookup a m :: Maybe (Map b elt) of + Just (m2 :: Map b elt) -> lookup b m2 :: Maybe elt + +data MP a b elt = MP (Map a (Map b elt)) |