On Friday 04 June 2010 17:37:16, Martin Drautzburg wrote: > Dear all, > > If I have a problem where I have to select from a set of operations, how > would I print the result? > > Example: If I can chose from (x+y), (x*y), (x^2+y)... > and I feed them all into my problem solver > and it finds that "(x*y) is right", how can I print that string?
You'd have to pass the description string to the problem solver too. If it was previously solver :: Num a => Whatever -> [a -> a -> a] -> Result it would become for example solver :: Num a => Whatever -> [(a -> a -> a, String)] -> Result _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe