Re: [Haskell-cafe] zip3, zip4 ... -> zipn?

2007-08-11 Thread Joel Koerwer
Frank, The return type of zipn would have to depend on the number of arguments. If you are satisfied with all arguments having the same type, then you can use transpose: zipn list1 list2 .. listn => transpose [list1, list2, .. listn] Can we make a polyvariadic zipn that returns a [HList]? Seems

Re: [Haskell-cafe] Geometry

2007-08-26 Thread Joel Koerwer
Hi Tony, x is called the sagitta. At least when making a telescope mirror it is[1]. By bisecting your angle with another radius, you'll see that you have a right triangle with hypotenuse a, and legs of length (b/2) and (a-x). Then sagitta a b = a - sqrt (a*a - b*b/4) Considered as a function of

Re: [Haskell-cafe] Missing Symbol (2)

2007-09-18 Thread Joel Koerwer
Paul, The Hutton book has gotten great reviews, but pouring over a faulty OCRd version can only be counterproductive. I highly recommend Yet Another Haskell Tutorial[1]. After that you can check out all the other wonderful online resources (starting here [2]). At that point a few OCR errors won't

Re: [Haskell-cafe] Missing Symbol (2)

2007-09-19 Thread Joel Koerwer
Hi Paul, Sorry that my suggestion wasn't so practicable. On the other hand, I see that the YAHT tex source is available on darcs.haskell.org/yaht. Maybe we can do something about those unextractable symbols. Anyone know more about this? It really is a great resource for beginners. -- Joel On 9

Re: [Haskell-cafe] Missing Symbol (2)

2007-09-19 Thread Joel Koerwer
Hi Paul, Sorry that my suggestion wasn't so practicable. On the other hand, I see that the YAHT tex source is available on darcs.haskell.org/yaht. Maybe we can do something about those unextractable symbols. Anyone know more about this? It really is a great resource for beginners. -- Joel On 9

[Haskell-cafe] Mission: To take args from a list... generally

2006-10-04 Thread Joel Koerwer
Haskellers, Let's say I want to evaluate a function of type (a->a->...->a->a), taking the arguments from a list. If know the function ahead of time, I can simply wrap it: foo a b c d = ... wrapFoo (a:b:c:d:_) = foo a b c d But, as an exercise, I challenged myself to write a function, multApply

[Haskell-cafe] Mission: To take args from a list... generally

2006-10-04 Thread Joel Koerwer
Thanks! Don pointed me to Oleg's page too. I *was* (90%) convinced that this is fundamentally different, but it sure looks similar. Kind of an inside-out polyvariadic function. Any given f only takes n args, but myApply doesn't know the value of n. In fact, a polyvariadic f would cause an infinit

Re: [Haskell-cafe] Mission: To take args from a list... generally

2006-10-04 Thread Joel Koerwer
Thanks for the link. So many variations on a theme: n-vars to a list : Oleg's solution for polyvariadic functions list + n-adic function -> value : This thread list of (n_i)-adic functions + argument -> list of (n_i-1)-adic functions : The link you gave. The first two had very similar an

Re: [Haskell-cafe] ghc 6.8.1 bug?

2007-11-15 Thread Joel Koerwer
I'm also seeing unusual behavior from GSL under ghc-6.8.1. I get a singular matrix error where there was none before, but if I prefix the function's rhs with "m `seq`", where m is the matrix in question, the error goes away. I'll try removing the seq and compiling with -fvia-C tomorrow to see if I

Re: [Haskell-cafe] First steps in Haskell

2005-12-18 Thread Joel Koerwer
Try ghci fac.hs. You will then have an interactive session with access to the definitions in your file.Then after you've played with you creation a bit, check out http://haskell.org/learning.html Welcome and enjoy!Joel ___ Haskell-Cafe mailing list Haskel

Re: [Haskell-cafe] Known Unknowns

2006-01-26 Thread Joel Koerwer
On 1/26/06, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote:  Ah, i just do: ghc A.hs -O2 -ddump-simpl | lessand then read the Core, keeping an eye on the functions I'm interestedin, and checking they're compiling to the kind of loops I'd write byhand. This is particularly useful for the kinds of ti

Re: [Haskell-cafe] Known Unknowns

2006-01-28 Thread Joel Koerwer
Thanks Chris. I was actually asking about analyzing Core output in general. I'm well aware of the problems we're having with the nbody entry.I'm convinced my list based version can go faster than it is now. That's why I was asking if Don could put together a few notes on how to optimize inner loops

Re: [Haskell-cafe] Known Unknowns

2006-02-01 Thread Joel Koerwer
Don, that's a great little mini tutorial, exactly what I was hoping for. I'm looking forward to learning more tricks.On an unrelated note, I have an STUArray nbody. I haven't really looked closely at the chris+dons version, but I suspect they amount to doing the same thing. I get commensurate runti

Re: [Haskell-cafe] Known Unknowns

2006-02-02 Thread Joel Koerwer
Hey this is great. Chris your improvements are awesome. I mean the speed is nice, but you really cleaned up the code. There's an extraneous call to energy in the second runST block, but it should be insignificant. Also, -fglasgow-exts is necessary for the left-hand-side type declarations of size a