On Apr 21, 2008, at 3:50 , Ryan Ingram wrote:

is almost unnecessary; (btw., functions /are/ instances of Show).

Now it's my turn to call:

Prelude Test.QuickCheck> show ((\x -> x) :: Int -> Int)
<interactive>:1:0:
    No instance for (Show (Int -> Int))

import Data.Function.  (but it is indeed a useless instance)

A slightly less useless instance (more or less the one lambdabot uses) is at http://www.cmu.edu.edu/~allbery/FuncShow.hs; note that it only works for monomorphic functions (more specifically, for functions whose parameters are Typeable).

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to