At 10:05 PM -0500 12/2/03, rui yang wrote:
I want to print a function which itself have some functions as it's parameters
and will return some functions as the results, and I want to print out the
result, does anyone knows how to define the instance declaration of show class
to this function type?

[moving to Haskell Cafe]


The mechanics of such an instance definition are simple enough. Letting F be your function type, this would do it:

 instance Show F where
   showsPrec f = ... some String ...

The hard question is what the result should be. Unlike the types already in Show (such as Bool, Int, Char, etc.), there's no canonical representation for functions (other than a complete list of argument-result pairs, which would not be very useful).


Regards,

--Ham
--
------------------------------------------------------------------
Hamilton Richards, PhD           Department of Computer Sciences
Senior Lecturer                  The University of Texas at Austin
512-471-9525                     1 University Station C0500
Taylor Hall 5.138                Austin, Texas 78712-0233
[EMAIL PROTECTED]                [EMAIL PROTECTED]
------------------------------------------------------------------
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to