Re: [Haskell-cafe] Re: Library design question

2008-09-20 Thread David Menendez
On Fri, Sep 19, 2008 at 7:02 PM, Andre Nathan [EMAIL PROTECTED] wrote: On Fri, 2008-09-19 at 23:16 +0200, Daniel Fischer wrote: Yes. What's IO gotta do with it? I did it because of randomIO :( (or what about StateT (Graph a b) (State StdGen) ?). Now there's something I wouldn't have

[Haskell-cafe] Iteratee-based IO

2008-09-20 Thread oleg
brian wrote: I want to use Parsec to parse NNTP data coming to me from a handle I get from connectTo. One unworkable approach I tried is to get a lazy String from the handle with hGetContents. It seems there is another approach, which is neither unsafe nor imperative. It relies neither on

[Haskell-cafe] having fun with GADT's

2008-09-20 Thread Anatoly Yakovenko
I dont remember where i saw it, but i think someone had an example of a list whose type is the maximum element in the list. I've been trying to reproduce that with GADT's. data One = One data Two = Two data Three = Three data MaxList t where Elem1 :: MaxList One Elem2 :: MaxList Two

[Haskell-cafe] Ropes

2008-09-20 Thread Rafael Gustavo da Cunha Pereira Pinto
On Fri, Sep 19, 2008 at 23:18, Don Stewart [EMAIL PROTECTED] wrote: RafaelGCPP.Linux: Hi all, Is there any implementation of the rope data structure in Haskell? I couldn't find any on Hackage, and I am intending to implement it. There's no mature rope implementation. Can you

Re: [Haskell-cafe] Ropes

2008-09-20 Thread Rafael Gustavo da Cunha Pereira Pinto
I am doing the ICFPC07 task right now, to learn Haskell and tried to use the Sequence, but the final code is too damn slow (a few iterations per minute!). The DNA needs only 2 operations: head (or take) and concat. I am thinking in using ropes for the DNA and sequences for all the rest

[Haskell-cafe] Re: Ropes

2008-09-20 Thread apfelmus
Rafael Gustavo da Cunha Pereira Pinto wrote: I am doing the ICFPC07 task right now, to learn Haskell and tried to use the Sequence, but the final code is too damn slow (a few iterations per minute!). The DNA needs only 2 operations: head (or take) and concat. I am thinking in using ropes

Re: [Haskell-cafe] Re: Library design question

2008-09-20 Thread Daniel Fischer
Am Samstag, 20. September 2008 08:53 schrieb David Menendez: On Fri, Sep 19, 2008 at 7:02 PM, Andre Nathan [EMAIL PROTECTED] wrote: On Fri, 2008-09-19 at 23:16 +0200, Daniel Fischer wrote: Yes. What's IO gotta do with it? I did it because of randomIO :( (or what about StateT (Graph a

[Haskell-cafe] Re: having fun with GADT's

2008-09-20 Thread Reiner Pope
Anatoly Yakovenko aeyakovenko at gmail.com writes: I dont remember where i saw it, but i think someone had an example of a list whose type is the maximum element in the list. I've been trying to reproduce that with GADT's. data One = One data Two = Two data Three = Three data

[Haskell-cafe] Haskell Weekly News: Issue 86 - September 20, 2008

2008-09-20 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20080920 Issue 86 - September 20, 2008 --- Welcome to issue 86 of HWN, a newsletter covering

[Haskell-cafe] OpenSPARC project applicant chosen

2008-09-20 Thread Duncan Coutts
I am very pleased to announce that we have chosen Ben Lippmeier for the OpenSPARC project. Congratulations Ben! Ben will spend three months hacking on GHC to make it perform well on the latest multi-core OpenSPARC chips. I would also like to thank the other people who applied. The reviewers

Re: [Haskell-cafe] Re: Library design question

2008-09-20 Thread Andre Nathan
On Sat, 2008-09-20 at 14:56 +0200, Daniel Fischer wrote: modify' f = do s - get put $! f s Or try Control.Monad.State.Strict. Control.Monad.State.Strict did it for me, but the strict modify didn't. I tried using modify' and also randomDouble = do g - get let (r, g') =

Re: [Haskell-cafe] Hugs on the iphone

