[Haskell-cafe] Very crazy

Andrew Coppin andrewcoppin at btinternet.com
Tue Sep 25 05:22:38 EDT 2007


Neil Mitchell wrote:
> Hi
>
>   
>> And people complain that *Perl* is bad? This function is quite obviously
>> absurd. I mean, it works, but can *you* figure out what it does without
>> running it?
>>     
>
> No. Can you say what the intention of this code is? Maybe a few
> examples? The type signature? That way I think people will be more
> able to give you hints.
>   

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. ;-)



More information about the Haskell-Cafe mailing list