Creighton Hogg wrote:
Hi,
I'm working on writing a genetic programming system in
Haskell, and I wanted to know what might be a good way to
print out the programs that are being generated.
There's no instance of Show for functions, but I'd really
like to see what's happening so that I know if it's working
right.
What should I try?
One way would be to, instead of generating Haskell functions directly (I
guess this is what you are doing), declare an algebraic data type with
constructors for the various basic functions that you use (again I'm
guessing as to how you are doing this). Then you can have a Show
instance for that type, and a function for producing a real function
from a value of your type.
/Björn
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe