Bug in Dependent Parameters?
Koen Claessen
koen@cs.chalmers.se
Thu, 23 Nov 2000 15:27:56 +0100 (MET)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-838832689-974989676=:1495
Content-Type: TEXT/PLAIN; charset=US-ASCII
Hi,
I am running "hugs -98" on Solaris, version February 2000.
I get the following strange error message:
>>>
Main> generalZipWith (+) [1,2,3] [3,4,5] :: [Int]
ERROR: Cannot justify constraints in type annotation
*** Expression : generalZipWith (+) [1,2,3] [3,4,5]
*** Type : [Int]
*** Given context : ()
*** Constraints : (Num Int, Num Int, Num Int, Num Int, Num Int, Num Int, Num Int)
<<<
Apart from looking at the program that generates this
message, isn't it a bit strange that it complains about
unjustified constraints of the form "Num Int"? How can this
constraint be unjustified??
When I write all the types explicitly I get the correct
answer:
>>>
Main> generalZipWith (+) ([1,2,3]::[Int]) ([3,4,5]::[Int]) :: [Int]
[4,6,8]
<<<
The program generating this is attached.
Regards,
Koen.
--
Koen Claessen http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424 mailto:koen@cs.chalmers.se
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden
---559023410-838832689-974989676=:1495
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="zipper.hs"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SOL.4.21.0011231527560.1495@muppet23.cs.chalmers.se>
Content-Description:
Content-Disposition: attachment; filename="zipper.hs"
DQpjbGFzcyBaaXAgYSBiIHwgYiAtPiBhIHdoZXJlDQogIHppcHBlciA6OiBb
YV0gLT4gYg0KDQppbnN0YW5jZSBaaXAgYSBbYV0gd2hlcmUNCiAgemlwcGVy
IGFzID0gYXMNCg0KaW5zdGFuY2UgWmlwIGEgYiA9PiBaaXAgKHggLT4gYSkg
KFt4XSAtPiBiKSB3aGVyZQ0KICB6aXBwZXIgZnMgYXMgPSB6aXBwZXIgKHpp
cFdpdGggKCQpIGZzIGFzKQ0KDQpnZW5lcmFsWmlwV2l0aCA6OiBaaXAgYSBi
ID0+IGEgLT4gYg0KZ2VuZXJhbFppcFdpdGggZiA9IHppcHBlciAocmVwZWF0
IGYpDQo=
---559023410-838832689-974989676=:1495--