Re: Eq instance for (a,b,c,d,e) and upwards



About this list Date view Thread view Subject view Author view

Malcolm Wallace (malcolm-nhc@cs.york.ac.uk)
Fri, 20 Apr 2001 11:38:18 +0100


> For some reason nhc98 only defines equality for tuples up to 4. This is no particular reason for this restriction. Ghc defines standard instances for tuples only up to 5. I suppose nhc98 should at least match that. > Is there a way to fix this in nhc98? Yes, you can add your extra instance into the Prelude if you like. Following the current naming scheme, it should go into a file called src/prelude/Prelude/Eq_5.hs with (very important) a module header 'module Prelude where'. Then add the filename Eq_5.hs to the COMMON_SRCS variable in src/prelude/Prelude/Makefile and finally 'make prelude' from the top-level directory. (If the final step complains that 'prelude is up to date' then remove the dummy file targets/ix86-Linux/prelude and 'make prelude' again.) I'll include extra instances for Eq and Ord for at least 5-tuples in the next release. I could even go up to 12-tuples if you like. Regards, Malcolm


About this list Date view Thread view Subject view Author view