Mike Jones wrote:
> [...]
> data Fn = Fn (Float -> Float) Int
> deriving Show
>
> But, I get the error from GHC as follows:
>
> Stimulus.hs:12:
> No instance for `Show (Float -> Float)'
> When deriving classes for `Fn'
> [...]
Functions are not an instance of Show, so you have to supply
instance Show (a -> b) where
showsPrec _ _ = showString "<function>"
or add `import ShowFunctions' (in the upcoming GHC 4.07's package lang).
Cheers,
Sven
--
Sven Panne Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen Oettingenstr. 67
mailto:[EMAIL PROTECTED] D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne