[commit: ghc] master: Test Trac #10403 (f1f265d)

git at git.haskell.org git at git.haskell.org
Mon May 18 12:45:25 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f1f265df0742b7214f3b909190f5a171819392b5/ghc

>---------------------------------------------------------------

commit f1f265df0742b7214f3b909190f5a171819392b5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed May 13 17:17:22 2015 +0100

    Test Trac #10403


>---------------------------------------------------------------

f1f265df0742b7214f3b909190f5a171819392b5
 testsuite/tests/partial-sigs/should_compile/T10403.hs | 19 +++++++++++++++++++
 .../tests/partial-sigs/should_compile/T10403.stderr   | 17 +++++++++++++++++
 testsuite/tests/partial-sigs/should_compile/all.T     |  1 +
 3 files changed, 37 insertions(+)

diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.hs b/testsuite/tests/partial-sigs/should_compile/T10403.hs
new file mode 100644
index 0000000..a33646d
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE PartialTypeSignatures #-}
+module T10403 where
+
+data I a = I a
+instance Functor I where
+    fmap f (I a) = I (f a)
+
+newtype B t a = B a
+instance Functor (B t) where
+    fmap f (B a) = B (f a)
+
+newtype H f = H (f ())
+
+app :: H (B t)
+app = h (H . I) (B ())
+
+h :: _ => _
+--h :: Functor m => (a -> b) -> m a -> H m
+h f b = (H . fmap (const ())) (fmap f b)
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
new file mode 100644
index 0000000..6b0660d
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -0,0 +1,17 @@
+
+T10403.hs:17:6: warning:
+    Found hole ‘_’ with inferred constraints: Functor f
+    In the type signature for ‘h’: _ => _
+
+T10403.hs:17:11: warning:
+    Found hole ‘_’ with type: (a -> b) -> f a -> H f
+    Where: ‘f’ is a rigid type variable bound by
+               the inferred type of h :: Functor f => (a -> b) -> f a -> H f
+               at T10403.hs:19:1
+           ‘b’ is a rigid type variable bound by
+               the inferred type of h :: Functor f => (a -> b) -> f a -> H f
+               at T10403.hs:19:1
+           ‘a’ is a rigid type variable bound by
+               the inferred type of h :: Functor f => (a -> b) -> f a -> H f
+               at T10403.hs:19:1
+    In the type signature for ‘h’: _ => _
diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T
index e83e070..91294a5 100644
--- a/testsuite/tests/partial-sigs/should_compile/all.T
+++ b/testsuite/tests/partial-sigs/should_compile/all.T
@@ -46,3 +46,4 @@ test('SomethingShowable', normal, compile, ['-ddump-types -fno-warn-partial-type
 test('Uncurry', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
 test('UncurryNamed', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
 test('WarningWildcardInstantiations', normal, compile, ['-ddump-types'])
+test('T10403', normal, compile, [''])



More information about the ghc-commits mailing list