[commit: testsuite] master: Add a type signature for a function with an ambiguous type (0b8ea97)
Simon Peyton Jones
simonpj at microsoft.com
Sat Jul 21 20:11:05 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/0b8ea972714f7f368a3b1884477fdf4e24cc1bf4
>---------------------------------------------------------------
commit 0b8ea972714f7f368a3b1884477fdf4e24cc1bf4
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Sat Jul 21 19:10:48 2012 +0100
Add a type signature for a function with an ambiguous type
There's a comment with visit_PPSArgs to explain. GHC was rightfully
rejecting visit_PPS as having an ambiguous type. And it does! It
worked before because the ambiguity involved only standard classes
and hence was resolved.
(I suppose this could be a warning instead. But I'm fixing the test
anyway.)
>---------------------------------------------------------------
tests/programs/joao-circular/Visfun_Lazy.hs | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/tests/programs/joao-circular/Visfun_Lazy.hs b/tests/programs/joao-circular/Visfun_Lazy.hs
index fa76899..494604e 100644
--- a/tests/programs/joao-circular/Visfun_Lazy.hs
+++ b/tests/programs/joao-circular/Visfun_Lazy.hs
@@ -854,6 +854,20 @@ visit_PPCArgs (C_NilPPCArgs_1 ) x_ifillerrs x_ifillfmts x_ifillmins x_ireqs = (x
x_fmts = ([] )
x_fillmins = ([] )
x_error = ([] )
+
+
+visit_PPSArgs :: PPSArgs -> [T_Frame] -> (T_Errs, T_Fmts, Integer, T_Mins)
+-- This function's most general type is
+-- visit_PPSArgs :: forall a. (Integral a, Show a)
+-- => PPSArgs -> [T_Frame] -> (T_Errs, T_Fmts, a, T_Mins)
+-- But in the same mutually recusive group is visit_PPS whose type becomes
+-- visit_PPS :: forall a. (Integral a, Show a)
+-- => PPS -> T_Frame -> (Bool, T_Formats, INT, INT, INT)
+-- which GHC now (rightfully) rejects that as ambiguous, even though
+-- acutally default resolution will allow it at call sites,
+-- So I've added a type signature
+-- SLPJ July 2012
+
visit_PPSArgs (C_ConsArgs_1 t_PPS t_PPSArgs_2 ) x_reqs = (x_error , x_fmts , x_len , x_mins )
where
x_reqs_2 = (tail_T_Reqs x_reqs)
More information about the Cvs-ghc
mailing list