2008-09-20 Thread Alberto R. Galdo
Hi, I finally got hugs to compile for the iPhone 2.x firmware ( pwnaged,obviously ). It was a matter of using the gcc compiler version distributed by apple in their iPhone SDK ( wich generates ARM code and suitable for cross-compiling C code in a mac ), autoconf 'configure' script tweaking

Re: [Haskell-cafe] Re: Library design question

2008-09-20 Thread Daniel Fischer
Am Samstag, 20. September 2008 17:46 schrieb Andre Nathan: On Sat, 2008-09-20 at 14:56 +0200, Daniel Fischer wrote: modify' f = do s - get put $! f s Or try Control.Monad.State.Strict. Control.Monad.State.Strict did it for me, but the strict modify didn't. I tried using

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Donnie Jones
Hello Brandon and Haskell-cafe, (Sorry for the delayed reply...) These seem to be the relevant lines from configure of OpenGL package. checking GL/gl.h usability... yes checking GL/gl.h presence... yes checking for GL/gl.h... yes checking OpenGL/gl.h usability... no checking OpenGL/gl.h

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Brandon S. Allbery KF8NH
On 2008 Sep 20, at 12:57, Donnie Jones wrote: checking GL/gl.h usability... yes checking GL/gl.h presence... yes checking for GL/gl.h... yes checking OpenGL/gl.h usability... no checking OpenGL/gl.h presence... no checking for OpenGL/gl.h... no checking GL/glu.h usability... yes checking

Re: [Haskell-cafe] Re: having fun with GADT's

2008-09-20 Thread Anatoly Yakovenko
data One = One data Two = Two data Three = Three data MaxList t where Elem1 :: MaxList One Elem2 :: MaxList Two ML1Cons1 :: MaxList One - MaxList One - MaxList One ML1Cons2 :: MaxList One - MaxList Two - MaxList Two ML2Cons1 :: MaxList Two - MaxList One - MaxList Two

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Donnie Jones
Hello Brandon, On Sat, Sep 20, 2008 at 1:02 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: On 2008 Sep 20, at 12:57, Donnie Jones wrote: checking GL/gl.h usability... yes checking GL/gl.h presence... yes checking for GL/gl.h... yes checking OpenGL/gl.h usability... no checking

[Haskell-cafe] ANNOUNCE: protocol-buffers-0.2.9 for Haskell is ready

2008-09-20 Thread ChrisK
Hello one and all, Amid much rejoicing, my Haskell version of protocol-buffer is now released (version 0.2.9). What is this for? What does it do? Why? Shorter answer: It generates Haskell data types that can be converted back and forth to lazy ByteStrings that interoperate with Google's

Re: [Haskell-cafe] Re: having fun with GADT's

2008-09-20 Thread David Menendez
On Sat, Sep 20, 2008 at 1:12 PM, Anatoly Yakovenko [EMAIL PROTECTED] wrote: Your problem in this example is that the t in MaxList t is universally quantified when it needs to be existentially quantified. The following definition encodes the existential quantification as a rank-2 type: mlTail

[Haskell-cafe] haskell shootout -- mandelbrot

2008-09-20 Thread Tim Newsham
Since this one's trivially parallizable, I took a crack at the mandelbrot test case. It was fairly easy to thread it on a per-line basis in Haskell without changing the original too much. It might be more efficient to break the work into larger chunks, but that would require some slightly more

[Haskell-cafe] Re: Ropes

2008-09-20 Thread Rafael Gustavo da Cunha Pereira Pinto
I have been told that you could pretty much literally implement the algorithms from the problem specification with Seq from Data.Sequence and achieve acceptable speed (IIRC ~ one minute for generating a whole picture). Yes, it is straightforward to implement the algorithm when using

Re: [Haskell-cafe] haskell shootout -- mandelbrot

2008-09-20 Thread Tim Newsham
a) have you submitted it to the shootout. no b) is it faster yes c) can you put it on the parallel shootout wiki, http://haskell.org/haskellwiki/Shootout/Parallel http://haskell.org/haskellwiki/Shootout/Parallel/Mandelbrot Tim Newsham http://www.thenewsh.com/~newsham/

