John Peterson wrote:

 | > instance Show (a -> b) where
 | >  showsPrec _ _ = showString " << Function >> "

We had the same problem in QuickCheck. When testing
properties quantified over functions, we got a type error
because suddenly "a -> b" is not an instance of Show
anymore.

Now, if we had taken the same approach as you propose in
QuickCheck, it would have been impossible to use Haskore and
QuickCheck together!

Therefore, John Hughes suggested to add a standard library
to Haskell, called "ShowFunctions", in which this instance
is declared. So that both Haskore and QuickCheck (and any
other program that is broken after this Haskell98 "fix") can
just import this module and co-exist happily!

(As I understand, this module is now part of the Hugs/GHC
distribution tree.)

/Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen     
phone:+46-31-772 5424      e-mail:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden

Reply via email to