Showing functions

2000-07-31 Thread Tony Davie

Hello all,

Section 6.1.6 of the report says that "Functions are an instance of the
Show class but not
Read." How are functions meant to be shown? The standard prelude
'specification' doesn't say anything about it.

--
Tony Davie, Computer Science, St.Andrews University, North Haugh,
St.Andrews
Scotland, KY16 9SS,  Tel: +44 1334 463257,  Fax: +44 1334
463278
mailto:[EMAIL PROTECTED]  Home:
http://www.dcs.st-and.ac.uk/~ad/Home.html
Handel Index and Chronology:
http://bruichladdich.dcs.st-and.ac.uk/HandelWWW/HandelCat.html






Re: Showing functions

2000-07-31 Thread Ralf Hinze

| Section 6.1.6 of the report says that "Functions are an instance of the
| Show class but not
| Read." How are functions meant to be shown? The standard prelude
| 'specification' doesn't say anything about it.

That's a typo. Section 6.3.3 says

``All Prelude types, except function types and IO types, are instances of Show and 
Read''

Before Haskell 98 there was an instance

instance Show (a - b) where
  showsPrec p f = showString "function"

Cheers, Ralf