[Haskell-cafe] Re: tail recursion ?

2007-06-12 Thread H .
Simon Brenner simbr843 at student.liu.se writes: listOfIndices' ubound = concat [ [i,(2*i) .. ubound] | i - [1..ubound] ] calc ubound = accumArray (const.not) False (1,ubound) $ [(x,False) | x - listOfIndices ubound] Thanks a lot! Your solution works fine as long as there are not to

Re: [Haskell-cafe] Re: Mathematica

2007-06-12 Thread Tomasz Zielonka
On Sun, May 13, 2007 at 02:19:55PM +0100, Andrew Coppin wrote: Writing *insanely* efficient number chrunking software requires a deep understanding of the target architecture, and lots of playing with very low-level constructs. Assembly is really the only language you can do it with; even C

Re: [Haskell-cafe] Just curios

2007-06-12 Thread Andrew Coppin
Thomas Schilling wrote: On 6/11/07, Andrew Coppin [EMAIL PROTECTED] wrote: Of course, our biggest mistake was using the word 'monad'. We should have called it 'warm fuzzy thing'... You know that thing called Google? ;) http://lambda-the-ultimate.org/node/92 Among others. I don't see any

[Haskell-cafe] Construct all possible trees

2007-06-12 Thread Andrew Coppin
I'm trying to construct a function all_trees :: [Int] - [Tree] such that all_trees [1,2,3] will yield [ Leaf 1, Leaf 2, Leaf 3, Branch (Leaf 1) (Leaf 2), Branch (Leaf 1) (Leaf 3), Branch (Leaf 2) (Leaf 1), Branch (Leaf 2) (Leaf 3), Branch (Leaf 3) (Leaf 1), Branch (Leaf 3) (Leaf 2), Branch

Re: [Haskell-cafe] Re: Mathematica

2007-06-12 Thread Jon Harrop
On Tuesday 12 June 2007 18:41:34 Tomasz Zielonka wrote: On Sun, May 13, 2007 at 02:19:55PM +0100, Andrew Coppin wrote: Writing *insanely* efficient number chrunking software requires a deep understanding of the target architecture, and lots of playing with very low-level constructs.

[Haskell-cafe] Re: Construct all possible trees

2007-06-12 Thread Jon Fairbairn
Andrew Coppin [EMAIL PROTECTED] writes: I'm trying to construct a function all_trees :: [Int] - [Tree] such that all_trees [1,2,3] will yield [ Leaf 1, Leaf 2, Leaf 3, Branch (Leaf 1) (Leaf 2), Branch (Leaf 1) (Leaf 3), Branch (Leaf 2) (Leaf 1), Branch (Leaf 2) (Leaf 3),

Re: [Haskell-cafe] Construct all possible trees

2007-06-12 Thread Colin DeVilbiss
On 6/12/07, Andrew Coppin [EMAIL PROTECTED] wrote: Based on the sample output, I'm guessing that the desired output is every tree which, when flattened, gives a permutation of a non-empty subset of the supplied list. This limits the output to trees with up to n leaves. Branch (Branch (Leaf 1)

Re: [Haskell-cafe] found monad in a comic

2007-06-12 Thread Paul Johnson
Marc A. Ziegert wrote: http://xkcd.com/c248.html ( join /= coreturn ) IMHO this could be a beautiful and easy way to explain monads. comments? I read it as a take on Godel Escher Bach, especially the stuff about counterfactual situations. But you are right. Actually its more about the

Re: [Haskell-cafe] Re: Mathematica

2007-06-12 Thread Jacques Carette
Jon Harrop wrote: On Tuesday 12 June 2007 18:41:34 Tomasz Zielonka wrote: On Sun, May 13, 2007 at 02:19:55PM +0100, Andrew Coppin wrote: Writing *insanely* efficient number chrunking software requires a deep understanding of the target architecture, and lots of playing with very

Re: [Haskell-cafe] Implementing Mathematica

2007-06-12 Thread Gene A
On 6/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: (... and showing an example of a simple-minded simplifier and symbolic differentiator. The unification was presented as a powerful pattern-matcher, being able to instanciate logic variables, and test the coherence within patterns sharing

[Haskell-cafe] How to devide matrix into small blocks

2007-06-12 Thread L.Guo
Hi all: I already have one matrix of type [[a]] to store one image. What I want to do is to devide the image into severial small blocks in same size. To do that, I wrote this tool function. chop :: Int - [a] - [[a]] chop _ [] = [] chop n ls = take n ls : chop n (drop n ls) But I do not