Re: [Haskell-cafe] Nim Game in Haskell - Someone plz?
This sounds like a request for homework help. http://www.haskell.org/haskellwiki/Homework_help Mike Luis Felipe wrote: Hi, I need help to develop an implementation of nim game in Haskell. Could anyone send me a implementation of this game in haskell?? thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is Haskell a Keynesian language?
I prefer the terms "awesome" and "crappy", respectively, but sure, whatever works for you ;-) Mike Henning Thielemann wrote: Here is another approach of questionable classification of languages. :-) A lazy functional program is demand driven, an imperative program is supply driven. That is, if I request some information by calling a function in GHCi or Hugs, the interpreter develops a plan a how to produce the information I need and then executes the necessary steps. In contrast to that, an imperative program executes what's next on the schedule, whether it is need or not. So is Haskell a Keynesian language and C++ a Say language? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] source code for haskell web server?
Does anyone know where I could find the source code for the Haskell web server described in the papers "Tackling the Awkward Squad" by SPJ and "Writing High-Performance Server Applications in Haskell, Case Study: A Haskell Web Server" by Simon Marlow? Thanks in advance, Mike ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Need a good book on Haskell
A good follow-up is "The Haskell School of Expression" by Paul Hudak. Eventually, though, you're going to have to start reading research papers, which is where most of the cutting-edge stuff is. Phil Wadler's papers (available from his web site, just google it) are a good place to start, as are Simon Peyton-Jones' papers. Mike Johan Tibell wrote: I've read Haskell: The Craft of Functional Programming on a course on functional programming at Chalmers (I also took the advanced course) and now I'm looking for some more reading material. Are there any other good Haskell books? Is there a Pick Axe, Camel or Dragon Book for Haskell? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why does Haskell have the if-then-else syntax?
As opposed to what? Mike Mike Gunter wrote: I had hoped the "History of Haskell" paper would answer a question I've pondered for some time: why does Haskell have the if-then-else syntax? The paper doesn't address this. What's the story? thanks, -m ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] scripting in haskell
Lemmih wrote: On 7/25/06, mvanier <[EMAIL PROTECTED]> wrote: Hi, I was playing around with runhaskell (runghc to be precise), and I discovered the limitation wherein you have to use the file suffix ".hs". Don't get me wrong, runhaskell is great, but if you didn't have that restriction it would make haskell much more attractive to many programmers who write standalone scripts. Of course it's always possible to do e.g. (file: hello) #! /bin/sh runhaskell Hello.hs (file: Hello.hs) module Main where main :: IO () main = putStrLn "hello, world!" but that's pretty inconvenient. What I'd like is: (file: hello) #! /usr/bin/env runhaskell module Main where main :: IO () main = putStrLn "hello, world!" which is _almost_ doable; you have to name the file "hello.hs". What would really be optimal is something like (file: hello) #! /usr/bin/env runhaskell -fglasgow-exts -- extra arguments to runhaskell !# module Main where main :: IO () main = putStrLn "hello, world!" Looking through the mailing list I see something from May 2005 on this topic about adding the equivalent of gcc's "-x" option to ghc. What's the status of that? This is already implemented and will be in GHC-6.6 when it's released. Awesome! Thanks. Mike ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] scripting in haskell
Hi, I was playing around with runhaskell (runghc to be precise), and I discovered the limitation wherein you have to use the file suffix ".hs". Don't get me wrong, runhaskell is great, but if you didn't have that restriction it would make haskell much more attractive to many programmers who write standalone scripts. Of course it's always possible to do e.g. (file: hello) #! /bin/sh runhaskell Hello.hs (file: Hello.hs) module Main where main :: IO () main = putStrLn "hello, world!" but that's pretty inconvenient. What I'd like is: (file: hello) #! /usr/bin/env runhaskell module Main where main :: IO () main = putStrLn "hello, world!" which is _almost_ doable; you have to name the file "hello.hs". What would really be optimal is something like (file: hello) #! /usr/bin/env runhaskell -fglasgow-exts -- extra arguments to runhaskell !# module Main where main :: IO () main = putStrLn "hello, world!" Looking through the mailing list I see something from May 2005 on this topic about adding the equivalent of gcc's "-x" option to ghc. What's the status of that? Cheers, Mike ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: [haskell] ANNOUNCE: HNOP 0.1
Yup, that's the problem all right. Recompiling ghc with --with-gcc=/usr/bin/gcc-3.3 (on Debian) gives small executables. Thanks, Ian! What a relief -- I was running multiple instances of hnop and it was chewing up all of my memory ;-) Perhaps an hnop server might be a useful future direction... Mike Ian Lynagh wrote: On Fri, Jun 30, 2006 at 03:45:57PM -0700, mvanier wrote: I'm at a loss here. Somehow, the SplitObjs option doesn't seem to be doing the job. Any suggestions would be appreciated. It looks like gcc 4.1 is floating all the __asm__("\n__stg_split_marker:"); results to the top of the file, so the splitter sees only a number of empty sections followed by one large one. Results of echo 'module Foo where' > Foo.hs for i in `seq 1 10`; do echo "foo$i = 'c'" >> Foo.hs; done mkdir Foo_split ghc -O -split-objs -c Foo.hs -v -keep-tmp-files are attached, using $ gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,fortran,objc,obj-c++,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.2 20060613 (prerelease) (Debian 4.1.1-5) Amd64 doesn't seem to be afflicted. Thanks Ian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: [haskell] ANNOUNCE: HNOP 0.1
[Moving to haskell-cafe] OK, after going through this several times, here's what I've found: 1) The Debian linux build of haskell produces large executables. 2) The generic x86 binary distribution produces smallish executables (383765 bytes; still kind of large; stripped it's 191584 bytes). 3) I removed my entire source distribution, and recompiled from scratch with this build.mk file: SRC_HC_OPTS = -H64m -O2 GhcLibHcOpts= -O2 -fgenerics SplitObjs = YES I did an "autoreconf; configure; make; make install" and then recompiled hnop from scratch. I got large executables (2838528 bytes unstripped, 1540072 stripped). I'm at a loss here. Somehow, the SplitObjs option doesn't seem to be doing the job. Any suggestions would be appreciated. Mike Donald Bruce Stewart wrote: Hmm. Did you build from scratch? Perhaps the libraries didn't get rebuilt with split objs ? mvanier: I've tried doing a manual build with SplitObjs set to YES, but without success; either the compiler was broken or it would still generate large executables. So as a sanity check, I installed the debian unstable build. But that one also gives me a huge executable: % ls -l total 2720 -rw-r--r-- 1 mvanier mvanier 818 Jun 29 20:48 LICENSE -rw-r--r-- 1 mvanier mvanier 308 Jun 30 04:59 Main.hi -rw-r--r-- 1 mvanier mvanier 80 Jun 29 20:48 Main.hs -rw-r--r-- 1 mvanier mvanier1928 Jun 30 04:59 Main.o -rw-r--r-- 1 mvanier mvanier 43 Jun 29 20:48 Makefile -rwxr-xr-x 1 mvanier mvanier 2756151 Jun 30 04:59 hnop -rw-r--r-- 1 mvanier mvanier 807 Jun 29 23:56 hnop.tar.gz Am I the only person in the world with this problem? Also, for some inexplicable reason, debian puts ghci into /usr/X11R6/bin, though ghc is in the more sensible /usr/bin/ghc. TIA, Mike Donald Bruce Stewart wrote: mvanier: Nope, just ghc-6.4.2 that I compiled myself on a Dell x86 laptop (Pentium M). I didn't use any strange configure options. Is there a special configure flag for split objects? If not, how is this determined? Ah ha! You need to add -split-objs to the build.mk used by ghc to build its libraries, as described here: http://cvs.haskell.org/cgi-bin/cvsweb.cgi/~checkout~/fptools/ghc/HACKING?content-type=text%2Fplain You want: SplitObjs = YES in mk/build.mk It's not enabled by default, since it doesn't work on every platform. The ghc that is distributed in the debian package system does have split objs on, though. Cheers, Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] dumb monad syntax question
I've been reading Phil Wadler's monad papers from the early '90s, and it's been interesting to see how the monad concept evolved over the course of those years. But I haven't been able to track down the first use of the "do" notation for monads. Can anyone tell me where that came from? I'd appreciate paper citations if it was presented initially in a paper. Thanks in advance, Mike ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe