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
participants (1)
-
Koen Claessen