On 25/09/2007, Andrew Coppin <[EMAIL PROTECTED]> wrote: > Type signature is > > show_system :: [[Double]] -> String > > It takes a matrix representing a system of equations, and pretty prints > it. Unfortunately, doing complex formatting like that is... well, > complex. The input is quite simple (it's a bunch of numbers), the output > is quite simple (it's a neatly formatted string), but the process in the > middle is... a mess. I'd like to find a more readable way of doing stuff > like this. It's not just this specific function; any general hints would > be good. ;-)
In this instance I would suggest: (1) Text.Printf (2) Pull out some of those things into separate functions with where/let clauses. If it's a matrix you should probably have something like > showMatrix = concatMap showRow Since you'll be applying the same procedures to each line of digits. Cheers, D. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe