[Haskell-cafe] Zippers, Random Numbers Terrain

2007-07-30 Thread Thomas Conway
Hi All, To amuse myself while waiting for test-runs to complete, I was thinking about random terrain generation. I came across a bunch of nice posts by Torben Mogensen, where he describes a neat way of constructing random terrains by recursively subdividing right angled isosceles triangles. It

RE: [Haskell-cafe] Space usage and CSE in Haskell

2007-07-30 Thread Simon Peyton-Jones
|power_list :: [a] - [[a]] |power_list = foldr (\x ~(_:xs) - []:xs = \ys - [ys, x:ys]) [[]] | | I loved how short and sweet this version is, but sadly with GHC it's | noticeably slower than Bertram's first, more directly coded, version | (1.32 seconds vs 0.55 seconds for power_list

RE: [Haskell-cafe] Strange behavior of executeFile

2007-07-30 Thread Simon Peyton-Jones
| Anything involving sharing file descriptors between processes becomes | similarly broken if the GHC runtime starts using a file descriptor as a | Handle. You're not the only one to be surprised by this behaviour, but | unfortunately it's not trivial to work around. | | Simon Marlow was going to

[Haskell-cafe] Re: Zippers, Random Numbers Terrain

2007-07-30 Thread apfelmus
Thomas Conway wrote: To amuse myself while waiting for test-runs to complete, I was thinking about random terrain generation. I came across a bunch of nice posts by Torben Mogensen, where he describes a neat way of constructing random terrains by recursively subdividing right angled isosceles

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-30 Thread Dan Licata
With the functional dependency, you can't work with the view datatypes at all. Once you write type Typ data TypView = Unit | Arrow Typ Typ instance View Typ TypView where view = ... you're no longer allowed to take apart a TypView at all! E.g. you can't write outUnit :: TypView - Bool

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Requestforfeedback

2007-07-30 Thread Dan Licata
On Jul30, Claus Reinke wrote: one could turn that promise into a type-checked guarantee by using explicit sum types (and thus structural rather than name-based typing), but that gets awkward in plain haskell. I don't think the choice of whether you label your variants with names or with

[Haskell-cafe] Re: Zippers, Random Numbers Terrain

2007-07-30 Thread Martin Lütke
apfelmus apfelmus at quantentunnel.de writes: Thomas Conway wrote: To amuse myself while waiting for test-runs to complete, I was thinking about random terrain generation. I came across a bunch of nice posts by Torben Mogensen, where he describes a neat way of constructing random

[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request?for?feedback

2007-07-30 Thread Jon Fairbairn
ChrisK [EMAIL PROTECTED] writes: And the readability is destroyed because you cannot do any type inference in your head. If you see { Matrix m = ; Matrix x = m * y; ...; } Then you know very little about the possible types of y since can only conclude that: [snippage] This

Re: [Haskell-cafe] Re: Zippers, Random Numbers Terrain

2007-07-30 Thread Jon Harrop
On Monday 30 July 2007 09:51:48 apfelmus wrote: Thomas Conway wrote: To amuse myself while waiting for test-runs to complete, I was thinking about random terrain generation. I came across a bunch of nice posts by Torben Mogensen, where he describes a neat way of constructing random

[Haskell-cafe] Definition of the Haskell standard library

2007-07-30 Thread Chris Smith
Can someone clarify what's going on with the standard library in Haskell? As of right now, I can download, say, GHC from haskell.org/ghc and get a set of libraries with it. I can visit http://haskell.org/ghc/docs/latest/html/libraries/, linked from the haskell.org home page, and see

Re: [Haskell-cafe] Re: HDBC or HSQL

2007-07-30 Thread Isto Aho
Hi, I was also wandering between these different db-libs and thanks for your information. I tried several (HDBC, HSQL, HaskellDB) and made only small trials. HaskellDB has quite many examples on wiki that gave a quick start to further trials. But, I wasn't able to tell that some of the fields

[Haskell-cafe] Re: Definition of the Haskell standard library

2007-07-30 Thread Dave Bayer
Chris Smith cdsmith at twu.net writes: Can someone clarify what's going on with the standard library in Haskell? ... sites for the thousandth time before realizing that so-and-so's GUI library hasn't actually been touched since they finished their class Short answer: Our system is very

[Haskell-cafe] MAPI provider?

2007-07-30 Thread John Goerzen
Hi, I apologize if this is off-topic or stupid. I'm not very familiar (at all) with Windows programming... I have a Haskell program that I want to get called when someone sends a message on Windows. This sending a message will happen from various programs that call MAPI. It doesn't seem

Re: [Haskell-cafe] Definition of the Haskell standard library

2007-07-30 Thread Duncan Coutts
On Mon, 2007-07-30 at 09:19 -0600, Chris Smith wrote: Can someone clarify what's going on with the standard library in Haskell? As of right now, I can download, say, GHC from haskell.org/ghc and get a set of libraries with it. I can visit

Re: [Haskell-cafe] Re: Zippers, Random Numbers Terrain

2007-07-30 Thread Dan Piponi
On 7/30/07, Martin Lütke [EMAIL PROTECTED] wrote: It uses a chaotic function (ergodic?) that works on integers. In the case of Terrain it uses 2. One for the x and one for y coordinate. It should be infinite for Zooming out. When zooming in one uses interpolation. The drawback(?) is when

Re: [Haskell-cafe] Definition of the Haskell standard library

2007-07-30 Thread brad clawsie
On Mon, Jul 30, 2007 at 05:27:21PM +0100, Duncan Coutts wrote: We have tools to solve the downloading and installing all deps problem. It's called cabal-install. It's sort-of almost ready for wider testing. duncan - will this have an interactive prompt? i have found perl -MCPAN -e shell

Re: [Haskell-cafe] Definition of the Haskell standard library

2007-07-30 Thread Duncan Coutts
On Mon, 2007-07-30 at 11:05 -0700, brad clawsie wrote: On Mon, Jul 30, 2007 at 05:27:21PM +0100, Duncan Coutts wrote: We have tools to solve the downloading and installing all deps problem. It's called cabal-install. It's sort-of almost ready for wider testing. duncan - will this have an

[Haskell-cafe] GSL special functions (Re: [Haskell] math library for Haskell)

2007-07-30 Thread Alberto Ruiz
(moved to Haskell-cafe) On Wednesday 25 July 2007 12:52, Gregory Wright wrote: On Jul 25, 2007, at 6:39 AM, Chris Kuklewicz wrote: Alberto Ruiz wrote: I have included a binding to gsl_sf_gamma in the darcs repo of GSLHaskell:

Re: [Haskell-cafe] Re: [Haskell] View patterns in GHC: Request for feedback

2007-07-30 Thread Stefan O'Rear
On Mon, Jul 30, 2007 at 05:31:40AM -0400, Dan Licata wrote: With the functional dependency, you can't work with the view datatypes at all. Once you write type Typ data TypView = Unit | Arrow Typ Typ instance View Typ TypView where view = ... you're no longer allowed to take apart a

[Haskell-cafe] Re: Definition of the Haskell standard library

2007-07-30 Thread Aaron Denney
On 2007-07-30, Dave Bayer [EMAIL PROTECTED] wrote: My pet example is a PDF library. No language should have its own PDF library, when Postscript is so easy to write, and Ghostscript is a cross-platform conversion tool maintained by thousands of our best and brightest. Except, of course, that

[Haskell-cafe] Latest AngloHaskell news and a request

2007-07-30 Thread Philippa Cowderoy
Two pieces of news regarding AngloHaskell: 1) We've been offered WiFi access at Microsoft Research for any attendees who want it. We'll need a name, email address and company/institution affiliation where appropriate - see wiki for details. 2) We're being given lunch on Friday! Finally, a

[Haskell-cafe] infinite list of random elements

2007-07-30 Thread Chad Scherrer
I'm trying to do something I thought would be pretty simple, but it's giving me trouble. Given a list, say [1,2,3], I'd like to be able to generate an infinite list of random elements from that list, in this case maybe [1,2,1,3,2,1,3,2,3,1,2,...]. I'm using IO for random purely due to laziness

Re: [Haskell-cafe] infinite list of random elements

2007-07-30 Thread Stefan O'Rear
On Mon, Jul 30, 2007 at 02:40:35PM -0700, Chad Scherrer wrote: I'm trying to do something I thought would be pretty simple, but it's giving me trouble. Given a list, say [1,2,3], I'd like to be able to generate an infinite list of random elements from that list, in this case maybe

Re: [Haskell-cafe] infinite list of random elements

2007-07-30 Thread Cale Gibbard
On 30/07/07, Chad Scherrer [EMAIL PROTECTED] wrote: I'm trying to do something I thought would be pretty simple, but it's giving me trouble. Given a list, say [1,2,3], I'd like to be able to generate an infinite list of random elements from that list, in this case maybe

Re: [Haskell-cafe] infinite list of random elements

2007-07-30 Thread Lauri Alanko
On Mon, Jul 30, 2007 at 02:40:35PM -0700, Chad Scherrer wrote: Given a list, say [1,2,3], I'd like to be able to generate an infinite list of random elements from that list, in this case maybe [1,2,1,3,2,1,3,2,3,1,2,...]. I'm using IO for random purely due to laziness (my own, not Haskell's).

Re: [Haskell-cafe] infinite list of random elements

2007-07-30 Thread Lennart Augustsson
Why this obsession with IO? There should be no IO involved in this, except for getting the initial generator. Using IO just confuses what is going on. -- Lennart On 7/30/07, Cale Gibbard [EMAIL PROTECTED] wrote: On 30/07/07, Chad Scherrer [EMAIL PROTECTED] wrote: I'm trying to do

Re: [Haskell-cafe] infinite list of random elements

2007-07-30 Thread Sebastian Sylvan
On 30/07/07, Lennart Augustsson [EMAIL PROTECTED] wrote: Why this obsession with IO? There should be no IO involved in this, except for getting the initial generator. Using IO just confuses what is going on. Indeed. Here's my version: -- first define a shuffle function, completely pure!

Re: [Haskell-cafe] Re: Code and Perf. Data for Prime Finders (was: Genuine Eratosthenes sieve)

2007-07-30 Thread Thorkil Naur
Hello, On Wednesday 25 July 2007 01:42, Thorkil Naur wrote: Hello Melissa, On Tuesday 24 July 2007 19:09, Melissa O'Neill wrote: ... (See ONeillPrimes.hs in http://www.cs.hmc.edu/~oneill/code/haskell- primes.zip for the complete code. I've also added Thorkil Naur's code from

[Haskell-cafe] Constraing satisfaction

2007-07-30 Thread drop669
Hi. I have a set of problems in the field of constaint satisfaction and I'm looking for a tool for this. In simplest form, these task are like Sudoku puzzle solver, school schedule creator, etc. Prolog language comes to mind at first. But if to choose Haskell? Can be these tasks defined in Haskell

Re[2]: [Haskell-cafe] Constraing satisfaction

2007-07-30 Thread drop669
I have a set of problems in the field of constaint satisfaction and I'm looking for a tool for this. In simplest form, these task are like Sudoku puzzle solver, school schedule creator, etc. Prolog language comes to mind at first. Have you seen Eclipse? http://eclipse.crosscoreop.com/ - it

Re: [Haskell-cafe] Constraing satisfaction

2007-07-30 Thread Andrew Wagner
Haskell is certainly up for the challenge. You may be interested in this paper, for example: http://citeseer.ist.psu.edu/335780.html On 7/30/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a set of problems in the field of constaint satisfaction and I'm looking for a tool for this. In

Re: [Haskell-cafe] infinite list of random elements

2007-07-30 Thread Chad Scherrer
Thanks for your responses. Stefan, I appreciate your taking a step back for me (hard to judge what level of understanding someone is coming from), but the example you gave doesn't contradict my intuition either. I don't consider the output [IO a] a list of tainted a's, but, as you suggest, a list

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Stefan O'Rear
On Mon, Jul 30, 2007 at 06:57:25PM -0700, Michael Vanier wrote: When I try to build lambdabot, I get this: Configuring lambdabot-4.0... configure: Dependency base-any: using base-2.1.1 configure: Dependency unix-any: using unix-2.1 configure: Dependency network-any: using network-2.0.1

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Michael Vanier
Thanks, but this doesn't answer the question. I can load up the Control.Arrow module fine in ghci. Is there a problem with the packaging information? I did a google search, and this problem has come up on IRC, but nobody figured out what was causing it as far as I can tell. Mike Stefan

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Donald Bruce Stewart
mvanier: Thanks, but this doesn't answer the question. I can load up the Control.Arrow module fine in ghci. Is there a problem with the packaging information? It needs the 'arrows' package from hackage, not just Control.Arrow. You'll get by fine by just removing the 'arrows' dependency :

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Michael Vanier
OK, Stefan was right. The arrows package is an extension of Control.Arrow, not a from-scratch implementation. The name confused me. Perhaps a better name would be arrows-ext or something like that. Mike Michael Vanier wrote: Thanks, but this doesn't answer the question. I can load up the

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Michael Vanier
So, now that I've got all the libraries installed, the compile fails like this: Building lambdabot-4.0... [13 of 91] Compiling Lib.Parser ( Lib/Parser.hs, dist/build/lambdabot/lambdabot-tmp/Lib/Parser.o ) Lib/Parser.hs:19:39: Module `Language.Haskell.Syntax' does not export `as_name'

Re: [Haskell-cafe] problem building lambdabot

2007-07-30 Thread Stefan O'Rear
On Mon, Jul 30, 2007 at 08:54:12PM -0700, Michael Vanier wrote: So, now that I've got all the libraries installed, the compile fails like this: Building lambdabot-4.0... [13 of 91] Compiling Lib.Parser ( Lib/Parser.hs, dist/build/lambdabot/lambdabot-tmp/Lib/Parser.o )

[Haskell-cafe] curious hxt error

2007-07-30 Thread brad clawsie
i am having a problem with hxt, i was wondering if anyone here has experience with it. in particular, i find that the xread function chokes on xml files with xml declarations, and i am not sure why. consider this sample script: module Main where import Text.XML.HXT.Parser main = do xml -