Re: [Haskell-cafe] Announcing OneTuple-0.1.0

2008-10-02 Thread Simon Brenner
On 10/2/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: G'day all. Quoting John Dorsey [EMAIL PROTECTED]: Contributions are welcome. The project could use a tutorial, and a decent test suite. Strict singleton tuples are planned for the next version. I hope it has a Monad

Re: [Haskell-cafe] Shooting your self in the foot with Haskell

2008-10-01 Thread Simon Brenner
On 10/1/08, John Van Enk [EMAIL PROTECTED] wrote: There's the well known How to shoot your self in the foot list which I have it printed and taped on my desk at work. http://www-users.cs.york.ac.uk/susan/joke/foot.htm I had a co-worker ask me how you'd shoot your self in the foot with

Re: [Haskell-cafe] csv one-liner

2008-09-30 Thread Simon Brenner
Something like this perhaps: writeFile output.csv . printCSV . map updateLine . fromRight = parseCSVFromFile input.csv (with fromRight = either (error fromRight :: Left) id or something equivalent) On 9/30/08, wman [EMAIL PROTECTED] wrote: I got asked how to do one particular thing in excel,

Re: [Haskell-cafe] Health effects

2008-09-29 Thread Simon Brenner
On 9/29/08, Gianfranco Alongi [EMAIL PROTECTED] wrote: Oh, yeah, I thought you really meant that you would force that baby down. :) Nice to hear that you wouldn't. Not even lazy evaluation would save you there 7-8 hours later. 2kg of chocolate 'thunks' to 'force' really might 'blow your

Re: Re[2]: [Haskell-cafe] Climbing up the shootout...

2008-09-22 Thread Simon Brenner
On Mon, Sep 22, 2008 at 2:07 PM, Bulat Ziganshin [EMAIL PROTECTED] wrote: this overall test is uselles for speed comparison. afair, there are only 2-3 programs whose speed isn't heavily depend on libraries. in DNA test, for example, Tcl (or PHP?) was leader just because it has better regexp

Re: [Haskell-cafe] Head and tail matching question

2007-06-11 Thread Simon Brenner
Why not do something like this instead? untab [] = [] untab xs = head : untab (drop 1 tail) where (head, tail) = break (== '\t') xs BTW, going the extra step through unfoldr seems unnecessary to me - is there any special reason to prefer unfolds over simple recursive functions here? (Of

Re: [Haskell-cafe] Re: tail recursion ?

2007-06-11 Thread Simon Brenner
The key is letting haskell be lazy and produce the output one item at a time. My solution below generates a list of all indices to be inversed (with indices being duplicated as appropriate), then for each index in that list inverses the corresponding element in the array. The list can be written

Re: [Haskell-cafe] Finding points contained within a convex hull.

2007-06-06 Thread Simon Brenner
Do you simply want the set of coordinates, or do you want to do something smart with the them (i.e. optimize a function value etc)? In the first case, with a good starting point and a function that enumerates all coordinates (by going in a spiral, perhaps), I think this can be done in O(nm),