[Haskell-cafe] anyone interested in developing a Language.C library?

2007-04-20 Thread Duncan Coutts
Hi all, If anyone is interested in developing a Language.C library, I've just completed a full C parser which we're using in c2hs. It covers all of C99 and all of the GNU C extensions that I have found used in practise, including the __attribute__ annotations. It can successfully parse the whole

[Haskell-cafe] Re: haskell question

2007-04-20 Thread oleg
Greg Meredith wrote: The file compiles with ghc as is. If you uncomment the last section, however, you see that to close the loop on the constraints for the agent syntax we hit a typing error. i bithink/i/b this is a hard constraint in Haskell that prevents this level of generality in the

RE: [Haskell-cafe] COM and Haskell

2007-04-20 Thread Bayley, Alistair
On Thu, Apr 19, 2007 at 08:59:17AM -0700, Justin Bailey wrote: All, I'm interested in automating Excel using Haskell. I'm Has any work been done on using Excel (or more generally, COM) from Haskell? There is only one library: hdirect. No-one remembers Krasimir's hscom

Re: [Haskell-cafe] COM and Haskell

2007-04-20 Thread Tomasz Zielonka
On Thu, Apr 19, 2007 at 05:45:18PM +0100, Neil Mitchell wrote: And I would recommend using VBA, I've done loads of Excel programming - VBA is perfectly easy enough, the hard bit is the Excel API which is quite big. If you move to Haskell you get a slightly better programming language, with the

[Haskell-cafe] Vacancy for a PhD student

2007-04-20 Thread Johan Jeuring
(Knowledge of Haskell is a big plus; implementation of most of the tools will be done in Haskell.) Vacancy: PhD student in the Strategy Feedback project 1+3 years, Open University the Netherlands, location: Heerlen (preference). The project: In many subjects students have to acquire

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-20 Thread Mirko Rahn
Thanks for your answer, I think it emphasizes that my example matches the exclaimed conditions * small * useful * demonstrate Haskell's power * preferably something that might be a bit tricky in another language It's easy to encode this in some

Re: [Haskell-cafe] Re: fftw bindings

2007-04-20 Thread Christian Jaeger
Are you aware of Dan J. Bernstein's library?: http://cr.yp.to/djbfft.html According to his benchmarks (from 1999?) it is faster than FFTW. I don't know whether that's still the case, a quick search did turn up http://projects.scipy.org/pipermail/scipy-dev/2002-August/001107.html which suggests

RE: [Haskell-cafe] Re: fftw bindings

2007-04-20 Thread Bayley, Alistair
On Thu, Apr 19, 2007 at 05:46:49PM -0400, Al Falloon wrote: For us less knowledgable, what's fftw? Fastest Fourier Transform in the West. http://www.fftw.org/ Its cool, they use generative programming: an OCaml program generates codlets in C that can be composed and tuned to the

Re: [Haskell-cafe] Re: fftw bindings

2007-04-20 Thread Erik de Castro Lopo
Christian Jaeger wrote: Are you aware of Dan J. Bernstein's library?: http://cr.yp.to/djbfft.html According to his benchmarks (from 1999?) it is faster than FFTW. Quite possibly faster, but restricted to Intel and AMD CPUs. FFTW compiles and runs on anything with a C compiler. Erik --

[Haskell-cafe] Installation of hs-plugins

2007-04-20 Thread Philipp Volgger
Hello everybody, could somebody please tell me how hs-plugins has to be installed. I tried it with hs-plguin 1.0rc1 and I was unable to build it. I did runhaskell Setup.lhs configure runhaskell Setup.lhs build (Crash without any information) I tried it wiht GHC 6.4, 6.4.1 and 6.6. I

[Haskell-cafe] Re: [C2hs] anyone interested in developing a Language.C library?

2007-04-20 Thread Manuel M T Chakravarty
Duncan Coutts wrote: If anyone is interested in developing a Language.C library, I've just completed a full C parser which we're using in c2hs. It covers all of C99 and all of the GNU C extensions that I have found used in practise, including the __attribute__ annotations. It can successfully

RE: [Haskell-cafe] Installation of hs-plugins

