summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T6015.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-05-14 13:54:06 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-05-14 13:54:06 +0100
commitd93dc415916f23088c70eb6613d685911fb14e23 (patch)
tree869f71db60682987ea8389ff4258cf98ec60f056 /testsuite/tests/polykinds/T6015.hs
parent6729fa6b2be246eca5a903f5311fc5456b20cb5a (diff)
downloadhaskell-d93dc415916f23088c70eb6613d685911fb14e23.tar.gz
Test Trac #6015
Diffstat (limited to 'testsuite/tests/polykinds/T6015.hs')
-rw-r--r--testsuite/tests/polykinds/T6015.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T6015.hs b/testsuite/tests/polykinds/T6015.hs
new file mode 100644
index 0000000000..8f91025f6d
--- /dev/null
+++ b/testsuite/tests/polykinds/T6015.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE DataKinds, MultiParamTypeClasses, FunctionalDependencies,
+ PolyKinds, UndecidableInstances, ScopedTypeVariables #-}
+
+module T6015 where
+
+data Proxy a = Proxy
+
+class Value a t | a -> t where value :: Proxy a -> t
+
+instance Value True Bool where value _ = True
+
+instance Value a t => Value (Just a) (Maybe t)
+ where value _ = Just (value (Proxy :: Proxy a))
+
+test = value (Proxy :: Proxy (Just True))