Re: [Haskell-cafe] Defining show for a function type.

2006-07-11 Thread ihope
On 7/10/06, Fritz Ruehr [EMAIL PROTECTED] wrote: Were you interested in seeing the function, you could do so, at least for finite, total functions (you can also enumerate them, compare them for equality, etc.). See my haskell-cafe message at

Re: [Haskell-cafe] Defining show for a function type.

2006-07-11 Thread Fritz Ruehr
On Jul 11, 2006, at 8:27 AM, ihope wrote: On 7/10/06, Fritz Ruehr [EMAIL PROTECTED] wrote: Were you interested in seeing the function, you could do so, at least for finite, total functions (you can also enumerate them, compare them for equality, etc.). See my haskell-cafe message at

[Haskell-cafe] Defining show for a function type.

2006-07-10 Thread Johan Grönqvist
I am a haskell-beginner and I wish to write a Forth-like interpreter. (Only for practice, no usefulness.) I would like use a list (as stack) that can contain several kinds of values. data Element = Int Int | Float Float | Func : Machine - Machine | ... Now I would like to have this type be

Re: [Haskell-cafe] Defining show for a function type.

2006-07-10 Thread David Sabel
Hi, you can make every function being an instance of class Show, this works for me: instance Show (a - b) where show _ = FUNCTION data Element = Int Int | Float Float | Func (Machine - Machine) deriving Show David Johan Grönqvist wrote: I am a haskell-beginner and I wish to write a

Re: [Haskell-cafe] Defining show for a function type.

2006-07-10 Thread Udo Stenzel
Johan Grönqvist wrote: I would like use a list (as stack) that can contain several kinds of values. data Element = Int Int | Float Float | Func : Machine - Machine | ... Now I would like to have this type be an instance of the class Show, so that I can see what the stack contains in

Re: [Haskell-cafe] Defining show for a function type.

2006-07-10 Thread Donald Bruce Stewart
johan.gronqvist: I am a haskell-beginner and I wish to write a Forth-like interpreter. (Only for practice, no usefulness.) I would like use a list (as stack) that can contain several kinds of values. data Element = Int Int | Float Float | Func : Machine - Machine | ... Now I would

Re: [Haskell-cafe] Defining show for a function type.

2006-07-10 Thread Fritz Ruehr
On Jul 10, 2006, at 8:44 AM, Johan Grönqvist wrote: deriving Show is impossible as Func is not instance of Show. Can I make it instance of Show? I just want to define something like ... and I am not interested in actually displaying any information about the function, ... Were you interested in