2007-04-20 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philipp Volgger could somebody please tell me how hs-plugins has to be installed. I tried it with hs-plguin 1.0rc1 and I was unable to build it. I did runhaskell Setup.lhs configure runhaskell Setup.lhs build (Crash

RE: [Haskell-cafe] Writing guards shorthand

2007-04-20 Thread Simon Peyton-Jones
| # let infer = function | A | B | C - true; | D | E | F - false;; | val infer : foo - bool = fun | | | Yes, I appreciate what you want, and I know ocaml too :) | | I was just talking around the other ways you can achieve it. I don't | know if there is a strong reason why haskell doesn't

Re: [Haskell-cafe] Re: fftw bindings

2007-04-20 Thread Christian Jaeger
Erik de Castro Lopo wrote: but restricted to Intel and AMD CPUs. This is wrong. I've just successfully compiled and run it on a PPC G3. FFTW compiles and runs on anything with a C compiler. There is no PPC specific code in the sources, so djbfft did compile and run on PPC just by virtue

Re: [Haskell-cafe] Re: fftw bindings

2007-04-20 Thread Fawzi Mohamed
Thanks to everybody for the answers, For the moment I think that I will try to slightly expand http://ofb.net/~wnoise/haskell/FFTW/ that was pointed out to me by Patrik Sellin with respect to Dan J. Bernstein's library http://cr.yp.to/djbfft.html I was not aware of it, but I would like to

Re: [Haskell-cafe] Re: fftw bindings

2007-04-20 Thread Erik de Castro Lopo
Christian Jaeger wrote: There is no PPC specific code in the sources, so djbfft did compile and run on PPC just by virtue of a C compiler. I stand corrected. I must admit it was many years ago that I last looked at djbfft. Erik -- +---+

Re: [Haskell-cafe] Re: How Albus Dumbledore would sell Haskell

2007-04-20 Thread Bryan O'Sullivan
Derek Elkins wrote: Game search is exactly an example use in Why Functional Programming Matters (http://www.math.chalmers.se/~rjmh/Papers/whyfp.html). That paper, 23 years later, is still pretty compelling. Perhaps, it should just be modernized and somewhat expanded. I'll echo Lennart's

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-20 Thread Justin Bailey
On 4/19/07, Simon Peyton-Jones [EMAIL PROTECTED] wrote: I have lots of *general* ideas. What I'm hoping is that I can steal working code for one or two compelling examples, so that I can spend my time thinking about how to present it, rather than on dreaming up the example and writing the

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-20 Thread Tillmann Rendel
Mirko Rahn wrote: More important: Correct me, if I'm wrong, but as far as I understand java, it is still impossible in your solution to evaluate the equivalent of head $ mirror $ rel [ (i,i) | i - [0..] ] in finite time, that is, your MirrorRel is not lazy in the elements. You have to build

Re: [Haskell-cafe] fftw bindings

2007-04-20 Thread Henning Thielemann
On Thu, 19 Apr 2007, Fawzi Mohamed wrote: Hi everybody, I was wondering if someone had fftw bindings for haskell, or if I should roll my own. I did a small search but found nothing. I have written FFTW wrappers for Modula-3 using SWIG. Maybe this can help you translating the weak C types

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-20 Thread Isaac Dupree
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: G'day all. Quoting Isaac Dupree [EMAIL PROTECTED]: Okay, looking at that code: The comments before the type definitions are mostly good... now it looks like I'm going into critique mode :) BTW, for the record, I

[Haskell-cafe] Program optimisation

2007-04-20 Thread Andrew Coppin
I have *no idea* if this is an appropriate place to put this, but here goes... I have a (presumably) common problem. I have a nice Haskell program. It's compute-bounded, and I'd like to make it go faster. To that end, I've been trying to optimise it. Without going into great detail, the

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread David Roundy
On Fri, Apr 20, 2007 at 07:01:32PM +0100, Andrew Coppin wrote: I have *no idea* if this is an appropriate place to put this, but here goes... Sure. Next, I read the GHC manual. Apparently there's a command-line switch -O2 which makes GHC try harder to optimise the program. (I had stupidly

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread David Roundy
On Fri, Apr 20, 2007 at 08:33:41PM +0100, Andrew Coppin wrote: Indeed, unboxed arrays are much nicer, but the whole Array batch of the standard library is pretty useless, in my experience. You can roll your own relatively easily using ForeignPtr, similar to Data.ByteString, but that's a bit

[Haskell-cafe] Re: how would Albus Dumbledore sell Haskell

2007-04-20 Thread Greg Meredith
Simon, Regarding Justin Bailey's idea of a calculator -- here's a twist. There is some sample Haskell code of Conway's account of numbers as games floating around the internet (http://www.dcs.ed.ac.uk/home/pgh/conway.html, http://www.dcs.ed.ac.uk/home/pgh/Conway.lhs). i can't vouch for the code

[Haskell-cafe] Re: haskell question

2007-04-20 Thread Greg Meredith
Oleg, Many thanks for your help! i notice that the code you sent requires -fglasgow-exts to be syntactically correct. Is there documentation on the multi-parameter type classes? i think i see what you've done, but i'd like to read up on it to make sure that i understand. Best wishes, --greg

[Haskell-cafe] Gotta love Haskell

2007-04-20 Thread Justin Bailey
My wife has been put in charge of scheduling lectors and ministers at our church, so of course she needs a Haskell program to do the schedules for her! While I've been working on it, I wrote something that I thought was a pretty cool trick. Each Mass requires a variety of different type and

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Adrian Hey
David Roundy wrote: I remember once going through all sorts of pain trying to avoid stack overflows when using Data.Map to compute a histogram, which all would have been avoided if there were a strict version of Data.Map (or even just strict functions on the lazy Data.Map). Then what you

Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-20 Thread Dan Weston
Simon Peyton-Jones wrote: Lots of interesting ideas on this thread, and Haskell-Cafe threads are *supposed* to wander a bit. But, just to remind you all: I'm particularly interested in concrete examples (pref running code) of programs that are * small * useful *

[Haskell-cafe] Re: [C2hs] anyone interested in developing a Language.C library?

2007-04-20 Thread Donald Bruce Stewart
chak: Duncan Coutts wrote: If anyone is interested in developing a Language.C library, I've just completed a full C parser which we're using in c2hs. It covers all of C99 and all of the GNU C extensions that I have found used in practise, including the __attribute__ annotations. It can

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Donald Bruce Stewart
droundy: In any case, in my opinion Haskell desperately needs more strict data types, as strict types can go a long way towards eliminating all sorts of Yes! Haskell is a combined strict and lazy language, after all. In particular, the ability to precisely combine strictness and laziness in a

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Donald Bruce Stewart
ahey: David Roundy wrote: I remember once going through all sorts of pain trying to avoid stack overflows when using Data.Map to compute a histogram, which all would have been avoided if there were a strict version of Data.Map (or even just strict functions on the lazy Data.Map). Then

[Haskell-cafe] QuickCheck subsumes unit testing

2007-04-20 Thread Donald Bruce Stewart
Just to walk the walk, and not just talk the talk, here's a quick unit testing 'diff' driver I hacked up for QuickCheck. When run, it 'diffs' (well, just prints ;-) the incorrect values from the unit test: $ runhaskell T.hs sort unit test : Falsifiable after 0 tests: -

[Haskell-cafe] Why Mathematical Soundness Matters.

2007-04-20 Thread Vivian McPhail
Hi All, This is in regard to previous posts about mathematical preludes. class Set a class (Set s) = SemiGroup s o where semigroup_op :: o - (s,s) - s -- closure -- associative class (SemiGroup s o) = Monoid s o where identity :: o - s class (Monoid s o) = Group s o where

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Adrian Hey
Donald Bruce Stewart wrote: ahey: David Roundy wrote: I remember once going through all sorts of pain trying to avoid stack overflows when using Data.Map to compute a histogram, which all would have been avoided if there were a strict version of Data.Map (or even just strict functions on the

Re: [Haskell-cafe] Program optimisation

2007-04-20 Thread Donald Bruce Stewart
ahey: Donald Bruce Stewart wrote: ahey: David Roundy wrote: I remember once going through all sorts of pain trying to avoid stack overflows when using Data.Map to compute a histogram, which all would have been avoided if there were a strict version of Data.Map (or even just strict functions