Re: [Haskell-cafe] OpenSPARC project applicant chosen

2008-09-20 Thread Roman Cheplyaka
* Duncan Coutts [EMAIL PROTECTED] [2008-09-20 16:37:08+0100] If you want to follow the progress we will be using the existing ghc development mailing list: http://www.haskell.org/mailman/listinfo/cvs-ghc and a corner of the ghc development wiki:

Re: [Haskell-cafe] haskell shootout -- mandelbrot

2008-09-20 Thread Don Stewart
newsham: a) have you submitted it to the shootout. no b) is it faster yes c) can you put it on the parallel shootout wiki, http://haskell.org/haskellwiki/Shootout/Parallel http://haskell.org/haskellwiki/Shootout/Parallel/Mandelbrot Nice, on quad core, the old entry, $

Re: [Haskell-cafe] OpenSPARC project applicant chosen

2008-09-20 Thread Duncan Coutts
On Sat, 2008-09-20 at 23:50 +0300, Roman Cheplyaka wrote: * Duncan Coutts [EMAIL PROTECTED] [2008-09-20 16:37:08+0100] If you want to follow the progress we will be using the existing ghc development mailing list: http://www.haskell.org/mailman/listinfo/cvs-ghc and a corner of the ghc

Re: [Haskell-cafe] Re: Munging wiki articles with tagsoup

2008-09-20 Thread Gwern Branwen
On 2008.09.09 19:49:49 +0100, Neil Mitchell [EMAIL PROTECTED] scribbled 2.3K characters: Hi Gwern, Sorry for not noticing this sooner, my haskell-cafe@ reading is somewhat behind right now! NP. I'm in no hurry; this TMR thing is an side project of mine, and I still haven't figured out how

[Haskell-cafe] Language.Haskell and strings

2008-09-20 Thread Maurí­cio
Hi, I'm using Language.Haskell.* and would like to know if it's possible to pretty-print big strings like this: into something like this: \ \\ \\ \\ \\ \\ \ to respect the limit

Re: [Haskell-cafe] Updated formlets sample?

2008-09-20 Thread Chris Eidhof
Hey Martin, On 19 sep 2008, at 04:14, Martin Huschenbett wrote: I found a blog post concerning formlets [1] in the web. Since looks very interesting I tried to compile the sample code with recent versions of HAppS and formlets from hackage. But this didn't work as the API of formlets has

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Donnie Jones
Hello Clifford, Thank you for the quick reply. I was able to get a test C program that draws a triangle with GLUT to work: gcc -lglut triangle.o -o triangle.exe However, when building the Haskell GLUT 'Hello World' it uses, -lGLU to link GLUT, but that does not work; however, from the config.log

SOLVED. Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Donnie Jones
Hello, ghc -package GLUT -lglut Hello1.hs -o Hello1 --- works! :) I'm not sure why I must specify -package GLUT and -lglut but that prevents the linker errors. Also, shouldn't configure correctly figure out how to link the GLUT libraries? Can someone explain? Thank you. __ Donnie On Sat,

Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Brandon S. Allbery KF8NH
On 2008 Sep 20, at 21:47, Donnie Jones wrote: However, when building the Haskell GLUT 'Hello World' it uses, -lGLU to link GLUT, but that does not work; however, from the config.log output configure seems to think that -lGL should work. Is there a way I can change the build to use -lglut?

Re: SOLVED. Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Brandon S. Allbery KF8NH
On 2008 Sep 20, at 22:10, Donnie Jones wrote: ghc -package GLUT -lglut Hello1.hs -o Hello1 --- works! :) I'm not sure why I must specify -package GLUT and -lglut but that prevents the linker errors. Also, shouldn't configure correctly figure out how to link the GLUT libraries? Can

Configure bug? Re: SOLVED. Re: [Haskell-cafe] Linker Errors For OpenGL / GLUT 'Hello World' Program.

2008-09-20 Thread Donnie Jones
Hello Brandon, Maybe this is a bug in the configure script of Haskell OpenGL or GLUT packages? Any suggestion from the package maintainers (or someone more familiar with these packages)? Thanks! :) __ Donnie On Sat, Sep 20, 2008 at 10:13 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: