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



About this list Date view Thread view Subject view Author view

Martin Norbäck (d95mback@dtek.chalmers.se)
Fri, 20 Apr 2001 14:49:49 +0200


2001-04-20T11:38:18+0100, Malcolm Wallace -> > > 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. Would be nice if this was regulated by the Haskell standard in some way, I haven't studied it that carefully though. > > 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.) This works, thanks! > 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. Better to keep it at the same level as ghc and hugs, which is 5. n. -- [ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ] Opinions expressed above are mine, and not those of my future employees. SIGBORE: Signature boring error, core dumped


About this list Date view Thread view Subject view Author view